How to make stuff controllable in Garry's mod

sinkoman

Party Escort Bot
Joined
Dec 2, 2004
Messages
7,457
Reaction score
21
Ok guys, i've figured out how to make it so that you can controll the canisters in Garrys mod. It's much like doing it in JBmod, so if you know how to do it in that, then you're all set.

For the rest of you, here we go!

Spawn four cannisters in triangle on anymap.

Aim at the first cannister.

Now go into the console and type this
Code:
ent_setname bob

Now what this does is it sets the name of the cannister you were aiming at to bob.

Now go into the console and type this

Code:
ent_fire bob activate

Now leave the console. You'll see that the cannister you named bob is now active! GOODY!

How does this work? Ent_fire is the general command for doing stuff with entities. You type ent_fire <entity name> <action>

So to turn bob off you would type

Code:
ent_fire bob deactivate

And he would deactivate!

How do you controll stuff with this? I'll show you how!

Go back to the console and type this

Code:
alias +bob "ent_fire bob activate";alias -bob "ent_fire bob deactivate"

What you just did was create two aliases named +bob and -bob to make a shortcut for activating stuff. The pluses will be important later but for now, all you need to know is that instead of typing "ent_fire bob activate" now all you need to type is "+bob".

Go back into the console and type this

Code:
bind i "+bob"

What this does is it makes the i key do +bob. +bob is "ent_fire bob activate". The plus infront of the alias tells the game to do +bob when i is pressed down, and -bob when i is unpressed. Get it?

How can you controll stuff like this you might be asking? Well say you want to controll the boat you just mades left and right movements. Make a cannister on the right side and do the whole +bob thing to it, and make a cannister on the left and do the +bob thing again only with a different alias and entity name and a different key press. Now when you want your boat to turn right, you press the key for +bob/+somename and when you want to go left press the key for +someothername!

I'll try to answer questions when I get home from school.

Oh and mod's, sticky?
 
but in v5 u can attach cannisters then simply turn them one with the use button, isnt this the same?
 
Try turning on the canister that you've attached to the back of your airboat while inside the airboat - it's a tricky task indeed. V. useful, thanks!
 
I'm sure this is old news, i remeber people using this method about 6 weeks ago, to fly their plane around BB_Final with canisters on jb mod. Theres even a thread on this page talking about it somewhere.

edit: oh there was but it was you repeating what you said in this thread, why did you make a new one!?
 
Is there a way to get an air cannister to activate when you press a button(let's say h) and deactivate when you release the button? That would make control a lot easier...
 
half alive said:
Is there a way to get an air cannister to activate when you press a button(let's say h) and deactivate when you release the button? That would make control a lot easier...

The code snipets at the top of the page show you exactly how to do this....

That's what the + and - are for in the alias.
 
Oh ok. I read it another time very carefully, and now I understand it :)

Thanks anyway Latin_Jones :thumbs:.
 
thanks, ive been too lazy to search how to do this in other threads.
 
Hectic Glenn said:
I'm sure this is old news, i remeber people using this method about 6 weeks ago, to fly their plane around BB_Final with canisters on jb mod. Theres even a thread on this page talking about it somewhere.

edit: oh there was but it was you repeating what you said in this thread, why did you make a new one!?


I know I already said it but I thought more people would see it if I made a new thread for it. Want to help as many people as possible.

And I said that if you know how to do this in jbmod then you already know how to do it in Garry's mod. Just some people might not know its also possible in Gmod.
 
the latest garrysmod version can do this easily by using one button... why waste the time?
 
HobbesHax said:
the latest garrysmod version can do this easily by using one button... why waste the time?
because you can create a balloon or a plane and map all your keys to stuff like yaw, pitch, and roll, and have a really really cool balloon\plane.
 
i was able to assign canisters names and control them, but once i weld them to an object they stop functioning. how do i get (named) welded cannisters to work properly?
 
kaf11 said:
i was able to assign canisters names and control them, but once i weld them to an object they stop functioning. how do i get (named) welded cannisters to work properly?
I'm pretty sure that once you weld an object to anyother object, it loses its name due to the fact that it was part of the other object.
 
itsmygame said:
I'm pretty sure that once you weld an object to anyother object, it loses its name due to the fact that it was part of the other object.

I've never noticed that. I'll try it out now!

Perhaps renaming it once you attatch it, or not naming it till you attatch it would fix the problem.
 
sinkoman said:
I've never noticed that. I'll try it out now!

Perhaps renaming it once you attatch it, or not naming it till you attatch it would fix the problem.
Yes thats the idea. :smoking:
 
Back
Top