kts.SetHomeFor

Name

kts.SetHomeFor – set the home tile (spawn point) being used by a knight

Synopsis

kts.SetHomeFor(player, position, direction)

kts.SetHomeFor(knight, position, direction)

Description

The first argument can be either a Player object or a Creature representing a knight. This function will set the corresponding player's home location (entry point tile) to be at dungeon position position and facing direction direction.

The position must be one square outside the actual "home" tile (i.e. it must be the square that the knight will actually spawn on), and the direction must face toward the dungeon exit.

Return Value

No value is returned.

Errors

An error will be generated if the inputs are not of the correct types.

Notes

Note that no check is made to see if the given position actually corresponds to a dungeon entrance tile ("home" tile). If the home position is not actually outside a "home" tile then the knight will spawn normally at that position, but healing (by returning to the entry point) will not be available.

Examples

This function isn't often used in normal Knights games, because the entry points are set up automatically, but it is used in the Tutorial to select the correct entry point on the tutorial map: see tutorial/init.lua.

See Also

kts.GetHomeFor