Hi, I write my custom Game.ChangeScene method:
The method works ok but the script stands in memory and never disappear.
In debug console I can see that it gets through to the end, but every time I change scene a new changeScene item is added in memory.
This doesen't happen when I replance the las line of my method "Game.ChangeScene(Scene_name, false, false);" to "Game.ChangeScene(Scene_name);". But I need to change Scene without fade.

Code: [Select]
method ChangeScene(Scene_name,fadeout,fadein)
{
global altermenuopciones;
if(Game.ChangingScene)
return;
if(Scene.Name!="negro" && Scene.Description!="intro")
{
if(altermenuopciones==null)
{
altermenuopciones=menu_opciones;
}
else
{
return;
}
}
if(fadeout==null) fadeout=true;
menu_opciones = true;
global selected_item;
Game.SelectedItem = null;
selected_item = null;
if(fadeout==true)
{
Game.FadeOut(250,0,0,0,255);
}
FondoScup(true);
Game.ChangeScene(Scene_name, false, false);
}
The method works ok but the script stands in memory and never disappear.
In debug console I can see that it gets through to the end, but every time I change scene a new changeScene item is added in memory.
This doesen't happen when I replance the las line of my method "Game.ChangeScene(Scene_name, false, false);" to "Game.ChangeScene(Scene_name);". But I need to change Scene without fade.






Logged
