Mod API Reference:StructureType: Difference between revisions
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
Note that all icons, other than City, were added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]] | Note that all icons, other than City, were added in [[Mod_API_Reference:IsVersionOrHigher|5.17.0]] | ||
== Custom Structures == | |||
If you wish to include your own custom image to represent a structure, you can use the '''WL.StructureType.Custom''' function. Here's the procedure for doing that: | |||
# Create a folder in your mod named "StructureImages" | |||
# Place a png in this folder, for example "MyStructure.png". The image should be no larger than 260x260 pixels. | |||
# Call '''WL.StructureType.Custom("MyStructure")''' to get a StructureType. You can pass this anyplace you would pass one of the above entries. | |||
[[Category:Mod API Reference]] | [[Category:Mod API Reference]] |
Latest revision as of 01:09, 20 August 2025
An enum that represents types of structures that can exist on a territory. These are displayed as icons on the map. The possible values are listed below. Currently, only City has an effect on the actual gameplay, as cities are used in commerce games. The rest of the items have no effect on the game except as defined by mods.
- WL.StructureType.City: Used for cities in commerce games.
- WL.StructureType.ArmyCamp
- WL.StructureType.Mine
- WL.StructureType.Smelter
- WL.StructureType.Crafter
- WL.StructureType.Market
- WL.StructureType.ArmyCache
- WL.StructureType.MoneyCache
- WL.StructureType.ResourceCache
- WL.StructureType.MercenaryCamp
- WL.StructureType.Power
- WL.StructureType.Draft
- WL.StructureType.Arena
- WL.StructureType.Hospital
- WL.StructureType.DigSite
- WL.StructureType.Attack
- WL.StructureType.Mortar
- WL.StructureType.Recipe
Note that cities will "collapse" when more than 3 of them are on a single territory and show the number of them as a digit followed by a single city icon. The rest of the icons do not collapse. Therefore, you should strive to avoid having more than 3 icons on a territory since it will not display well.
Note that all icons, other than City, were added in 5.17.0
Custom Structures
If you wish to include your own custom image to represent a structure, you can use the WL.StructureType.Custom function. Here's the procedure for doing that:
- Create a folder in your mod named "StructureImages"
- Place a png in this folder, for example "MyStructure.png". The image should be no larger than 260x260 pixels.
- Call WL.StructureType.Custom("MyStructure") to get a StructureType. You can pass this anyplace you would pass one of the above entries.