cohka cohka

Modding questions/help thread

Modding questions/help thread

Figured we needed a thread for questions that didn't need to take up valuable room from talented mod'rs.

1,923,971 views 844 replies
Reply #526 Top

Thanks. Very helpful link. Since the thread started over a year ago, me thinks this isn't something on the soon-to-be-fixed radar.

Reply #527 Top

Quoting nanogasm, reply 526

Thanks. Very helpful link. Since the thread started over a year ago, me thinks this isn't something on the soon-to-be-fixed radar.
End of nanogasm's quote

It's under the category of Modders beware and deal with the system. Surprise they may change it at any moment ;) like the most recent tech change, we can now add things to techs.

Reply #529 Top

Is it possible to mod population consumption based on number of troops in a produced stack? For example I want to produce a unit that consists of three men, so I want that 3 population should be taken from the city where I produce this unit. I tried to insert some colculated values based on number of troops but it didn't work. May be I made something wrong or may be this isn't possible?

Reply #530 Top

You could add this to every unit in the coreUnits.xml

<ProductionRequirement>
    <Type>Resource</Type>
    <Attribute>Population</Attribute>
    <Value>1</Value>
</ProductionRequirement>

There are other ways of going about this that would probably limit the number of changes you need to make. For example, you can attach this to each of the blood traits and thus to train a unit (since you have to have that trait) it will cost you 1 per unit.

Reply #531 Top

Quoting parrottmath, reply 530

You could add this to every unit in the coreUnits.xml

<ProductionRequirement>
    <Type>Resource</Type>
    <Attribute>Population</Attribute>
    <Value>1</Value>
</ProductionRequirement>

There are other ways of going about this that would probably limit the number of changes you need to make. For example, you can attach this to each of the blood traits and thus to train a unit (since you have to have that trait) it will cost you 1 per unit.
End of parrottmath's quote

Thank you very much! It works interestingly. If I paste this code to any unit, it works like for pionners 1 for each pack of figures in the unit. But when I place this code into anybody's blood (!) this works for each figure in the pack. If I have both codes in blood and in unit, they multiply and summ. So to give pioneers 30 population, I set 9 in the unit code and set 1 for blood code. As result 3 figures x 9 plus 3 x 1 from blood code = 27 + 3 = 30.

Reply #532 Top

Is there any way to change the traits available on the champion trait tree depending on race? So different races have different traits available. Not just greyed out but actually not taking up space.

Reply #533 Top

I answered my own question. It works if you set blood traits as prerequisites, although I'm surprised it does.

Reply #534 Top

So you mean

<Prereq>

    <Type>AbilityBonusOption</Type>
    <Target>Unit</Target>
    <Attribute>Blood_Wraith</Attribute>

</Prereq>
 

Will not leave a grayed out option.

Reply #535 Top

Yep. It was like the 5th thing I tried. Directly using the race or the model didn't work. I was wondering of I could give every race a different general tree but that seemed impossible, and then after looking at how paths worked I decided to try blood traits and amazingly enough it worked. I would have bet against it.

Reply #536 Top

Are you sure it's working as intended... I'm failing to reproduce your results.

Reply #537 Top

Works for me, I have multiple traits that occupy the same space on the General trait tree but only show up for different races.  The below ability won't show up on other races trait trees at all.

    <AbilityBonus InternalName="Enshadowed2Ability">
        <AbilityBonusType>Unit_Level</AbilityBonusType>
        <AbilityBonusOption InternalName="Enshadowed2">
            <DisplayName>Enshadowed</DisplayName>
            <Description>+7 to Dodge, and Spell Resistance</Description>
            <Icon>Ability_Enshadowed_Icon.png</Icon>
            <PerkTreePosX>1</PerkTreePosX>
            <PerkTreePosY>0</PerkTreePosY>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_Dodge</StrVal>
                <Value>7</Value>
            </GameModifier>
            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>AdjustUnitStat</Attribute>
                <StrVal>UnitStat_MagicResist</StrVal>
                <Value>7</Value>
            </GameModifier>            
            <Type>Defensive</Type>
            <UpgradePathID>Wraith</UpgradePathID>
            <Prereq>
                <Type>AbilityBonusOption</Type>
                <Target>Unit</Target>
                <Attribute>Blood_Wraith</Attribute>
            </Prereq>    
            <AIData AIPersonality="AI_General">
                <AIPriority>5</AIPriority>
            </AIData>
        </AbilityBonusOption>
    </AbilityBonus>

What are you seeing?

Reply #538 Top

I experimented with this ability...

<AbilityBonus InternalName="Necromancy2Ability">
    <AbilityBonusType>Unit_Level</AbilityBonusType>
    <AbilityBonusType>Unit_Spell_Rank</AbilityBonusType>
    <AbilityBonusOption InternalName="Necromancy2">
        <DisplayName>Greater Necromancy</DisplayName>
        <Description>Allows the unit to raise skeletal hordes in battle</Description>
        <Icon>Ability_GreaterNecromancy_Icon.png</Icon>
        <PerkTreePosX>2</PerkTreePosX>
        <PerkTreePosY>4</PerkTreePosY>
        <GameModifier>
            <Provides>Allows the unit to cast Raise Skeletal Horde in battle</Provides>
        </GameModifier>
        <Type>Spell</Type>
        <UpgradePathID>Necromancy</UpgradePathID>
        <Prereq>
            <Type>Allegiance</Type>
            <Attribute>Empire</Attribute>
        </Prereq>
        <Prereq>
            <Type>AbilityBonusOption</Type>
            <Target>Unit</Target>
            <Attribute>Necromancy1</Attribute>
        </Prereq>
        <AIData AIPersonality="AI_General">
            <AIPriority>5</AIPriority>
        </AIData>
        </AbilityBonusOption>
</AbilityBonus>

I just edited this and added the prereq as I wrote above. It doesn't display the trait no matter the blood ability. Not sure what quirk is arising here. I am editing core files to ensure there is no other types of oddities.

Reply #539 Top

Not sure what is happening there but it's probably a weird result from having so many prerequisites and/or editing an existing trait. I am just using the mod folder and adding completely new traits and it works fine.

Reply #540 Top

I tried this a while back, I didn't find a workable solution unfortunately. A long work-around was to put the bloodline itself in the trait tree, then have stuff depend only on that and a unitstat given by another trait.

Reply #541 Top

Well it works for me.

 

Both these pics are taken from the same game.

Reply #542 Top

Ah, sorry, I thought you meant having dual prerequisites (one normal, one bloodline).

Reply #543 Top

First of all, merry Xmas everyone ^^

 

So, in keeping with the spirit of the day, I'm playing around with the undead faction and it's traits. :P

 

I was trying to modify the 3 unique buildings that set the pop cap for the undead, and make the first or second one give 1 growth to the city if built, or something along the lines.

 

Thing is, I'm unable to find where in the xml files are those buildings defined.. I'm sure I checked the dlc04 files more than 10 times each, what am I missing?

 


EDIT: Of course, figures. As soon as I give up and make this post, I find out that not all dlc04 xmls are in the same folder. Gah. Sorry ^^;

 

So,am I correct that adding this to the building will make it give +1 growth? (still called prestige, wow)

 

Code: xml
  1.         &lt;GameModifier&gt;
  2.             &lt;ModType&gt;Resource&lt;/ModType&gt;
  3.             &lt;Attribute&gt;Prestige&lt;/Attribute&gt;
  4.             &lt;Value&gt;1&lt;/Value&gt;
  5.             &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  6.             &lt;Provides&gt;+1 Growth&lt;/Provides&gt;
  7.         &lt;/GameModifier&gt;

Oh, and I should state that this is the first time I do anything like this, so I'm very unfamiliar with LH data structure, so apologies in advance if I'm being obnoxious. :]

Reply #544 Top

You made everything right. Prestige means growth. In the original FE growth was determined by prestige value. I've also made such changes in my mod and tested this. It works.

Reply #545 Top

Hmm, something is wrong here. I added the above lines to the Mausoleum right under the graves gamemodifier, but it did not give +1 growth to the city when I tested this.. Any ideas as to what might have gone wrong?

 

Here is the full Mausoleum code

 

(This is in DLC04_improvements.xml)

 

Code: xml
  1. &lt;ImprovementType InternalName="Mausoleum"&gt;
  2.         &lt;DisplayName&gt;Mausoleum&lt;/DisplayName&gt;
  3.         &lt;Description&gt;Even the dead need rest, your city will need a Mausoleum if it is to house more dead.&lt;/Description&gt;
  4.         &lt;RequiresCity&gt;1&lt;/RequiresCity&gt;
  5.         &lt;BarredTerrain&gt;River&lt;/BarredTerrain&gt;
  6.         &lt;BarredTerrain&gt;SwampTerrain&lt;/BarredTerrain&gt;
  7.         &lt;PreferredTerrain&gt;City&lt;/PreferredTerrain&gt;
  8.         &lt;PreferredTerrain&gt;Category:Land&lt;/PreferredTerrain&gt;
  9.         &lt;PreferredTerrain&gt;Forest&lt;/PreferredTerrain&gt;
  10.         &lt;UpgradesToImprovement&gt;Catacomb&lt;/UpgradesToImprovement&gt;
  11.         &lt;UpgradeTier&gt;1&lt;/UpgradeTier&gt;
  12.         &lt;Prereq&gt;
  13.             &lt;Type&gt;AbilityBonusOption&lt;/Type&gt;
  14.             &lt;Attribute&gt;DLC04_UndeadFaction&lt;/Attribute&gt;
  15.             &lt;Target&gt;Player&lt;/Target&gt;
  16.         &lt;/Prereq&gt;
  17.         &lt;LaborToBuild&gt;193&lt;/LaborToBuild&gt;
  18.         &lt;GameModifier&gt;
  19.             &lt;ModType&gt;Resource&lt;/ModType&gt;
  20.             &lt;Attribute&gt;Graves&lt;/Attribute&gt;
  21.             &lt;Value&gt;120&lt;/Value&gt;
  22.             &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  23.             &lt;Provides&gt;+120 Graves&lt;/Provides&gt;
  24.             &lt;UpgradeComparisonID&gt;1&lt;/UpgradeComparisonID&gt;
  25.             &lt;UpgradeComparisonText&gt;Graves&lt;/UpgradeComparisonText&gt;
  26.         &lt;/GameModifier&gt;
  27.         &lt;GameModifier&gt;
  28.             &lt;ModType&gt;Resource&lt;/ModType&gt;
  29.             &lt;Attribute&gt;Prestige&lt;/Attribute&gt;
  30.             &lt;Value&gt;1&lt;/Value&gt;
  31.             &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  32.             &lt;Provides&gt;+1 Growth&lt;/Provides&gt;
  33.         &lt;/GameModifier&gt;
  34.         &lt;AIData AIPersonality="AI_General"&gt;
  35.             &lt;AIPriority&gt;10&lt;/AIPriority&gt;
  36.             &lt;AITag&gt;Economy&lt;/AITag&gt;
  37.         &lt;/AIData&gt;
  38.         &lt;ArtDef&gt;DLC04_Mausoleum_ArtDef&lt;/ArtDef&gt;
  39.         &lt;ImprovementTypeArtDef InternalName="DLC04_Mausoleum_ArtDef"&gt;
  40.             &lt;ImprovementTypeArtSubPack InternalName="DLC04_Mausoleum_Default"&gt;
  41.                 &lt;TileDesign&gt;DLC04_Mausoleum_01&lt;/TileDesign&gt;
  42.                 &lt;ConstructionTileDesign&gt;F_Construction1x1_01&lt;/ConstructionTileDesign&gt;
  43.                 &lt;DrawnIcon&gt;DLC04_Improvement_Mausoleum.png&lt;/DrawnIcon&gt;
  44.                 &lt;DrawnIconConstruction&gt;DLC04_Improvement_Mausoleum_C.png&lt;/DrawnIconConstruction&gt;
  45.                 &lt;Thumbnail&gt;DLC04_Mausoleum_Thumb_01.png&lt;/Thumbnail&gt;
  46.                 &lt;Medallions InternalName=""&gt;
  47.                     &lt;All&gt;DLC04_Mausoleum_Thumb_01.png&lt;/All&gt;
  48.                 &lt;/Medallions&gt;
  49.             &lt;/ImprovementTypeArtSubPack&gt;
  50.         &lt;/ImprovementTypeArtDef&gt;
  51.     &lt;/ImprovementType&gt;

 

Reply #546 Top

The GameModifier node looks correct to me.

Just a couple quick observations, in case you've not done modding for this game before

  • You have to check the "Enabled Mods" box in game settings, then restart the game (unless you're modifying the base game files)
  • The changes only take effect in *new* games (so you can't e.g. save a game, change your XML, then re-load the game to see if it worked.)

Also - if you're modifying the base game files instead of creating a mod (not sure why you'd want to do this) you want to make sure that Steam didn't overwrite your file - double check to make sure that your changes are still there.

 

Reply #549 Top

Quoting Primal_Savage, reply 547

Is it possible to add techs or is it only possible to modify current techs?
End of Primal_Savage's quote

With the most recent version, we are allowed to modify techs, adding techs is not possible (without overwriting core files).

Quoting Primal_Savage, reply 548
Is it possible to modify the (actual) game mounts w/o altering the CoreMounts.xml?
End of Primal_Savage's quote

These are game item types, which overwrite and do not take modifications. (Do not redo the artdefs, otherwise you will have the double mount problem)

+1 Loading…