[mod request] Adding custom unit traits

Just a question to all you modders out there.

I have never done any modding before, but I find myself increasingly interested in introducing my own trained unit traits to the available list. Is there some .xml file somewhere where I can edit in my own traits? I'm not sure where or how this could work, but I would appreciate any advice that you guys can give me. Thanks!

23,824 views 11 replies
Reply #1 Top

This is an example of a complete unit design trait.

    <AbilityBonus InternalName="IronskinAbility">
        <AbilityBonusType>Unit_Design</AbilityBonusType>
        <AbilityBonusOption InternalName="Ironskin">
            <DisplayName>Ironskin</DisplayName>
            <Description>+3 Defense</Description>
            <Icon>Ability_Ironskin_Icon.png</Icon>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_Defense_Pierce</StrVal>
                <Value>3</Value>
                <Provides>+3 Defense</Provides>
            </GameModifier>
            <AdditionalTrainingTurns>14</AdditionalTrainingTurns>
            <HideWhenUpgraded>0</HideWhenUpgraded>
            <Type>Defensive</Type>
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

The internalname of the AbilityBonus and AbilityBonusOption need to be unique, they can't be the same as any other AbilityBonus / AbilityBonusOption in the game.

+1 Loading…
Reply #2 Top


I was about to answer and Heavenfall beat me! You are the Master ;)

Reply #3 Top

Thanks!

I have a few other questions about this.

1) Where are the icons located? I notice it has "Ability_Ironskin_Icon.png" listed there, but what folder is it looking in for that image?

2) What is the "HideWhenUpgraded" field?

3) Can I add another category, say "Weaknesses", containing attributes with negative labor modifiers?

Reply #4 Top

1) Anywhere in C:\Users\yourusername\Documents\My Games\LegendaryHeroes\Mods\Gfx\

2) Useless in this case, it is used for heroes that have upgrades to traits like Lethal 1, Lethal 2, Lethal 3. Instead of showing all 3 traits, the unit will only display the last one.

3) Yes, alter the <Type> to anything you see fit.

Keep in mind the AI isn't going to use these traits unless you make up new unit designs for it to use.

Reply #5 Top

Quoting Heavenfall, reply 4

1) Anywhere in C:\Users\yourusername\Documents\My Games\LegendaryHeroes\Mods\Gfx\

2) Useless in this case, it is used for heroes that have upgrades to traits like Lethal 1, Lethal 2, Lethal 3. Instead of showing all 3 traits, the unit will only display the last one.

3) Yes, alter the <Type> to anything you see fit.

Keep in mind the AI isn't going to use these traits unless you make up new unit designs for it to use.

That's great! I am looking forward to being able to implement the line of faction-specific traits I have designed.

One final thing is it is my understanding that I just add on my XML things to the appropriate core file and then replace it in the core file, is that right?

Reply #6 Top

You can do that, or you can put it in C:\Users\yourusername\Documents\My Games\LegendaryHeroes\Mods\yourmodname\ in a new file.xml (only your new stuff). Make sure mods are turned on in options.

Reply #7 Top

Thank you very much, Heavenfall. Very informative ^^

Reply #8 Top


In my opinion is better to just replace the core file. At least my experience with trying to use the mod folder was a painful one. XO

PS: You probably know alredy, but just in case a friendly reminder to backup the original files before changing them ;)

Reply #9 Top

To each their own. I definitely won't put any mods in the install folder now that steam auto-updates (I don't want to turn it off!).

Reply #10 Top

I'm with heavenfall on this one. I'd prefer not to change the core files.

Reply #11 Top

Quoting parrottmath, reply 10
I'm with heavenfall on this one. I'd prefer not to change the core files.

As tempting as it is to change the core files, I think I will start off with just adding to the mods folder for now, and then maybe if I get more confident with modding and/or find some issue with the aforementioned method, I will edit the core files.

Quoting OliverFA_306, reply 8
PS: You probably know alredy, but just in case a friendly reminder to backup the original files before changing them

And yep, I know the importance of backing up original files from my previous experiments messing with core files in other games!