code/__DEFINES/subsystems.dm ![code/__DEFINES/subsystems.dm0](git.png)
Defines for subsystems and overlays Lots of important stuff in here, make sure you have your brain switched on when editing this file DB defines | |
DB_MAJOR_VERSION | DB major schema version |
---|---|
DB_MINOR_VERSION | DB minor schema version |
Timing subsystem | |
TIMER_UNIQUE | Don't run if there is an identical unique timer active |
TIMER_OVERRIDE | For unique timers: Replace the old timer rather then not start this one |
TIMER_CLIENT_TIME | Timing should be based on how timing progresses on clients, not the server. |
TIMER_STOPPABLE | Timer can be stopped using deltimer() |
TIMER_NO_HASH_WAIT | prevents distinguishing identical timers with the wait variable |
TIMER_LOOP | Loops the timer repeatedly until qdeleted |
TIMER_DELETE_ME | Delete the timer on parent datum Destroy() and when deltimer'd |
TIMER_ID_NULL | Empty ID define |
PROCESS_KILL | Used to trigger object removal from a processing list |
Initialization subsystem | |
INITIALIZATION_INSSATOMS | New should not call Initialize |
INITIALIZATION_INNEW_MAPLOAD | New should call Initialize(TRUE) |
INITIALIZATION_INNEW_REGULAR | New should call Initialize(FALSE) |
Initialization hints | |
INITIALIZE_HINT_NORMAL | Nothing happens |
INITIALIZE_HINT_LATELOAD | call LateInitialize at the end of all atom Initialization |
INITIALIZE_HINT_QDEL | Call qdel on the atom after initialization |
INITIALIZE_IMMEDIATE | type and all subtypes should always immediately call Initialize in New() |
SS initialization hints | |
SS_INIT_FAILURE | Negative values indicate a failure or warning of some kind, positive are good. 0 and 1 are unused so that TRUE and FALSE are guaranteed to be invalid values. Subsystem failed to initialize entirely. Print a warning, log, and disable firing. |
SS_INIT_NONE | The default return value which must be overridden. Will succeed with a warning. |
SS_INIT_SUCCESS | Subsystem initialized successfully. |
SS_INIT_NO_NEED | If your system doesn't need to be initialized (by being disabled or something) |
SS_INIT_NO_MESSAGE | Successfully initialized, BUT do not announce it to players (generally to hide game mechanics it would otherwise spoil) |
SS initialization load orders | |
GAME_STATE_STARTUP | Game is loading |
GAME_STATE_PREGAME | Game is loaded and in pregame lobby |
GAME_STATE_SETTING_UP | Game is attempting to start the round |
GAME_STATE_PLAYING | Game has round in progress |
GAME_STATE_FINISHED | Game has round finished |
END_ROUND_AS_NORMAL | Default, round is not being forced to end. |
FORCE_END_ROUND | End the round now as normal |
ADMIN_FORCE_END_ROUND | For admin forcing roundend, can be used to distinguish the two |
addtimer | Create a new timer and add it to the queue. |
SS_INIT_TIMER_KEY | The timer key used to know how long subsystem initialization takes |
VOTE_COUNT_METHOD_SINGLE | First past the post. One selection per person, and the selection with the most votes wins. |
VOTE_COUNT_METHOD_MULTI | Approval voting. Any number of selections per person, and the selection with the most votes wins. |
VOTE_WINNER_METHOD_SIMPLE | The choice with the most votes wins. Ties are broken by the first choice to reach that number of votes. |
VOTE_WINNER_METHOD_WEIGHTED_RANDOM | The winning choice is selected randomly based on the number of votes each choice has. |
VOTE_WINNER_METHOD_NONE | There is no winner for this vote. |
VOTE_AVAILABLE | Returned by /datum/vote/proc/can_be_initiated to denote the vote is valid and can be initiated. |
Define Details
ADMIN_FORCE_END_ROUND ![code/__DEFINES/subsystems.dm 274](git.png)
For admin forcing roundend, can be used to distinguish the two
DB_MAJOR_VERSION ![code/__DEFINES/subsystems.dm 14](git.png)
DB major schema version
Update this whenever the db schema changes
make sure you add an update to the schema_version stable in the db changelog
DB_MINOR_VERSION ![code/__DEFINES/subsystems.dm 23](git.png)
DB minor schema version
Update this whenever the db schema changes
make sure you add an update to the schema_version stable in the db changelog
END_ROUND_AS_NORMAL ![code/__DEFINES/subsystems.dm 270](git.png)
Default, round is not being forced to end.
FORCE_END_ROUND ![code/__DEFINES/subsystems.dm 272](git.png)
End the round now as normal
GAME_STATE_FINISHED ![code/__DEFINES/subsystems.dm 266](git.png)
Game has round finished
GAME_STATE_PLAYING ![code/__DEFINES/subsystems.dm 264](git.png)
Game has round in progress
GAME_STATE_PREGAME ![code/__DEFINES/subsystems.dm 260](git.png)
Game is loaded and in pregame lobby
GAME_STATE_SETTING_UP ![code/__DEFINES/subsystems.dm 262](git.png)
Game is attempting to start the round
GAME_STATE_STARTUP ![code/__DEFINES/subsystems.dm 258](git.png)
Game is loading
INITIALIZATION_INNEW_MAPLOAD ![code/__DEFINES/subsystems.dm 75](git.png)
New should call Initialize(TRUE)
INITIALIZATION_INNEW_REGULAR ![code/__DEFINES/subsystems.dm 77](git.png)
New should call Initialize(FALSE)
INITIALIZATION_INSSATOMS ![code/__DEFINES/subsystems.dm 73](git.png)
New should not call Initialize
INITIALIZE_HINT_LATELOAD ![code/__DEFINES/subsystems.dm 90](git.png)
call LateInitialize at the end of all atom Initialization
The item will be added to the late_loaders list, this is iterated over after initialization of subsystems is complete and calls LateInitalize on the atom see this file for the LateIntialize proc
INITIALIZE_HINT_NORMAL ![code/__DEFINES/subsystems.dm 82](git.png)
Nothing happens
INITIALIZE_HINT_QDEL ![code/__DEFINES/subsystems.dm 93](git.png)
Call qdel on the atom after initialization
INITIALIZE_IMMEDIATE ![code/__DEFINES/subsystems.dm 96](git.png)
type and all subtypes should always immediately call Initialize in New()
PROCESS_KILL ![code/__DEFINES/subsystems.dm 67](git.png)
Used to trigger object removal from a processing list
SS_INIT_FAILURE ![code/__DEFINES/subsystems.dm 114](git.png)
Negative values indicate a failure or warning of some kind, positive are good. 0 and 1 are unused so that TRUE and FALSE are guaranteed to be invalid values. Subsystem failed to initialize entirely. Print a warning, log, and disable firing.
SS_INIT_NONE ![code/__DEFINES/subsystems.dm 117](git.png)
The default return value which must be overridden. Will succeed with a warning.
SS_INIT_NO_MESSAGE ![code/__DEFINES/subsystems.dm 126](git.png)
Successfully initialized, BUT do not announce it to players (generally to hide game mechanics it would otherwise spoil)
SS_INIT_NO_NEED ![code/__DEFINES/subsystems.dm 123](git.png)
If your system doesn't need to be initialized (by being disabled or something)
SS_INIT_SUCCESS ![code/__DEFINES/subsystems.dm 120](git.png)
Subsystem initialized successfully.
SS_INIT_TIMER_KEY ![code/__DEFINES/subsystems.dm 345](git.png)
The timer key used to know how long subsystem initialization takes
TIMER_CLIENT_TIME ![code/__DEFINES/subsystems.dm 45](git.png)
Timing should be based on how timing progresses on clients, not the server.
Tracking this is more expensive, should only be used in conjunction with things that have to progress client side, such as animate() or sound()
TIMER_DELETE_ME ![code/__DEFINES/subsystems.dm 61](git.png)
Delete the timer on parent datum Destroy() and when deltimer'd
TIMER_ID_NULL ![code/__DEFINES/subsystems.dm 64](git.png)
Empty ID define
TIMER_LOOP ![code/__DEFINES/subsystems.dm 58](git.png)
Loops the timer repeatedly until qdeleted
In most cases you want a subsystem instead, so don't use this unless you have a good reason
TIMER_NO_HASH_WAIT ![code/__DEFINES/subsystems.dm 53](git.png)
prevents distinguishing identical timers with the wait variable
To be used with TIMER_UNIQUE
TIMER_OVERRIDE ![code/__DEFINES/subsystems.dm 36](git.png)
For unique timers: Replace the old timer rather then not start this one
TIMER_STOPPABLE ![code/__DEFINES/subsystems.dm 48](git.png)
Timer can be stopped using deltimer()
TIMER_UNIQUE ![code/__DEFINES/subsystems.dm 33](git.png)
Don't run if there is an identical unique timer active
if the arguments to addtimer are the same as an existing timer, it doesn't create a new timer, and returns the id of the existing timer
VOTE_AVAILABLE ![code/__DEFINES/subsystems.dm 361](git.png)
Returned by /datum/vote/proc/can_be_initiated to denote the vote is valid and can be initiated.
VOTE_COUNT_METHOD_MULTI ![code/__DEFINES/subsystems.dm 351](git.png)
Approval voting. Any number of selections per person, and the selection with the most votes wins.
VOTE_COUNT_METHOD_SINGLE ![code/__DEFINES/subsystems.dm 349](git.png)
First past the post. One selection per person, and the selection with the most votes wins.
VOTE_WINNER_METHOD_NONE ![code/__DEFINES/subsystems.dm 358](git.png)
There is no winner for this vote.
VOTE_WINNER_METHOD_SIMPLE ![code/__DEFINES/subsystems.dm 354](git.png)
The choice with the most votes wins. Ties are broken by the first choice to reach that number of votes.
VOTE_WINNER_METHOD_WEIGHTED_RANDOM ![code/__DEFINES/subsystems.dm 356](git.png)
The winning choice is selected randomly based on the number of votes each choice has.
addtimer ![code/__DEFINES/subsystems.dm 284](git.png)
Create a new timer and add it to the queue.
- Arguments:
-
- callback the callback to call on timer finish
-
- wait deciseconds to run the timer for
-
- flags flags for this timer, see: code__DEFINES\subsystems.dm
-
- timer_subsystem the subsystem to insert this timer into