Files
GS13NG/code/modules/modular_computers/documentation.html
2025-02-05 06:19:18 +00:00

62 lines
4.0 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../../"><link rel="stylesheet" href="dmdoc.css"><title>code/modules/modular_computers/documentation.md - /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></header><main><h1>Modular computer programs <aside>code/modules/modular_computers/documentation.md</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/modules/modular_computers/documentation.md0"><img src="git.png" width="16" height="16" title="code/modules/modular_computers/documentation.md0"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><p>How module computer programs work</p>
<p>Ok. so a quick rundown on how to make a program. This is kind of a shitty documentation, but oh well I was asked to.</p>
<h2 id="base-setup">Base setup</h2>
<p>This is how the base program is setup. the rest is mostly tgui stuff. I'll use the ntnetmonitor as a base</p>
<pre><code class="language-DM">/datum/computer_file/program/ntnetmonitor
/// This is obviously the name of the file itself. not much to be said
filename = &quot;ntmonitor&quot;
/// This is sort of the official name. it's what shows up on the main menu
filedesc = &quot;NTNet Diagnostics and Monitoring&quot;
/// This is what the screen will look like when the program is active
program_icon_state = &quot;comm_monitor&quot;
/// This is a sort of a description, visible when looking on the ntnet
extended_desc = &quot;This program is a dummy.&quot;
/// size of the program. Big programs need more hard drive space. Don't
/// make it too big though.
size = 12
/// If this is set, the program will not run without an ntnet connection,
/// and will close if the connection is lost. Mainly for primarily online
/// programs.
requires_ntnet = 1
/// This is access required to run the program itself. ONLY SET THIS FOR
/// SUPER SECURE SHIT. This also acts as transfer_access as well.
required_access = access_network
/// This is the access needed to download from ntnet or host on the ptp
/// program. This is what you want to use most of the time.
transfer_access = access_change_ids
/// If it's available to download on ntnet. pretty self explanatory.
available_on_ntnet = 1
/// ditto but on emagged syndie net. Use this for antag programs
available_on_syndinet = 0
/// Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination)
/// or PROGRAM_ALL. Use this to limit what kind of machines can run the
/// program. For example, comms program should be limited to consoles and laptops.
usage_flags = PROGRAM_ALL
/// This one is kinda cool. If you have the program minimized, this will
/// show up in the header of the computer screen. You can even have the
/// program change what the header is based on the situation! See `alarm.dm`
/// for an example.
var/ui_header = &quot;downloader_finished.gif&quot;
</code></pre>
<h2 id="preinstalls">Preinstalls</h2>
<p>Now. for pre-installing stuff.</p>
<p>Primarily done for consoles, there's an install_programs() proc in the console presets file in the machines folder.</p>
<p>for example, the command console one.</p>
<pre><code class="language-DM">/obj/machinery/modular_computer/console/preset/command/install_programs()
cpu.hard_drive.store_file(new/datum/computer_file/program/chatclient())
cpu.hard_drive.store_file(new/datum/computer_file/program/card_mod())
</code></pre>
<p>Basically, you want to do cpu.hard_drive.store_file(new/<em>program path here</em>()) and put it in the subtype's install_programs().
Probably pretty self explanatory, but just in case.</p>
<p>Will probably be expanded when new features come around or I get asked to mention something.</p></td></tr></table></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>