Map Properties and Layers
Map Properties
Maps have a few custom properties that can be added to them.
A map's properties panel can be accessed from the top ribbon, under "Map" > "Map properties...".
The following are all the custom properties that can be added to a map:
name- The name of the map. (shown on the save file)light- Whether the map is a Light World map (defaults tofalse)music- Name of the music track to play in the map (relative toassets/music)border- Name of the border to display in this map (relative toassets/sprites/borders)
Map Layers
Everything placed into a map has to be placed onto a layer. As well as being for their namesake (layering), Kristal uses layers to differentiate between different types of map data.
This works based on the layer type and layer name, so if a specific layer type and name are present in the map, Kristal will treat the data on it as a specific feature such as paths, markers, or objects.
Layer names are case-sensitive, and they can also include a suffix. This means you can have a layer named something like objects_enemies, and the suffix _enemies will not prevent it from loading as an objects layer, and a layer called Objects will not be treated as objects, because the casing does not match.
List of Map Layers
Generic Tile Layers
- A Tile layer with no specific name will be treated as regular tiles.
battleborder (Tile)
- Only visible when the player is inside a battle area.
-
- (See Battle Areas for more information on battle areas.)
objects (Object)
- Objects layers are used for placing events into a map.
- These can place engine events, any objects registered using
Game:registerEvent(), and any legacy events inscripts/world/events. -
- Either the
ClassorNameproperty of the object must reference the ID of the registered event you want to spawn.
- Either the
objects_party (Object)
- If an objects layer exists with this name, the party will always spawn on it.
-
- If this layer does not exist, the first
objectslayer that exists above themarkerslayer spawns the party instead.
- If this layer does not exist, the first
controllers (Object)
- Controller layers are used for placing controllers into a map.
-
- These are special event-like objects that have no physical presence in the map. They are designed for controlling other events, hence their name.
- User-registered controllers should be stored in the
scripts/world/events/controllersfolder of the project.
collision (Object)
- The shapes on this layer will be used as the collision for each map.
enemycollision (Object)
- The shapes on this layer will be used as collision that only affects enemies (ChaserEnemy).
- Enemies will still be affected by the collision of the standard
collisionlayer, regardless of this layer's presence
markers (Object)
- The shapes on this layer create markers that reference specific points or regions of a map. Each marker must be given a name so it can be referenced later.
- Markers for the current map are stored in
Game.world.map.markers, or can be gathered withGame.world.map:getMarker(name). -
- Sometimes, events will need markers for certain properties.
-
- Additionally, the world uses the
spawnmarker, if it exists, to determine where to place the party when the map is loaded from a savefile or without an entry position.
- Additionally, the world uses the
paths (Object)
- The perimeter of each shape on this layer is treated as a path. Each path must be given a name so it can be referenced later.
battleareas (Object)
- When the player enters any object on this layer, it will cause them to enter a "World Battle". This causes the
battleborderlayer to become visible, and the world to darken. -
- (See Battle Areas for more information on battle areas.)
blockcollision (Object)
- The shapes on this layer will be used as collision for the
pushblockevent.
Generic Image Layers
- Any layer using the Image type is treated as-is.