S
Shadowblitz16
Guest
does anybody know how to get around my object being deleted after I change rooms?
when I call the editor_goto_menu it doesn't set the room until after the script is finished instead of changing the room and then creating the objects.
I'm not sure if this gamemaker was programmed to do this intentionally but it should not work this way.
Code:
//Goto Room
room = rm_menu;
//Toolbar
tools_menu = new_item(0, 2, 0, Item_Toolbar_Menu, new_exit(6,6,5,1));
//Menus
menu_tiles = new_item(0, 16, 6, Item_Option_Tileset, new_exit(0,0,6,6));
Code:
/// @description new_item()
/// @param x
/// @param y
/// @param index
/// @param object
/// @param item_exit
var xx = argument[0];
var yy = argument[1];
var index = argument[2];
var object = argument[3];
var item_exit = argument[4];
var inst = instance_create_depth(x+xx, y+yy, -1, object);
inst.index = index;
inst.item_exit = item_exit;
inst.parent = id;
return inst;
Code:
/// @description new_exit()
/// @param up
/// @param down
/// @param left
/// @param right
var up = argument[0];
var down = argument[1];
var left = argument[2];
var right = argument[3];
var data;
data[0] = up;
data[1] = down;
data[2] = left;
data[3] = right;
return data;
I'm not sure if this gamemaker was programmed to do this intentionally but it should not work this way.