Yet another Roman Scenario

AI unit behavior is devilishly difficult to manage and AFAIK we can only change one setting that affects this. I haven't had much luck with it myself, I could add...

But there might be something I'm missing? :confused:

Yes possibly, I've no problem with Hannibal deciding to attack france, I understand that is not controlable. Its just the rest of the army disappeared.

I now realise it was because the quite large army was garrisoning milan when I killed hanibal. Hence western Europe flipped to me and these units disappeared.

Presumably If you really wanted you could kinda recreate hanibals march by repeatedly spawning and killing the same units ?
 
This discussion actually prompted me to look into what can be done with units in the CivIV Python API. And I noticed the method CyUnit.getGroup() which supposedly return a CySelectionGroup instance. This might not mean much to you guys, but I believe this has to do with how the AI groups units together - you can actually see some of these settings for individual units if you enable cheat mode. (Which you of course should if your modding or making a scenario.)

Anyway, looking at the API entry for CySelectionGroup there is a method called pushMoveToMission(iX,iY)... What this probably means is that it is in fact possible to make a grouped stack of AI units move to a target tile. This would be very useful! :goodjob:

But first I have to figure out if and how I can make, say, all units spawned with the same units() method - or all units spawned within the same Trigger - to group together. Because then it would probably be as easy to include a move() method to PyScenario. :goodjob:

One part of the solution might be to first figure out how to define a unit that is leading the group.

edit: No suck luck. :( I managed to give a unit go-to orders on spawn but the AI immediately revoked the order.
 
Presumably If you really wanted you could kinda recreate hanibals march by repeatedly spawning and killing the same units ?
There is actually a way to have a unit relocate without having to kill-recreate. :p

To utilize this to force-move a unit, all moves and action for the unit would have to be cancelled (as it would have been spent on the moving). Repeat one tile at the time until the target tile is reached. Actually, I believe it is possible to have the unit animation show the actual move (over any number of tiles in one single relocation :eek:).

So, a move() method for PyScenario would then first create a path from the spawn tile to the target tile, and have the unit relocate along this path every turn. But I doubt it would be very helpful in practice. (The Trigger would also have to fire every turn and the current location along the path be stored between turns.) But there would have to be some condition for stopping the move, like when the path is blocked or enemy units appear.
 
I now realise it was because the quite large army was garrisoning milan when I killed hanibal. Hence western Europe flipped to me and these units disappeared.
Yeah, enemy units will be deleted on flip. Maybe LuKo could engineer it so that the actual flip happens on a set date - with the condition that Hannibal died during the war? This would also mean that Hannibal needs to be killed before this date.
 
Top Bottom