I'm trying to find out the nearest city to a unit and then have that unit go there, as if you selected the unit and then gave it the Goto command to go there.
It's easy to get a list of your cities and details on the unit you have selected but I can't figure out how to both:
1. Determine how many turns it would take for a unit to get to a specific plot
and
2. Give the unit a Goto command to go there
CyUnit has a canMoveInto function was was nice but doesn't tell me anything about how many turns it would take
and CyPlot has a movementCost function which asks for a a CyUnit and the CyPlot it would be coming from but that gave me the same number for every city- 30.
Any ideas?
edit: Oh yeah and CySelectionGroup had an interesting function:
VOID pushMission(MissionType eMission, INT iData1, INT iData2, INT iFlags, BOOL bAppend, BOOL bManual, MissionAIType eMissionAI, CyPlot pMissionAIPlot, CyUnit pMissionAIUnit)
And MOVE_TO is a MissionType, but I have no idea what the following parameters mean:
iData1
iData2
iFlags
bManual
pMissionAIUnit
I'm assuming if I did a MOVE_TO mission the pMissionAIPlot is the destination, append just means whether it should be added to a qeueue of mission (?)
It's easy to get a list of your cities and details on the unit you have selected but I can't figure out how to both:
1. Determine how many turns it would take for a unit to get to a specific plot
and
2. Give the unit a Goto command to go there
CyUnit has a canMoveInto function was was nice but doesn't tell me anything about how many turns it would take
and CyPlot has a movementCost function which asks for a a CyUnit and the CyPlot it would be coming from but that gave me the same number for every city- 30.
Any ideas?
edit: Oh yeah and CySelectionGroup had an interesting function:
VOID pushMission(MissionType eMission, INT iData1, INT iData2, INT iFlags, BOOL bAppend, BOOL bManual, MissionAIType eMissionAI, CyPlot pMissionAIPlot, CyUnit pMissionAIUnit)
And MOVE_TO is a MissionType, but I have no idea what the following parameters mean:
iData1
iData2
iFlags
bManual
pMissionAIUnit
I'm assuming if I did a MOVE_TO mission the pMissionAIPlot is the destination, append just means whether it should be added to a qeueue of mission (?)
Comment