hurt_trigger questions (screenshots)

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

Moderator: Core Staff

Post Reply
x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

hurt_trigger questions (screenshots)

Post by x0mbie » March 10th, 2008, 4:46 am

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.
I saw a priest kill a cop on TV. :o

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: hurt_trigger questions (screenshots)

Post by Nightmare » March 10th, 2008, 5:34 am

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();
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 10th, 2008, 5:50 am

I'm still very new at scripting. How would that work?

btw, all the scripting I know I learned from your map nm_trap. :)
I saw a priest kill a cop on TV. :o

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: hurt_trigger questions (screenshots)

Post by Nightmare » March 10th, 2008, 11:54 pm

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");
	}
}
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 11th, 2008, 12:30 am

Awesome! I figured it out today at work, but I'm sure I would have had problems writing the code.
I saw a priest kill a cop on TV. :o

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 23rd, 2008, 6:42 am

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?
I saw a priest kill a cop on TV. :o

RiZzZla!
CJ Wannabe
CJ Wannabe
Posts: 14
Joined: March 23rd, 2008, 4:53 am
Location: United Kingdom
Contact:

Re: hurt_trigger questions (screenshots)

Post by RiZzZla! » March 23rd, 2008, 1:21 pm

Nightmare wrote:Its very simple
Yes yes it looks it :?

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: hurt_trigger questions (screenshots)

Post by Nightmare » March 23rd, 2008, 3:23 pm

Could you post your code? I am thinking it probably has something to do with your timing.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 23rd, 2008, 6:26 pm

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.
I saw a priest kill a cop on TV. :o

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: hurt_trigger questions (screenshots)

Post by Nightmare » March 23rd, 2008, 8:22 pm

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 24th, 2008, 6:28 am

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?
I saw a priest kill a cop on TV. :o

User avatar
ODD
CJ Wannabe
CJ Wannabe
Posts: 13
Joined: March 14th, 2006, 4:19 am
Location: Illinois, U.S.A.
Contact:

Re: hurt_trigger questions (screenshots)

Post by ODD » March 24th, 2008, 11:55 pm

He means that if the map is in the server with another map that uses the same targetnames then they won't work properly.
Image
ODD

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 25th, 2008, 9:10 am

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.
I saw a priest kill a cop on TV. :o

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Re: hurt_trigger questions (screenshots)

Post by Nightmare » March 26th, 2008, 1:26 am

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.
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

x0mbie
CJ Wannabe
CJ Wannabe
Posts: 32
Joined: February 1st, 2008, 7:07 am

Re: hurt_trigger questions (screenshots)

Post by x0mbie » March 26th, 2008, 5:06 am

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. :)
I saw a priest kill a cop on TV. :o

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests