What event is trigger on air unit rebasing?

ww2commander

Emperor
Joined
Aug 23, 2003
Messages
1,243
Location
Australia
Continuing my trend of asking questions too difficult to answer.....

Does anyone know what event to use to detect if an air unit is trying to rebase to another city. This would likely be when the rebase button is selected but before a move is done.

I want to prevent movement if certain conditions such as airbase being present are not met.

Any help appreciated.
 
I don't see any easy way to do that.

For the human player I suppose you can add another check when CanRebaseAt() is called in InGame.lua, but for the AI... Except if you're ready to completely rewrite the AI for air units. (which IMO would be the simplest AI to rewrite in Lua, but still be a lot of work)
 
Thanks Gedemon

Will check it out and see what I can come up with.
 
Actually, you might want to check SerialEventUnitCreated; at one time I think it triggered on rebase commands. I know it still triggers on embark/disembark events, and I think on unit upgrades, as well as the actual creation event the name implies, so they clearly haven't fixed it entirely.

Obviously, you'd have to find some other way to rule out those other possible triggers; an air unit can't embark or disembark, but if upgrades still trigger it then you'd need to log that somehow.
 
Cheers Spatz.....another one to add to my list.

I wont be using embark options in my scenario as none was done on a major scale. Hopefully this simplifies things with this event.
 
Back
Top Bottom