Variable inside filter_wml stopped working with 1.12.1
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
Variable inside filter_wml stopped working with 1.12.1
This is the code that used to return 1 or 0 before the Wesnoth update, now always returns 0. Removing this section of code allows the combat wml to work again.
[filter_wml]
[variable]
name=second_unit.max_experience
less_than=256
[/variable]
[/filter_wml]
[filter_wml]
[variable]
name=second_unit.max_experience
less_than=256
[/variable]
[/filter_wml]
Creator of 120+ units Lord of the Rings era and campaign now outdated & lost.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Re: Variable inside filter_wml stopped working with 1.12.1
I believe you want
\/ Ah yes, I am just used to [filter_condition] and similar.
this_unit.max_experience
instead.\/ Ah yes, I am just used to [filter_condition] and similar.
Last edited by Ravana on March 28th, 2015, 6:39 pm, edited 2 times in total.
Re: Variable inside filter_wml stopped working with 1.12.1
yo can not use [variable] inside [filter_wml]. What you can use is......wich doesnt allow logical keys as less_than=.
Code: Select all
[filter_wml]
[variables]
key=value
[/variables]
[/filter_wml]
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II
Re: Variable inside filter_wml stopped working with 1.12.1
Indeed, your code can't ever have worked the way you think.tekelili wrote:yo can not use [variable] inside [filter_wml].
Re: Variable inside filter_wml stopped working with 1.12.1
The code came from another thread when I asked for help on how to less than filter exp of an opponent. http://forums.wesnoth.org/viewtopic.php?f=21&t=40957
I know for sure [variable] was working inside [filter_wml] in the last version because when this code was shared with me I tested and the ability triggered on units with max exp under 256 but not on units with over 256.
When the update to 1.12 happened the units ability stopped triggering regardless of the opponent. I started commenting out various parts of code until I found the part responsible for breaking with the update. Removing only the section of code I shared and changing nothing else, the ability started triggering regardless of the opponents max exp.
I know for sure [variable] was working inside [filter_wml] in the last version because when this code was shared with me I tested and the ability triggered on units with max exp under 256 but not on units with over 256.
When the update to 1.12 happened the units ability stopped triggering regardless of the opponent. I started commenting out various parts of code until I found the part responsible for breaking with the update. Removing only the section of code I shared and changing nothing else, the ability started triggering regardless of the opponents max exp.
Creator of 120+ units Lord of the Rings era and campaign now outdated & lost.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Re: Variable inside filter_wml stopped working with 1.12.1
No, it can't have worked. Unless by a lucky fluke some other part of your code was buggy and actually set unit.variable.max_experience.Kharn wrote:I know for sure [variable] was working inside [filter_wml] in the last version
Re: Variable inside filter_wml stopped working with 1.12.1
In order to know what a programing language can do and what can not do, you should read creator´s spececifications. When I read your post I just checked wiki wml page to be sure [variable] is not described as a valid subtag of [filter_wml]. A wrong code langauage behavior is one different from guide described as expected. WML guide dont say is expected your code do anything.Kharn wrote:I know for sure [variable] was working inside [filter_wml] in the last version
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
World Conquest II