A problem with storing a diing 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.
A problem with storing a diing unit
So I am trying to make a unit in a campaign "immortal" by putting it on the recall list whenever it is killed. My attempt is to store it in a "last breath" event and unstore it into the recall list.
The event is as follows:
The event fires, the talking happens, but then Wesnoth writes in chat "<Invalid WML found> [unstore_unit]: variable 'rich-helper_stockpile' doesn't exist" and the unit is not stored, let alone placed onto the recall list.
Can someone please tell me, what I am doing wrong?
The event is as follows:
Code: Select all
[event]
name=last breath
first_time_only=no
[filter]
id=Rich-helper
[/filter]
[message]
id=Rich
message=_ "You are too wounded. Into the turban you go!"
[/message]
[message]
speaker=second_unit
message=_ "The enemy is being pulled away from me!"
[/message]
[message]
id=Rich-helper
message=_ "The turban smells of bats! I want to go somewhere else!"
[/message]
[message]
id=Rich
message=_ "But you do not have a sense of smell."
[/message]
[message]
id=Rich-helper
message=_ "But what about the ladies?"
[/message]
[store_unit]
[filter]
id=Rich-helper
[/filter]
variable=rich-helper_stockpile
[/store_unit]
[unstore_unit]
variable=rich-helper_stockpile
x,y=recall,recall
[/unstore_unit]
[/event]
Can someone please tell me, what I am doing wrong?
Re: A problem with storing a diing unit
"-" is invalid in variable name.
Re: A problem with storing a diing unit
Thank you. Replacing "-" with "_" worked.