Hey,
I'm having some issues with the way variables are created in WME.
In one of my scenes, I have an actor called FleetSalesman (the variable name). When I leave the scene, and go to a different scene, the actor is still there. Same position, different room.
I have loaded the actor as a var (not global), and I'm unloading the object in the SceneShutdown method.
So why doesn't it go away?
Code:
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
actor.SkipTo(400, 400);
actor.Direction = DI_DOWN;
actor.Active = true;
var FleetSalesman = Game.LoadActor("actors\Fleet_Salesman\Fleet_Salesman.actor");
FleetSalesman.SkipTo(690, 449);
FleetSalesman.Direction = DI_LEFT;
FleetSalesman.Active = true;
////////////////////////////////////////////////////////////////////////////////
// scene state
global StateEXT_Portagul_TheBeach_Night;
// default values
if(StateEXT_Portagul_TheBeach_Night==null)
{
StateEXT_Portagul_TheBeach_Night.Visited = false;
// add scene states here
}
////////////////////////////////////////////////////////////////////////////////
// setup scene according to state variables
////////////////////////////////////////////////////////////////////////////////
if(!StateEXT_Portagul_TheBeach_Night.Visited)
{
StateEXT_Portagul_TheBeach_Night.Visited = true;
// this is our first visit in this scene...
}
on "SceneShutdown"
{
Game.UnloadObject("FleetSalesman");
}