kts.GetAllHomes

Name

kts.GetAllHomes – return a list of all "home" (knight entry point) locations in the dungeon

Synopsis

result = kts.GetAllHomes()

Description

This function returns a Lua array/list of all "homes" in the dungeon. A "home" is a Tile which had type="home" set when it was created; home tiles are where players initially spawn into the dungeon.

Each entry in the array is represented by a Lua table with the following fields:

Return Value

The return value is a table as described above. Note that the table might be empty (e.g. this can happen in duel to the death quests, when all entry points have been secured and converted into walls).

Errors

None.

Notes

Since the "home" tables returned by this function include fields x and y, it is valid to pass them to functions that require a "Position" (i.e. the presence of the extra fields facing, tile and so on does not stop the tables being valid Positions, since Lua will just ignore the extra fields if they are present).

The list returned by this function includes any "special_exit" points (Guarded Exits) in the dungeon – even though these cannot be used as normal spawn points by knights (they are dungeon exit points only). The tile.special_exit flag can be used to check for this if required.

Examples

An example result might be:

{
  { x = 3, y = 4, facing = "west", tile = <tile object> },
  { x = 10, y = 13, facing = "south", tile = <tile object> },
  { x = 12, y = 9, facing = "east", secured_by = <player object>, tile = <tile object> },
  ...
}

See Also

kts.GetHomeFor

kts.GetTiles

kts.Secure

kts.Tile