Adding to local city health

omniclast

Prince
Joined
Aug 27, 2014
Messages
478
Hey folks, I'm working on a health rebalance mod. One thing I'd like to do is add specialists that generate +2 health, to create buildings that can scale health output through the game. Only problem: health isn't a yield so the Specialists table has no column for it.

I've added a new column to the Specialists table in SQL, and I know I have to write an Lua script so the DLL can recognize it, but I'm pretty much stumped there. My guess is that there is an integer somewhere that tracks local city health, and I can write a script to add to it when a specialist slot is taken, and subtract when it's removed. But I don't know what these events would be called or what the value I'm modifying is.

Does anyone have a better idea of what an Lua script to add/subtract local city health would look like? Maybe from a similar civ5 happiness script, since I'm assuming the implementation is pretty much the same in BE?
 
A quick "find in files" search with Notepad++ brings up this on line 717 of CityBannerManager.lua
Code:
local localHealth = city:GetLocalHealth();
Which looks like a good place to start.

Based on naming conventions, it'd be worth trying city:SetLocalHealth(newValue) or city:ChangeLocalHealth(amountToAdd).
 
Great, will try that, thanks!

Any idea what the event triggers might be for assigning/unassigning specialists, based on the conventions?

I will try agent ransacking the game files for this as well.
 
There isn't an event that fires when a specialist is assigned/removed. The closest you could get is to poll (aka check) each turn and add/remove a building that provides the Health.
 
Ok, but I could check whether a specialist was assigned to a specific slot in a city each turn? Would there be a Boolean with a city, building and specialist ID for that?
 
Top Bottom