Compatibility-breaking changes between 1.12 and 1.13/1.14
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.
- Development Team
- Battle for Wesnoth
- Location: Wesnoth.org
- Contact:
Compatibility-breaking changes between 1.12 and 1.13/1.14
The thread for changes from 1.10 to 1.12 is here.
Deprecated or removed feature:
Lua API changes:
Note: This list doesn't necessarily contain every conceivable change that could prove relevant in some cases, such as:
Deprecated or removed feature:
- The
FOREACH
macro is deprecated, use[for]
instead - The
ABILITY_LEADERSHIP_LEVEL_1
..5 macros are deprecated and are now aliases for the new more generalABILITY_LEADERSHIP
macro. - The
~BRIGHTEN()
(which was misdocumented as ~LIGHTEN()) and~DARKEN()
Image Path Functions have been removed. - The
backstab=
key in weapon specials is deprecated; use[filter_adjacent]
instead - The
share_view
andshare_maps
keys in[side]
are replaced withshare_vision
, which has possible values all, shroud, none. - The
current_player
key in[side]
is effectively replaced withside_name
. (Thecurrent_player
key still exists in[store_side]
, but has little meaning for non-MP games.) scenario_generation=cave
, that is the built-in cave map generator is now deprecated and will be removed in 1.14 or 1.15. Scenarios that previously used it should change to the new Lua cave map generator. To do this, usemap_generation=lua
withcreate_map = << return wesnoth.require("lua/cave_map_generator.lua").generate_map(...) >>
.- The
[advance]
tag in[modifications]
was changed to[advancement]
. - The
SOUND:SLOW
andSOUND:POISON
macros should no longer be used, because sounds for poisoning, slowing and petrifying no longer need to be played by attack animations; instead, they are defined globally in[game_config] [sounds] [status]
. ai.synced_command
was removed (use the newwesnoth.invoke_synced_command
function instead)
map_generation
in[multiplayer]
now behaves the same way as in[scenario]
, that is, it creates only the map instead of the whole scenario, so generate the whole scenarioscenario_generation
has to be used- The WML preprocessor now issues warnings to stderr when redefining macros without undefining them first with
#undef
. - moveto and
enter_hex
,exit_hex
event no longer abort the movement,[cancel_action]
must be used to cancel the current move. - [filter_vision] fix regarding [hides] abilities.
- [endlevel] no longer silently kills 0-hp units, so if a last breath event declares victory/defeat, a following die event matching the dying unit didn't trigger in 1.12 but will trigger in 1.13.
- DescriptionWML for menu options.
- The menu item syntax (e.g.
&image.png=Peasant=Easy
) in campaign difficulty and in[message][option]
is now deprecated. In any other place, it no longer works. - Variable names with spaces in them are now explicitly not supported.
- In
[set_variable], value="true"
will set the variable to"yes"
, whilevalue="false"
will set the variable to"no"
. This is due to the fact that said tag was ported to Lua, and depends on how Lua handles internally these values. - By default, tunnels now allow fog and shroud to be cleared through them. If you wish to restore the original behaviour, you can add
allow_vision=no
to the[tunnel]
tag. - Wesnoth doesn't allow special characters like ,?;:'" in unit type ids anymore.
- The
allow_new_game=
attribute in[scenario]
now defaults tofalse
(it still defaults totrue
in[multiplayer]
) . - In GUI2 dialogs/widgets
[resolution] window_width/height
now specifies the minimum window size for that resolution to be chosen. - If ai_algorithm is used in [modify_side][ai], it now replaces the whole AI with the contents of [modify_side][ai], instead of appending these parameters.
- the
controller
property of sides (for example lua side proxies) can no longer have the valuesnetwork
andnetwork_ai
, instead theis_local
property to check whether a side is local or not. - The behviour of [terrain_mask] regarding the border has changed.
- Multiplayer scenario [side] tag must include
faction="Custom"
to use custom recruit list.
Lua API changes:
- The
wesnoth.put_unit
function now takes the unit as its first argument, followed by an optional location. Usewesnoth.erase_unit
instead if you want to remove a unit from the map. wesnoth.select_hex
is now deprecated.wesnoth.highlight_hex
is no longer deprecated, but its behaviour has changed - it highlights the hex only (as if the mouse was moved over it), without selecting any unit that's on the hex. To select a unit, usewesnoth.select_unit
.- The AI functions that return aspects are deprecated. This includes functions such as
ai.get_aggression(), ai.get_caution()
, etc. Instead, you should use theai.aspects
table to look up aspects - egai.aspects.aggression, ai.aspects.caution
, etc. Functions that do not return aspects, such asai.get_targets()
orai.get_goals()
, are not deprecated. In addition,ai.get_attacks()
is not deprecated, as it returns not just the attacks aspect but a full analysis of all the attacks allowed by the attacks aspect;ai.aspects.attacks
, on the other hand, simply evaluates the aspect and returns an unprocessed list of the allowed units. wesnoth.get_unit([i]underlying_id[/i])
was removed.- The metatables used by the helper.lua module are now protected from external access. If anyone used
getmetatable()
to alter these metatables, their code will no longer work. (You shouldn't have been doing that in the first place, though.) - Reading global lua variables without writing to them first will now give an error, this help people finding spelling mistakes in their code. But it also means code like
my_global_var = my_global_var or 1
will no longer work, so to do this you have to userawget
(my_global_var = rawget(_G, "my_global_var") or 1
)
- Core portraits are no longer split into a small version with black background and a transparent version; instead of having both portraits/race/unit.png and portraits/race/transparent/unit.png, there is now only portraits/race/unit.png.
Note: This list doesn't necessarily contain every conceivable change that could prove relevant in some cases, such as:
- All removed or changed images or sounds.
- Simple changes to unit stats, such as balancing changes.
- Changes to internals of core macros, [unit_type]s or similar, which add-ons can but usually shouldn't make assumptions about.
Last edited by Ravana on May 29th, 2018, 5:39 pm, edited 2 times in total.
Re: Compatibility-breaking changes between 1.12 and 1.13/1.1
added to the list, what i did min my addon is create a globals variableRavana wrote:Lua uses strict globals viewtopic.php?f=2&t=41481.
Code: Select all
globals = {}
setmetatable(globals, {
["__index"] = function(t, k)
return rawget(_G, k)
end,
["__newindex"] = function(t, k, v)
_G[k] = v
end,
})
a = my_gloval_var
woudl then become a = globals.my_gloval_var
if you cannot be sure whether my_gloval_var was initilised at theat point.)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.
Re: Compatibility-breaking changes between 1.12 and 1.13/1.1
So is there anyway to append the contents of the AI, or modify a certain aspect without replacing others?If ai_algorithm is used in [modify_side][ai], it now replaces the whole AI with the contents of [modify_side][ai], instead of appending these parameters.
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Compatibility-breaking changes between 1.12 and 1.13/1.1
The quoted statement only applies if you replace the ai algorithm, that is, if you completely switch the AI for a new one (then you start with a clean slate). All other changes, such as adding or changing aspects work as before.The_Gnat wrote:So is there anyway to append the contents of the AI, or modify a certain aspect without replacing others?If ai_algorithm is used in [modify_side][ai], it now replaces the whole AI with the contents of [modify_side][ai], instead of appending these parameters.
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
Re: Compatibility-breaking changes between 1.12 and 1.13/1.1
Okay thank you for explaining
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
[store_side] colors now return color name not index. viewtopic.php?f=21&t=48082
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
In my experience side.current_player was side.nameThe current_player key in [side] is effectively replaced with side_name. (The current_player key still exists in [store_side], but has little meaning for non-MP games.)
but side.side_name was usually containing this "" (nothing) while side.name doesn't exist at all I believe.
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
khalifate is renamed as dunefolk and all khalifate names renamed too, unit types have double names like "Dune Rider", "Dune Piercer" etc..
That will also cause incompatibility when porting projects from 1.12 into 1.14
That will also cause incompatibility when porting projects from 1.12 into 1.14
- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
That is not completely correct. The old unit types (and race) are still present in 1.14, they are just marked as deprecated. They are only removed for 1.15.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
Yeah indeed.. possible that they work, I never tried, but the images definitely don't work anymore. So I'm not sure if there was a point to leave them deprecated, if the images are broken (I mean images are broken for custom content, not default... default no idea)
- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
The old unit types should use new paths for images as they are based on the new types: https://github.com/wesnoth/wesnoth/blob ... ecated.cfg. You will run into troubles only if your own code refers the old paths.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
The new image paths were added to wmllint.enclave wrote: ↑May 5th, 2018, 10:47 am Yeah indeed.. possible that they work, I never tried, but the images definitely don't work anymore. So I'm not sure if there was a point to leave them deprecated, if the images are broken (I mean images are broken for custom content, not default... default no idea)
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
For multiplayer scenarios that should have an AI enemy with a fixed recruit list (so survival scenarios), the
[side]
tag must include faction="Custom"
. If that key isn't included then a random faction will be chosen, and the side's recruit list will be overwritten with the faction's default recruit list.Re: Compatibility-breaking changes between 1.12 and 1.13/1.14
MP factions are now alphabetically sorted by name, further discussion is in viewtopic.php?f=21&t=48275.