kts.GetHomeFor – get the "home location" (dungeon entry point) of a player
result = kts.GetHomeFor(player)
result = kts.GetHomeFor(knight)
This function takes one parameter, which can either be a Player object (e.g. as returned from kts.GetPlayer), or a Creature object representing a knight. Either way, the function returns the current "home" (entry point) for that player, if they have one, or nil
otherwise.
The return value is either nil
, or a table with fields x
, y
, facing
, tile
and (possibly) secured_by
. See kts.GetAllHomes for a description of what these fields mean.
If the input is not a valid Player, nor a Creature representing a knight, then an error is raised.