Gaius Octavius
Deity
- Joined
- Jul 28, 2006
- Messages
- 4,016
I would like to change the unit AI code (CvUnitAI.cpp) to instruct a civ to move a unit to friendly terrain if that unit has a certain promotion.
Specifically, I have modded Grey Fox's fuel modcomp to give mechanized units a "low fuel" promotion when they run low on fuel (no surprise there), and I have changed the refueling mechanism to take place within friendly borders. So what I now need to do is teach the AI to move its low-fuel units back to the nearest open-borders, vassal, or friendly territory in order for them to be properly refueled. The nearest friendly/open borders city will also do the trick.
Can anyone offer me some advice on how to get started?
Specifically, I have modded Grey Fox's fuel modcomp to give mechanized units a "low fuel" promotion when they run low on fuel (no surprise there), and I have changed the refueling mechanism to take place within friendly borders. So what I now need to do is teach the AI to move its low-fuel units back to the nearest open-borders, vassal, or friendly territory in order for them to be properly refueled. The nearest friendly/open borders city will also do the trick.
Can anyone offer me some advice on how to get started?