Force city to work no tiles

3335d

CCtP Player
Joined
Jun 15, 2012
Messages
642
I was wondering if it is possible to force a city to work no tiles surrounding it. I wanted to create a tile-yield importation system that varies with policies, technologies, and the like, so it would obviously make no sense to work tiles and give double benefits. Any help is appreciated.
 
Need to modify CvCityCitizens::IsCanWork in the DLL. This however may break workers and work boats for the AI.
 
Game.SelectedCitiesGameNetMessage(GameMessageTypes.GAMEMESSAGE_DO_TASK, TaskTypes.TASK_NO_AUTO_ASSIGN_SPECIALISTS, -1, -1, true);

You can use that to set it to force manual specialist control. The issue is the AI also use this system. In CvCityCitizens::DoTurn() the AI can unset it and then call DoReallocateCitizens() (and DoSpecialists()) to figure out who should be working where. So you still don't get away from doing a DLL modification.

The AI reassign citizens right before growth, production, etc so I don't think it's possible to overwrite it's choices in lua between assigning and stuff happening as a result of it.
 
Thanks, I'm working on it. Right now, I am trying to get the yield-importation mechanic itself off the ground, but haven't found a function which allows one to compensate for the existence of routes. Is there a way to do this in Lua, or would it be virtually impossible to do it that way? I see no Plot:GetRoute( cityID ) function in the Lua reference.
 
Back
Top Bottom