Lua API

FOV module

Functions for testing visibility.

Usage

local FOV = ELONA.require("core.FOV")

Functions

los (from, to) Checks if there is line of sight between two positions in the current map.
you_see (chara) Returns true if the player can see the given character, taking blindness into account.
you_see (pos) Returns true if the player can see the given position, taking blindness into account.
refresh () Forces an update of the player's field of view cache.

Functions

# los (from, to)

Checks if there is line of sight between two positions in the current map.

Parameters: Returns:
  • (bool) true if there is line of sight between the positions
# you_see (chara)

Returns true if the player can see the given character, taking blindness into account.

Parameters: Returns:
  • (bool) true if the player can see the character
# you_see (pos)

Returns true if the player can see the given position, taking blindness into account.

Parameters: Returns:
  • (bool) true if the player can see the position
# refresh ()

Forces an update of the player's field of view cache.

You should run this if you're creating objects inside Lua and expecting them to be visible to the player immediately after, or if you're updating the layout of the map and expecting the player's visible object list to change.