Silence's WML Questions
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.
- Elvish_Hunter
- Posts: 1600
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Silence's WML Questions
There's something fishy going on here...Silence wrote:Neither message was shown: from that, I assume that something is wrong with name="turn $($turn_number| + 4)" but I don't know what it is.

Seriously, when you have an event name like this, each turn the game will look for a turn number greater by 4 than the current one. Needless to say, it will never work - not correctly, at least.
You have two solutions:
1) keep this syntax and try adding delayed_variable_substitution=no. This will acquire the turn number from the parent event, so sooner or later $turn_number+4 will mean something useful.
2) use variables. When the parent event is fired, you set a variable containing the turn number. Then you add 4 to that variable. Then you use an [event] with [filter_condition] to check if the variable turn number equals to your variable. It will be longer to write, but simpler to understand. Your call.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)