1
Technical forum / Re: WME resets door state
« on: June 28, 2009, 01:35:55 PM »
I solved it - - Jippiiiiiiiii
in my scene_init script I wrote:
And then when opening or closing the door, I changed the StateFionas_Zimmer value to true or false and now it works.
It's a bit different from what HelLRaiseR posted, but the idea is the same, thanks alot...
in my scene_init script I wrote:
Code: [Select]
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
actor.SkipTo(461, 566);
actor.Direction = DI_DOWNRIGHT;
actor.Active = true;
////////////////////////////////////////////////////////////////////////////////
// scene state
global StateFionas_Zimmer;
// default values
if(StateFionas_Zimmer==null)
{
StateFionas_Zimmer.Visited = false;
// add scene states here
StateFionas_Zimmer.dooropen = false;
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
if(StateFionas_Zimmer.dooropen) // If the door is opened
{
var doorclosed = Scene.GetNode ("fiona_door_closed");
var dooropen = Scene.GetNode ("fiona_door_open");
var flur = Scene.GetNode ("fiona_flur");
doorclosed.Active = false;
dooropen.Active = true;
flur.Active = true;
}
else // If the door is closed
{
doorclosed.Active = true;
dooropen.Active = false;
flur.Active = false;
}
////////////////////////////////////////////////////////////////////////////////
if(!StateFionas_Zimmer.Visited)
{
StateFionas_Zimmer.Visited = true;
// this is our first visit in this scene...
}
And then when opening or closing the door, I changed the StateFionas_Zimmer value to true or false and now it works.
It's a bit different from what HelLRaiseR posted, but the idea is the same, thanks alot...