List of all available placeable units
Moderator: Forum Moderators
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
List of all available placeable units
Is there a way to get a list of all units available for placement via [unit], as well as the data contained within the [unit_type]?
Or to put it another way, what I'm looking for is the programmatic equivalent of (for every unit in the game, as well as potentially any campaign currently being played): placing the unit on the map > [store_unit] > kill the unit and repeat with the next unit.
Or to put it another way, what I'm looking for is the programmatic equivalent of (for every unit in the game, as well as potentially any campaign currently being played): placing the unit on the map > [store_unit] > kill the unit and repeat with the next unit.
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: List of all available placeable units
For single-player context, https://wiki.wesnoth.org/InternalAction ... ype_ids.5D and https://wiki.wesnoth.org/LuaWML/Units#w ... unit_types.
However, it is unknown (meaning I havent tested and people I asked didnt know), exactly whose list of available units it gets when there are multiple people available.
However, it is unknown (meaning I havent tested and people I asked didnt know), exactly whose list of available units it gets when there are multiple people available.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: List of all available placeable units
[store_unit_type_ids]/[store_unit_type] looks like it'll do exactly what I want, thanks!
As for multiplayer, I am not too worried; I just need the data, I'm not actually going to be spawning units at random or something.
As for multiplayer, I am not too worried; I just need the data, I'm not actually going to be spawning units at random or something.
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
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: List of all available placeable units
To follow up on this a bit, [store_unit_type_ids] does get all available [unit_type]s - including campaign specific units when the modification is enabled for a campaign. The list of ids it returns is even pre-sorted alphabetically
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: List of all available placeable units
Yes, I changed the wiki to say that it includes all units across all loaded addons.