I don't usually fear Yoyo changing internal structure that drastically, especially when it's been that way for so many years now. lol Although I do admit the method I first posted has some drawbacks compared to the method in my other post (fear factors aside).
Dumping the rooms into a ds_list or array (like Tsuriko did) is actually quite flexible at the cost of somewhat duplicated data. First off, it lets you randomize the layout of the rooms. If you base room layout on the resource tree, you can't randomize room order -- the order of the rooms is the order they appear in the resource tree. Another advantage is world wrapping. You take the list/array index of whatever room you're in (again, pointing back to Tsuriko's post) and add or subtract to it, then get the modulo of that index by the number of rooms in the list.
Code:
room_index = (room_index + 1) mod ds_list_size(rooms_map);
Using the resource tree, if you try to go to a room that is less than 0 or higher than the number of rooms you have, you'll crash the game, so you'd need to verify that the player doesn't try to warp beyond the limits of the room. Using the list/array method, you can easily find the first or last room, or wrap around. While you
can have world wrapping using just the resource tree, this prevents you from having any miscellaneous rooms, like a main menu, options menu, or whatever else. With the list/array, only the game levels would be included.
With a 2D array or ds_grid, you can easily make sprawling world maps. Adding or subtracting the first index moves the player left or right on the world, while adding or subtracting the second index moves the player up or down on the world.
Update: What about
Code:
repeat 10 room_goto_next()
?