By using some plain old algebra I've tried to get some
more insight on the 'volumedamage'-thing and how to
set up the right values for it (don't laugh, it's raining
outside and I'd nothing better to do).
Understanding how this volumedamage number works can
help us use it as a 'replacement' for the non-functioning
trigger_hurt. Just a little info, nothing new or terribly
exciting, but just a reminder of a fast and easy way
to make something hurt the player without using a seperate
script file. I believe this has been a topic before,
but I still see few people actually use this easy method
to inflict pain upon a player (I know some people use
their own barbwire/hurt-script, but this is just another
way of doing the same sort of thing).
You might have noticed the use of a thread called
'waterdeath' in some original map's scripts, to cause
instant death when a player touches the water. This
original thread goes as follows:
waterdeath: $ocean1
volumedamage 1000 end
As with so many things, you can set this to whatever
you want; let's say you want your fire to cause pain
to the player, but not kill him immediately and give
him a fair chance to get out. Everybody understands
that the value must be less than the given 1000, but
what's a good value for the purpose you have in mind?
Well...erm, let's say just a 100? I found that even
with just a 100 the player is gonna be dead in just
2 seconds. Howcome? It seems like this volumedamage
is hitting the player about 3 to 4 times per second.
Before I start talking numbers and get all 'interesting',
here's how to set up the trigger in MohRadiant, nothing
new, just a trigger.
-------------------------------------------------------------------------------
Setting up the trigger
-------------------------------------------------------------------------------
(1) make a trigger_multiple around the fire (or whatever)
you want to cause the pain.
(2) with this trigger selected press 'N' to set its
properties
key:
targetname
value:
gimme_a_name
key:
setthread
value:
whatever_you_want
key:
wait (sets the amount
of seconds between triggerings)
value:
the number of seconds
you want
(3) next, add the following to the script of your
map, after 'level waittill spawn :
whatever_u_want: $gimme_a_name
volumedamage 100 //(example)
end
(4) and you're done.
Now for the meaning of the damage number and the use
of the wait-key:
As you can see you can slow down the hurting by adding
a 'wait' key to your trigger in Mohradiant. It says
default is '2', but in this case you still have to set
a value to make it work. By default, and without this
'wait' key the 'volumedamage' takes your health away
very fast and without pause, like every ~1/4 second.
Therefore, if the trigger is not to kill the player
instantly and you wanna give him a fair chance to escape,
I really recommend you to set a 'wait' key of at least
1 second.
Also, there is a 'delay'-key available. When delay
is set, then: -> the player activates the trigger but
it waits some time before firing. I can't really think
of a reason why to add this delay when hurting a player,
other than to use it when a player is in cold water
(fell through the ice..) and the freezing sets in. Right,
but enough about the delay-key.
Note : While
testing with a value of a 100 and using a wait-key of
1 second, I lost 13 healthpoints per hit (or triggering)
and died in ~8 seconds. In the statistics it said: hits
taken = 8. Then, without the wait-key, I still took
the same amount of 8 hits but was killed in only ~2
seconds, about 4 times as fast.
If you don't like algebra, just skip this part and
read the last part, this just explains how I got the
numbers.
The above means, that 'volumedamage 100' stands for
13 healthpoints (the health you lose is 13% of your
volumedamage) per hit, about 4 times per second. And,
if 4 hits would take place in 1 second, I would lose
4 * 13 = ~52 healthpoints per second (this makes sense
as I was killed in about two seconds; still this is
just guessing, the whole thing goes too fast).
Figure it out: you set volumedamage to 100 and lose
about 52 healthpoints per second. Remember, this would
be the case when you don't set a wait-key for the trigger.
However, when you do set
a wait-key, that same volumedamage of 100 will only
take away 13 healthpoints every time you touch your
trigger (everytime your wait-key expires).
Note : Unfortunately
I can't tell the effect 'per second' for sure as I don't
know exactly how many triggerings take place in 1 second.
All this time I was talking about what happens when
you use a volumedamage of 100. To find out what volumedamage
1 (= 1% of 100) does to your health per second, just
take 1% of 13 = 0.13 healthpoints per hit.
-------------------------------------------------------------------------------
How to define the values you want
-------------------------------------------------------------------------------
(Give your trigger a wait-key to see the hits)
volumedamage = (amount of healthpoints per hit) /
0.13
Example: you want to take 10 healthpoints per hit;
volumedamage = 10 / 0.13 => (~)
77
reversed:
amount of healthpoints per hit = volumedamage * 0.13
Example: say volumedamage is set to 50;
Healthpoints per hit = 50 * 0.13
=> 6.5
In the original waterdeath thread they used 1000.
Healthpoints per hit = 1000 *
0.13 => 130
This, combined with the fact that multiple hits take
place in 1 second would explain an instant death. But
keep in mind that without a wait-key even a value of
100 is very lethal, as with 100 you'd lose 13 points
per hit. With full health the player should be able
to take (100/13 = 7.7 =>) 8 hits. With about 3 to 4
hits per second, the player dies in a second or two.
Tip : If you wanna use
this volumedamage for making barbwire hurt the player,
but don't wanna use a wait-key, set 'volumedamage' to
a value < 10.
Personally, for barbwire I'd go for a wait-key (say
1 second), and a value of 15, which comes down to 2
healthpoints per hit every second (the time of my wait-key)
and is enough to warn the player when he's touching
the barbwire without making it annoying or really life-threatening.
I don't know if anyone finds this information useful,
but if you're still looking for an easy way to hurt
the player give this a try. All you need to do to make
the player lose the amount of health you want is set
up your trigger(s) and see what your volumedamage should
be, using the first 'formula'.