Compatibility-breaking changes between 1.16 and 1.17/1.18

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.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

This lists removed WML functionality and helpful hints for avoiding pitfalls.

A similar thread for changes before 1.16 can be found here.

Compatibility breaking (requires updates to work)
  • [heal_unit] no longer sets the heal_amount variable, instead supporting the variable attribute. This variable will be an array with each element containing the id of the unit healed and the amount that unit was healed for.
  • The [kill] tag now explicitly no longer accepts [filter].
  • Getting a unit's jamming_cost now actually returns that value instead of the unit's vision.
  • [resistance] abilities that don't specify a max_value now defaults their max value to 100 instead of 0.
  • Custom status icons no longer have transparent padding cropped off by the engine. It either needs to be cropped off the image itself, or the ~CROP_TRANSPARENT() IPF can be added.
  • Unit sprites:
    • Elvish Fighter moved to units/elves-wood/fighter/fighter.png.
    • Naga Fighter moved to units/nagas/fighter/fighter.png.
    • Naga Warrior moved to units/nagas/fighter/warrior.png.
    • Naga Myrmidon moved to units/nagas/fighter/myrmidon.
    • Naga Guardian moved to units/nagas/guardian/guardian.png.
    • Naga Sentinel moved to units/nagas/guardian/sentinel.png.
    • Naga Warden moved to units/nagas/guardian/warden.png.
    • Naga Dirkfang moved to units/nagas/mixed/dirkfang.png.
    • Naga Ophidian moved to units/nagas/mixed/ophidian.png.
    • Naga Ringcaster moved to units/nagas/mixed/ringcaster.png.
    • Naga Sicarius moved to units/nagas/mixed/sicarius.png.
    • Naga Zephyr moved to units/nagas/mixed/zephyr.png.
    • units/human-loyalists/spearman-attack-ranged.png changed to units/human-loyalists/spearman-attack-ranged1.png, units/human-loyalists/spearman-attack-ranged2.png, units/human-loyalists/spearman-attack-ranged3.png.
    • units/human-loyalists/spearman-attack-ne.png changed to units/human-loyalists/spearman-attack-ne1.png, units/human-loyalists/spearman-attack-ne2.png, units/human-loyalists/spearman-attack-ne3.png.
    • units/human-loyalists/swordsman-defend.png changed to units/human-loyalists/swordsman-defend1.png, units/human-loyalists/swordsman-defend2.png.
    • units/human-loyalists/general-leading.png changed to units/human-loyalists/general-leading1.png, units/human-loyalists/general-leading2.png, units/human-loyalists/general-leading3.png.
    • units/human-loyalists/swordsman-attack-* changed to units/human-loyalists/swordsman-attack-se-*.
    • The units/human-loyalists/spearman-attack-s-* images are removed.
    • The units/human-loyalists/spearman-attack-se 4-14 images are removed.
    • The units/human-loyalists/swordsman-idle-* images are removed.
    • Ghost, Nightgaunt, Shadow, Spectre, and Wraith sprites moved from units/undead/ to units/undead-spirit/
  • Almost all .jpg story images have been converted to .webp, and their filenames changed to match. However, the engine won't automatically look for the renamed images (it does for .png, but not .jpg).
Deprecations (will continue to work for now)
  • Change terrain codes "Irs, Ias, Icr, Ior, and Icn" to "Isr, Isa, Isc, Iwo, and Iwc", respectively.
  • Lua function wesnoth.fire_event --> wesnoth.game_events.fire.
  • Lua function wesnoth.fire_event_by_id --> wesnoth.game_events.fire_by_id.
  • Lua function wesnoth.remove_event_handler --> wesnoth.game_events.remove.
  • Terrain macros: a lot - search for "#deprecated 2 1.19.0" in 19fcc1424fd75386e524b9115a42e2804b98dc8c.
  • Lua function helper.set_wml_action_metatable --> wml.fire.tag.
  • Lua script helper.lua. Everything in this module has been moved into the core modules.
  • Unit "Giant Stoat" --> "Frost Stoat".
  • FormulaAI (FAI).
  • Lua function wesnoth.print --> wesnoth.interface.add_overlay_text.
  • map_file when passed a .cfg file --> use include_file instead.
  • All special notes macros.
  • Lua function ai_helper.split --> stringx.split.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Atreides
Posts: 1075
Joined: March 30th, 2019, 10:38 pm
Location: On the 2nd story of the centre village of Merwuerdigliebe turning the lights on and off

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Atreides »

Undead ghosty sprites also have moved into spirit subdirectories.
User avatar
Elvish_Hunter
Posts: 1576
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Elvish_Hunter »

As of 28cea58, wmllint is capable of both updating the sprite paths and warning about [filter] in [kill] tags.
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)
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

Added the note about custom status icons.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
white_haired_uncle
Posts: 1207
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by white_haired_uncle »

I just spent several minutes searching for this thread (couldn't think of a good search query). Might be nice to add a link to at least the dev branch release announcements like viewtopic.php?t=57624

Seems a little odd being under WML Workshop since there's so much lua included. Not enough to move it since so many are probably used to finding it here, but odd nonetheless.

End rant.
Speak softly, and carry Doombringer.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

Mostly it's just how it's always been - these threads predate there being a Lua Labs forum at all. But also it's because more people use WML Workshop than Lua Labs.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
white_haired_uncle
Posts: 1207
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by white_haired_uncle »

What about units/human-loyalists/spearman-attack-ranged.png?

Looks like units/human-loyalists/spearman-attack-ranged2.png is the best fit, but perhaps the idea is to use all three (I don't know anything about animation, I just got an error).

See also units/human-loyalists/spearman-attack-s-*
Speak softly, and carry Doombringer.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

It means that the defend animation was expanded from 1 frame to 3 frames, and it looks like the original defend image isn't present anymore.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
white_haired_uncle
Posts: 1207
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by white_haired_uncle »

Thanks. I was mostly just concerned if it should be on your list.

And I notice wmllint doesn't catch it, but I've used that like three times so I'm not sure what to expect.
Speak softly, and carry Doombringer.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

I've added it - a lot of the sprite file changes weren't documented anywhere or added to wmllint unfortunately.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
white_haired_uncle
Posts: 1207
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by white_haired_uncle »

units/human-loyalists/spearman-attack-ne -> ne1, ne1, ne3
units/human-loyalists/spearman-attack-se[4-14] removed
units/human-loyalists/swordsman-attack-[1-2] > se[1-8]
units/human-loyalists/swordsman-defend -> defend-1, defend-2
units/human-loyalists/swordsman-idle-[1-12] removed
units/human-loyalists/general-leading.png -> leading[1-3]

Note that what I list here is just based on filenames. I don't do animations so someone would need to confirm.
Speak softly, and carry Doombringer.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

Alright, added those as well. units/human-loyalists/swordsman-attack-[1-2] > se[1-8] isn't really a compatibility issue though, since the 1 and 2 images still exist?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
white_haired_uncle
Posts: 1207
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by white_haired_uncle »

No, the 1 and 2 (and 3, my bad) are removed. Everything is now attacks-se:

/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-1.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-2.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-3.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-4.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-5.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-6.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-7.png
/opt/wesnoth-1.17-git/share/wesnoth/data/core/images/units/human-loyalists/swordsman-attack-se-8.png
/usr/share/games/wesnoth/1.16/data/core/images/units/human-loyalists/swordsman-attack-1.png
/usr/share/games/wesnoth/1.16/data/core/images/units/human-loyalists/swordsman-attack-2.png
/usr/share/games/wesnoth/1.16/data/core/images/units/human-loyalists/swordsman-attack-3.png
Speak softly, and carry Doombringer.
User avatar
Pentarctagon
Project Manager
Posts: 5566
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by Pentarctagon »

Alright, added as well.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: Compatibility-breaking changes between 1.16 and 1.17/1.18

Post by octalot »

Almost all .jpg story images have been converted to .webp, and their filenames changed to match. However, the engine won't automatically look for the renamed images (it does for .png, but not .jpg).
Post Reply