Modding:level object (0.9.9.7)

From DoomRL Wiki

Revision as of 21:47, 23 December 2012 by Yaflhdztioxo (Talk | contribs)

Jump to: navigation, search

The level object in DoomRL pulls triple duty: it stores and publishes properties relevant to the current level, it provides access to the level API which includes procedures from Lua, DoomRL, and valkyrie, and through clever use of metatables it exposes the light, cell type, and HP arrays stored in the valkyrie LuaMapNode object.

Properties

Properties
status word This is for use by level designers and is preserved after a level is exited.
name string This is the level name as displayed on the HUD.
name_number word This controls the "LevX" part of the level name. If zero, it won't be displayed.
danger_level word Level generation parameter that usually corresponds to depth.
style byte The style (tile set) used by the level generation functions.
id string The id of the current level
special_exit string The id of the level that red stairs lead to

Properties

Array Properties
flags[Level Flag] boolean Get or set level flags
light[coord][Light Flag] boolean Get or set cell light flags*
map[coord] cell Get or set cells on a map by cell id
hp[coord] byte Get or set cell HP values
  • As a special extension you can pass an area to level.light when setting flags and the procedure will automatically iterate through every coord
Personal tools