Important v1.6 Syntax Changes

The place to post your WML questions and answers.

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.
Post Reply
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Important v1.6 Syntax Changes

Post by Sapient »

(unit description disambiguation):

Code: Select all

description --> id
user_description --> name
unit_description --> description
(unit disambiguation)
when defining a unit type and NOT spawning a unit:

Code: Select all

[unit] --> [unit_type]
(filter concordance)
when filtering:

Code: Select all

[special_filter] --> [filter_attack]
[wml_filter] --> [filter_wml]
[unit_filter] --> [filter]
[secondary_unit_filter] --> [filter_second]
[attack_filter] --> [filter_attack]
[secondary_attack_filter] --> [filter_second_attack]
[special_filter_second] --> [filter_second_attack]
Note: the wmllint utility can help you make these changes automatically.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Re: Important v1.5 Syntax Changes

Post by Noyga »

(less important) In themeWML, to be consistent with the above :

Code: Select all

[unit_description] -> [unit_name] 
"Ooh, man, my mage had a 30% chance to miss, but he still managed to hit! Awesome!" ;) -- xtifr
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Important v1.5 Syntax Changes

Post by AI »

[multiplayer_side]:
-name, no longer takes a complex set of characters to provide both an image and some text (MENU_IMG_TXT), just a single translatable string.
new tags:
-image, to take up the functionality stripped from name. Note that no ~RC is needed because the images are automatically team-coloured based on actual team now.
-flag_rgb, better known as MAGENTA_IS_THE_TEAM_COLOR, for automatic team-colouring.
So that means that

Code: Select all

name={MENU_IMG_TXT "minotaurs/shaman.png~RC(magenta>red)" _"Minotaurs"}
becomes

Code: Select all

name= _"Minotaurs"
image=minotaurs/shaman.png
{MAGENTA_IS_THE_TEAM_COLOR}
Last edited by AI on November 1st, 2008, 9:51 pm, edited 1 time in total.
Reason: Cleared up which tag the post is about.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Important v1.5 Syntax Changes

Post by Sapient »

one change you should be careful of in 1.5.6... empty attributes are now filterable
so [filter] level={OPTIONAL_VALUE} # won't work anymore
and level="$null" will always be false in 1.5.6, while previously it was ignored

this change will allow you to filter things that are empty. also it's more intuitive in my view and makes some bugs easier to diagnose
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Iris
Site Administrator
Posts: 6796
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Important v1.5 Syntax Changes

Post by Iris »

The advanceto= attribute for [unit_type] was renamed in Wesnoth 1.5.4 to advances_to= .
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
joshudson
Posts: 501
Joined: January 17th, 2006, 8:04 pm
Contact:

Re: Important v1.5 Syntax Changes

Post by joshudson »

Oh, and somebody finally removed backwards compatibility for letter= in [terrain]
Last edited by Iris on March 23rd, 2009, 12:33 pm, edited 1 time in total.
Reason: [terrain], not [modify_terrain]
CHKDSK has repaired bad sectors in CHKDSK.EXE
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: Important v1.5 Syntax Changes

Post by Sapient »

in attack filters of events, you now must use name= to filter for the name of the weapon (not weapon= )
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Post Reply