Trigger Damage Problem

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

Moderator: Core Staff

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Trigger Damage Problem

Post by ekat » April 22nd, 2013, 7:36 am

Hey Guys..
My trigger_damage wont work.
It works with knife, nades, flash.. But not if i shoot on it.
http://www.youtube.com/watch?v=u2J1qE51vyM
http://s14.directupload.net/images/130422/zi2ufhig.jpg
has anyone an idea?
btw.. sorry for my bad english :x

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Trigger Damage Problem

Post by megazor » April 22nd, 2013, 12:45 pm

Maybe it has a special flag for shooting. You can reset all its flags in Radiant.

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 22nd, 2013, 5:41 pm

Already done but its a clean damage trigger..
http://s14.directupload.net/images/130422/zi2ufhig.jpg
:(

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Trigger Damage Problem

Post by Drofder2004 » April 22nd, 2013, 7:08 pm

Would like to see script and how you have made it (trigger textured brush + are you moving the trigger or just turning it on/off?)
you could also try:
trig setcandamage();

Just to make sure it is accepting damage.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 22nd, 2013, 7:26 pm

I tried it with cjmod and completly without mod..
Same shit.. :(

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 22nd, 2013, 7:49 pm

done! Thank you! :)

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 22nd, 2013, 8:10 pm

Done.. I unlinked all trigger and make them static but they still wont work with bullets..
The biggest problem is that if i hit it with bullets it doesnt count "Hit" or "Missed".
If i knife it counts the hits and if i do nothing it counts the "Missed" so the trigger seems to noticed the bullets.. o.O

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Trigger Damage Problem

Post by Drofder2004 » April 22nd, 2013, 11:07 pm

change trigger waittill("trigger", user)
to 'trigger waittill("damage", user)'

And see if that does the trick.


Also, clear all your mod directories into another folder while you test, just in case there is a mod affecting the damage.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 23rd, 2013, 4:21 am

Done.. But everytime i shoot at the trigger i got an error..

Code: Select all

******* script runtime error *******
pair '50' and 'entity' has unmatching types 'int' and 'object': (file 'maps/mp/_collectiums.gsc', line 481)
  if (user==level.userr) level.hit=true;
          *
Error: started from:
(file 'maps/mp/_collectiums.gsc', line 480)
  target4trig waittill("damage",user);
Error: ************************************
      dvar set com_errorTitle Error
      dvar set com_errorMessage script runtime error
(see console for details)
pair '50' and 'entity' has unmatching types 'int' and 'object'
Could not find menu 'main'

******* script runtime error *******
cannot cast undefined to bool: (file 'maps/mp/_collectiums.gsc', line 481)
  if (user==level.userr) level.hit=true;
          *
Error: started from:
(file 'maps/mp/_collectiums.gsc', line 480)
  target4trig waittill("damage",user);
Error: ************************************

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Trigger Damage Problem

Post by Drofder2004 » April 23rd, 2013, 8:42 am

sorry.
trigger waittill ("damage", idamage, user)

Btw, that 50 means that the trigger is detecting 50 dmg.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Trigger Damage Problem

Post by Rezil » April 23rd, 2013, 9:06 am

Btw, that 50 means that the trigger is detecting 50 dmg.
What he means is that only when the damage(one shot, not accumulative) applied is above 50, then the trigger will be triggered. This would for example mean that if regular pistol bullets deal less than 50dmg you won't be able to trigger this at all.

You could try adding a threshold value to the enitity in radiant:

key: threshold
value: 10
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Trigger Damage Problem

Post by megazor » April 23rd, 2013, 9:42 am

I think Rezil is mistaken. Damage triggers are different from hurt triggers. The 'dmg' thing is only supposed for hurt triggers and determines how much it hurts entities on one frame; for damage triggers you should use the key 'threshold'.

But by default, triggers should respond on any damage.

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: Trigger Damage Problem

Post by Rezil » April 23rd, 2013, 9:48 am

megazor wrote:I think Rezil is mistaken. Damage triggers are different from hurt triggers. The 'dmg' thing is only supposed for hurt triggers and determines how much it hurts entities on one frame; for damage triggers you should use the key 'threshold'.

But by default, triggers should respond on any damage.
You're right, my mistake. Edited my post to use the proper term.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

ekat
CJ Newbie
CJ Newbie
Posts: 53
Joined: September 15th, 2010, 4:56 pm

Re: Trigger Damage Problem

Post by ekat » April 23rd, 2013, 10:40 am

Drofder2004 wrote: sorry.
trigger waittill ("damage", idamage, user)
Done.. Wont work..:(
Rezil wrote:
You could try adding a threshold value to the enitity in radiant:

key: threshold
value: 10
Done.. Wont work..:(

Maybe someone can get it working on my testmap and tell me how:
http://unpure-gaming.de/~unpure/downloa ... _range.zip

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Trigger Damage Problem

Post by Drofder2004 » April 23rd, 2013, 9:41 pm

One massive problem after a lot of testing, I found your "user.hits" is actually already a built-in variable.

The game resets the hits variable to zero after every bullet misses a player.
So, you hit the target, the map script says "+1" then the game script says "player missed, reset to 0" (this is used for one of the challenges in the stock game)

I have rebuilt the map and code for a look at a neater approach, but your old code will probably work with the adjustment of changing the variable. I suggest taking a look at how I did the mapping for the triggers and how I tied that in to the code using arrays.
mp_shooting_range_edit.zip
You do not have the required permissions to view the files attached to this post.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests