• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Copying Layer data from another room

V

VengefulSpoon77

Guest
I'm trying to copy the tiles and assets from one room to another, for a roguelike dungeon. I need to be able to copy from a variety of rooms, and the layer commands are very confusing to me. Thanks!
 
V

VengefulSpoon77

Guest
You would want to use layer_set_target_room and layer_reset_target_room afterwards.

This way you can access everything except for instance data - for that you would want to briefly visit the room on game start or pre-generate that data (I made an extension for that https://forum.yoyogames.com/index.php?threads/gmroompack-load-rooms-into-other-rooms.54995/)
Thanks. I've used this, but now more specifically I need to get the sprite from an asset within an asset layer. Everything else would work fine if I could.

EDIT: I've now checked out your itch.io page, your stuff looks great.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Thanks. I've used this, but now more specifically I need to get the sprite from an asset within an asset layer. Everything else would work fine if I could.
You would want layer_get_all_elements and then pick through them with layer_sprite_ functions.
 
Top