You would need to use your own scene variable, similarly to "Visited". I will use the default scene_init.script as a template to
////////////////////////////////////////////////////////////////////////////////
// scene state
global StateScene1;
// default values
if(StateScene1==null)
{
StateScene1.Visited = false;
StateScene1.BoulderFell = false;
// add scene states here
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
if(StateScene1.BoulderFell)
{
//set sprite frame to last
}
////////////////////////////////////////////////////////////////////////////////
if(!StateScene1.Visited)
{
StateScene1.Visited = true;
// this is our first visit in this scene...
}
So you have a global variable
StateScene1 which will contain the variables that describe the scene state. When you first visit the scene the variable is null, therefore the initialization code inside the first "if" is executed. Then, when the boulder falls, you must assign true to
StateScene1.BoulderFell.
This way, next time you visit the scene, the variable will still be true, therefore the code of the second "if" will be executed, setting the sprite to the last frame.
There are other ways to achieve what you want (which I have tried and made my life complicated
) but I believe the way I described above is the best to handle the scene state.