[units] vs [+units] tag
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.
[units] vs [+units] tag
Documetation (https://wiki.wesnoth.org/AddonStructure) says I should use [+ units] instead of [units] tag, becouse "it's very important", without giving clear reason. What is the difference? Additional question, will may sound stupid but I want make it clear: Why tags like [UNIT_TYPE] are subtags of [units]? Why they can not be called a top level like scenarios and eras? What design decision lays before this?
Re: [units] vs [+units] tag
For your first question it is [+units] is used to load your units files. For example you would put:Smok wrote:Documetation (https://wiki.wesnoth.org/AddonStructure) says I should use [+ units] instead of [units] tag, becouse "it's very important", without giving clear reason. What is the difference? Additional question, will may sound stupid but I want make it clear: Why tags like [UNIT_TYPE] are subtags of [units]? Why they can not be called a top level like scenarios and eras? What design decision lays before this?
Code: Select all
[+units]
{~add-ons/SOME_DIRECTORY/}
[/units]
Also [unit_type] are subtags of [units] because [unit_type] creates new units where [units] load units that are already created.
Hopefully this helps!

(note: i unfortunately am not super experienced at wml so if anyone has anything to add or if i made a mistake in this explanation please comment)
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon.
- James_The_Invisible
- Posts: 543
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: [units] vs [+units] tag
[+tag] is used to append something to the last tag of that name. E. g. you can modify a unit created via a macro with this syntax. But in your case with [units] it is not really needed, it will work just fine without the + sign.
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: [units] vs [+units] tag
Before, [units] wouldn't have worked because there could only be one [units] tag (which you'd have to append to using [+units]), but now apparently multiple [units] tags are recognized so you can just use [units].