Page 1 of 1

hurt_trigger questions (screenshots)

Posted: March 10th, 2008, 4:46 am
by x0mbie
In a map I'm making I have a passage where there are columns moving up and down. (see the screenshots)

http://jamesgrubb.net/cod/screenshots/shot0000.jpg
http://jamesgrubb.net/cod/screenshots/shot0001.jpg

I'd like for the bottom of the column to have a hurt_trigger on it so that if you're caught under it when it comes down you're killed. Any ideas on how I can do that? I thought about making a trigger that moves up and down along with the column, but I found out you can't move triggers like they're brush models.

Re: hurt_trigger questions (screenshots)

Posted: March 10th, 2008, 5:34 am
by Nightmare
Simply make the trigger_hurt and give it a targetname. You can then turn it on and off with the following

Code: Select all

(entity) thread maps\mp\_utility::triggerOff();
(entity) thread maps\mp\_utility::triggerOn();

Re: hurt_trigger questions (screenshots)

Posted: March 10th, 2008, 5:50 am
by x0mbie
I'm still very new at scripting. How would that work?

btw, all the scripting I know I learned from your map nm_trap. :)

Re: hurt_trigger questions (screenshots)

Posted: March 10th, 2008, 11:54 pm
by Nightmare
Its very simple, here is a quick example.

Code: Select all

column_kill() 
{ 
	kill_trig = getent ("kill_trigger","targetname"); // Hurt Trigger
	column = getent ("column","targetname");  //Script Brushmodel
	kill_trig thread maps\mp\_utility::triggerOff();  //Turn the trigger off at the start
	while(1)
	{
		column moveZ(bla,bla,bla); //Make sure that there is 72 units before turning the trigger on, or the column will glitch
		column waittill ("movedone");
		kill_trig thread maps\mp\_utility::triggerOn(); //Turn on
		column moveZ(bla,bla,bla); //Finish moving the column till the floor.
		column waittill ("movedone");
		kill thread maps\mp\_utility::triggerOff(); //Turn off
		column moveZ(bla,bla,bla); //Move the column back to the top
		column waittill ("movedone");
	}
}

Re: hurt_trigger questions (screenshots)

Posted: March 11th, 2008, 12:30 am
by x0mbie
Awesome! I figured it out today at work, but I'm sure I would have had problems writing the code.

Re: hurt_trigger questions (screenshots)

Posted: March 23rd, 2008, 6:42 am
by x0mbie
Ok, this works great!

The only thing that I have a problem with is when the brush stops moving and turns the trigger on the brush pauses for a second. Is there anyway to make it move seamlessly?

Re: hurt_trigger questions (screenshots)

Posted: March 23rd, 2008, 1:21 pm
by RiZzZla!
Nightmare wrote:Its very simple
Yes yes it looks it :?

Re: hurt_trigger questions (screenshots)

Posted: March 23rd, 2008, 3:23 pm
by Nightmare
Could you post your code? I am thinking it probably has something to do with your timing.

Re: hurt_trigger questions (screenshots)

Posted: March 23rd, 2008, 6:26 pm
by x0mbie

Code: Select all

column_kill1()
{
   kill_trig1 = getent ("kill_col1","targetname"); // Hurt Trigger
   column1 = getent ("col1","targetname");  //Script Brushmodel
   kill_trig1 thread maps\mp\_utility::triggerOff();  //Turn the trigger off at the start
   while(1)
   {
      column1 moveZ(-24,1,0.5); //Make sure that there is 72 units before turning the trigger on, or the column will glitch
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOn(); //Turn on
      column1 moveZ(-72,1); //Finish moving the column till the floor.
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOff(); //Turn off
      column1 moveZ(96,1,0.5); //Move the column back to the top
      column1 waittill ("movedone");
   }
}
If I understand right the starting time and stopping time for moving a brush are default at 0.5. I tried changing it to 0 and it didn't seem to make a difference. I read in a tutorial about scripting that it was optional do define a start/stop time so I left it out in the first move, the middle move, and then again on the the end.

Re: hurt_trigger questions (screenshots)

Posted: March 23rd, 2008, 8:22 pm
by Nightmare

Code: Select all

column_kill1()
{
   kill_trig1 = getent ("kill_col1","targetname"); // Hurt Trigger
   column1 = getent ("col1","targetname");  //Script Brushmodel
   kill_trig1 thread maps\mp\_utility::triggerOff();  //Turn the trigger off at the start
   while(1)
   {
      column1 moveZ(-24,1); //Make sure that there is 72 units before turning the trigger on, or the column will glitch
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOn(); //Turn on
      column1 moveZ(-72,1); //Finish moving the column till the floor.
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOff(); //Turn off
      column1 moveZ(96,1); //Move the column back to the top
      column1 waittill ("movedone");
   }
}
Try this.
There is no default, if no starting speed time is defined it just starts and stops automatically
Btw, be sure you add your map name in front of those targetnames, both in your .map and in your script! This will prevent conflicting.

Re: hurt_trigger questions (screenshots)

Posted: March 24th, 2008, 6:28 am
by x0mbie
Nope, didn't change it. Still slows or pauses a sec when it completes the first move and turns on the trigger.

Nightmare wrote: Btw, be sure you add your map name in front of those targetnames, both in your .map and in your script! This will prevent conflicting.
What do you mean?

Re: hurt_trigger questions (screenshots)

Posted: March 24th, 2008, 11:55 pm
by ODD
He means that if the map is in the server with another map that uses the same targetnames then they won't work properly.

Re: hurt_trigger questions (screenshots)

Posted: March 25th, 2008, 9:10 am
by x0mbie
I should have been able to figure that out. I'll give it a try tomorrow and see if it makes a difference. Either way, thanks for the tip.

Re: hurt_trigger questions (screenshots)

Posted: March 26th, 2008, 1:26 am
by Nightmare

Code: Select all

column_kill1()
{
   kill_trig1 = getent ("kill_col1","targetname"); // Hurt Trigger
   column1 = getent ("col1","targetname");  //Script Brushmodel
   kill_trig1 thread maps\mp\_utility::triggerOff();  //Turn the trigger off at the start
   while(1)
   {
      column1 moveZ(-24,1,0,0); //Make sure that there is 72 units before turning the trigger on, or the column will glitch
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOn(); //Turn on
      column1 moveZ(-72,1,0,0); //Finish moving the column till the floor.
      column1 waittill ("movedone");
      kill_trig1 thread maps\mp\_utility::triggerOff(); //Turn off
      column1 moveZ(96,1,0,0); //Move the column back to the top
      column1 waittill ("movedone");
   }
}
Try this, if this doesn't work, I still have another thing you can try.

Re: hurt_trigger questions (screenshots)

Posted: March 26th, 2008, 5:06 am
by x0mbie
I tried that before I posted here, but I tried again to be sure and its still the same.

If it would help you I can send you my map files. You'll be getting credits already anyway for helping me with the scripting. :)