Trigger/Script not working

Have questions about CoD4 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Trigger/Script not working

Post by inzerke » February 20th, 2012, 8:56 pm

I've been making a deathrun map and wanted to script my traps now.
Doing this made some problems.
I want to make clear that the trap works, only add 1) to it!
I got my first trap working how, but I want it so that:
1) you can use it only once a round

Code: Select all

   thread firetrap ();
	}

firetrap()
	{
   firetrap = getent( "firetrap", "targetname" );
   trig      = getent( "firetraptrig", "targetname" );
while(true)
	{
   trig waittill ("trigger");
   firetrap movex ( -137, 0.5, 0.25, 0.25);
   firetrap waittill ("movedone");
	wait 5;
   //trig waittill ("trigger");
   firetrap movex ( 137, 4, 2, 2);
   firetrap waittill ("movedone");
My second trap I was scripting is the next:
1) a piano falling downstairs ( like a brush moves down )
2) the floor where the piano falls breaks and falls aswell for a bit
3) also you can use it only once a round

Code: Select all

   thread pianotrapfloor ();
	}

pianotrapfloor()
	{
   pianotrapfloor = getent( "pianotrapfloor", "targetname" );
   trig      = getent( "pianotraptrig", "targetname" );
   trig waittill ("trigger");
   pianotrapfloor movey ( -200, 0.5, 0.25, 0.25);
   pianotrapfloor waittill ("movedone");
	}
About this second trap, I was scripting the floor.
Everything went good, I even can go ingame without any errors,
but the floor doesn't fall down or maybe the trigger doesn't work.
I got the right targetnames and target, I'm 100% sure of that.

So if anyone would have some tips/help, your welcome!

Nekoneko
CJ Fan
CJ Fan
Posts: 170
Joined: April 18th, 2011, 3:48 pm

Re: Trigger/Script not working

Post by Nekoneko » February 20th, 2012, 10:25 pm

For the first:

Code: Select all

thread firetrap ();
   }
 
firetrap()
   {
   firetrap = getent( "firetrap", "targetname" );
   trig      = getent( "firetraptrig", "targetname" );
 
   trig waittill ("trigger");
   firetrap movex ( -137, 0.5, 0.25, 0.25);
   firetrap waittill ("movedone");
   wait 5;
   firetrap movex ( 137, 4, 2, 2);
   firetrap waittill ("movedone");
   }
for 2nd, what kind of trigger is it and is the pianotrapfloor a script brushmodel?

inzerke
CJ Wannabe
CJ Wannabe
Posts: 15
Joined: February 18th, 2012, 9:27 am

Re: Trigger/Script not working

Post by inzerke » February 20th, 2012, 10:53 pm

2nd is a use_touch trigger and it is a brushmodel yes.

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests