
For users:
This is a mod that works as an addon for leader mods. It enables set custom leader model.
For developers:
Install mod.
To assign a custom model to your leader you have 2 options:
1. Set LeaderType
change the LeaderType from LEADER_{NAME} to LEADER_{NAME}__{MODEL}.
Example:
LEADER_CATHERINE → LEADER_CATHERINE__CHAR_LOGIOS_ARISTOTLE
LEADER_CATHERINE → LEADER_CATHERINE__UNIT_ARCHER
2. Add JS config (all properties except model name are optional)
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",
LEADER_CATHERINE: {
model: "UNIT_MIGRANT",
animation: 'IDLE', // IDLE / SPAWN / RUN / WALK / RELOAD
seed: 12313, // don't set if you want random
scale: 1,
alpha: 1, // 0 - 1
angle: 5,
},
}
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"
}
LeaderModelManager.modelMap = {
...(LeaderModelManager.modelMap || {}),
LEADER_CONFUCIUS: "CHAR_LOGIOS_ARISTOTLE",
LEADER_CATHERINE: {
model: "UNIT_MIGRANT",
animation: 'WALK', // IDLE / SPAWN / RUN / WALK / RELOAD
seed: 123135345212, // don't set if you want random
scale: 1,
alpha: 1, // 0 - 1
angle: 5,
age: 'AGE_ANTIQUE',
civilization: 'CIVILIZATION_ROME'
},
}
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>