Death event that has a second_unit
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Death event that has a second_unit
Basically i want to do some things to the unit that kills another unit.
For example:
When a Master dies then the unit that kills him is modified. However, this does not work because apparently
Thank you!
For example:
Code: Select all
[event]
name=last breath
[filter]
id=Master
[/filter]
[modify_unit]
[filter]
id=$second_unit.id
[/filter]
// ... some stuff
[/modify_unit]
[/event]
last breath
does not have a second unit stored. Is there another event i can use instead?Thank you!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Death event that has a second_unit
you could try
name=die
instead. It will fire after the killed unit actually died. Not sure if it stores a second unit though.Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: Death event that has a second_unit
I will give it a try!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Death event that has a second_unit
Unfortunately that does not seem to have a second_unit either.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Death event that has a second_unit
have you tried using [filter_second]?
EDIT:
have you tried using
Not sure but it might be that you are asking if the first unit ([filter]) has the id of the second unit ($second_unit.id). I never really understood the depth of those filters..
EDIT2: Oh, I guess not. It's the filter of the
EDIT:
have you tried using
[filter_second]
?Not sure but it might be that you are asking if the first unit ([filter]) has the id of the second unit ($second_unit.id). I never really understood the depth of those filters..
EDIT2: Oh, I guess not. It's the filter of the
[modify_unit]
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: Death event that has a second_unit
Code: Select all
[event]
name=die
[filter]
[/filter]
[message]
speaker=unit
message= _ "I die!"
[/message]
[message]
speaker=second_unit
message= _ "I killed you!"
[/message]
[/event]
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: Death event that has a second_unit
Hmm... when i tried something similar to that it did not work. I must have made an error. I will attempt it again, Thank you!
EDIT: Thank you i was able to make it work!
EDIT: Thank you i was able to make it work!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Death event that has a second_unit
Good to hear you made it. What was the problem?
Developer of Project Haldric
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Add-ons: Millennium Era, Vision of a Shaman, A New Home
Art: Bitron's Art Thread
Tools: WML Syntax Highlighter for VS Code
Re: Death event that has a second_unit
my problem was in the
Thank you again for telling me about the
die
event i was using the second_unit as a variable but i was using it incorrectly (because $second_unit doesn't actually mean anything as a variable it just represents a unit). I solved it by using $second_unit.side which worked.Thank you again for telling me about the
die
event! Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Death event that has a second_unit
As far as I know, last breath works the same way, it also stores the second unit in every case. The only difference between last breath and die is that last breath happens just before the death animation, and die happens right after it, so that the $unit is no longer on the map, but is still stored, and can be saved. [message]speaker=unit is fine in a last breath event, but it looks funny in a die event.
What I do instead of trying to read the $second_unit, is filter for the unit standing on x,y=$x2,$y2. This always works (Unless you move units in your event, and the second unit moves away from this hex.)
What I do instead of trying to read the $second_unit, is filter for the unit standing on x,y=$x2,$y2. This always works (Unless you move units in your event, and the second unit moves away from this hex.)
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Re: Death event that has a second_unit
Thank you whitewolf, yes probably the
last breath
event is better for my situation, and since i have figured out my problem (the incorrect use of $second_unit) it should work! Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.