Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMRoomPack

Package GameMaker rooms and load them as you please · By YellowAfterlife

[SOLVED] Best way to remove a room after done using it

A topic by Double7 created May 29, 2019 Views: 300 Replies: 1
Viewing posts 1 to 2
(2 edits)

So for my game I am wanting to have a bunch of rooms that I can load in and out as I am playing. I have figured out how to get everything loaded in pretty well but I have had issues removing the room after I am done with it. I was trying to use room_pack_store_tiles( ) to save the tiles to a list and then destroy them but that did not seem to work.

I am curious what the easiest way to destroy all of the assets I loaded. 

Also, I am curious what layer the instances that are loaded in are loaded in on. Or if a new one is made.

Edit : So I got it working for instances. It is the tiles that I am stuck on right now

Edit #2: I FIGURED IT OUT!

So I assumed that it would save each tile as an index but it saves all of the tiles loaded as a tileset. So you can use tilemap_clear(list, 0) to get rid of all of the tiles that you loaded in last.

Developer

For proper unloading, you may want layer_tilemap_destroy rather than tilemap_clear, but the rest is correct. For all output arguments the target elements will be added to the specified list.