Files
GS13NG/code/__DEFINES/subsystems.html
2025-02-05 06:19:18 +00:00

36 lines
12 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/__DEFINES/subsystems.dm - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="code/__DEFINES/subsystems.html#define">Define Details</a></header><main><h1>code/__DEFINES/subsystems.dm <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm0"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm0"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><p>Defines for subsystems and overlays</p>
<p>Lots of important stuff in here, make sure you have your brain switched on
when editing this file</p>
<h2 id="db-defines">DB defines</h2></td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/DB_MAJOR_VERSION">DB_MAJOR_VERSION</a></th><td>DB major schema version</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/DB_MINOR_VERSION">DB_MINOR_VERSION</a></th><td>DB minor schema version</td></tr><tr><td colspan="2"><h2 id="timing-subsystem">Timing subsystem</h2></td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_UNIQUE">TIMER_UNIQUE</a></th><td>Don't run if there is an identical unique timer active</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_OVERRIDE">TIMER_OVERRIDE</a></th><td>For unique timers: Replace the old timer rather then not start this one</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_CLIENT_TIME">TIMER_CLIENT_TIME</a></th><td>Timing should be based on how timing progresses on clients, not the server.</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_STOPPABLE">TIMER_STOPPABLE</a></th><td>Timer can be stopped using deltimer()</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_NO_HASH_WAIT">TIMER_NO_HASH_WAIT</a></th><td>prevents distinguishing identical timers with the wait variable</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_LOOP">TIMER_LOOP</a></th><td>Loops the timer repeatedly until qdeleted</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_DELETE_ME">TIMER_DELETE_ME</a></th><td>Delete the timer on parent datum Destroy() and when deltimer'd</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/TIMER_ID_NULL">TIMER_ID_NULL</a></th><td>Empty ID define</td></tr><tr><td colspan="2"><h2 id="initialization-subsystem">Initialization subsystem</h2></td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZATION_INSSATOMS">INITIALIZATION_INSSATOMS</a></th><td>New should not call Initialize</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZATION_INNEW_MAPLOAD">INITIALIZATION_INNEW_MAPLOAD</a></th><td>New should call Initialize(TRUE)</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZATION_INNEW_REGULAR">INITIALIZATION_INNEW_REGULAR</a></th><td>New should call Initialize(FALSE)</td></tr><tr><td colspan="2"><h3 id="initialization-hints">Initialization hints</h3></td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZE_HINT_NORMAL">INITIALIZE_HINT_NORMAL</a></th><td>Nothing happens</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZE_HINT_LATELOAD">INITIALIZE_HINT_LATELOAD</a></th><td>call LateInitialize at the end of all atom Initalization</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZE_HINT_QDEL">INITIALIZE_HINT_QDEL</a></th><td>Call qdel on the atom after intialization</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/INITIALIZE_IMMEDIATE">INITIALIZE_IMMEDIATE</a></th><td>type and all subtypes should always immediately call Initialize in New()</td></tr><tr><th><a href="code/__DEFINES/subsystems.html#define/addtimer">addtimer</a></th><td>Create a new timer and add it to the queue.</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/DB_MAJOR_VERSION"><aside class="declaration">#define </aside>DB_MAJOR_VERSION <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L14"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 14"></a></h3><p>DB major schema version</p>
<p>Update this whenever the db schema changes</p>
<p>make sure you add an update to the schema_version stable in the db changelog</p><h3 id="define/DB_MINOR_VERSION"><aside class="declaration">#define </aside>DB_MINOR_VERSION <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L23"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 23"></a></h3><p>DB minor schema version</p>
<p>Update this whenever the db schema changes</p>
<p>make sure you add an update to the schema_version stable in the db changelog</p><h3 id="define/INITIALIZATION_INNEW_MAPLOAD"><aside class="declaration">#define </aside>INITIALIZATION_INNEW_MAPLOAD <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L70"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 70"></a></h3><p>New should call Initialize(TRUE)</p><h3 id="define/INITIALIZATION_INNEW_REGULAR"><aside class="declaration">#define </aside>INITIALIZATION_INNEW_REGULAR <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L72"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 72"></a></h3><p>New should call Initialize(FALSE)</p><h3 id="define/INITIALIZATION_INSSATOMS"><aside class="declaration">#define </aside>INITIALIZATION_INSSATOMS <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L68"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 68"></a></h3><p>New should not call Initialize</p><h3 id="define/INITIALIZE_HINT_LATELOAD"><aside class="declaration">#define </aside>INITIALIZE_HINT_LATELOAD <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L85"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 85"></a></h3><p>call LateInitialize at the end of all atom Initalization</p>
<p>The item will be added to the late_loaders list, this is iterated over after
initalization of subsystems is complete and calls LateInitalize on the atom
see <a href="atom.html#proc/LateInitialize">this file for the LateIntialize proc</a></p><h3 id="define/INITIALIZE_HINT_NORMAL"><aside class="declaration">#define </aside>INITIALIZE_HINT_NORMAL <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L77"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 77"></a></h3><p>Nothing happens</p><h3 id="define/INITIALIZE_HINT_QDEL"><aside class="declaration">#define </aside>INITIALIZE_HINT_QDEL <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L88"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 88"></a></h3><p>Call qdel on the atom after intialization</p><h3 id="define/INITIALIZE_IMMEDIATE"><aside class="declaration">#define </aside>INITIALIZE_IMMEDIATE<aside>(X)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L91"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 91"></a></h3><p>type and all subtypes should always immediately call Initialize in New()</p><h3 id="define/TIMER_CLIENT_TIME"><aside class="declaration">#define </aside>TIMER_CLIENT_TIME <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L44"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 44"></a></h3><p>Timing should be based on how timing progresses on clients, not the server.</p>
<p>Tracking this is more expensive,
should only be used in conjuction with things that have to progress client side, such as
animate() or sound()</p><h3 id="define/TIMER_DELETE_ME"><aside class="declaration">#define </aside>TIMER_DELETE_ME <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L60"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 60"></a></h3><p>Delete the timer on parent datum Destroy() and when deltimer'd</p><h3 id="define/TIMER_ID_NULL"><aside class="declaration">#define </aside>TIMER_ID_NULL <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L63"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 63"></a></h3><p>Empty ID define</p><h3 id="define/TIMER_LOOP"><aside class="declaration">#define </aside>TIMER_LOOP <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L57"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 57"></a></h3><p>Loops the timer repeatedly until qdeleted</p>
<p>In most cases you want a subsystem instead, so don't use this unless you have a good reason</p><h3 id="define/TIMER_NO_HASH_WAIT"><aside class="declaration">#define </aside>TIMER_NO_HASH_WAIT <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L52"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 52"></a></h3><p>prevents distinguishing identical timers with the wait variable</p>
<p>To be used with TIMER_UNIQUE</p><h3 id="define/TIMER_OVERRIDE"><aside class="declaration">#define </aside>TIMER_OVERRIDE <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L35"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 35"></a></h3><p>For unique timers: Replace the old timer rather then not start this one</p><h3 id="define/TIMER_STOPPABLE"><aside class="declaration">#define </aside>TIMER_STOPPABLE <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L47"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 47"></a></h3><p>Timer can be stopped using deltimer()</p><h3 id="define/TIMER_UNIQUE"><aside class="declaration">#define </aside>TIMER_UNIQUE <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L32"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 32"></a></h3><p>Don't run if there is an identical unique timer active</p>
<p>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</p><h3 id="define/addtimer"><aside class="declaration">#define </aside>addtimer<aside>(args ...)</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/__DEFINES/subsystems.dm#L238"><img src="git.png" width="16" height="16" title="code/__DEFINES/subsystems.dm 238"></a></h3><p>Create a new timer and add it to the queue.</p>
<ul>
<li>Arguments:</li>
<li>
<ul>
<li>callback the callback to call on timer finish</li>
</ul>
</li>
<li>
<ul>
<li>wait deciseconds to run the timer for</li>
</ul>
</li>
<li>
<ul>
<li>flags flags for this timer, see: code__DEFINES\subsystems.dm</li>
</ul>
</li>
</ul></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html>