GameMaker runs creation code when a room starts: each instance's after its Create event, then the room's.
- Room: Add Creation Code in the room's inspector (or Room > Room Settings > Add Room Creation Code) makes
RoomCreationCode.gmlnext to the room, points the room at it and opens it. When the room has creation code, Room Creation Code opens it. - Instance: select an instance; Add Creation Code in its inspector (also in Room > Room Settings and the instance's right-click menu) makes
InstanceCreationCode_<name>.gmlnext to the room and opens it. - Each is one undo step: undoing it takes the setting back and moves the new file to the Trash.
Related topics
Keys are shown as on the Mac: ⌘ Command, ⌥ Option, ⌃ Control, ⇧ Shift. Studio for Windows shows its own keys beside each menu item.