How do I choose the starting room?

Y

yuna3849

Guest
I made several rooms.
How can I change starting room(default room)?
 

Jason C.

Member
The starting room is traditionally whatever room is at the top of your room resource list in the GameMaker window. You can also use functions like room_goto to change what room is played first, if you want it to be dynamic for whatever reason.
This is a most unhelpful answer. I see no place in GMS2 where I can VIEW or CHANGE a room index value nor anywhere in any of the settings choices where to set which room is my startup room in the GMS2 editor. In UNITY of course you tell the program which Scene to start with. The problem comes from renaming rooms or moving rooms around into Groups, etc.., how to tell which is the "default" or "startup" room, how to change it? Right now it appears to be 100% guess work, which sucks.
 

Evanski

Raccoon Lord
Forum Staff
Moderator
This is a most unhelpful answer.
How?

I see no place in GMS2 where I can VIEW or CHANGE a room index value nor anywhere in any of the settings choices where to set which room is my startup room in the GMS2 editor.
There isnt one.

In UNITY of course you tell the program which Scene to start with.
Thats neat. This is Game Maker Studio V2

The problem comes from renaming rooms or moving rooms around into Groups, etc.., how to tell which is the "default" or "startup" room, how to change it?
The starting room is traditionally whatever room is at the top of your room resource list in the GameMaker window.

Right now it appears to be 100% guess work, which sucks.
Its not really, its the room in your room list thats at the top because resources are ID indexed, so what ever is at the top is room_0
 

TheouAegis

Member
Regardless of groups and whatnot, the very first room in the resource tree is room 0 -- not to be confused with Room0 (or room0 or any variation thereof). Even if it's in a group, if that group is at the top of the resource tree and that room is at the top of the rooms in that group, then it's room 0. Room IDs are assigned at compile time, hence the reason you use room constants (the names of the rooms).

Note: The above statements only apply to Studio. In GM Legacy, IDs are assigned upon creation and importation.

The room_goto() bit was kinda wrong, though. I mean, I get what he was saying, but the way he said it was wrong. At the very beginning of the game when it first loads up, the first room is ALWAYS room 0. But you can use room_goto() of course to specify the starting room for continues and game overs, rather than taking the buggy lackluster game_restart() way. But other than that, room_goto() does nothing for specifying where the first room is. lol
 
N

NoFontNL

Guest
The starting room is traditionally whatever room is at the top of your room resource list in the GameMaker window. You can also use functions like room_goto to change what room is played first, if you want it to be dynamic for whatever reason.
This is a most unhelpful answer. I see no place in GMS2 where I can VIEW or CHANGE a room index value nor anywhere in any of the settings choices where to set which room is my startup room in the GMS2 editor. In UNITY of course you tell the program which Scene to start with. The problem comes from renaming rooms or moving rooms around into Groups, etc.., how to tell which is the "default" or "startup" room, how to change it? Right now it appears to be 100% guess work, which sucks.
Just because I wanted to show my response. Jabbers is right. For Jason C. Jabbers didn't say anything about VIEWING or CHANGING room index values.
You could always make a room at the top of the room resource list, for example 'rm_initialize' and put 'room_goto(desiredRoom)' in the creation code.
 

Jabbers

Member
Lmao, I login to see this random topic blowing up two years after I posted in it.

The first room in the room list is still the first room played in GMS2.




In the above image, the following behaviour can be expected:

room_goto(game_room); will take the player to the room named game_room.

room_goto_next(); will take the player to game_room if it is called while in the room main_menu, or it will produce an error if called while in game_room (because there are no more rooms to move into as we have reached the end of our room list).

The index of the rooms is 0 for main_menu and 1 for game_room. The engine variable room will return 0 if you are in main_menu and 1 if you are in game_room, but understand it corresponds to the order the rooms are in the list, so if you put game_room first, then game_room adopts index 0 (because it is as the start of the room list, and 0 is the first item for the computer-- not 1).

If you can help it, just refer to rooms by their name.
 

Dustin

Member
I'm using gamemaker 2.3 and changing the room order doesn't change which one is loaded first. This is determined instead by a "house" icon to the left of the home room. After some clicking around, I figured out that unlike previous versions, you have to change the order in the "Room Manager", not the "Asset Browser".
 
Last edited:
Top