Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Here's what the sample seen in the first screenshot does on room start in a controller object:

var json = scr_rts(); // generated from rooms starting with rt_
room_pack_blank_object = obj_blank;
randomize();
with (obj_room) { // obj_room is placeholder object
    // pick a random room name from the map:
    var name = ds_map_find_first(json);
    repeat (irandom_range(0, ds_map_size(json) - 1)) {
        name = ds_map_find_next(json, name);
    }
    // and load that:
    room_pack_load_map(json[?name], x, y,
        room_pack_flag_instances|room_pack_flag_tiles|room_pack_flag_sprites);
}
ds_map_destroy(json);

Also make sure not to accidentally insert your outer room into itself (you can specify the filter-prefix for this reason)

This definitely solved that issue! Thank you so much, this means more than you know since I've been trying to get a system like this working for many days!

Theres another smaller issue that was created from the code you gave me though. I had this piece of code in my chunks placeholder step event:

//Set 3 random instances as chest sprites
while (global.chest_minimum < 3) {
    inst = instance_find(chunks,irandom(instance_number(chunks)-1));
    if (inst.sprite_index != spr_chunks_chest) {
        inst.sprite_index = spr_chunks_chest;
    }
global.chest_minimum++;
}

It seems that because GMRoomPack activates on room start, it doesn't give the placeholder object time to change its sprite, therefore I'm not able to target specific sprites. I can easily target different sprites and say: 

with(obj_room) {

if sprite_index = chest {

//activate the code you sent me, but for a script containing chest rooms

} //and then and else if statement for a different sprite index, for a script containing normal rooms.

I've tried different variations, but there's either errors or the code just doesn't replace the placeholders. For context, I want rooms like chests and shops which ALWAYS appear on a map (like in Binding of Isaac, or Enter the Gungeon). How would you approach doing this? 

You could only run GMRoomPack once global.chest_minimum is 3, or run that code in Create event before running GMRoomPack - after all, it's a one-time thing.