- Add the extension to your project. For GMS1, right-click on Extensions in resource tree and pick "Import"; pick GMEZ; For GMS2, drag-and-drop the YYMP onto the workspace area of GMS2 window with your project open in it.
- Add the included files from the extension (prompted during installation). These are not needed at runtime and only serve to convert rooms for use with extension. That said, it is completely safe to unflag all platforms in their Properties or even move them to a non-project directory. On Mac, install Neko VM and omit importing .exe/.ndll files.
- Add a completely empty object, say, obj_blank
and assign it to room_pack_blank_object,
room_pack_blank_object = obj_blank
before you call loading functions (usually, on Game Start)
- On GMS1, double-click GMRoomPack.exe in Included Files On GMS2, right-click GMRoomPack.exe (Windows) or GMRoomPack.n (Mac) and pick "Open externally" If on Mac and you've not set Neko VM to open .n files, pick "Show in Finder" instead and run server from directory.
- At this point you are presented with a console window asking what you would like to do. If you have at least minor experience with CLI, you can check help for arguments, otherwise you can pick options and have it do the work for you. Extra note here - to export to a script/included file, you should add a blank script/file prior to the project for GMRoomPack to modify.
- If you exported room(s) to JSON, you can load them via room_pack_load_file (for files containing single rooms) or room_pack_load_map (for cached data or a sub-map in a file with multiple rooms).
- If you exported room(s) to scripts, the script will return a new map for the room data upon calling it, which (or a sub-map of which) you can then pass to room_pack_load_map and free up later.
Loading a single room:
var json = scr_some(); // generated from rm_some room_pack_load_map(json); // and when you're done: ds_map_destroy(json);
Loading from a pack of rooms:
var json_rooms = scr_rts(); // generated from rooms starting with rt_ // pick a random room name from the map: var name = ds_map_find_first(json_rooms); repeat (irandom_range(0, ds_map_size(json_rooms) - 1)) { name = ds_map_find_next(json_rooms, name); } // and load that: room_pack_load_map(json_rooms[?name]); // and when you're done: ds_map_destroy(json_rooms);
Loading a room at callee's XY:
// ... room_pack_load_map(json, x, y);
Loading only instances and tiles from a room at XY:
/// ... room_pack_load_map(json, x, y, room_pack_flag_instances | room_pack_flag_tiles);