Air capacity bug

kszyhoo

Chieftain
Joined
Sep 2, 2003
Messages
31
Location
Gniezno, Poland
There is something wrong with cities' air capacity. I could build air units when i built airport, but it's no longer possible after building military base.
 
Thank you kszyhoo, I believe you may have spotted the error.

In our code we have changed the Military Base thus:

Code:
<Update>
	<Where BuildingClass="BUILDINGCLASS_MILITARY_BASE" />
	<Set ExtraCityHitPoints="250"
		 AirModifier="-25"
		 NukeModifier="-50"
		 />
</Update>

The tag AirModifier 'MAY' have been changed in the latest patch to mean something different to what is expected, or we simply made an error.

As this is the only building other than the Airport to use this tag, most likely it is the culprit.
The Airport uses it as a straight numerical value of units available to be stored, "4".
Changing this value, or perhaps even better, removing it from the Military Base should fix it.

For those of you editing on your own it is in the CEC_Other.xml file line 75.

EDIT:
It doesn't appear to fix the saved game. New games work fine now, any city with or without Military Bases can have multiple planes.
 
It looks like AirModifier was an unused modifier in G&Ks and GEM had added it to the military base.
 
Seems to be a lot of "unused" stuff floating around in the Firaxis code. Tables, modifiers, who knows what?

I saw this the other day while browsing some of the code in the SDK.
//antonjs: consider: this check wasn't here before, maybe we shouldn't have it in case mods, scenarios use luxuries in a unique malus way
//CvAssertMsg(m_iExtraHappinessPerLuxury + iChange >= 0, "Net extra happiness per luxury not expected to be negative!");
// slewis - Hey Anton, I removed this because it was complaining during my awesome Fall of Rome scenario.

Looks like the developers aren't sure what they are supposed to be doing and add or remove things as they like.
 
It doesn't appear to fix the saved game. New games work fine now, any city with or without Military Bases can have multiple planes.

To be precise: It partially work with saved games. If you are in earlier era and there are no military bases in cities, you'll be fine as it looks like that CEC_Other.xml changes are applied when military base is built. But if you have it already built, then nothing changes. I've tried to fix my game, but so far all workarounds failed:
- setting airmodifier for airport to 1000+ didn't change anything in cities with MB (despite it affects other cities)
- giving MB goldmaintance=1 then demolishing also don't work (still not allowed to build air units after demolishing).
So, anyone with any other ideas how to fix savegame would be appreciated.
 
I'm 99% certain the reason this fix will not work with saved games is because the 'AirModifier' variable changes the CITY not just the base in the city.

What this effectively means is even after the base is destroyed or sold or otherwise removed, the affect is still in place.
Which is bad design, the effect should go if the base is removed.

There probably is a lua hack that could be done via the lua console, but I am not sure what that might be. Something that changes the getAirModifier() value.

Unfortunately, it looks like we will just have to carry on with these bad saves or start afresh.

Makes me wonder if the Airport is removed will the city still get the extra 4 units but not have the gold maintenance anymore!
 
i'm having that problem to, where do i find that archive to modify ? and sorry if my english is bad, i'm not used to write in this language, and if i get a reply, thanks for attention
 
Top Bottom