Module DetectionZoneUnit

Detect the intrusion of any player inside the effect zone.

Element class: DetectionZoneUnit

Extends: Element

Functions

getRadius () Returns the detection zone radius.
getPlayers () Returns the list of IDs of the players in the detection zone.
getSignalOut (plug) Return the value of a signal in the specified OUT plug of the element.
EVENT_enter (id) Deprecated: Event: A player just entered the zone.
EVENT_onEnter (id) Event: Emitted when a player enters the detection zone.
EVENT_leave (id) Deprecated: Event: A player just left the zone.
EVENT_onLeave (id) Emitted when a player leaves the detection zone.
mockRegisterEnter (callback, filter) Mock only, not in-game: Register a handler for the in-game `enter(id)` event.
mockDoEnter (id) Mock only, not in-game: Simulates a user entering the detection zone.
mockRegisterLeave (callback, filter) Mock only, not in-game: Register a handler for the in-game `leave(id)` event.
mockDoLeave (id) Mock only, not in-game: Simulates a player leaving the detection zone.
mockGetClosure () Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".


Functions

getRadius ()
Returns the detection zone radius.

Returns:

    float The detection zone radius.
getPlayers ()
Returns the list of IDs of the players in the detection zone. Updates after events fire, so won't be correct in event handling.

Returns:

    list The list of player IDs.
getSignalOut (plug)
Return the value of a signal in the specified OUT plug of the element.

Valid plug names are:

  • "out" for the out signal.

Parameters:

  • plug string A valid plug name to query.

Returns:

    0/1 The plug signal state
EVENT_enter (id)
Deprecated: Event: A player just entered the zone.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onEnter should be used instead.

Parameters:

See also:

EVENT_onEnter (id)
Event: Emitted when a player enters the detection zone.

Note: This is documentation on an event handler, not a callable method.

Parameters:

EVENT_leave (id)
Deprecated: Event: A player just left the zone.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onLeave should be used instead.

Parameters:

  • id int The ID of the player. Use database.getPlayer(ID).name to retrieve its name.

See also:

EVENT_onLeave (id)
Emitted when a player leaves the detection zone.

Note: This is documentation on an event handler, not a callable method.

Parameters:

mockRegisterEnter (callback, filter)
Mock only, not in-game: Register a handler for the in-game `enter(id)` event.

Parameters:

  • callback function The function to call when the a player enters.
  • filter string The id to filter on, or "*" for all.

Returns:

    int The index of the callback.

See also:

mockDoEnter (id)
Mock only, not in-game: Simulates a user entering the detection zone.

Parameters:

  • id int The ID of the player who entered.
mockRegisterLeave (callback, filter)
Mock only, not in-game: Register a handler for the in-game `leave(id)` event.

Parameters:

  • callback function The function to call when a player leaves.
  • filter string The id to filter on, or "*" for all.

Returns:

    int The index of the callback.

See also:

mockDoLeave (id)
Mock only, not in-game: Simulates a player leaving the detection zone.

Note: This does not set plugOut to 0.0 because it can't track if everyone has left. Do this manually if it's relevant.

Parameters:

  • id int The ID of the player who left.
mockGetClosure ()
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".

Returns:

    table A table encompasing the api calls of object.

See also:

generated by LDoc 1.4.6 Last updated 2022-12-01 00:35:59