Skip to content

Treasure_open

Jan Sandström edited this page Apr 28, 2020 · 2 revisions

Treasure_open is a component in which there is a visible, or apparently hidden chest, which can be accessed without any items.

The component shares a lot of features with obstacle_puzzle, the difference being a hidden chest must be apparently hidden. This is usually achieved by putting the hidden chest on a small_floor tile with the appropriate floor_border tiles.

Each treasure_open map script must contain the following snippet:

local map, data = ...

local treasure = require 'maps/components/treasure_open/treasure_open'

treasure.init(map, data)

Apart from the common component placeholders, the component requires the following tiles:

  • A placeholder_treasure_open tile which must be named chest. The helper will decide if it is a visible or hidden chest depending on whether there is a switch in the map or not.

If the component is designed as a puzzle the component also requires pots and/or blocks:

  • Plots are placed as dynamic floor_pot tile which must be prefixed pot_. No actual pots are placed in the map.
  • Blocks that are candidates for the switch should be placed as block entities with the appropriate pushable settings. Blocks should never be pullable. The block must be prefixed block_

The map also needs:

  • A walkable switch which must be named switch. Place it in the corner of the map, the helper will position it.
Clone this wiki locally