Skip to content

Configuration ​

Overview ​

This page covers GMRoomLoader's configuration macros, found in the RoomLoaderConfig script. Adjusting these lets you customize loading behavior, debug output, default parameters, and more.

The defaults work well for most projects, so you only need to change them when you have a specific need.

UPDATING

If you've customized any of these configs and are updating to a new version of GMRoomLoader, make sure to back them up first. See the Updating FAQ entry for instructions.

General ​

ROOMLOADER_ENABLE_DEBUG ​

Default: true.

Whether to show debug messages in Output (true) or not (false).


ROOMLOADER_DEFAULT_XORIGIN ​

Default: 0.

Default X origin used in Loading and Screenshotting. Origins range from 0 to 1: 0 is left, 0.5 is center, 1 is right.


ROOMLOADER_DEFAULT_YORIGIN ​

Default: 0.

Default Y origin used in Loading and Screenshotting. Origins range from 0 to 1: 0 is top, 0.5 is center, 1 is bottom.


ROOMLOADER_DEFAULT_FLAGS ​

Default: ROOMLOADER_FLAG_ALL.

Default flags used for Asset Type Filtering in Loading and Screenshotting.


ROOMLOADER_MERGE_LAYERS ​

Default: false.

When loading rooms using RoomLoader.Load(), whether to merge loaded layers with existing layers (true) or keep them separate (false).

  • If true: merge into existing layers with the same name. If no matching layer exists, a new one will be created.
  • If false: a new layer is always created, even if a layer with the same name already exists.

PAYLOAD TRACKING

Layers reused for merging are not tracked by Payload and will not be destroyed during .Cleanup().


ROOMLOADER_MERGE_TILEMAPS ​

Default: false.

Whether loaded tilemaps should be merged into existing tilemaps (true) or not (false).

  • This triggers if an existing tilemap is present on a layer with the same name as the loaded layer.
  • The existing tilemap will be repositioned and resized to fit the loaded tilemap.
  • When loading full rooms via RoomLoader.Load(), ROOMLOADER_MERGE_LAYERS must be set to true for this to work.
  • Merging is only possible if both tilemaps use the same tileset.

ROOMLOADER_DELIVER_PAYLOAD ​

Default: true.

  • If true, RoomLoader.Load() returns an instance of Payload containing the IDs of all loaded layers and their elements.
  • If false, no IDs are collected or returned, improving loading performance.

TIP

Set this to false if you don't need to manually clean up loaded contents. For example, when room switching automatically destroys all instances, layers and assets, or if cleanup is generally irrelevant.


ROOMLOADER_LOAD_EMPTY_LAYERS ​

Default: false.

Whether to create empty layers when loading (true) or skip them (false).

Elements ​

ROOMLOADER_PARTICLES_UPDATE_STEPS ​

Default: 0.

How many steps to pre-update particle systems on load so they don't appear freshly created.

WARNING

Higher values increase load time.

Debug View ​

ROOMLOADER_DEBUG_VIEW_ENABLED ​

Default: false.

Controls whether the Debug View is enabled (true) or disabled (false).

ROOMLOADER_DEBUG_VIEW_START_VISIBLE ​

Default: false.

Determines if the Debug View window is open (true) or closed (false) on game start.

ROOMLOADER_DEBUG_VIEW_LOAD_KEY ​

Default: vk_f1.

The keyboard key that triggers room loading via the Debug View.

ROOMLOADER_DEBUG_VIEW_ROOMS ​

Default: undefined.

Specifies which rooms can be loaded through the Debug View. Expects an Array of Asset.GMRoom. If left undefined, all rooms in the project will be available.

js
// All rooms in the project
#macro ROOMLOADER_DEBUG_VIEW_ROOMS undefined

// A few hardcoded rooms
#macro ROOMLOADER_DEBUG_VIEW_ROOMS [rmChunkA, rmChunkB, rmChunkC]

// All rooms with the Chunk tag assigned
#macro ROOMLOADER_DEBUG_VIEW_ROOMS tag_get_asset_ids("Chunk", asset_room)

ROOMLOADER_DEBUG_VIEW_GET_X ​

Default: undefined.

When using the Getters Position Mode, this callback returns the X coordinate where the room should be loaded. If left undefined, the X position defaults to 0.

ROOMLOADER_DEBUG_VIEW_GET_Y ​

Default: undefined.

When using the Getters Position Mode, this callback returns the Y coordinate where the room should be loaded. If left undefined, the Y position defaults to 0.