Sign in to follow this  
Followers 0
Pixel

Scripting Moving Triggers

4 posts in this topic

Is i possible to script triggers for movement?  By this I mean using moveX,Y,Z etc with them, because it doesn't seem to work. I know you can link them to brush but I don't want that.

 

Also, for some reason I did hurt hide(); but it didn't hide it on another trap. 

0

Share this post


Link to post
Share on other sites

As far as I'm aware you can't move triggers by themselves, you could do something like this:

trig = GetEnt( "trigger", "targetname" );
org = Spawn( "script_origin", trig.origin );
 
trig EnableLinkto();
trig LinkTo( org );
 
org MoveZ( 9000, 9000 ); // Lol, ignore

What it does is spawn a script_origin (which is not visible ingame) at the origin of your trigger, it'll link the trigger to the origin and move it like it would do if it was linked to a brush.

0

Share this post


Link to post
Share on other sites

You can also link it to a non-visible or non-solid brush, or both.

It's more convenient to spawn a script_origin and link the trigger to that. Otherwise it'll become a mess in Radiant and you'd still have to NotSolid() the brush in GSC as you can't make a script_brushmodel non-solid in Radiant. ;)

 

Edit: For you second problem, you can't hide a trigger, you need to put this line at the top of your GSC file:

#include maps\mp\_utility;

And then use these:

hurt TriggerOn();
hurt TriggerOff();
0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0