City upgrades - mod 2013!

After 4+ years I started playing GCII again. Need some help if any modders still visit here! :|

In the last 2 weeks I'm working on a total mod.

Now I'm stuck... I made 2 new upgrades for cities one for the capital (CapitalCity) and one for the other planets (InitialColony). Unfortunatelly game sees the upgrade of Initial Colony as a new improvement and it appears on capital planet!

I tried to think ways to avoid this but doesn't seem to be possible unless I make a single upgrade for both cities which I don't want.

 

Any ideas...? I hope mod community is not totally dead..

6,796 views 5 replies
Reply #1 Top

I hope mod community is not totally dead..

It's not dead. It's just resting. ;)

No, seriously, the mod community isn't dead, but it's not seeing much activity lately. Same can be said for the forums in general.

As for your problem, the only way to make this work is, to add an upgrade-target tag to your new versions, and change it to refer to the original improvement. Like this:

<Improvement>
<S_InternalName>InitialColony2</S_InternalName>
<S_Name>Advanced Colony</S_Name>
<PlacementLimit>1</PlacementLimit>
<AI>0</AI>
<S_UpgradeTarget>InitialColony</S_UpgradeTarget>
<S_Type>Normal</S_Type>
<Maintenance>10</Maintenance>
<Cost>0</Cost>
<S_IconName>NeutralCivCapitol.png</S_IconName>
<S_QueryGraphicName>NeutralCivCapitol.png</S_QueryGraphicName>
<CanHaveAgents>0</CanHaveAgents>
<Indestructable>1</Indestructable>
<S_TechRequirement>0</S_TechRequirement>
<Industry>16</Industry>
<Food>10</Food>
<Research>16</Research>
<MoraleBonus>15</MoraleBonus>
<S_InvasionMovie1>NeutralCivCapitol_Normal.bik</S_InvasionMovie1>
<S_InvasionMovie2>NeutralCivCapitol_Smoking.bik</S_InvasionMovie2>
<S_InvasionMovie3>NeutralCivCapitol_Damaged.bik</S_InvasionMovie3>
<S_InvasionMovie4>NeutralCivCapitol_Ruined.bik</S_InvasionMovie4>
</Improvement>

Same goes for the upgrade of the Capital City.

Still, there is one problem with this approach. Unless you make the tech, that unlocks those upgrades, available to all races, there is a possibility to permanently lose the building. This is a problem with the one-per-planet restriction. The game registers an upgrade as a new building. So, if you loose the building, the game doesn't allow you to replace it, because it thinks, that you still have one. The Indestructable-tag should prevent this from happening with your upgrades, but it is something to keep in mind for other improvements, that don't have the tag.

Well, I hope this answers your question.

Reply #2 Top

Thats exactly what I did but the game sees the upgrades as a new improvements that can be built along with Colonies and Capital City!
I understand that cities are hard coded to be built by the game and not the player, but upgrades do not have this limit!  X|

Of course there is the appropriate tech but I like to keep it unique for 1 race (Humans) if they lose their capital so be it!

Here is what I wrote for improvements:

 The original ones untouched:

<Improvement>   
<S_InternalName>InitialColony</S_InternalName>  
<S_Name>Initial Colony</S_Name>   
<PlacementLimit>1</PlacementLimit>   
<AI>0</AI>   
<S_Type>Normal</S_Type>   

<Maintenance>10</Maintenance>   
<Cost>0</Cost>   
<S_IconName>NeutralCivCapitol.png</S_IconName>   
<S_QueryGraphicName>NeutralCivCapitol.png</S_QueryGraphicName>   
<CanHaveAgents>0</CanHaveAgents>   
<Indestructable>1</Indestructable>   
<S_TechRequirement>0</S_TechRequirement>   
<Industry>14</Industry>   
<Food>8</Food>   
<Research>14</Research>   
<MoraleBonus>10</MoraleBonus>   
<S_InvasionMovie1>NeutralCivCapitol_Normal.bik</S_InvasionMovie1> 
<S_InvasionMovie2>NeutralCivCapitol_Smoking.bik</S_InvasionMovie2>  
<S_InvasionMovie3>NeutralCivCapitol_Damaged.bik</S_InvasionMovie3> 
<S_InvasionMovie4>NeutralCivCapitol_Ruined.bik</S_InvasionMovie4>
</Improvement>  

<Improvement>  
<S_InternalName>CapitalCity</S_InternalName>   
<S_Name>Civilization Capital</S_Name>   
<PlacementLimit>1</PlacementLimit>  
<S_Type>Normal</S_Type>   
<Maintenance>0</Maintenance>  
<Cost>0</Cost>   
<S_IconName>NeutralCivCapitol.png</S_IconName>  
<S_QueryGraphicName>NeutralCivCapitol.png</S_QueryGraphicName>   
<CanHaveAgents>0</CanHaveAgents>  
<Indestructable>1</Indestructable>   
<S_TechRequirement>0</S_TechRequirement>   
<Industry>24</Industry>   
<Food>16</Food>  
<Research>24</Research>   
<MoraleBonus>25</MoraleBonus>   
<EconomicBonus>10</EconomicBonus>   
<PrestigeBonus>50</PrestigeBonus>   
<S_InvasionMovie1>NeutralCivCapitol_Normal.bik</S_InvasionMovie1>  
<S_InvasionMovie2>NeutralCivCapitol_Smoking.bik</S_InvasionMovie2>  
<S_InvasionMovie3>NeutralCivCapitol_Damaged.bik</S_InvasionMovie3>  
<S_InvasionMovie4>NeutralCivCapitol_Ruined.bik</S_InvasionMovie4>  
</Improvement>  

and the upgrades:


<Improvement>  
<S_InternalName>StarCity</S_InternalName>   
<S_Name>Star City</S_Name>   
<S_UpgradeTarget>InitialColony</S_UpgradeTarget>   
<PlacementLimit>1</PlacementLimit>   
<S_Type>Normal</S_Type>   
<Maintenance>15</Maintenance>   
<Cost>10</Cost>   
<S_IconName>StarCity.png</S_IconName>   
<S_QueryGraphicName>StarCity.png</S_QueryGraphicName>   
<CanHaveAgents>0</CanHaveAgents>   
<Indestructable>1</Indestructable>   
<S_TechRequirement>StarCities</S_TechRequirement>   
<Industry>18</Industry>   
<Food>12</Food>   
<Research>18</Research>   
<MoraleBonus>20</MoraleBonus>   
<S_InvasionMovie1>NeutralCivCapitol_Normal.bik</S_InvasionMovie1>  
<S_InvasionMovie2>NeutralCivCapitol_Smoking.bik</S_InvasionMovie2>  
<S_InvasionMovie3>NeutralCivCapitol_Damaged.bik</S_InvasionMovie3>  
<S_InvasionMovie4>NeutralCivCapitol_Ruined.bik</S_InvasionMovie4>  
</Improvement>  

<Improvement>   
<S_InternalName>StarCapital</S_InternalName>   

<S_Name>Capital Star City</S_Name>   
<S_UpgradeTarget>CapitalCity</S_UpgradeTarget>   
<PlacementLimit>1</PlacementLimit>   
<S_Type>Normal</S_Type>   
<Maintenance>0</Maintenance>   
<Cost>0</Cost>  
<S_IconName>NeutralCivCapitol.png</S_IconName>   
<S_QueryGraphicName>NeutralCivCapitol.png</S_QueryGraphicName>   
<CanHaveAgents>0</CanHaveAgents>   
<Indestructable>1</Indestructable>   
<S_TechRequirement>StarCapital</S_TechRequirement>   
<Industry>30</Industry>   
<Food>20</Food>   
<Research>30</Research>   
<MoraleBonus>50</MoraleBonus>   
<EconomicBonus>20</EconomicBonus>   
<PrestigeBonus>100</PrestigeBonus>   
<S_InvasionMovie1>NeutralCivCapitol_Normal.bik</S_InvasionMovie1>  
<S_InvasionMovie2>NeutralCivCapitol_Smoking.bik</S_InvasionMovie2>  
<S_InvasionMovie3>NeutralCivCapitol_Damaged.bik</S_InvasionMovie3>  
<S_InvasionMovie4>NeutralCivCapitol_Ruined.bik</S_InvasionMovie4>  
</Improvement>

Reply #3 Top

Quoting alphaprior, reply 2

Thats exactly what I did but the game sees the upgrades as a new improvements that can be built along with Colonies and Capital City!
I understand that cities are hard coded to be built by the game and not the player, but upgrades do not have this limit!

I see. I haven't fully tested this approach, so I didn't knew about this problem. To my knowledge, Tolmekian tried it to solve the farming-issue of the AI, but eventually abandoned the idea. Now I see why.

The main issue in solving this is the hardcoded part. Changing the Internal Name for the Capital City and the Initial Colony wouldn't work, as the game would then be unable to find and place them. Changing the Internal Name for the upgrades to be the same as the base improvements wouldn't work either, due to circular logic, and would freeze the game once you finish researching them (I had that happen to me once). 

Bottom line, I can't think of any way to fix this. Nor do I think it is possible without access to the source code.

Sorry. :(

 

 

Reply #4 Top

I've tried out the Advanced Colony thing myself but alas, I ran into the same problem.

What you can do, although it may not be an entirely balanced thing to do, is approach it in the same way as Weather Control Centre or Biosphere Modulator (which give you tiles to use) thereby offsetting the fact that you have to use a tile in order to build the 'upgrade' on a planet.  You get a similar effect, with a possibility of also increasing the planet quality about the threshold for it to get a bonus to approval for being PQ 11 or greater.

Obviously, you would want to limit how many of these improvements exist (so some races would have to share) or make the technology for them untradeable and unstealable.

Reply #5 Top

Well I did it! :D

First technology for upgraded capital, is an expensive one so it becomes available later in the game.
Its a Super Project and once the technology becomes available auto-upgrade begins (expensive too). This is the imperfection here is that you can stop it and build it somewhere else.

Now on the upgraded colonies..

I made a trick so the colonies will not be available to build in capital planet.

I gave 2x tags to capital upgrade

  <S_InternalName>StarCapital</S_InternalName>   
  <S_InternalName>StarCity</S_InternalName>

unorthodox method I know but it works!

Now once the StarCity upgrade for colonies becomes available StarCity tag in Capital City is recognized as another StarCity even its not but colony upgrade is unavailable in capital planet and Capital City keeps all the bonuses!

Now the game every time there is a new colony will keep building the InititalColony but that's great because it feels right you build a simple colony first and later you upgrade it.