Global Event After Room Loaded?

Started by SilverSpook, Wed 11/11/2015 10:17:36

Previous topic - Next topic

SilverSpook

Hi, I'm trying to have a certain animation play after a player leaves a room into a new room.  The thing is, it's not certain what the new room will be, so the animation cannot be put into the "room load" script.  Is there a way to have a certain animation play after the next room is loaded no matter what the new room is? 

Thanks.

Khris

In GlobalScript.asc:
Code: ags
// above repeatedly_execute
bool event_x_has_happened = false;

// inside repeatedly_execute
  if (!event_x_has_happened && player.PreviousRoom == 7) {
    // stuff happens
    event_x_has_happened = true;
  }


The repeatedly_execute() function starts running immediately after a room has faded in (and other blocking functions have ended, like the room's after fadein).
This block (lines 6 & 7) will only run once though, since we're setting the bool to true and the condition will no longer be fulfilled afterwards.
You can of course rename event_x_has_happened to your liking.

SMF spam blocked by CleanTalk