Difference between revisions of "CompatibilityBreakingChanges"

From The Battle for Wesnoth Wiki
(Compatibility breaking changes between 1.18 and 1.19/1.20)
Line 4: Line 4:
  
 
== Compatibility breaking changes between 1.18 and 1.19/1.20 ==
 
== Compatibility breaking changes between 1.18 and 1.19/1.20 ==
 +
 +
=== Compatibility breaking (requires updates to work) ===
 +
 +
* '''[kill]''' now reduces target unit hitpoints to 0 before triggering '''last_breath, die''' events. This affects mentioned events that rely on [have_unit] conditions.
 +
* WFL Removed properties '''unit.side''' and '''terrain.owner'''. Use '''unit.side_number''' and '''terrain.owner_side''' instead. They return 1-indexed side, removed properties returned 0-indexed side.
 +
* Abilities with both '''add''' and '''sub''' now calculate value differently
 +
* rotate_loc_around formula now works
 +
* [era] with id=era_dunefolk does not exist anymore
 +
* [side]'s leader attribute has been removed
 +
* [side]'s [variables] tag is now used to set side variables. Use [side]'s [leader] tag to set a unit variable.
 +
* Setting gold to decimal value fails with error. Previously it was converted to int automatically. As of 1.19.21, automatic conversion is only done in [gold], but not in Lua or [modify_side].
 
* The following macros were removed ([https://github.com/wesnoth/wesnoth/pull/11126 #11126])
 
* The following macros were removed ([https://github.com/wesnoth/wesnoth/pull/11126 #11126])
 
** EARLY_FINISH_BONUS_NOTE
 
** EARLY_FINISH_BONUS_NOTE
Line 21: Line 32:
 
** ENABLE_NIGHTBLADE
 
** ENABLE_NIGHTBLADE
  
 +
=== Deprecations (will continue to work for now) ===
 +
* rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability] and [filter_specials] and make "experimental_" deprecated.
  
<nowiki>This lists removed WML functionality and helpful hints for avoiding pitfalls.
+
=== New features (help fill this list, https://wiki.wesnoth.org/Special:WhatLinksHere/Template:DevFeature1.19) ===
 
+
* StandardAbilityFilter, including [https://github.com/wesnoth/wesnoth/pull/7814 7814]
A similar thread for changes before 1.18 can be found [url=https://forums.wesnoth.org/viewtopic.php?t=57288]here[/url].
+
* [resistance] min_value
 
+
* [attack] alignment
[b][u]Compatibility breaking (requires updates to work)[/u][/b]
+
* New events '''unit_hits''', '''unit_misses'''
[list][*][c][kill][/c] now reduces target unit hitpoints to 0 before triggering [c]last_breath, die[/c] events. This affects mentioned events that rely on [have_unit] conditions.
+
* Positive '''attack_weight''' now affects weapon selection
[*]WFL Removed properties [c]unit.side[/c] and [c]terrain.owner[/c]. Use [c]unit.side_number[/c] and [c]terrain.owner_side[/c] instead. They return 1-indexed side, removed properties returned 0-indexed side.
+
* Unit attack [effect]+Lua+formula API min_range and max_range
[*]Abilities with both [c]add[/c] and [c]sub[/c] now calculate value differently
+
* Lua unit attributes fearless and healthy
[*]rotate_loc_around formula now works
+
* wesnoth.game_config shows some color-related values
[*][era] with id=era_dunefolk does not exist anymore
+
* wesnoth.units.rebuild
[*][side]'s leader attribute has been removed
+
* stringx.ends_with, stringx.starts_with
[*][side]'s [variables] tag is now used to set side variables. Use [side]'s [leader] tag to set a unit variable.
+
* Unit formula new attributes objects, advancements_taken, traits_count, objects_count, advancements_taken_count, fearless, healthy
[*]Setting gold to decimal value fails with error. Previously it was converted to int automatically. As of 1.19.21, automatic conversion is only done in [gold], but not in Lua or [modify_side].
+
* Formula functions lerp_index, ends_with, replace_all, starts_with, get_palette
[/list]
+
* Custom themes https://wiki.wesnoth.org/GUIToolkit#Custom_themes
 
+
* Abilities and specials now support [event] (does not work correctly due to [issue]10819[/issue])
[b][u]Deprecations (will continue to work for now)[/u][/b]
+
* Ability & Weapon specials registry ([https://github.com/wesnoth/wesnoth/pull/10644 10644]) (does not work correctly if ability contains [event] due to [issue]10819[/issue])
[list][*]rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability] and [filter_specials] and make "experimental_" deprecated.
+
* [effect][remove_specials]
[/list]
+
* Expose unit pick dialog to Lua as a simple API call ([https://github.com/wesnoth/wesnoth/pull/8829 8829])
 
+
* [fire_event][data] can be accessed from other event as $data
[b][u]New features (help fill this list, https://wiki.wesnoth.org/Special:WhatLinksHere/Template:DevFeature1.19)[/u][/b]
+
* Unit Type Editor
[list]
+
* [era]auto_sort allows to use custom faction ordering
[*]StandardAbilityFilter, including [pr]7814[/pr]
+
* [terrain_defaults] formula is now working as expected in case formula evaluates to null
[*][resistance] min_value
+
* [set_menu_item] description substitutes variables when rightclick is used
[*][attack] alignment
+
* [defense]
[*]New events [c]unit_hits[/c], [c]unit_misses[/c]
+
* [resistance_defaults] is not causing OOS in random maps anymore
[*]Positive [c]attack_weight[/c] now affects weapon selection
+
* Ability/weapon special descriptions support po variables in descriptions like '''$add''', '''$sub''' etc that contain the value of the relevant key. ([https://github.com/wesnoth/wesnoth/pull/10053 10053], [https://github.com/wesnoth/wesnoth/pull/10293 10293], [https://github.com/wesnoth/wesnoth/pull/10749 10749])
[*]Unit attack [effect]+Lua+formula API min_range and max_range
+
* Ability/weapon special help page ids now follow the format: '''ability_<unique_id>''' or '''weaponspecial_<unique_id>''' ([https://github.com/wesnoth/wesnoth/pull/11012 11012]).
[*]Lua unit attributes fearless and healthy
+
* A lot more functions were added to https://wiki.wesnoth.org/LuaAPI/types/widget with https://wiki.wesnoth.org/index.php?title=LuaAPI%2Ftypes%2Fwidget&type=revision&diff=74843&oldid=74842
[*]wesnoth.game_config shows some color-related values
 
[*]wesnoth.units.rebuild
 
[*]stringx.ends_with, stringx.starts_with
 
[*]Unit formula new attributes objects, advancements_taken, traits_count, objects_count, advancements_taken_count, fearless, healthy
 
[*]Formula functions lerp_index, ends_with, replace_all, starts_with, get_palette
 
[*]Custom themes https://wiki.wesnoth.org/GUIToolkit#Custom_themes
 
[*]Abilities and specials now support [event] (does not work correctly due to [issue]10819[/issue])
 
[*]Ability & Weapon specials registry ([pr]10644[/pr]) (does not work correctly if ability contains [event] due to [issue]10819[/issue])
 
[*][effect][remove_specials]
 
[*]Expose unit pick dialog to Lua as a simple API call ([pr]8829[/pr])
 
[*][fire_event][data] can be accessed from other event as $data
 
[*]Unit Type Editor
 
[*][era]auto_sort allows to use custom faction ordering
 
[*][terrain_defaults] formula is now working as expected in case formula evaluates to null
 
[*][set_menu_item] description substitutes variables when rightclick is used
 
[*][defense]
 
[*][resistance_defaults] is not causing OOS in random maps anymore
 
[*]Ability/weapon special descriptions support po variables in descriptions like [c]$add[/c], [c]$sub[/c] etc that contain the value of the relevant key. ([pr]10053[/pr], [pr]10293[/pr], [pr]10749[/pr])
 
[*]Ability/weapon special help page ids now follow the format: [c]ability_<unique_id>[/c] or [c]weaponspecial_<unique_id>[/c] ([pr]11012[/pr]).
 
[*]A lot more functions were added to https://wiki.wesnoth.org/LuaAPI/types/widget with https://wiki.wesnoth.org/index.php?title=LuaAPI%2Ftypes%2Fwidget&type=revision&diff=74843&oldid=74842
 
[/list]</nowiki>
 

Revision as of 12:29, 13 April 2026

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

The previous list is available here.

Compatibility breaking changes between 1.18 and 1.19/1.20

Compatibility breaking (requires updates to work)

  • [kill] now reduces target unit hitpoints to 0 before triggering last_breath, die events. This affects mentioned events that rely on [have_unit] conditions.
  • WFL Removed properties unit.side and terrain.owner. Use unit.side_number and terrain.owner_side instead. They return 1-indexed side, removed properties returned 0-indexed side.
  • Abilities with both add and sub now calculate value differently
  • rotate_loc_around formula now works
  • [era] with id=era_dunefolk does not exist anymore
  • [side]'s leader attribute has been removed
  • [side]'s [variables] tag is now used to set side variables. Use [side]'s [leader] tag to set a unit variable.
  • Setting gold to decimal value fails with error. Previously it was converted to int automatically. As of 1.19.21, automatic conversion is only done in [gold], but not in Lua or [modify_side].
  • The following macros were removed (#11126)
    • EARLY_FINISH_BONUS_NOTE
    • NO_EARLY_FINISH_BONUS_NOTE
    • NO_GOLD_CARRYOVER_NOTE
    • NEW_GOLD_CARRYOVER_NOTE_100
    • NEW_GOLD_CARRYOVER_NOTE_40
    • NEW_GOLD_CARRYOVER_NOTE_20
    • MISSILE_FRAME_FIREBALL
    • MESSAGE
    • STORY_PART_SPEECH
    • LOYAL_UNDEAD_UNIT
    • ON_SIGHTING
    • MAKE_AI_SIDE_PERSISTENT
    • DRAKE_FLYING_ANIM
    • NO_INTERRUPT_NO_UNDO
    • ENABLE_NIGHTBLADE

Deprecations (will continue to work for now)

  • rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability] and [filter_specials] and make "experimental_" deprecated.

New features (help fill this list, https://wiki.wesnoth.org/Special:WhatLinksHere/Template:DevFeature1.19)

  • StandardAbilityFilter, including 7814
  • [resistance] min_value
  • [attack] alignment
  • New events unit_hits, unit_misses
  • Positive attack_weight now affects weapon selection
  • Unit attack [effect]+Lua+formula API min_range and max_range
  • Lua unit attributes fearless and healthy
  • wesnoth.game_config shows some color-related values
  • wesnoth.units.rebuild
  • stringx.ends_with, stringx.starts_with
  • Unit formula new attributes objects, advancements_taken, traits_count, objects_count, advancements_taken_count, fearless, healthy
  • Formula functions lerp_index, ends_with, replace_all, starts_with, get_palette
  • Custom themes https://wiki.wesnoth.org/GUIToolkit#Custom_themes
  • Abilities and specials now support [event] (does not work correctly due to [issue]10819[/issue])
  • Ability & Weapon specials registry (10644) (does not work correctly if ability contains [event] due to [issue]10819[/issue])
  • [effect][remove_specials]
  • Expose unit pick dialog to Lua as a simple API call (8829)
  • [fire_event][data] can be accessed from other event as $data
  • Unit Type Editor
  • [era]auto_sort allows to use custom faction ordering
  • [terrain_defaults] formula is now working as expected in case formula evaluates to null
  • [set_menu_item] description substitutes variables when rightclick is used
  • [defense]
  • [resistance_defaults] is not causing OOS in random maps anymore
  • Ability/weapon special descriptions support po variables in descriptions like $add, $sub etc that contain the value of the relevant key. (10053, 10293, 10749)
  • Ability/weapon special help page ids now follow the format: ability_<unique_id> or weaponspecial_<unique_id> (11012).
  • A lot more functions were added to https://wiki.wesnoth.org/LuaAPI/types/widget with https://wiki.wesnoth.org/index.php?title=LuaAPI%2Ftypes%2Fwidget&type=revision&diff=74843&oldid=74842