Addon: Leader model changer

Addon: Leader model changer 1.5



1742990808993.png

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>
Author
izica
Downloads
1,506
Views
4,408
First release
Last update

Ratings

5.00 star(s) 1 ratings

More resources from izica

Latest updates

  1. 1.5

    fix replace when leaders have same model, but different seeds
  2. Updated to 1.2.0 patch

    Updated to 1.2.0 patch
  3. 1.3

    Support added for defining a counter angle to display elements on the right side. { angle...
  4. 1.2

    new options for config
  5. Implemented a JS option to replace the model.

    To change the model using JS, you need to create two files and include them in modinfo: the...

Latest reviews

This is awesome!
Back
Top Bottom