<RequiresCity>False</RequiresCity> <!-- Does it do anything??

I have been experimenting with building my own improvements, and they more or less work how I would expect, but with the exception that I cannot seem to make an improvement build *outside* the city. It is always confined to the little green squares which are adjacent to the rest of your city. So what does this parameter do if not that? And is there a way to accomplish what I am trying to do? thanks.

 

10,539 views 14 replies
Reply #1 Top


I have been experimenting with building my own improvements, and they more or less work how I would expect, but with the exception that I cannot seem to make an improvement build *outside* the city. It is always confined to the little green squares which are adjacent to the rest of your city. So what does this parameter do if not that? And is there a way to accomplish what I am trying to do? thanks.

End of quote

I have attempted this myself, and came to the conclusion that this is not really possible. This particular tag is mainly for resource improvements like mines and training buildings, where they are able to be built outside the city. Now, even if you make a building that does not require a city, you have no method in the game to actually build it on nothing. Looking at the UI to begin, the build screen for a city automatically restricts to the green squares, and resources have a build button which allow the building of a single improvement. I am guessing you want to make something resembling farms/cottages/workshops from civ, or at least this is what I was trying to do. Sadly, there does not seem to be a method to build an improvement on non-resource squares, nor is there a way to make units have such a method.

Reply #2 Top

That is really too bad. As itchy as I am to start working in some of my own ideas, I realize they are not focusing on modability yet because the core game needs so much love. Ah well. While I have your attention, do you know of a way to make building one thing prevent the option to build another? Like say you have to choose either a Shrine of War or a Shrine of Commerce. (Negative prerequisite, would also be extremely useful for skill trees / tech trees.)

 

Oh yeah, and is there a Wiki documenting some of the more obscure XML settings?

Thanks

 

Reply #3 Top

There is no direct xml tag to make buildings be mutually exclusive. You can work around it for the player by applying a local resource to the cityhub, then demanding that resource for the building. But the UI won't display it well, and the AI will ignore it on anything but the lowest settings.

There's no wiki, and barely any documentation. I cover the basics here: https://forums.elementalgame.com/403584

Reply #4 Top


There is no direct xml tag to make buildings be mutually exclusive. You can work around it for the player by applying a local resource to the cityhub, then demanding that resource for the building. But the UI won't display it well, and the AI will ignore it on anything but the lowest settings.
End of quote

I used to use this method of enforcing mutual exclusion on buildings, but as heavenfall rightly points out, the AI will get some multiple of this resource due to the difficulty settings. This is one of the reasons I put my building mod on hold.

 

Reply #5 Top

Quoting kenata, reply 4

I used to use this method of enforcing mutual exclusion on buildings, but as heavenfall rightly points out, the AI will get some multiple of this resource due to the difficulty settings. This is one of the reasons I put my building mod on hold.
End of kenata's quote

There appears to be a work-around to this. If you set a negative production bonus in your unique improvement equal to the resource production in your cityhub, the two should cancel each other out. In that case it shouldn't make a difference if the AI gets a production multiplier because it will also multiply the (negative) production of the improvement. I have tried it and it appears to work. Am I missing something?

Local Resource:

Code
  1. &lt;ResourceTypes&gt;
  2.     &lt;!-- ************** --&gt;
  3.     &lt;!-- ** Local_1 *** --&gt;
  4.     &lt;!-- ************** --&gt;
  5.       &lt;ResourceType InternalName="L1_Local"&gt;
  6.             &lt;DisplayName&gt;Local_Resource&lt;/DisplayName&gt;
  7.             &lt;Type&gt;Local_1&lt;/Type&gt;
  8.             &lt;HarvestType&gt;Mining&lt;/HarvestType&gt;
  9.             &lt;IconColor&gt;0,0,0&lt;/IconColor&gt;
  10.             &lt;Icon&gt;Gfx//Icons//Icon_Metal.png&lt;/Icon&gt;
  11.             &lt;ClothIcon&gt;gfx\\TacticalIcons\\MetalOre_1.png&lt;/ClothIcon&gt;
  12.             &lt;TileDesign&gt;Res_MetalOre_01&lt;/TileDesign&gt;
  13.             &lt;ModelColor&gt;0,0,0&lt;/ModelColor&gt;
  14.             &lt;Production&gt;1.0&lt;/Production&gt;
  15.             &lt;Worth&gt;1&lt;/Worth&gt;
  16.             &lt;Global&gt;1&lt;/Global&gt;
  17.             &lt;Rarity&gt;0.0&lt;/Rarity&gt;
  18.         &lt;Stored&gt;0&lt;/Stored&gt;
  19.         &lt;Shared&gt;0&lt;/Shared&gt;
  20.             &lt;TradedByCaravans&gt;0&lt;/TradedByCaravans&gt;
  21.             &lt;ShownInGlobalDisplay&gt;1&lt;/ShownInGlobalDisplay&gt;
  22.             &lt;Medallions InternalName="IronOre_Res_Medallions"&gt;
  23.                   &lt;All&gt;Res_Ores_Plains.png&lt;/All&gt;
  24.             &lt;/Medallions&gt;
  25.       &lt;/ResourceType&gt;
  26. &lt;ResourceTypes&gt;

City Hub: (only lvl 1 included)

Code
  1. &lt;ImprovementTypes&gt;
  2.     &lt;DataChecksum NoParse="1"&gt;
  3.         &lt;Ignore&gt;DisplayName&lt;/Ignore&gt;
  4.         &lt;Translate&gt;DisplayName&lt;/Translate&gt;
  5.     &lt;/DataChecksum&gt;
  6.     
  7.   &lt;!--******************************--&gt;
  8.     &lt;!-- Capital Level 1 --&gt;
  9.     &lt;!--******************************--&gt;
  10.     &lt;ImprovementType InternalName="K_Capital"&gt;
  11.         &lt;DisplayName&gt;Capital&lt;/DisplayName&gt;
  12.         &lt;AIName&gt;Outpost&lt;/AIName&gt;
  13.         &lt;TileDesign&gt;F_Outpost_02_v2&lt;/TileDesign&gt;
  14.         &lt;TileStagePopulation&gt;2&lt;/TileStagePopulation&gt;
  15.         &lt;TileStageDesign&gt;F_Outpost_03&lt;/TileStageDesign&gt;
  16.         &lt;TileStagePopulation&gt;4&lt;/TileStagePopulation&gt;
  17.         &lt;TileStageDesign&gt;F_Outpost_04&lt;/TileStageDesign&gt;
  18.         &lt;TileStagePopulation&gt;7&lt;/TileStagePopulation&gt;
  19.         &lt;TileStageDesign&gt;F_Outpost_05&lt;/TileStageDesign&gt;
  20.         &lt;TileStagePopulation&gt;10&lt;/TileStagePopulation&gt;
  21.         &lt;TileStageDesign&gt;F_Outpost_06&lt;/TileStageDesign&gt;
  22.         &lt;TileStagePopulation&gt;14&lt;/TileStagePopulation&gt;
  23.         &lt;TileStageDesign&gt;F_Outpost_02&lt;/TileStageDesign&gt;
  24.         &lt;IsCityHub&gt;true&lt;/IsCityHub&gt;
  25.         &lt;RequiresCity&gt;False&lt;/RequiresCity&gt;
  26.         &lt;SupportedTerrainType&gt;Land&lt;/SupportedTerrainType&gt;
  27.         &lt;SupportedTerrainType&gt;City&lt;/SupportedTerrainType&gt;
  28.         &lt;DrawnIcon&gt;Gfx/TacticalIcons/F_Hovel.dds&lt;/DrawnIcon&gt;
  29.         &lt;DrawnIconDefended&gt;Gfx/TacticalIcons/WorldMap_Outpost_Def.png&lt;/DrawnIconDefended&gt;
  30.         &lt;Thumbnail&gt;Gfx/Medallions/Building_Inn1.png&lt;/Thumbnail&gt;
  31.         &lt;ZOCMinRadius&gt;1&lt;/ZOCMinRadius&gt;
  32.         &lt;ZOCMaxRadius&gt;3&lt;/ZOCMaxRadius&gt;
  33.         &lt;ZOCRadiusTurnsBeforeUpdate&gt;10&lt;/ZOCRadiusTurnsBeforeUpdate&gt;
  34.         &lt;BuildRadius&gt;1&lt;/BuildRadius&gt;
  35.         &lt;BuildableTiles&gt;50&lt;/BuildableTiles&gt;
  36.         &lt;CitywideDuplicateImpLimit&gt;1&lt;/CitywideDuplicateImpLimit&gt;
  37.         &lt;OnSelectSFX&gt;Click_Paper_5&lt;/OnSelectSFX&gt;
  38.         &lt;OnSelectSFX&gt;Click_Paper_4&lt;/OnSelectSFX&gt;
  39.         &lt;Prereq InternalName="L1_Allegiance_Prereq"&gt;
  40.             &lt;Type&gt;Allegiance&lt;/Type&gt;
  41.             &lt;Attribute&gt;Empire&lt;/Attribute&gt;
  42.         &lt;/Prereq&gt;
  43.             &lt;GameModifier InternalName="L1_Local"&gt;
  44.                   &lt;ModType&gt;Resource&lt;/ModType&gt;
  45.                   &lt;Attribute&gt;Local_1&lt;/Attribute&gt;
  46.                   &lt;Value&gt;1&lt;/Value&gt;
  47.                   &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  48.                   &lt;ResourceShared&gt;0&lt;/ResourceShared&gt;
  49.             &lt;/GameModifier&gt;
  50.     &lt;!--Holds some population--&gt;
  51.     &lt;GameModifier InternalName="L1_Storage_Population"&gt;
  52.       &lt;ModType&gt;ResourceStorage&lt;/ModType&gt;
  53.       &lt;Attribute&gt;Population&lt;/Attribute&gt;
  54.       &lt;Value&gt;10.0&lt;/Value&gt;
  55.       &lt;Cumulative&gt;true&lt;/Cumulative&gt;
  56.     &lt;/GameModifier&gt;
  57.     &lt;!-- Level-up Cap --&gt;
  58.     &lt;GameModifier InternalName="L1_LevelCap"&gt;
  59.       &lt;ModType&gt;LevelBarrier&lt;/ModType&gt;
  60.       &lt;Attribute&gt;Population&lt;/Attribute&gt;
  61.       &lt;Value&gt;15.0&lt;/Value&gt;
  62.       &lt;CityUpgrade&gt;F_Capital_L2&lt;/CityUpgrade&gt;
  63.     &lt;/GameModifier&gt;
  64.     &lt;GameModifier&gt;
  65.         &lt;ModType&gt;City&lt;/ModType&gt;
  66.         &lt;Attribute&gt;AdjustDefendingUnit&lt;/Attribute&gt;
  67.         &lt;Value&gt;5&lt;/Value&gt;
  68.         &lt;Operator&gt;+&lt;/Operator&gt;
  69.         &lt;StrVal&gt;UnitStat_HitPoints&lt;/StrVal&gt;
  70.         &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  71.     &lt;/GameModifier&gt;
  72.     &lt;GameModifier&gt;
  73.           &lt;ModType&gt;Resource&lt;/ModType&gt;
  74.           &lt;Attribute&gt;local_1&lt;/Attribute&gt;
  75.           <span style="color: #ff6600;">&lt;Value&gt;1.0&lt;/Value&gt; &lt;!-- multiply this --&gt;</span>
  76.           &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  77.     &lt;/GameModifier&gt;
  78.     &lt;!-- Item Shop - Base Items --&gt;
  79.         &lt;UnlocksShopItem&gt;SaltedPork&lt;/UnlocksShopItem&gt;
  80.         &lt;UnlocksShopItem&gt;GnarledClub&lt;/UnlocksShopItem&gt;
  81.         &lt;UnlocksShopItem&gt;Staff&lt;/UnlocksShopItem&gt;
  82.         &lt;UnlocksShopItem&gt;TravelingBoots&lt;/UnlocksShopItem&gt;
  83.     &lt;/ImprovementType&gt;
  84. &lt;/ImprovementTypes&gt;

Unique Improvement:

Code
  1. &lt;ImprovementTypes&gt;
  2.     &lt;DataChecksum NoParse="1"&gt;
  3.         &lt;Ignore&gt;DisplayName&lt;/Ignore&gt;
  4.         &lt;Translate&gt;DisplayName&lt;/Translate&gt;
  5.     &lt;/DataChecksum&gt;
  6.     
  7.     &lt;!-- ********** --&gt;
  8.     &lt;!-- ** Farm ** --&gt;
  9.     &lt;!-- ********** --&gt;
  10.     &lt;ImprovementType InternalName="Unique_Improvement"&gt;
  11.         &lt;DisplayName&gt;Unique_1&lt;/DisplayName&gt;
  12.         &lt;Description&gt;Unique Improvement&lt;/Description&gt;
  13.             &lt;!-- Improvement Data --&gt;
  14.         &lt;TileDesign&gt;K_Farm_01&lt;/TileDesign&gt;
  15.         &lt;ConstructionTileDesign&gt;K_Farm_Build_01&lt;/ConstructionTileDesign&gt;
  16.         &lt;SupportedTerrainType&gt;Land&lt;/SupportedTerrainType&gt;
  17.         &lt;SupportedTerrainType&gt;City&lt;/SupportedTerrainType&gt;
  18.         &lt;DrawnIcon&gt;Gfx/TacticalIcons/K_Farm1.png&lt;/DrawnIcon&gt;
  19.         &lt;DrawnIconConstruction&gt;Gfx/TacticalIcons/K_Farm1_C.png&lt;/DrawnIconConstruction&gt;
  20.         &lt;Thumbnail&gt;K_Farm_01_Thumb.png&lt;/Thumbnail&gt;
  21.         &lt;IgnoreDuplicateImpLimit&gt;True&lt;/IgnoreDuplicateImpLimit&gt;
  22.         &lt;!-- Medallion Data --&gt;
  23.         &lt;Medallions InternalName=""&gt;
  24.             &lt;All&gt;K_Farm_01_Thumb.png&lt;/All&gt;
  25.             &lt;Border_All&gt;
  26.             &lt;/Border_All&gt;
  27.         &lt;/Medallions&gt;
  28.         &lt;!-- Prerequisites --&gt;
  29.         &lt;RequiresCity&gt;True&lt;/RequiresCity&gt;
  30.         &lt;!-- Unlock this through the farming tech --&gt;
  31.         &lt;!-- Cost --&gt;
  32.         &lt;IgnoreDuplicateImpLimit&gt;True&lt;/IgnoreDuplicateImpLimit&gt;
  33.         &lt;LaborToBuild&gt;1.0&lt;/LaborToBuild&gt;
  34.         &lt;!-- Building Production/Consumption. --&gt;
  35.         &lt;GameModifier&gt;
  36.             &lt;ModType&gt;ConstructionResourceCost&lt;/ModType&gt;
  37.             &lt;Attribute&gt;Local_1&lt;/Attribute&gt;
  38.             &lt;Value&gt;-1.0&lt;/Value&gt;
  39.         &lt;/GameModifier&gt;
  40.             &lt;GameModifier InternalName="Production1"&gt;
  41.                   &lt;ModType&gt;Resource&lt;/ModType&gt;
  42.                   &lt;Attribute&gt;Local_1&lt;/Attribute&gt;
  43.                   <span style="color: #ff6600;">&lt;Value&gt;-1&lt;/Value&gt; &lt;!-- and multiply this --&gt;</span>
  44.                   &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  45.             &lt;/GameModifier&gt;
  46.         &lt;GameModifier InternalName="Production1"&gt;
  47.             &lt;ModType&gt;Resource&lt;/ModType&gt;
  48.             &lt;Attribute&gt;Rations&lt;/Attribute&gt;
  49.             &lt;Value&gt;5.0&lt;/Value&gt;
  50.             &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  51.         &lt;/GameModifier&gt;
  52.         &lt;Prereq&gt;
  53.               &lt;Type&gt;Allegiance&lt;/Type&gt;
  54.               &lt;Attribute&gt;Kingdom&lt;/Attribute&gt;
  55.         &lt;/Prereq&gt;
  56.         &lt;!-- AI Info --&gt;
  57.         &lt;AIData AIPersonality="AI_General"&gt;
  58.               &lt;AITag&gt;Farming&lt;/AITag&gt;
  59.         /AIData&gt;
  60.       &lt;/ImprovementType&gt;
  61. &lt;/ImprovementTypes&gt;

Reply #6 Top

Quoting troglyte, reply 5

Quoting kenata, reply 4
I used to use this method of enforcing mutual exclusion on buildings, but as heavenfall rightly points out, the AI will get some multiple of this resource due to the difficulty settings. This is one of the reasons I put my building mod on hold.
There appears to be a work-around to this. If you set a negative production bonus in your unique improvement equal to the resource production in your cityhub, the two should cancel each other out. In that case it shouldn't make a difference if the AI gets a production multiplier because it will also multiply the (negative) production of the improvement. I have tried it and it appears to work. Am I missing something?
End of troglyte's quote

I am a bit skeptical as to your solution. This is the negative production is the same method they use for a buildings maintenance, so thus I can not imagine that it is multiplied in the way you are thinking, as this would basically be counter to what they want from the multiplier in the first place.

Reply #7 Top

I've got some buildings hooked up to similar code, I'll try it out.

Edit: The negative production was not multiplied. On ridiculous, 1 production and then -1 production meant 9 total production.

In addition, even if it was reduced to 0, the player could still build more than one in the same turn. I placed 1 production in the cityhub, then -1 in huts. As long as I built the huts in the same turn, I was able to build as many as I wanted. As soon as one finished constructing, I wasn't able to build more.

Reply #8 Top

Quoting kenata, reply 6

I am a bit skeptical as to your solution. This is the negative production is the same method they use for a buildings maintenance, so thus I can not imagine that it is multiplied in the way you are thinking, as this would basically be counter to what they want from the multiplier in the first place.
End of kenata's quote

Quoting Heavenfall, reply 7


Edit: The negative production was not multiplied.
End of Heavenfall's quote

You are both absolutely right. It was a mistake in my implementation that made it look like it was working. Negative production is automatically separated from positive production in the city resource screen, and there's no way to fool it. (kind of makes you wonder they didn't anticipate the production of negative resources, like pollution, how about magical pollution that mutates your population into glowing mindless... ah well next time)

The good news is, I've actually found a way to build mutually exclusive buildings. No, this time for real! :p

Basically set up a custom resource using Population as a template. In your city hub set a modifier for 1 resource per turn. Then set a resource storage again using Population as a template, set the storage value to at least 10x your accumulation per turn. See where this is going? Now on your buildings set a negative production per turn to about equal to your maximum storage (minus 1 needed for building it). The only real downside is that a player must wait at least 10 turns from founding their city before there's enough resources to build. Also there will be constant useless resource showing in your city screen. Each custom resource set up in this way can support an unlimited number of mutually exclusive buildings, however they will stay in your construction menu forever, even after the possibility to build them is gone.

Reply #9 Top

I'm guessing you'll still have the issue of building another one before the first one finishes.

Reply #10 Top

Quoting Heavenfall, reply 9
I'm guessing you'll still have the issue of building another one before the first one finishes.
End of Heavenfall's quote

No, that's the beauty. It depletes your entire store of resources to build one, and it takes ~10 turns to refill. So as long as your build time is not > than your replenish time there isn't an issue.

After a bit more experimenting I have found you can go as low as 5 turns after foundation, but any lower and the amount of resources the structure cancels out is less than the AI bonus so they can build another.

http://solidfiles.com/d/71150/download <-- 10 turn version

Reply #11 Top

Well done. By the way, when you're modifying existing buildings, there's no need to include the whole improvementtype. You can just go

    <ImprovementType InternalName="K_Capital">

        <GameModifier InternalName="L1_Storage_Local">
            <ModType>ResourceStorage</ModType>
            <Attribute>Local_1</Attribute>
            <Value>11.0</Value>
            <Cumulative>true</Cumulative>
        </GameModifier>

            <GameModifier InternalName="L1_Local">
                  <ModType>Resource</ModType>
                  <Attribute>Local_1</Attribute>
                  <Value>1</Value>
                  <PerTurn>1</PerTurn>
            </GameModifier>

</ImprovementType>

End of quote

In fact, anything else is a bad idea, as gamemodifiers will stack. For example, with the k_hubs in your rar, you'll end up with double the health bonus to defending units because it's defined both in your file, and in the core file. Tags that can only appear once are overrided, but tags that can appear multiple times are simply added after each other.

 

Reply #12 Top

Some of the work-arounds you guys find to ease the woes of such limited modability is astounding.

Not to get slightly off topic, but does tag <Capital>Cityname</Capital> in the XML for factions serve any purpose?  Or was this one of those old tags that no longer does anything?  Because it sure doesn't seem to do anything regarding capital names (would be fantastic if the AI could recognize such a thing).

Reply #13 Top

It may be used in campaigns, don't know. In sandbox it doesn't do anything.

Reply #14 Top

Trog, just remember to go easy on these resources as they are not hidden in the city screen. One of the reasons Heavenfall and I stopped using this method was that these easily get out of control and can make looking at the city details screen unpleasant. As I said previously, I used a similar method when attempting to do the wizard's tower mod and found that even 2 or 3 of these can get annoying.