Addon: Leader model changer

izica

Chieftain
Joined
Feb 25, 2025
Messages
51
Download: https://forums.civfanatics.com/resources/addon-leader-model-changer.32124/



For users:
This is a mod that works as an addon for leader mods. It enables set custom leader model.

For developers:
1. Install mod.
2. To assign a custom model to your leader, change the LeaderType from LEADER_{NAME} to LEADER_{NAME}__{MODEL}.

Example:
LEADER_CATHERINE → LEADER_CATHERINE__CHAR_LOGIOS_ARISTOTLE
LEADER_CATHERINE → LEADER_CATHERINE__UNIT_ARCHER
 
Last edited:
1742990808993.png
 
Update 1.1
added js way

To change the model using JS, you need to create two files and include them in modinfo:
the first one is shell.js:
JavaScript:
import LeaderSelectModelManager from '/core/ui/shell/leader-select/leader-select-model-manager.js';

LeaderSelectModelManager.modelMap = {
    ...(LeaderSelectModelManager.modelMap || {}),
    LEADER_CONFUCIUS: "CHAR_LOGIOS_ARISTOTLE"
}


second one is game.js:
JavaScript:
import LeaderModelManager from '/base-standard/ui/diplomacy/leader-model-manager.js';

LeaderModelManager.modelMap = {
    ...(LeaderModelManager.modelMap || {}),
    LEADER_CONFUCIUS: "CHAR_LOGIOS_ARISTOTLE"
}

and include files into modinfo:
XML:
<ActionGroup id="..." scope="game" criteria="always">
    <Actions>
        <UIScripts>
            <Item>ui/game.js</Item>
        </UIScripts>
    </Actions>
</ActionGroup>
<ActionGroup id="..." scope="shell" criteria="always">
    <Actions>
        <UIScripts>
            <Item>ui/shell.js</Item>
        </UIScripts>
    </Actions>
</ActionGroup>
 
Important thing: do not include "Leader model changer" mod code into your mod.

Including code of this mod into your mod could cause compatibility problems with other leader mods.
Use it as a standalone mod addon with a separate installation.
 
I don't understand why they just didn’t simply add a VisualRemap for leaders
I suppose they thought they would not have as much work on the UI and stuff and would get the mod tools out quick. If the tools are delayed the need to give us a way to specify unit models for custom units.
 
Back
Top Bottom