Space Station 13 - Modules - TypesVar Details - Proc Details

Basic Proximity Monitor

Attaching this component to an atom means that the atom will be able to detect mobs or objects moving within a specified radius of it.

The component creates several /obj/effect/abstract/proximity_checker objects, which follow the parent AKA hasprox_receiver around, always making sure it's at the center. When something crosses one of these proximiy checkers, the hasprox_receiver will have the HasProximity() proc called on it, with the crossing mob/obj as the argument.

Vars

always_activeShould the parent always detect proximity and update the field on movement, even if it's not on a turf?
field_checker_typeThe type of checker object that should be used for the main field.
hasprox_receiverThe primary atom the component is attached to and that will be receiving HasProximity() calls. Same as the parent.
nested_receiver_locsA list which contains references to movable atoms which the hasprox_receiver has moved into. Used to handle complex situations where the receiver is nested several layers deep into an object. For example: inside of a box, that's inside of a bag, which is worn on a human. In this situation there are 3 locations we need to listen to for movement.
proximity_checkersA list of currently created /obj/effect/abstract/proximity_checker in use with this component.
radiusThe radius of the field, in tiles.

Procs

clear_nested_locsRemoves and unregisters signals from all objects currently in the nested_receiver_locs list.
create_prox_checkersCalled in Initialize(). Generates a set of proximity checker objects around the parent.
create_single_prox_checkerCreates a single proximity checker object, at the given location and of the given type. Adds it to the proximity checkers list.
map_nested_locsRegisters signals to any nested locations the hasprox_receiver is in, excluding turfs, so they can be monitored for movement.
move_prox_checkersRelays basic directional movement from the hasprox_receiver or host, to all objects in the proximity_checkers list.
on_disposal_enterCalled when the receiver or an atom in the nested_receiver_locs list moves into a disposals holder object.
on_disposal_exitCalled when the receiver or an atom in the nested_receiver_locs list moves out of a disposals holder object.
on_nested_loc_moveCalled when an atom in nested_receiver_locs list moves, if one exists.
on_receiver_moveCalled when the hasprox_receiver moves.
recenter_prox_checkersRe-centers all of the proximity_checkers around the parent's current location.
set_radiusSpecifies a new radius for the field. Creates or deletes proximity_checkers accordingly.
toggle_checkersUpdate all of the component's proximity checker's to either become active or not active.

Var Details

always_active

Should the parent always detect proximity and update the field on movement, even if it's not on a turf?

field_checker_type

The type of checker object that should be used for the main field.

hasprox_receiver

The primary atom the component is attached to and that will be receiving HasProximity() calls. Same as the parent.

nested_receiver_locs

A list which contains references to movable atoms which the hasprox_receiver has moved into. Used to handle complex situations where the receiver is nested several layers deep into an object. For example: inside of a box, that's inside of a bag, which is worn on a human. In this situation there are 3 locations we need to listen to for movement.

proximity_checkers

A list of currently created /obj/effect/abstract/proximity_checker in use with this component.

radius

The radius of the field, in tiles.

Proc Details

clear_nested_locs

Removes and unregisters signals from all objects currently in the nested_receiver_locs list.

create_prox_checkers

Called in Initialize(). Generates a set of proximity checker objects around the parent.

create_single_prox_checker

Creates a single proximity checker object, at the given location and of the given type. Adds it to the proximity checkers list.

Arguments:

map_nested_locs

Registers signals to any nested locations the hasprox_receiver is in, excluding turfs, so they can be monitored for movement.

move_prox_checkers

Relays basic directional movement from the hasprox_receiver or host, to all objects in the proximity_checkers list.

Arguments:

on_disposal_enter

Called when the receiver or an atom in the nested_receiver_locs list moves into a disposals holder object.

This proc recieves arguments, but they aren't needed.

on_disposal_exit

Called when the receiver or an atom in the nested_receiver_locs list moves out of a disposals holder object.

This proc recieves arguments, but they aren't needed.

on_nested_loc_move

Called when an atom in nested_receiver_locs list moves, if one exists.

Arguments:

on_receiver_move

Called when the hasprox_receiver moves.

Arguments:

recenter_prox_checkers

Re-centers all of the proximity_checkers around the parent's current location.

set_radius

Specifies a new radius for the field. Creates or deletes proximity_checkers accordingly.

This proc can have a high cost due to the news and qdels of the proximity checkers, depending on the number of calls you need to make to it.

Arguments: new_radius - the new value that proximity_radius should be set to.

toggle_checkers

Update all of the component's proximity checker's to either become active or not active.

Arguments: