Plot signs / automated workers

karadoc

AI programmer
Joined
Oct 3, 2005
Messages
1,568
Location
Australia
I'd like a mod that allows automated worker actions to be influenced by signs that the player has put on the tile.

For example, if I use alt+s to make a sign that says "f" on a particular tile, then automated workers should only consider putting a farm on that tile.

I've briefly looked at the c++ code for the .dll, and my first impression is that the best way to implement this would be to edit "CvUnitAI::AI_improveBonus", which apparently is meant to search for the best local improvements to build. It can be edited to only consider particular types of improvements.

My main problem now is that I'm having trouble working out where the sign text is actually stored. That is, the text displayed on the plot that can be edited if you press alt+s and then click the plot. .. and maybe there is a better way of doing this anyway.

Any comments and suggestions would be appreciated.

(If you know of a mod like this that already exists, then please tell me! :) )

[edit]
After much searching through the code and through these forums, I think I can conclude that the map signs I was talking about are a part of the engine, and are not accessible using the SDK. Well, 'addSign' is a function that can be called in python to add such a sign to the map, but it isn't so easy to check the sign caption at a particular location. As far as I can tell, to do this you'd have to iterate through every sign on the map, check that the sign is on the right tile and owned by the right player, and only then can you read the caption. I hope that's not the best way to achieve my goal...
 
Top Bottom