Use a "Unit Takes Damage" trigger with "Damage Fatal Option: Fatal" (assuming you haven't made any ability which kills instead of dealing damage, in which case this won't work). Then use triggering player for the owner of the killed unit and damaging player for the owner of the killing unit.
Are you saying that you are using a trigger to killer a unit, but you want to find out which player caused it? From my Wc3 modding I find it's better never to use a simple kill unit action, especially if it is part of a spell or ability that some player uses.
You are much better off having them cause damage to the unit equivalent to the units health, this way your other triggers and conditions will work normally.
Are you saying that you are using a trigger to killer a unit, but you want to find out which player caused it?
No.
For example lets say there is a lava region and when a unit enters, it simply dies. NO message should be displayed.
But when another player kills your unit, a message SHOULD be displayed.
I need to filter out the "unit dies through trigger" effect.
Ahh okay. There used to be conditions like "Owner of Killing Unit is a Player" or similar in Wc3 editor, so you don't have to set a condition for every single player.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
See title, I need to find out the condition for that.
Something like "Triggering player != null" if you get what I mean. But there seems to be no null element anywhere.
Background information: When a player kills a unit of another player it should show "Player 1 just killed Player 2!"
But when someone's unit is killed by a Kill Unit trigger, it shows " just killed Player 2!" with a trigger error. I need to filter that out...
Thanks!
@phoenixfire2001: Go
Would "Triggering player > 0" work?
Sadly no.
@phoenixfire2001: Go
Use a "Unit Takes Damage" trigger with "Damage Fatal Option: Fatal" (assuming you haven't made any ability which kills instead of dealing damage, in which case this won't work). Then use triggering player for the owner of the killed unit and damaging player for the owner of the killing unit.
@phoenixfire2001: Go
Are you saying that you are using a trigger to killer a unit, but you want to find out which player caused it? From my Wc3 modding I find it's better never to use a simple kill unit action, especially if it is part of a spell or ability that some player uses.
You are much better off having them cause damage to the unit equivalent to the units health, this way your other triggers and conditions will work normally.
Otherwise you could store the data in variables.
No. For example lets say there is a lava region and when a unit enters, it simply dies. NO message should be displayed. But when another player kills your unit, a message SHOULD be displayed.
I need to filter out the "unit dies through trigger" effect.
Try this..:
If you wanted a special message whenever a unit died but it was not killed by another player, you simply insert
Not:
containing everything in the Conditions above.
Works perfectly, many thanks.
@phoenixfire2001: Go
Ahh okay. There used to be conditions like "Owner of Killing Unit is a Player" or similar in Wc3 editor, so you don't have to set a condition for every single player.