Using SetRestartPoint() in a cut-scene

Started by fluxmaster, Thu 14/02/2008 05:03:20

Previous topic - Next topic

fluxmaster

I am trying to use SetRestartPoint() to set the point that the game will go to when F9 is pressed.  If I put the function in my room script the game hangs up when the player presses F9.  In a previous thread, a user suggested executing the function at the first idle moment after the room is entered.  I have tried this, but there is one problem:  The room where I want to execute this function has no idle time--it is a cut scene that automatically loads the next room.  So pressing F9 restarts the game in the next room, not the cut scene where I want it to start.  Is there a way around this?

I am using version 2.72.  Does this function work better in the latest version?  I don't want to convert my game right now, although I may later.  Is there a way to get this to work in the version that I am using?
The Fluxmaster

Khris

Try this: In after fadein, instead of starting the cutscene, call SetRestartPoint(), then set a timer to expire after 5 loops or some other low number.
Then use the usual timer code in the room's rep_ex:
Code: ags
function my_cutscene() {

  // cutscene code here

}

// room's rep_ex
  if (IsTimerExpired(X)) my_cutscene();


I've never used SetRestartPoint(), but it might work this way.

Pumaman

Yes, something like that would do the trick. At any point in your cutscene, you can allow it to save by breaking out of a chain of blocking animations with a timer or something to give a couple of game loops where no script is running to allow the save to take place.

fluxmaster

The Fluxmaster

SMF spam blocked by CleanTalk