Move away from [+tag] macros #8762
Labels
Enhancement
Issues that are requests for new features or changes to existing ones.
Good first issue
Issues deemed adequate for contributors without prior experience to work on.
WML
Issues involving the WML engine or WML APIs.
Describe the desired feature
It'd be good to move away from macros of the form:
wesnoth/data/core/macros/unit-utils.cfg
Lines 180 to 185 in 0222fda
which are most commonly used following unit creation macro calls. I think it's a bad habit especially in core macros.
We should either use a macro tailored for the use case that includes the additional parts or use a generic macro that allows adding whatever WML when calling the macro as in the case of the
UNIT
macro for example.wesnoth/data/core/macros/unit-utils.cfg
Lines 22 to 32 in 0222fda
When calling that macro the
WML
parameter there could beai_special=guardian
for example which completely avoids the need for the first macro.I think one simple step would be to add an optional
WML
parameter to all core macros that would benefit from it or at least those that are currently used with [+tag] macros following them (for exampleLOYAL_UNIT
). And then remove all instances of [+tag] macro calls following these macros and put the respective WML in that macro call instead.For example
{LOYAL_UNIT 1 Spearman 1 1}
followed by{GUARDIAN}
would become{LOYAL_UNIT 1 Spearman 1 1 (ai_special=guardian)}
.The obsolete [+tag] macros can then be deprecated indefinitely.
(See #7883 for one such macro example. That issue is mixed with using different defaults for unit macros though.)
The text was updated successfully, but these errors were encountered: