Skip to main content

Cave Entrance

Based on game build 714014 | Last updated: 2026-02-28

Overview

This file defines a static map layout for cave entrances using the Tiled map format. It is not a game component attached to entities via AddComponent, but rather a static data structure used during world generation to define tile placement and object placement for the cave entrance area. It includes background tile layer (BG_TILES) with visual patterns (e.g., tile ID 4 placed at specific coordinates) and an object group (FG_OBJECTS) containing a single cave entrance marker (type = "cave_entrance"). The layout serves as a reusable blueprint for placing cave entry points in the caves world level.

Usage example

This file is loaded by the world generation system, not instantiated directly by modders. It is referenced in level/task definitions (e.g., in map/levels/caves.lua or map/tasksets/caves.lua) to insert this layout at a designated world position.

-- The file is typically loaded and embedded via worldgen scripts like:
-- level:AddStaticLayout("cave_entrance", { x = worldx, y = worldy })
-- This file itself returns a Tiled-compatible table, not a component or prefab.

Dependencies & tags

Components used: None — this is a static data file, not a Lua component.

Tags: None — no entity tags are modified.

Properties

The file returns a plain Lua table conforming to the Tiled JSON/CSV export schema (converted to Lua format). Key properties are:

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled version compatibility identifier.
luaversionstring"5.1"Lua runtime version used for serialization.
orientationstring"orthogonal"Map coordinate system orientation.
widthnumber16Map width in tiles.
heightnumber16Map height in tiles.
tilewidthnumber16Width of each tile in pixels.
tileheightnumber16Height of each tile in pixels.
propertiestable{}Custom map-level properties (empty in this case).
tilesetsarraySee sourceArray of tileset definitions (references external image and tile mappings).
layersarraySee sourceArray of layers: one tilelayer (background tiles), one objectgroup (cave entrance marker).

Main functions

No functions are defined. The file returns a single data table with no executable methods.

Events & listeners

Not applicable — this is a static data file, not an active component. No events are listened to or pushed.