How to pause game for a popup?

jdog5000

Revolutionary
Joined
Nov 25, 2003
Messages
2,601
Location
California
Here's what I'm trying to do:

Currently in my Revolution mod, popups offering players choices in how to handle a rebellious city are launched at the beginning of a players turn. Depending on the situation and player's response, rebel units may spawn. Currently, since this all happens at the beginning of the turn, the motherland gets the first strike ... the rebels spawn and you get to attack them first. I'd like to change this so that it all happens at the end of the player's turn, that way the rebels get the first strike.

The trouble is, when I launch a popup at the end of the players turn, the game doesn't wait for the players response before continuing on ... the AIs take their turns and by the time the player has read the popup and responded it's the beginning of their turn again and then things play out just as if the popup had happened at the beginning of the turn.

Any ideas for how to force the game to wait for the popup to be handled?
 
jdog5000 said:
Here's what I'm trying to do:

Currently in my Revolution mod, popups offering players choices in how to handle a rebellious city are launched at the beginning of a players turn. Depending on the situation and player's response, rebel units may spawn. Currently, since this all happens at the beginning of the turn, the motherland gets the first strike ... the rebels spawn and you get to attack them first. I'd like to change this so that it all happens at the end of the player's turn, that way the rebels get the first strike.

The trouble is, when I launch a popup at the end of the players turn, the game doesn't wait for the players response before continuing on ... the AIs take their turns and by the time the player has read the popup and responded it's the beginning of their turn again and then things play out just as if the popup had happened at the beginning of the turn.

Any ideas for how to force the game to wait for the popup to be handled?

Perhaps as an alternate solution you can spawn the rebels but then set them all to have already moved? nm, I misread your post :blush:

Perhaps you can save what affect is going to happen from the popup and then at the start of the next player's turn do the affects?
 
Gerikes said:
Perhaps as an alternate solution you can spawn the rebels but then set them all to have already moved? nm, I misread your post :blush:

Perhaps you can save what affect is going to happen from the popup and then at the start of the next player's turn do the affects?
Yeah, I thought about that ... one problem would be if you saved and quit in the middle of the turn, so I'd have to save all the data and reload it ...

Another idea I had was exposing the CvPlayer.doTurn function to Python ... definitely a hack, but then I could have the rebels move their units first in a special first turn that interupts your turn. Both of these have the added benefit of keeping all popups at the beginning of the players turn ... consistency is good. But I'd still like to be able to force the game to process a popup before going forward ...
 
Back
Top Bottom