Moving Cities removes Bonus-Hitpoints

Ryika

Lazy Wannabe Artista
Joined
Aug 30, 2013
Messages
9,395
Like the title says: Moving an aquatic city removes all City Hit Points gained from Buildings and resets them to their original value of 100.

Pretty annoying.
 
Ugh... Really? I've never even noticed; that's very disappointing. It also really destroys a concept I wanted to develop.
 
Yeah, I didn't notice it either, until I made hitpoints the primary city defense, then I wondered why that 800 hp beast went down in one turn and realized it had only 100 hp. ;)

Can be fixed via lua though, by running a script that removes and re-adds all buildings with HP-bonuses attached to them at the beginning of each turn - possibly restricted to cities with full hp only, because the current hp seem to reset to 100 every turn even if the city was below that.

That solution is of course restricted to buildings that don't grant free units/resources etc. after completion.
 
Yeah, I didn't notice it either, until I made hitpoints the primary city defense, then I wondered why that 800 hp beast went down in one turn and realized it had only 100 hp. ;)

Can be fixed via lua though, by running a script that removes and re-adds all buildings with HP-bonuses attached to them at the beginning of each turn - possibly restricted to cities with full hp only, because the current hp seem to reset to 100 every turn even if the city was below that.

That solution is of course restricted to buildings that don't grant free units/resources etc. after completion.

I take it this problem extends to AI cities just the same?

That might explain why the AI crumbles so quickly when on the water, even during the late game.

Fixing this might also give the NSA and Chungsu a fighting chance against Krakens too!...
 
Yes, it effects all cities that are moved no matter by whom. ...which means that the AI is effected the most because it keeps moving their cities around like a kid that can't sit still for a minute.

In the unmodded game with all defensive buildings you end up with I believe around ~200 hp in aquatic cities so that's basically half their defense gone.
 
That is very disappointing. I'm guessing since you didn't mention anything else, the other defensive bonuses remain intact...
 
Yes, combat strength seems to work correctly. Haven't tested for the Torpedo Battery's 20% bonus to city attacks though.
 
No finished code, just a partial fix so I can continue working on my mod:

Code:
function BuildingsMainFunction(iPlayer)
	CurrentTurn = Game:GetGameTurn()

	for iCity in Players[iPlayer]:Cities() do

		if iCity ~= nil then 
	

			if iCity:GetNumBuilding(GameInfoTypes.BUILDING_HEADQUARTERS) > 0 then
				iCity:SetNumRealBuilding(GameInfo.Buildings["BUILDING_HEADQUARTERS"].ID, 0)
				iCity:SetNumRealBuilding(GameInfo.Buildings["BUILDING_HEADQUARTERS"].ID, 1)
			end
			if iCity:GetNumBuilding(GameInfoTypes.BUILDING_ROCKET_BATTERY) > 0 then
				iCity:SetNumRealBuilding(GameInfo.Buildings["BUILDING_ROCKET_BATTERY"].ID, 0)
				iCity:SetNumRealBuilding(GameInfo.Buildings["BUILDING_ROCKET_BATTERY"].ID, 1)
			end
			-- (etc.)
		end
	end
end
GameEvents.PlayerDoTurn.Add(BuildingsMainFunction)

I haven't bothered implementing the HP-check that I've mentioned above yet.
 
Top Bottom