kts.TeleportTo

Name

kts.TeleportTo – teleport a creature to a given location

Synopsis

kts.TeleportTo(creature, pos)

Description

The first parameter should be a Creature and the second parameter should be a position (that is, a table containing fields x and y giving the co-ordinates of a particular square in the dungeon). The creature will be moved to the given square. If the square is occupied, then the four adjacent squares (to the north, south, east and west) will also be tried. If all of those are occupied as well, then the creature is left at its current position.

Return Value

None.

Errors

Errors will be reported if the parameters are not a Creature and a map position respectively.

Notes

This function just moves the creature, it does not play any sound effect or flash the screen etc.; that has to be done separately.

Examples

kts.TeleportTo(cxt.actor, {x=33, y=31})

See Also

kts.Attractor

kts.TeleportRandom