I am attempting to mimic the effect for LH using a custom resource created for each city hub like so,
Code: xml
- <ResourceType InternalName="CityCount">
- <DisplayName>City Count</DisplayName>
- <Type>CityCount</Type>
- <Description>Increases the count of your city total.</Description>
- <IconColor>0,0,0</IconColor>
- <Icon>Gfx//Icons//Ledger_CityLevel_Icon.png</Icon>
- <HideInHiergamenon>1</HideInHiergamenon>
- <ShownInGlobalDisplay>1</ShownInGlobalDisplay>
- <Global>1</Global>
- <Stored>0</Stored>
- <Shared>0</Shared>
- <TradedByCaravans>0</TradedByCaravans>
- <RummagedPerTurn>0.01</RummagedPerTurn>
- <!-- AI Info -->
- <AIData AIPersonality="AI_General">
- <AITag>Shard</AITag>
- </AIData>
- </ResourceType>
I then added this resource to each city hub using this code,
Code: xml
- <GameModifier>
- <ModType>Resource</ModType>
- <Attribute>CityCount</Attribute>
- <Value>1</Value>
- <PerTurn>1</PerTurn>
- </GameModifier>
All of this works and I can see my total city count going up in my global resource pool. The problem comes when trying to use this new resource pool to increase unrest as more cities are added. I lowered the tax base by 10 initially and then set up the following code and it sort of worked,
Code: xml
- <GameModifier>
- <ModType>Resource</ModType>
- <Attribute>Unrest</Attribute>
- <PerTurn>1</PerTurn>
- <Calculate InternalName="Value" ValueOwner="OwnerCity">
- <Expression><![CDATA[[CityCount] * 10]]></Expression>
- </Calculate>
- </GameModifier>
The problem lies in that it only calculates for the city it is in so it only counts 1 ever. I tried a variation of the shard call request used in most spells like this,
Code: xml
- <GameModifier>
- <ModType>Resource</ModType>
- <Attribute>Unrest</Attribute>
- <PerTurn>1</PerTurn>
- <Calculate InternalName="Calc" ValueOwner="TargetCity">
- <Expression><![CDATA[[UnitOwner_GetNumCityCount]]]></Expression>
- </Calculate>
- <Calculate InternalName="Value">
- <Expression><![CDATA[[Calc] * 10]]></Expression>
- </Calculate>
- </GameModifier>
But this did not work, I am kind of stuck at the moment until I can get a hint how to get a total city count that I can then apply as a value to multiply against.
Thanks for any help guys.