Siesta Guru
Prince
Thanks, I had done similer tests with GameEvents.PlayerTurnStarted and PlayerTurnActivated (and failed to get consistent results) but did not try with GameEvents.PlayerTurnStartComplete !
what if you remove the unit's moves left on PlayerTurnStartComplete (to prevent the AI from using it), then try to restore the move and use the UI code later during the AI turn ? (maybe tricky to get an event firing at the correct time)
So I did a bunch of testing on this, because it sounds like it could work, but no luck so far.
Stopping the AI from doing any thing with the units works, but then I've been unable to find a way to get the RequestOperation to work
Every turn these four events get processed in this order: PlayerTurnStarted, PlayerTurnStartComplete, PlayerTurnActivated, PlayerTurnDeactivated
Additionally, the events RemotePlayerTurnBegin and RemotePlayerTurnEnd seem to get called every turn. But their ordering is independent of the order of the other 4
Move points get restored between PlayerTurnStarted and PlayerTurnStartComplete.
The AI seems to do its thing between PlayerTurnStartComplete and PlayerTurnActivated.
The AI could indeed be prevented from acting by setting the unit moves to 0 in PlayerTurnStartComplete
But then regardless of what other Event I tried to put the move restore and operation request in, I couldn't get anything to work.
CanStartOperation always returns true in PlayerTurnStarted and PlayerTurnStartComplete and always returns false in PlayerTurnActivated and PlayerTurnDeactivated, regardless of how I placed the restores
Strangely enough, by immediately checking a units moves after calling the replenish I can confirm the replenish works, however, when back in the UI context method, the amount of moves is back to 0. This happens regardless of whether I check instantly or wait until the next event.
I'm not sure whether the problem is that it's just fundamentally impossible, or that the events are not timed well enough, or whether the move replenish is not working as intended.