Overmap objects
Everything visible on the overmap: stations, ships, ruins, events, and more.
This base class should be the parent of all objects present on the overmap. For the control counterparts, see /obj/machinery/computer/helm. For the shuttle counterparts (ONLY USED FOR SHIPS), see /obj/docking_port/mobile.
Vars | |
char_rep | The character that represents this overmap datum on the overmap in ASCII mode. |
---|---|
contents | List of all datums docked in this datum. |
current_docking_ticket | The current docking ticket of this object, if any |
dock_time | The time, in deciseconds, needed for this object to call |
dock_timer_id | The current docking timer ID. |
docked_to | The datum this datum is docked to. |
docking | Whether or not the overmap object is currently docking. |
name | The name of this overmap datum, propogated to the token, docking port, and areas. |
token | The token this datum is represented by. |
token_icon_state | The icon state the token will be set to on init. |
token_type | Token type to instantiate. |
x | The x position of this datum on the overmap. Use [/datum/overmap/proc/move] to change this. |
y | The y position of this datum on the overmap. Use [/datum/overmap/proc/move] to change this. |
Procs | |
Dock | HERE BE DRAGONS - DOCKING CODE Docks the overmap datum to another overmap datum, putting it in the other's contents and removing it from the overmap. Sets X and Y equal to null. Does not check for distance or nulls. |
Initialize | This proc is called directly after New(). It's done after the basic creation and placement of the token and setup has been completed. |
Rename | Proc used to rename an overmap datum and everything related to it. |
Undock | Undocks from the object this datum is docked to currently, and places it back on the overmap at the position of the object that was previously docked to. |
adjust_dock_to_shuttle | Helper proc for docking. Alters the position and orientation of a stationary docking port to ensure that any mobile port small enough can dock within its bounds |
complete_dock | Called after datum/overmap/proc/start_dock, either instantly or after a time depending on the datum/overmap/var/dock_time variable. Return result is ignored. |
complete_undock | Called after datum/overmap/proc/Undock, either instantly or after a time depending on the datum/overmap/var/dock_time variable. Return result is ignored. |
get_jump_to_turf | Returns a turf that can be jumped to by observers, admins, and such. |
get_nearby_overmap_objects | Returns all other overmap objects on the tile as a list. Will return an empty list if there are no other objects, or the source object is docked. Setting include_docked to TRUE will include any overmap objects docked to objects at the tile. |
overmap_move | Called whenever you need to move an overmap datum to another position. Can be overridden to add additional movement functionality, as long as it calls the parent proc. |
overmap_step | Moves the overmap datum in a specific direction a specific number of spaces (magnitude, default 1). |
post_docked | Called at the very end of a datum/overmap/proc/Dock call, on the TARGET of the docking attempt. Return value is ignored. |
post_undocked | Called at the very end of a [datum/overmap/proc/Unock] call (non-blocking/asynchronously), on the TARGET of the undocking attempt. Return result is ignored. |
pre_dock | Called at the very start of a datum/overmap/proc/Dock call. If it returns FALSE, the docking will be aborted. Will only be called after datum/overmap/proc/pre_docked has been called and returned TRUE. |
pre_docked | Called at the very start of a datum/overmap/proc/Dock call, on the TARGET of the docking attempt. If it returns FALSE, the docking will be aborted. Called before datum/overmap/proc/pre_dock is called on the dock requester. |
set_or_create_token | Used to generate a token for this datum. |
start_dock | For defining custom actual docking behaviour. Called after both datum/overmap/proc/pre_dock and datum/overmap/proc/pre_docked have been called and they both returned TRUE. |
update_token_location | Updates the location of our linked token to be correct. |
Var Details
char_rep
The character that represents this overmap datum on the overmap in ASCII mode.
contents
List of all datums docked in this datum.
current_docking_ticket
The current docking ticket of this object, if any
dock_time
The time, in deciseconds, needed for this object to call
dock_timer_id
The current docking timer ID.
docked_to
The datum this datum is docked to.
docking
Whether or not the overmap object is currently docking.
name
The name of this overmap datum, propogated to the token, docking port, and areas.
token
The token this datum is represented by.
token_icon_state
The icon state the token will be set to on init.
token_type
Token type to instantiate.
x
The x position of this datum on the overmap. Use [/datum/overmap/proc/move] to change this.
y
The y position of this datum on the overmap. Use [/datum/overmap/proc/move] to change this.
Proc Details
Dock
HERE BE DRAGONS - DOCKING CODE Docks the overmap datum to another overmap datum, putting it in the other's contents and removing it from the overmap. Sets X and Y equal to null. Does not check for distance or nulls.
- dock_target - The overmap datum to dock to. Cannot be null.
Initialize
This proc is called directly after New(). It's done after the basic creation and placement of the token and setup has been completed.
- placement_x/y - the X and Y position of the overmap datum.
Rename
Proc used to rename an overmap datum and everything related to it.
- new_name - The new name of the overmap datum.
Undock
Undocks from the object this datum is docked to currently, and places it back on the overmap at the position of the object that was previously docked to.
adjust_dock_to_shuttle
Helper proc for docking. Alters the position and orientation of a stationary docking port to ensure that any mobile port small enough can dock within its bounds
complete_dock
Called after datum/overmap/proc/start_dock, either instantly or after a time depending on the datum/overmap/var/dock_time variable. Return result is ignored.
- dock_target - The overmap datum that has been docked to. Cannot be null.
- ticket - The docking ticket that was returned from the datum/overmap/proc/pre_docked call.
complete_undock
Called after datum/overmap/proc/Undock, either instantly or after a time depending on the datum/overmap/var/dock_time variable. Return result is ignored.
get_jump_to_turf
Returns a turf that can be jumped to by observers, admins, and such.
get_nearby_overmap_objects
Returns all other overmap objects on the tile as a list. Will return an empty list if there are no other objects, or the source object is docked. Setting include_docked to TRUE will include any overmap objects docked to objects at the tile.
overmap_move
Called whenever you need to move an overmap datum to another position. Can be overridden to add additional movement functionality, as long as it calls the parent proc.
- new_x/y - the X and Y position to move the overmap datum to. Must be numbers, will CRASH() otherwise.
overmap_step
Moves the overmap datum in a specific direction a specific number of spaces (magnitude, default 1).
- dir - The direction to move the overmap datum in. Takes cardinal and diagonal directions.
- magnitude - The number of spaces to move the overmap datum in the direction.
post_docked
Called at the very end of a datum/overmap/proc/Dock call, on the TARGET of the docking attempt. Return value is ignored.
- dock_requester - The overmap datum trying to dock with this one. Cannot be null.
post_undocked
Called at the very end of a [datum/overmap/proc/Unock] call (non-blocking/asynchronously), on the TARGET of the undocking attempt. Return result is ignored.
- dock_requester - The overmap datum trying to undock from this one. Cannot be null.
pre_dock
Called at the very start of a datum/overmap/proc/Dock call. If it returns FALSE, the docking will be aborted. Will only be called after datum/overmap/proc/pre_docked has been called and returned TRUE.
- dock_target - The overmap datum to dock to. Cannot be null.
- ticket - The docking ticket that was returned from the datum/overmap/proc/pre_docked call.
pre_docked
Called at the very start of a datum/overmap/proc/Dock call, on the TARGET of the docking attempt. If it returns FALSE, the docking will be aborted. Called before datum/overmap/proc/pre_dock is called on the dock requester.
- dock_requester - The overmap datum trying to dock with this one. Cannot be null.
Returns - A docking ticket that will be passed to datum/overmap/proc/pre_dock on the dock requester.
set_or_create_token
Used to generate a token for this datum.
start_dock
For defining custom actual docking behaviour. Called after both datum/overmap/proc/pre_dock and datum/overmap/proc/pre_docked have been called and they both returned TRUE.
- dock_target - The overmap datum to dock to. Cannot be null.
- ticket - The docking ticket that was returned from the datum/overmap/proc/pre_docked call.
update_token_location
Updates the location of our linked token to be correct.