Source code version 2: Fixing an issue with deactivation
Got alerted to this in a GMC forum discussion, romms_rooms_handle_deactivation did not work properly and could leave rooms deactivated permanently if you switched layers. There are two separate issues at play here:
- instance_(de)activate_region should be given left/top/width/height arguments and not left/top/right/bottom (a larger region than expected was always activated and it would grow the further right/down you go)
- For some reason instance_activate_layer is buggy and the rooms wouldn't get activated when layer and region functions are mixed with each other like this
The fixed version of the code looks like this, updating the function accordingly will fix this buggy behavior in your project and I've updated the source as well so others won't run into this issue in the future.
Having to resort to activating all rommsrooms and then deactivating them one at a time with a with loop feels a bit stupid and inefficient but it looks like it's the only way right now :/ Performance issues at least shouldn't be a big concern since this function is only ran when you scroll to a different room / change layers. (No clue why the object-layer objects weren't affected and only the rooms-layer ones)
Files
Get Room Object Metroidvania Mapping System
Room Object Metroidvania Mapping System
Basic exploration game toolkit for GameMaker:Studio 2
Leave a comment
Log in with itch.io to leave a comment.