Difference between revisions of "Modding:level object (0.9.9.7)"
From DoomRL Wiki
Yaflhdztioxo (Talk | contribs) |
Yaflhdztioxo (Talk | contribs) |
||
Line 16: | Line 16: | ||
|}} | |}} | ||
}} | }} | ||
− | == Properties == | + | == Array Properties == |
{{drltable|Array Properties|3|{{Table3Col | {{drltable|Array Properties|3|{{Table3Col | ||
|es=background: #333; | |es=background: #333; |
Revision as of 21:58, 23 December 2012
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. Here we focus on its representation as an 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 |
Array 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