Hello again jimm84.
This is a very common functionality in adventure games and this is one use for global variables. First, please refer to our previous discussion
http://forum.dead-code.org/index.php?topic=5382.msg30555#msg30555So, you have two scenes, the one is the current (StateCurrent) and the one you need to change (StateOther). In each
scene_init.script you will have the following:
in current scene's scene_init.scriptin other scene's scene_init.scriptin the script of the other.
This still doesn't help you though, because the current scene script cannot "see" StateOther. This can easily be fixed in two ways. Either you declare the "other" scene variable in your current scene's scene_init.script or you declare both once in your base.inc and this way all the scripts of the game will be able to access it. Below is a solution for the first way, using the script you provided:
on "Stone"
{
global StateOther;
actor.
Talk("That should do it!");
StateOther.StoneFloor = false;
}
an in the other scene's scene_init.script////////////////////////////////////////////////////////////////////////////////
// scene state
global StateOther;
// default values
if(StateOther==null)
{
StateOther.Visited = false;
StateOther.StoneFloor = true;
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
if(StateOther.StoneFloor)
{
}
////////////////////////////////////////////////////////////////////////////////
if(!StateOther.Visited)
{
StateOther.Visited = true;
// this is our first visit in this scene...
}