Page 1 of 1

Changing Message about Means of Death

Posted: Tue Mar 08, 2005 12:17 am
by wacko
I read somewhere that I could change the MoD which I would like to do with a trigger_multiple.
As far as I understood, I have to use the command meansofdeath (value) and I even found this list of possible values:

Code: Select all

// Means of death values: 
// 0   MOD_NONE, 
// 1   MOD_SUICIDE, 
// 2   MOD_CRUSH, 
// 3   MOD_CRUSH_EVERY_FRAME, 
// 4   MOD_TELEFRAG, 
// 5   MOD_LAVA, 
// 6   MOD_SLIME, 
// 7   MOD_FALLING, 
// 8   MOD_LAST_SELF_INFLICTED, 
// 9   MOD_EXPLOSION, 
// 10   MOD_EXPLODEWALL, 
// 11   MOD_ELECTRIC, 
// 12   MOD_ELECTRICWATER, 
// 13   MOD_THROWNOBJECT, 
// 14   MOD_BEAM, 
// 15   MOD_ROCKET, 
// 16   MOD_IMPACT, 
// 17   MOD_BULLET, 
// 18   MOD_FAST_BULLET, 
// 19   MOD_VEHICLE, 
// 20   MOD_FIRE, 
// 21   MOD_FLASHBANG, 
// 22   MOD_ON_FIRE, 
// 23   MOD_GIB, 
// 24   MOD_IMPALE, 
// 25   MOD_BASH, 
// 26   MOD_TOTAL_NUMBER
So, I gave a trigger_multiple keys/values of targetname/ canyon_death_trigger and setthread/canyon_death and in the script there is
...
canyon_death:
$canyon_death_trigger meansofdeath 1 //suicide, but I also tried 7 falling
$canyon_death_trigger volumedamage 100
end
Nevertheless, I just get the message "Wacko blew up".
Where did I wrong?
Btw, $canyon_death_trigger.meansofdeath = 1 didn't work either :?

Posted: Tue Mar 08, 2005 9:22 am
by Elgan
ive not tried that way. however u can change that using damage.

parm.other damage self 100 self (0 0 0) (0 0 0) (0 0 0) 0 1 22 -1

Aboce^^

The trigger (self) is damaging parm.other(player) with 100 health off
means of death 22 and location general (-1).

would print. "Wacko was burned to a crisp"

NOTE: some dont work. sme print others..some are not used and can be changed of r ur own messages server side using localisation.txt

Posted: Tue Mar 08, 2005 5:37 pm
by wacko
Yep, great :D Thanks a lot, m8

Posted: Sun Mar 27, 2005 11:01 pm
by K.I.A.
I have a similar problem, my message says "K.I.A. blew up." when I would like it to say "K.I.A. drowned." The thread is called 'ouch' and the trigger_multiple is called 'harm1'. My volume damage is set to 10 (every second).

I don't understand how to apply Elgan's solution, and where to put that line in my script. All I have now is:

ouch:
$harm1 volumedamage 10
end

What I would like to do is change the MoD to an unused MoD, and then make a serverside mod that makes the MoD message say "[player] drowned." and include that in the .pk3 with my map.

If some1 could explain how to apply Elgan's solution to my script, I should be able to figure out the rest.

Posted: Mon Mar 28, 2005 6:38 am
by Rookie One.pl
I assume you the ouch thread is called by the trigger and you set it to do so via setthread. You can just change $harm volumedamage 10 to what Elgan wrote, then.

This is the damage command syntax, if you need it:
g_allclasses.htm wrote:damage( Entity attacker, Integer damage, Entity inflictor, Vector position, Vector direction, Vector normal, Integer knockback, Integer damageflags, Integer meansofdeath, Integer location )

general damage event used by all entities

Location values:
-1 General
0 Pelvis
1 Lower Torso
2 Mid Torso
3 Upper Torso
4 Neck
5 Head
6 RUpperArm
7 RForearm
8 RHand
9 LUpperArm
10 LForearm
11 LHand
12 RThigh
13 RCalf
14 RFoot
15 LThigh
16 LCalf
17 LFoot

Posted: Mon Mar 28, 2005 8:03 am
by bdbodger
From the global/bullethit.scr
// Create a damage event with the parameters I want
self damage NULL local.damage NULL (0 0 0) local.direction (0 0 0) local.knockback 16 17 local.locationint

/////////////////////////////////////
// info
/////////////////////////////////////

// Means of death values:
// 0 MOD_NONE,
// 1 MOD_SUICIDE,
// 2 MOD_CRUSH,
// 3 MOD_CRUSH_EVERY_FRAME,
// 4 MOD_TELEFRAG,
// 5 MOD_LAVA,
// 6 MOD_SLIME,
// 7 MOD_FALLING,
// 8 MOD_LAST_SELF_INFLICTED,
// 9 MOD_EXPLOSION,
// 10 MOD_EXPLODEWALL,
// 11 MOD_ELECTRIC,
// 12 MOD_ELECTRICWATER,
// 13 MOD_THROWNOBJECT,
// 14 MOD_BEAM,
// 15 MOD_ROCKET,
// 16 MOD_IMPACT,
// 17 MOD_BULLET,
// 18 MOD_FAST_BULLET,
// 19 MOD_VEHICLE,
// 20 MOD_FIRE,
// 21 MOD_FLASHBANG,
// 22 MOD_ON_FIRE,
// 23 MOD_GIB,
// 24 MOD_IMPALE,
// 25 MOD_BASH,
// 26 MOD_TOTAL_NUMBER
The 17 in that statement is for bullet hit so I think elgan is right

Posted: Mon Mar 28, 2005 10:15 pm
by K.I.A.
OK, i should have explained that I am "scripting challenged". I was hoping some1 could spell it out for me here. right now i have a trigger_multiple with targetname harm1 and setthread ouch. (it also has a delay 20 and wait 1 though not really of importance here) In my script I have to following thread as I posted before:

ouch:
$harm1 volumedamage 10
end

So far this works (for the most part) as I want it to. If I touch the trigger, I get 20 seconds, then i lose 10 HP/second until I die, unless I remove myself from the trigger. I want the same effect but I want the MoD changed (right now it says "Player blew up.")

I'm still not sure how to include Elgan's line, but from the explainations so far, this is my best guess.

ouch:
parm.other damage self 10 self (0 0 0) (0 0 0) (0 0 0) 0 1 6 -1
end

I have changed the 100 to 10 for damage, and the MoD to 6 (slime death) to change later. With this in the script, I get a 20 second delay, 10 damage per second, and the MoD is changed.

The problem is with this script, if I enter the trigger then leave immediately, I still take damage 20 seconds later. Or, if I die from the damage, I still take damage when I respawn. I believe the problem is the 'self' under 'entity attacker' and 'entity inflictor'. Shouldn't there be a $harm1 included in this somewhere to link the damage to the trigger area, and not just trigger damage that I can't escape from?

Posted: Tue Mar 29, 2005 4:34 am
by K.I.A.
I have found a problem with volume damage and delays. Once triggered, the delay starts, and any other players entering the trigger dont get an individual delay time. ex. If player1 enters trigger, 15 seconds later player2 enters the trigger, player2 only get 5 seconds before recieving damage.

So I need the trigger to tranfer damage on the individuals. That's where this thread comes in:

ouch:
parm.other damage self 10 self (0 0 0) (0 0 0) (0 0 0) 0 1 6 -1
end

Now, can i put the dalay and wait in this thread instead of in the trigger_multiple so each player gets their own delay? Also, can I have it so the damage stops and delay resets when I leave the trigger_multiple, or put in another trigger to stop the damage? It just keeps getting more complicated.

Posted: Tue Mar 29, 2005 12:10 pm
by bdbodger
well for one thing useing parm.other that way isn't good because parm.other changes . I would do local.player = parm.other that way you get a snapshot of who parm.other was when that line was read and the rest of the thread will run better . Don't forget that with setthread you will have many copies of the same thread running every time the trigger fires and in some of those multiple threads parm.other will be the same player . This thraed is not that long but in a longer thread you might want to do

local.player = parm.other

if(local.player.is_in_trigger == 1)
end

local.player.is_in_trigger = 1

// do stuff

local.player.is_in_trigger = 0

end

Something like that anyway just to keep only one thread running on the player not more

Posted: Wed Mar 30, 2005 1:16 am
by K.I.A.
I don't know the syntax and valid commands for scripting, but I am hoping if I write what I want done in pseudocode, some1 can translate it for me.

ouch: // name of setthread in trigger_multiple

waited = 0 // identifier to give player 20 second delay before damage

while (player.is_in_trigger == 1) {

if (waited == 0) { // checks to see if delay has happened
wait 20
waited = 1
}

damage.player 10
wait 1 // delivers 10 damage every second
}

There's my mix of scripting and java/c that I haven't used in 4 years. To get back to the original topic of this thread, I would still like to change the MoD for this damage :? Maybe 1 of you can show me how to script this correctly.