How to handle less-than in a filter?
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.
How to handle less-than in a filter?
How do I fix the code below to replace the Less than symbol since wesnoth cant handle less than symbols?
Code: Select all
[event]
name=attack_end
first_time_only=no
[filter_attack]
name=Theft
[/filter_attack]
[filter_second]
canrecruit=no
[and]
max_experience<265
[/and]
[/filter_second]
...
...
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: How to handle less-than in a filter?
you have to use formula or lua, here the formula version (not tested, might have typos):
Code: Select all
[filter_second]
formula = "max_experience < 265"
[/filter_second]
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to handle less-than in a filter?
You can do it purely in WML too (also not tested):
Code: Select all
[filter_wml]
[variable]
name=second_unit.max_experience
less_than=256
[/variable]
[/filter_wml]
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: How to handle less-than in a filter?
Yes, although you need to use [filter_condition] for it:beetlenaut wrote:You can do it purely in WML too (also not tested):
Code: Select all
[event]
name=attack_end
first_time_only=no
[filter_attack]
name=Theft
[/filter_attack]
[filter_second]
canrecruit=no
[/filter_second]
[filter_condition]
[variable]
name=second_unit.max_experience
less_than=256
[/variable]
[/filter_condition]
...
...