GameMaker: Studio

GameMaker: Studio

View Stats:
How do you transition rooms?
How do you move rooms in a rpg game. I have no idea.
< >
Showing 1-9 of 9 comments
MrDave Jan 17, 2018 @ 2:19am 
room_goto(ROOMNAME)

Just replace ROOMNAME with what you called your room.
Sappy Secretary Jan 17, 2018 @ 2:22am 
Originally posted by MrDave:
room_goto(ROOMNAME)

Just replace ROOMNAME with what you called your room.
Yes but i want to tranistion when the player goes to a certain spot
MrDave Jan 17, 2018 @ 3:04am 
The easiest way to do this is just to make a new object and inside it have a collision event with the player, every time the player touches this it runs the code to take them to the room you pick.
Sappy Secretary Jan 17, 2018 @ 3:10am 
Originally posted by MrDave:
The easiest way to do this is just to make a new object and inside it have a collision event with the player, every time the player touches this it runs the code to take them to the room you pick.
THANK YOU!!!!!
barbarbar338 Jan 17, 2018 @ 9:05pm 
Enable use of view if you want to follow the character and choose following object for your player object
Sappy Secretary Jan 19, 2018 @ 9:33pm 
Originally posted by MrDave:
The easiest way to do this is just to make a new object and inside it have a collision event with the player, every time the player touches this it runs the code to take them to the room you pick.
Umm why i did and this messege came up

############################################################################################
FATAL ERROR in
action number 1
of Step Eventobj_player
for object obj_door:

Variable obj_door.room_hallway(100003, -2147483648) not set before reading it.
at gml_Object_obj_door_CollisionEvent_2_1 (line 2) - room_goto(room_hallway)
############################################################################################
Zappy Jan 20, 2018 @ 12:02am 
Originally posted by DANNNNN:
Variable obj_door.room_hallway(100003, -2147483648) not set before reading it.
at gml_Object_obj_door_CollisionEvent_2_1 (line 2) - room_goto(room_hallway)
This implies that you don't actually have a room named specifically "room_hallway". Double-check the rooms your game has and their names. (Feel free to rename them if appropriate.)
Metakettu :^) Jan 21, 2018 @ 2:54am 
Just wondering is it possible to use something;
If player i in room 1
and then the colliding code
Go to room 2.

Then this code for every room so I dont need to create separate doors. So if Im in room 1 it only goes to room 2 and from room 2 it goes to room 3. And if i want my character go back to room 2 or 1 i can create same code but for differend code right? Hope u undertood the idea im sayin
Zappy Jan 21, 2018 @ 11:19am 
Originally posted by Zo4N:
Just wondering is it possible to use something; If player i in room 1 and then the colliding code Go to room 2.
Then this code for every room so I dont need to create separate doors. So if Im in room 1 it only goes to room 2 and from room 2 it goes to room 3. And if i want my character go back to room 2 or 1 i can create same code but for differend code right? Hope u undertood the idea im sayin
You can check the current room with room, the next room with room_next(room), and the previous room with room_previous(room). This means you could use room_goto(room_next(room)) to go to the next room (though you could also use room_goto_next() for the same effect), but you should always make sure that room_next(room) is not -1 before trying to go to the next room.


Alternatively, you could add roomtogoto = -1 to the object's Create event, then have it do something like if roomtogoto != -1 { room_goto(roomtogoto) } for the room-changing code, and then right-click the object in the room editor, choose "Creation Code...", and type roomtogoto = room_forest if you want that specific instance of that object to make you go to the forest room. ("Creation code" can be set individually for different instances of the same object, even in the same room, and is run after the object's normal Create event.)

(Or in other words, you could make it store a variable for which room to go to, then set that variable on a per-instance basis.)
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Jan 16, 2018 @ 9:12pm
Posts: 9