Variable inside filter_wml stopped working with 1.12.1

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Kharn
Posts: 82
Joined: December 12th, 2005, 7:50 pm
Location: Dallas, Tx

Variable inside filter_wml stopped working with 1.12.1

Post by Kharn » March 28th, 2015, 3:29 pm

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]
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.

User avatar
Ravana
Forum Moderator
Posts: 2263
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Variable inside filter_wml stopped working with 1.12.1

Post by Ravana » March 28th, 2015, 4:00 pm

I believe you want 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.

User avatar
tekelili
Posts: 1038
Joined: August 19th, 2009, 9:28 pm

Re: Variable inside filter_wml stopped working with 1.12.1

Post by tekelili » March 28th, 2015, 5:01 pm

yo can not use [variable] inside [filter_wml]. What you can use is...

Code: Select all

    [filter_wml]
        [variables]
            key=value
        [/variables]
    [/filter_wml]
...wich doesnt allow logical keys as less_than=.
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II

User avatar
zookeeper
WML Wizard
Posts: 9740
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Variable inside filter_wml stopped working with 1.12.1

Post by zookeeper » March 28th, 2015, 6:06 pm

tekelili wrote:yo can not use [variable] inside [filter_wml].
Indeed, your code can't ever have worked the way you think.

Kharn
Posts: 82
Joined: December 12th, 2005, 7:50 pm
Location: Dallas, Tx

Re: Variable inside filter_wml stopped working with 1.12.1

Post by Kharn » March 30th, 2015, 11:22 am

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.
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.

User avatar
zookeeper
WML Wizard
Posts: 9740
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Variable inside filter_wml stopped working with 1.12.1

Post by zookeeper » March 30th, 2015, 12:16 pm

Kharn wrote:I know for sure [variable] was working inside [filter_wml] in the last version
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.

User avatar
tekelili
Posts: 1038
Joined: August 19th, 2009, 9:28 pm

Re: Variable inside filter_wml stopped working with 1.12.1

Post by tekelili » March 30th, 2015, 1:57 pm

Kharn wrote:I know for sure [variable] was working inside [filter_wml] in the last version
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.
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II

Post Reply