Module ...

Define a level

Functions

_M:addEntity (e, after, no_error) Adds an entity to the level Only entities that need to act need to be added.
_M:addSublevel (name, level) Adds a sublevel
_M:decay (what, check) Decay the level Decaying means we look on the map for the given type of entities and if we are allowed to we delete them
_M:getEntitiesList (type) Gets an entity list for the level, this allows the Zone to pick objects/actors/...
_M:hasEntity (e) Is the entity on the level?
_M:init (level, map) Initializes the level with a "level" and a map
_M:pickSpot (filter) Pick a random spot matching the given filter
_M:pickSpotRemove (filter) Pick a random spot matching the given filter and remove it
_M:removeEntity (e, force) Removes an entity from the level
_M:removeSublevel (name) Removes a sublevel
_M:removed () Removed, so we remove all entities
_M:save () Serialization
_M:selectSublevel (name) Activate the given sublevel to become the new main one
_M:setEntitiesList (type, list, permanent) Setup an entity list for the level, this allows the Zone to pick objects/actors/...


Functions

_M:addEntity (e, after, no_error)
Adds an entity to the level Only entities that need to act need to be added. Terrain features do not need this usually

Parameters

  • e:
  • after:
  • no_error:
_M:addSublevel (name, level)
Adds a sublevel

Parameters

  • name:
  • level:
_M:decay (what, check)
Decay the level Decaying means we look on the map for the given type of entities and if we are allowed to we delete them

Parameters

  • what: what Map feature to decay (ACTOR, OBJECT, ...)
  • check: either a boolean or a function, if true the given entity will be decayed

Return value:

the number of decayed entities and the total number of such entities remaining
_M:getEntitiesList (type)
Gets an entity list for the level, this allows the Zone to pick objects/actors/...

Parameters

  • type:
_M:hasEntity (e)
Is the entity on the level?

Parameters

  • e:
_M:init (level, map)
Initializes the level with a "level" and a map

Parameters

  • level:
  • map:
_M:pickSpot (filter)
Pick a random spot matching the given filter

Parameters

  • filter:
_M:pickSpotRemove (filter)
Pick a random spot matching the given filter and remove it

Parameters

  • filter:
_M:removeEntity (e, force)
Removes an entity from the level

Parameters

  • e:
  • force:
_M:removeSublevel (name)
Removes a sublevel

Parameters

  • name:
_M:removed ()
Removed, so we remove all entities
_M:save ()
Serialization
_M:selectSublevel (name)
Activate the given sublevel to become the new main one

Parameters

  • name:
_M:setEntitiesList (type, list, permanent)
Setup an entity list for the level, this allows the Zone to pick objects/actors/...

Parameters

  • type:
  • list:
  • permanent:

Valid XHTML 1.0!