So, here is my tutorial on how to use a moving trigger...
In this tutorial, I am going to be moving a small platform with a trigger hurt attached to it.
Ok.
1 - First make a base unit (this is important, your trigger will be attached to this). If you want this to be invisble, simply give it the texture [nodraw_notsolid] found under "usage<tools"
2 - Make the base unit a script_brushmodel and give it a relevant targetname.
3 - Now make you trigger_hurt. Give it a relevant targetname and the relevant settings.
Thats it for the map.
Now the scripting.
Code: Select all
main()
{
maps\mp\_load::main(); //Always include this in all main map gsc's
move_trig = getent("move_trig","targetname"); //Name of your hurt_trigger
move = getent("move","targetname"); //Name of your base
move_trig enablelinkto(); // This is the most important part of the script. this allows you to move the trigger.
move_trig linkto(move); //Now you must link the trigger to the base
// The following is how you want your BASE to move. (Your trigger will follow your base)
while(1)
{
move moveX(500, 5);
wait 5;
move moveY(500, 5);
wait 5;
move moveX(-500, 5);
wait 5;
move moveY(-500, 5);
wait 5;
}
}