Possible to use CityLevel in Improvement GameModifier?

Guys does anyone know if it's possible to use the City Level in a GameModifier expression in improvements?

So i'd like to have an improvment that grants say +1 gildar per City Level?

I can see the onse that let you use the TileYield but can't find any examples that use City Level :-(

Cheers.

73,735 views 20 replies
Reply #1 Top

As far as I know, that's not possible. BUT:

You can create a new city resource called CityLevel and then edit city hubs. So the level 1 city hub will provide 1 CityLevel resource, the level 2 city hubs will provide 2 CityLevel resources, the level 3 city hubs will provide 3 CityLevel resources and so on.

+1 Loading…
Reply #2 Top

Dude, that's a good workaround thanks.

It happens to work pretty well in this case (which is nice for a change) in that because the ImprovementType's retain all their tags when you add something via the mod folder (as mentioned in the most useful mod post ever https://forums.elementalgame.com/434780).... you can easily add the CityLevel resource to all the hubs just with little stubs like this in your mod folder:

<ImprovementType InternalName="CityHub3_Town">
   <GameModifier>
      <ModType>Resource</ModType>
      <Attribute>CityLevel</Attribute>
      <Value>3</Value>
      <PerTurn>1</PerTurn>
   </GameModifier>
</ImprovementType>

Rather than have to copy/paste the whole ImprovementType.  Hopefully this makes it more futureprove that some other change to core stuff.

Works a treat.  Got it up and running in 10 mins, thanks.

On a side note - this is a good example of how useful it is at time to be able to add/modify something in the core files without overriding the whole thing.  It would suck if I had to copy the entire CityHubs to do this (I wouldn't bother).

 

Reply #3 Top

Happy to help ^_^

Care to share what you are working on? ;)

Reply #4 Top

See the gildar tree I made... it does exactly what you are suggesting

https://forums.elementalgame.com/442891

Check out the gildar tree improvement, it grants +1 gildar per city level.

https://dl.dropboxusercontent.com/u/75549875/Fallen%20Enchantress/Quest_ManUnderTheTree/Quest_ManUnderTheTree_1_1.zip

Reply #5 Top


Edit: parrotmath beat me to it, his solution is the same as mine.

Do this instead, it is preferable since other modders may add more types of cityhubs later on


  <GameModifier>
    <ModType>Resource</ModType>
    <Attribute>Mana</Attribute>
    <PerTurn>1</PerTurn>
    <Provides>+1 Mana per City Level</Provides>
    <UpgradeComparisonID>1</UpgradeComparisonID>
    <Calculate InternalName="Value" ValueOwner="OwnerCity">
      <Expression><![CDATA[[CityLevel]]]></Expression>
    </Calculate>
  </GameModifier>

CityLevel is a very old variable that wasn't used in FE but E:wom, but it still functions.

Reply #6 Top

Thats roughly how I did the gildar tree.

Edit: Replied before the dis-edit ;)

Reply #7 Top


So the variable was there after all! I wish we had a full list of variables that we can use.

Reply #8 Top

Quoting OliverFA_306, reply 7


So the variable was there after all! I wish we had a full list of variables that we can use.

 

I wish there was a full list of what variables can be used with what variables.

 

for example, what attributes, values, str values, etc work together.

 

For example, you can make a Tame ability apply to the whole army instead of just the lead unit; however you can't make Divine Insight give experience to every unit in the army (while you can give every unit in the army damage or healing).

 

You can make a unit take damage per turn or cost upkeep per turn, but you can't make it gain experience per turn.

 

You can make a spell, item, or building do most of the same things. There is a lot of potential to work with. I have fun sorting through some of the frustrations but sometimes its frustrating knowing (or thinking) there is a secret guide of everything that nobody has.

 

Reply #9 Top

Quoting thadianaphena, reply 8
there is a secret guide of everything that nobody has.

That is completely, false... I know for a fact that Heavenfall and I have this secret guide. Most of Stardock also has this guide and they update it constantly. ;)

Quoting thadianaphena, reply 8
Divine Insight give experience to every unit in the army (while you can give every unit in the army damage or healing).

Try this spell out as a test guide to show you that you can apply XP to every unit in an army. Mind you still have the XP split from champion to unit (namely what you give to a unit is halved), but it works.

<SpellDef InternalName="AMonkeySpell">
        <DisplayName>Monkey Experience</DisplayName>
        <Description>This does something. Try it for the experience.</Description>
        <Image>S_DestinysInsight_Painting.png</Image>
        <IconFG>S_DestinysInsight_Icon.png</IconFG>
  <AutoUnlock>1</AutoUnlock>
        <SpellBookSortCategory>Unit</SpellBookSortCategory>
        <SpellBookSortSubCategory>UnitEnchantment</SpellBookSortSubCategory>
        <SpellType>Strategic</SpellType>
        <SpellClass>Defensive</SpellClass>
        <SpellSubClass>Buff</SpellSubClass>
        <SpellTargetType>FriendlyUnit</SpellTargetType>
  <UnitAppSpecifier>ApplyToAll</UnitAppSpecifier>
        <CasterMustBeSov>1</CasterMustBeSov>
        <SpellResourceCost>
            <Resource>Mana</Resource>
            <Amount>2</Amount>
        </SpellResourceCost>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>GiveExperience</Attribute>
            <Value>25</Value>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>80</AIPriority>
        </AIData>
        <HitSoundFX>Spell_DestinyGift_01</HitSoundFX>
        <SpellDefEffect>
            <EffectName>S_Paragon_Particle</EffectName>
            <LocalPosition>0,30,0</LocalPosition>
            <EffectScale>1</EffectScale>
            <EffectDelay>0</EffectDelay>
            <SnapToTerrain>1</SnapToTerrain>
        </SpellDefEffect>
    </SpellDef>

 

Reply #10 Top


So we need to work hard to earn that guide? Ok, let's start! :banhammer:

Reply #11 Top

Lots of reading the current XML and lots of trial and error.

Reply #12 Top

Quoting Heavenfall, reply 11

Lots of reading the current XML and lots of trial and error.

Don't give them the secret to the manual  :-" .

Reply #13 Top

As others have said before though, and I agree, sometimes its like reading sanskrit that has been partially eroded.

Reply #14 Top

Quoting parrottmath, reply 12

Quoting Heavenfall, reply 11
Lots of reading the current XML and lots of trial and error.

Don't give them the secret to the manual  .
why?   :'(

Please please pretty please! :pout:

Reply #15 Top

HF / parrottmath,

Thanks that's heaps easier.  Appreciate all the responses.

Lots of reading the current XML

Yeah I do a lot of searches for through the files for things I think might work... in this case I had already searched for "CityLevel" and "City_Level" in the CoreImprovements.xml file but it's not used in there so I assumed (wrongly) that there it didn't exist.

But as it turns out it was used in eWoM back in the day how about that.  That's where you guys who've been around working on this stuff are invaluable.  Thanks.

(possibly I should have just tried/tested "CityLevel" in the first place).


 

Reply #16 Top

Quoting OliverFA_306, reply 3
Care to share what you are working on?

Oh wow, I only just figured out how to quote properly!    

Well, I'm kinda working a mod to create a bunch of new factions.  It started out very innocently... I don't really go on any of the default factions very much. and I like big maps with 10+ factions, so I started creating a heap of my own.  Then I ran out of faction traits to make them different.  So then I started to tweak stuff a bit... like giving spider riders to the Cult of a Hundred Eyes.  From there things have gotten waaaayyyyy out of control.  I started using some of DsRaiders faction traits... then created a heap of my own, then a heap of spell schools, fixed/balanced some things that really peeved me etc.  

It was only ever planned to be for my own use.. but if I get it to the point where it's finished/stable and enough value to others I might stick it on the Nexus or whatever.  I've pinched one or two things from Stormworld and DsRaiders faction traits mods so subject to their ok  :-"

Started on FE but i've since moved it over to LH because wasn't to play with the trait trees and stuff.  It's a bugger though working on it during a beta.

 

Reply #17 Top

 Yeah so the reason for this OP was, a lot of the faction traits i've added have various monsters units and stuff to try and add a bit of faction diversity.  Generally I cap these units though.  In this case i've got "Ogre Alliance" faction trait.... it lets you train Young Ogres, Ogres and Bone Ogres... but you have to build Ogre Pits to get them.  They are zero maintenance so you can only have so many.  At the moment i've got this

<ImprovementType InternalName="JB_OgrePit">
  <DisplayName>Ogre Pit</DisplayName>
  <Description>An Ogre Pit allows Ogres to be trained in the city, however their presence causes some unrest among the populace.</Description>

  blah

  <GameModifier>
      <ModType>Resource</ModType>
      <Attribute>Unrest</Attribute>
      <Value>5</Value>
      <PerTurn>1</PerTurn>
      <Provides>+5% Unrest</Provides>
      <UpgradeComparisonID>1</UpgradeComparisonID>
      <UpgradeComparisonText>Unrest</UpgradeComparisonText>
   </GameModifier>
   <GameModifier>
      <ModType>Resource</ModType>
      <Attribute>JB_OgreInfluence</Attribute>
      <PerTurn>1</PerTurn>
      <Provides>+3 Ogre Influence (+1 per City Level)</Provides>
      <UpgradeComparisonID>1</UpgradeComparisonID>
      <Calculate InternalName="Value" ValueOwner="OwnerCity">
         <Expression><![CDATA[[CityLevel] + 3]]></Expression>
      </Calculate>
   </GameModifier>

   blah

</ImprovementType>

 

So the bigger the city the more "Ogre Influence" you have.  Young Ogres require 2 Ogre Influence, Ogres 3 , Bone Ogres 4.  That kind of thing.

I like using the size/level of the city as a factor, to try and encourage a bit of tall rather than wide empire building.  I'd be temped to go for CityLevel * CityLevel = Ogre Influence or something.... so that you get more Ogre Influence (or whatever resource) on an exponential basis for city level rather than linear.  I figure that would reward a tall build.

Reply #18 Top

OK so i'm waffling on now, but here's some screens of what i'm talking about just for fun ;P   Not sure if we're allowed to be talking about modding LH at this stage but anyways.

 

 

 

 

 

 

 

 

 

 

Reply #19 Top

Looks nice. I can't wait to see what people will cook up for their mods. I have stuff of my own too.

Reply #20 Top

I look forward to this too, you figured out a few things I didn't.  will be fun to tinker with.