Logo Platform
logo amplifiers simplified

Winter Immune Ice Warg Mod / Tutorial

Reply
Copied to clipboard!
10 years ago
Nov 3, 2014, 6:59:47 AM
In response to this thread(link), I made the following mod / tutorial. Since it's such a basic mod that changes one thing for one unit, it's more of an exploration of how to implement it, than a useful mod.



1.

If you want no winter movement penalty, you can use:

A) UnitAbilityImmuneToWinterMovementPenalty

If you want complete winter immunity, you can use:

B) UnitAbilityDarkProof



2.

Let's go deeper. These abilities are defined in:

\Simulation\UnitAbilities.xml

A)

[code]







[/code]

B)

[code]











[/code]



These are the abilities that appear in the "traits" section of the unit view.



Side-note, these abilities are described and made visible in the GUI here:

\Gui\GuiElements[UnitAbilities].xml

The actual text is localised here, but if you omit the % symbol you can give an absolute description rather than a localised description:

\Localization[language]\EF_Localization_Assets_Locales.xml



We aren't making changes to abilities so we don't really care.



3.

Furthermore, the effects of each of these Winter-based "SimulationDescriptors" are defined in:

\Simulation\SimulationDescriptors[Season].xml

like so:

[code]



























































































[/code]



You'll notice that for each of the Immunity's there's nothing between the tags, that's because it's basically a "null effect" - i.e. rather than having a malus (e.g. WinterMovementReduction), it does nothing instead.



Other SimulationDescriptors are in these files:

\Simulation\SimulationDescriptors
  • .xml


  • such as:

    \Simulation\SimulationDescriptors[UnitAbility].xml



    Compared to 2. which chooses which effects to use for each ability, these SimulationDescriptors describe the actual in-game effects.



    4.

    Let's go even deeper. Each of these unit attributes / properties (e.g. VisionRange) is defined in:

    \Simulation\SimulationDescriptors[Class].xml

    What each of them do, you'll just have to figure out based on the name, because I assume this is the point where the XML code interfaces with the underlying game. I could be wrong though. Every other XML file only modifies these properties.

    Each of these properties applies to a certain class. And here's the point where I'm still trying to figure things out.



    5.

    Back to the top now. Let's give the Ice Warg the ability "Dark Proof" (complete winter immunity).

    The definition for Geldirus / Ice Warg is found in:

    \Simulation\UnitBodyDefinitions.xml



    Look at, say, Hurnas Orc:

    [code]















    ...



    [/code]



    Clearly, you place any unit abilities between the UnitBodyDefinition tags. From this, you would conclude that you (essentially) add the new unit ability to that XML file between the existing UnitBodyDefinition tags:

    [code]







    [/code]



    Yes, all of that explanation for such a simple change. But never mind.



    6.

    Now to implementing the mod.

    i) First, we create a new folder in My Documents\Endless Legend\Community called NiceWarg

    ii) Then we download ModdingReference.rar from [URL=https://www.games2gether.com/endless-legend/forum/15-modding/thread/5777-tutorials-for-modding-endless-legendandextractittothefolderwecreatedabove:MyDocuments\EndlessLegend\CommunityNiceWarg

    iii)WerenameModdingReference.xmlinthenewfoldertothesamenameweusedabove:NiceWarg.xml

    iv)WeopenandeditNiceWarg.xml(IjustusedNotepad),andchangethefollowingcode

    [code]







    The Author

    A link to a website if necessary

    <i>What this mod do</i>

    A description of what this mod does.



    [/code]

    to

    [code]







    Tigregalis



    <i>Winter Immune Ice Warg</i>

    Grants winter immunity to the Geldirus minor faction unit Ice Warg.



    [/code]

    v) we re-create the Simulation folder in NiceWarg: My Documents\Endless Legend\CommunityNiceWarg\Simulation

    And for ease, we copy the steamapps\Endless Legend\Public\Simulation[/I]UnitBodyDefinitions.xml file into our new folder.

    vi) We open and edit the UnitBodyDefinitions.xml file. First we remove all of the unrelated UnitBodyDefinition tags we aren't making changes to (all except the Geldirus faction unit). My assumption is that mod tags effectively overwrite existing tags if using the same name (in this case UnitBodyGeldirusIceWarg), so we can't just add our one line, but we must keep the entire UnitBodyDefinition tag for the Geldirus faction in order to preserve the actual unit. So the entire content of our xml file is (with my single line addition in bold):

    [code]































    ($Property(../ClassEmpire:UnitProductionCostMoreThanAverage) + $Property(../ClassEmpire:UnitProductionCostMoreThanAverage) * $Property(../ClassEmpire:CostIncreaseFromEra))

























    $Path(.../EmpireTypeMajor/EmpireTypeMinor,AffinityGeldirus) or $Path(.../EmpireTypeMinor,AffinityGeldirus)



    $Path(.../EmpireTypeMajor/EmpireTypeMinor,AffinityGeldirus) or $Path(.../EmpireTypeMinor,AffinityGeldirus)

    ($Property(ClassCity,Garrison:MaximumUnitSlotCount) - $Property(ClassCity,Garrison:UnitSlotCount)) ge 1





























































    [/code]



    7. Now we can select the mod in-game and play the game.



    Notes:

    - You could, of course, create your own UnitAbility instead of using the existing Dark Proof one, and make the appropriate changes, making sure to add the new UnitAbility in \Gui\GuiElements[UnitAbilities].xml and \Localization[language]\EF_Localization_Assets_Locales.xml as necessary.

    - I wish there was some sort of map relating each of the d
    0Send private message
    0Send private message
    ?

    Click here to login

    Reply
    Comment