This wiki is archived from 2021-09-05

Custom Strategic Icons: Difference between revisions

From Planetary Annihilation: TITANS and Classic PA Wiki
Jump to navigation Jump to search
(Created page with "Category:Modding = 50px Adding Custom Strategic Icons = == 50px Unit Icon Selection == Units have a default icon nam...")
 
mNo edit summary
 
Line 1: Line 1:
[[Category:Modding]]
[[Category:Modding]]
= [[File:Titans-icon.png|50px]] Adding Custom Strategic Icons =
= Adding Custom Strategic Icons =


== [[File:gold-rank-icon.png|50px]] Unit Icon Selection ==
== Unit Icon Selection ==


Units have a default icon name based on the unit json name, so <code>assault_bot.json</code> would have icon name of <code>assault_bot</code>.
Units have a default icon name based on the unit json name, so <code>assault_bot.json</code> would have icon name of <code>assault_bot</code>.


Units can override the strategic icon name by including the <code>si_name</code> property. For example, each commander has a different json name, but the base commander includes <code>"si_name": "commander"</code>, so they all use the generic commander icon.
Units can override the strategic icon name by including the <code>si_name</code> property. For example, each commander has a different json name, but the base commander includes <code>"si_name": "commander"</code>, so they all use the generic commander icon.
== [[File:gold-rank-icon.png|50px]] Icon Files ==
== Icon Files ==


The path to strategic icons is constructed by the icon atlas, so generally they are in:
The path to strategic icons is constructed by the icon atlas, so generally they are in:
Line 15: Line 15:
Where <code>icon1</code> is the icon name.
Where <code>icon1</code> is the icon name.


== [[File:gold-rank-icon.png|50px]] Registering Icons ==
== Registering Icons ==


If you just need to add a small number of icons and are not concerned about multiple mods cumulatively exceeding max icons, all you need is an [[Icon_atlas_scene|icon_atlas]] mod with:
If you just need to add a small number of icons and are not concerned about multiple mods cumulatively exceeding max icons, all you need is an [[Icon_atlas_scene|icon_atlas]] mod with:

Latest revision as of 10:44, 9 September 2021

Adding Custom Strategic Icons

Unit Icon Selection

Units have a default icon name based on the unit json name, so assault_bot.json would have icon name of assault_bot.

Units can override the strategic icon name by including the si_name property. For example, each commander has a different json name, but the base commander includes "si_name": "commander", so they all use the generic commander icon.

Icon Files

The path to strategic icons is constructed by the icon atlas, so generally they are in:

/ui/main/atlas/icon_atlas/img/strategic_icons/icon_si_icon1.png

Where icon1 is the icon name.

Registering Icons

If you just need to add a small number of icons and are not concerned about multiple mods cumulatively exceeding max icons, all you need is an icon_atlas mod with:

model.strategicIcons.push('icon1', 'icon2', 'icon3')

For larger deployments, HodgePodge includes max icon protection and fallback aliasing.