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,922,913 views 844 replies
Reply #301 Top

That would work for every game after right? I'm thinking that it would need to be tied to the sovereign somehow to work right. (like instead of an ability it gets champion support instead) I guess I am asking too much and should try experimenting more instead ;)

Reply #302 Top

Quoting parrottmath, reply 299


This will not ensure that the unit is a champion if you do it this way. You need to create a spell that will summon a champion unit. The answer already lies within this thread.

As to the random event, you need a city in order for a random event to trigger via a turn.

This thread is 13 pages long. Isn't it starting to be a bit much to ask for someone to read this entire thread for the answer? I search most of my "terms" in this forum when I am looking for something, but most people won't (based on my personal experience obviously). Either way, why will a spell work and not an ability? (professional curiousity ;) as that would be my goto thing with custom sovereigns, and not spells )

 

 

Reply #303 Top

The summon unit creates a summoned unit which is different from a normal unit and a champion. The spell allows you to create a unit class for a champion to summon a champion unit type. Interesting enough you can spawn a unit instead of a champion, did that as a failed experiment when creating a quest at some point. Here is the spell that was done earlier in the thread.

<GameModifier InternalName="Reward2">
    <ModType>Unit</ModType>
    <Attribute>UnitJoinArmy</Attribute>
    <StrVal>internalnameofyourunittypehere</StrVal>
    <UnitClass>Champion</UnitClass>
  </GameModifier>

this is the game modifier needed to summon a champion. You can use that via a quest or a spell, just not available as a startup ability. Since it needs the bolded tag.

Reply #304 Top

Does a Champion Summon require an Upkeep mana cost?  The following test code doesn't summon anything:

Code: xml
  1. &lt;Spells&gt;
  2. &lt;SpellDef InternalName="SummonMausolos"&gt;
  3. &lt;DisplayName&gt;Summon Mausolos&lt;/DisplayName&gt;
  4. &lt;Description&gt;Summons Mausolos&lt;/Description&gt;
  5. &lt;AutoUnlock&gt;1&lt;/AutoUnlock&gt;
  6. &lt;CanStack&gt;0&lt;/CanStack&gt;
  7. &lt;SpellBookSortCategory&gt;Summon&lt;/SpellBookSortCategory&gt;
  8. &lt;SpellBookSortSubCategory&gt;Summon&lt;/SpellBookSortSubCategory&gt;
  9. &lt;SpellType&gt;Strategic&lt;/SpellType&gt;
  10. &lt;SpellClass&gt;Defensive&lt;/SpellClass&gt;
  11. &lt;SpellSubClass&gt;Summon&lt;/SpellSubClass&gt;
  12. &lt;SpellTargetType&gt;Self&lt;/SpellTargetType&gt;
  13. &lt;Range&gt;0&lt;/Range&gt;
  14. &lt;SpellResourceCost&gt;
  15. &lt;Resource&gt;Mana&lt;/Resource&gt;
  16. &lt;Amount&gt;5&lt;/Amount&gt;
  17. &lt;/SpellResourceCost&gt;
  18. &lt;GameModifier&gt;
  19. &lt;ModType&gt;Unit&lt;/ModType&gt;
  20. &lt;Attribute&gt;SummonUnit&lt;/Attribute&gt;
  21. &lt;StrVal&gt;Champion_Mausolos&lt;/StrVal&gt;
  22. &lt;UnitClass&gt;Champion&lt;/UnitClass&gt;
  23. &lt;Duration&gt;-1&lt;/Duration&gt;
  24. &lt;/GameModifier&gt;
  25. &lt;AIData AIPersonality="AI_General"&gt;
  26. &lt;AIPriority&gt;70&lt;/AIPriority&gt;
  27. &lt;/AIData&gt;
  28. &lt;/SpellDef&gt;
  29. &lt;/Spells&gt;

Reply #305 Top

Try this version instead

<GameModifier>
    <ModType>Unit</ModType>
    <Attribute>UnitJoinArmy</Attribute>
    <StrVal>internalnameofyourunittypehere</StrVal>
    <UnitClass>Champion</UnitClass>
  </GameModifier>

This is what is used inside of quests, but I think it should work for spells.

Reply #306 Top

Question:


Is there a way to limit the total number of a certain type of unit in the world?  For example, I am interested in making a building that allows the recruitment of a powerful unit... but I'd like the custom faction to only be allowed to recruit, say... 3 of these guys.  It would be even better if once those units die, the faction could still not recruit more.

Reply #307 Top

Quoting Dumhed, reply 306

Question:


Is there a way to limit the total number of a certain type of unit in the world?  For example, I am interested in making a building that allows the recruitment of a powerful unit... but I'd like the custom faction to only be allowed to recruit, say... 3 of these guys.  It would be even better if once those units die, the faction could still not recruit more.

The building could unlock a zero mana spell which summons the unit, and has 800 turn cooldown.

Reply #308 Top

Quoting Dumhed, reply 306
Is there a way to limit the total number of a certain type of unit in the world?

Yes you can do this using a custom resource type.  Check out the first few posts of this thread:

https://forums.elementalgame.com/439334/page/1/#3311666

Quoting davrovana, reply 307
It would be even better if once those units die, the faction could still not recruit more.

You could achieve that using the method in that post... but rather than have your building produce 3 of the resource per turn, set it to produce 3 as a one off.

 

Reply #309 Top

I want to make a faction trait that disallows building fortresses, is this possible?

Tried disabling the "fortress" improvement but this does not stop fortresses from being built.

Reply #310 Top

It's definitely possible. Try looking at CityLevel_UnlockLevel2 in CoreImprovements.xml and adding a prereq to Forts.

 

Reply #311 Top

Quoting DsRaider, reply 310

It's definitely possible. Try looking at CityLevel_UnlockLevel2 in CoreImprovements.xml and adding a prereq to Forts.

 

Thank you.

Reply #312 Top

Opps actually it's in CoreAbilities.

Reply #313 Top

Anyone know if the unrest penalty per city can be tweaked, by faction? Working on a trait, can't figure out how to tweak this as an offset for some bonuses.

Reply #314 Top


Hi,

Just starting out modding LH, and I'm trying to add a new faction with new racial/blood and also add some new traits. Could someone please provide a guide on how to do this please? What files do I need to include in my mod folder? etc.

I've taken a look at both DSraider's "Additional Faction Traits and Races" and Attackdrone's "Fervor" Mods (which are both great by the way), but there's so many files I can't really make heads or tails of it, so any advice would be great. Thanks.

All the Best,

Reply #315 Top

Question:

What determines the zoom distance for a sovereign in their info card?  I have a sovereign that in new game selection is zoomed closer than all the others.  I'm not really sure how to make the sovereign the same size as the others.

Reply #316 Top

Yet another:


How do mod files work when "conflicting" with the main game files?  that is... say I want to make it so the Logging Camp cannot be built by a custom faction... if I edit the coreimprovements file I can make a prereq.  but what if a mod file has the same improvement with the same internal name... would the mod file override the main file?

 

For things further down the tech tree, i can easily make a new tech and tech tree... but for buildings that are default such as logging camp, I'm not sure what my options are.

Reply #317 Top

Final question (for a bit):

How do I make a unit dependent on a building?  For instance, I'd like Archer's to be produced by only if there is a woodworking shop, etc.  I've tried playing around with the prereqs a bit:

Code: xml
  1. &lt;Prereq&gt;
  2. &lt;Type&gt;Tech&lt;/Type&gt;
  3. &lt;Attribute&gt;Archery&lt;/Attribute&gt;
  4. &lt;/Prereq&gt;
  5. &lt;Prereq&gt;
  6. &lt;Type&gt;BuildingRequirement&lt;/Type&gt;
  7. &lt;Attribute&gt;WoodcraftWorkshop&lt;/Attribute&gt;
  8. &lt;Value&gt;1&lt;/Value&gt;
  9. &lt;Target&gt;Player&lt;/Target&gt;
  10. &lt;/Prereq&gt;
  11. <span>

But that didn't work.  The improvement was built, but the unit didn't appear.  I also used target=city instead.  But the result was the same.  I also tried playing with this tag, borrowed from the city improvements

Code: xml
  1. &lt;RequiresCityImprovement&gt;1&lt;/RequiresCityImprovement&gt;
  2. &lt;RequiredImprovement&gt;WoodcraftWorkshop&lt;/RequiredImprovement&gt;

 

But that also did nothing.

Reply #318 Top

You might want to try setting the Requires city improvement tag to 0, sometimes the system is a little odd on what is considered an enabled bit for the different tags.

Reply #319 Top

Is there a way to only allow (or show) certain Quest choice dialog options based on Allegiance prerequisite?

Reply #320 Top

Quoting Dumhed, reply 315
What determines the zoom distance for a sovereign in their info card?  I have a sovereign that in new game selection is zoomed closer than all the others.  I'm not really sure how to make the sovereign the same size as the others.

That's a bit strange.  Have a look at the xml file for that Sov, it should have lines like this...

<CutSceneDataPack>Procipinee_CutscenePack</CutSceneDataPack>
<ModelScale>1.0000</ModelScale>
<TacticalModelScale>1.5000</TacticalModelScale>
<EquipmentScale>1.0000</EquipmentScale>
<ClothMapScale>1.6000</ClothMapScale>

 Those numbers should be the same. 

You could also check the CutSceneDataPack as that would impact the zoom level.

Reply #321 Top

Quoting Dumhed, reply 316
How do mod files work when "conflicting" with the main game files?  that is... say I want to make it so the Logging Camp cannot be built by a custom faction... if I edit the coreimprovements file I can make a prereq.  but what if a mod file has the same improvement with the same internal name... would the mod file override the main file?

 

For things further down the tech tree, i can easily make a new tech and tech tree... but for buildings that are default such as logging camp, I'm not sure what my options are.

 

Checkout this thread, it should answer your questions.  It's for FE but 99% should apply the same in LH:

https://forums.elementalgame.com/434780

 

Reply #322 Top

Quoting Dumhed, reply 317
How do I make a unit dependent on a building?  For instance, I'd like Archer's to be produced by only if there is a woodworking shop, etc.  

Unfortunately it's not as simple as you'd like.  There's no nice tag to do it.

You've got to use a bit of a workaround.  Basically you create a new local ResourceType and have the improvement produce the resource.... then have the unit require the resource to be produced.  So for your example you could have it so that the Woodworking shop producing "wood" or "bows" at a rate of 3 per turn or something.  Then put a requirement that the unit, or an ability the unit has... or maybe even the bow itself require "wood" or "bows" to produce.

Have a look at this post specifically the reply #2 from Heavenfall:

https://forums.elementalgame.com/439334/page/1/#3311666

It's a similar thing to what you want to do.  Just use a local ResourceType (not Shared) instead.  You might also want to set it to Stored = 1.

That should work.

+1 Loading…
Reply #323 Top

Quoting StevenAus, reply 319
Is there a way to only allow (or show) certain Quest choice dialog options based on Allegiance prerequisite?

I think CoS does this.  Checkout this post where it was discussed in the past it might help:

https://forums.elementalgame.com/442543/page/1/#3342019

 

Reply #324 Top

Quoting abob101, reply 320


Quoting Dumhed, reply 315What determines the zoom distance for a sovereign in their info card?  I have a sovereign that in new game selection is zoomed closer than all the others.  I'm not really sure how to make the sovereign the same size as the others.

That's a bit strange.  Have a look at the xml file for that Sov, it should have lines like this...

<CutSceneDataPack>Procipinee_CutscenePack</CutSceneDataPack>
<ModelScale>1.0000</ModelScale>
<TacticalModelScale>1.5000</TacticalModelScale>
<EquipmentScale>1.0000</EquipmentScale>
<ClothMapScale>1.6000</ClothMapScale>

 Those numbers should be the same. 

You could also check the CutSceneDataPack as that would impact the zoom level.

 

Yeah, those are the same values on my custom sovereign.  I'm a bit mystified.  I also based this sovereign's data on Procipinee so, most of the values are the same, with the exception of head, hair, equipment, traits, etc.  But somehow my lady boss likes the camera. 

Reply #325 Top

Thanks abob101 for the earlier feedback.  I sometimes have a hard time using the right query in the search to find what I need.  

 

New Question:

Is there any way to create a randomized result in unit recruitment?  Let's say for example I have 4 elementals that can be trained... is it possible for the city to recruit elemental (general), and only after recruitment find out which of the 4 you got?