Files
Yogstation/code/modules/modular_computers/documentation.md
alexkar598 8b963c9626 Documents 61 files (#9306)
* Document the world (#46495)

* Document drone verbs.dm

* Document the outfit datum with autodoc (#45415)

* Uncurse take_damage and document obj_defense.dm (#45146)

The original take_damage proc defined vars for no good reason had some 
duplicate code and wasn't very readable.

If you are wondering why it calls obj_break every time it takes damage 
while below integrity_failure, that's the way it used to be. Most (if 
not all) stuff that takes advantage of this functionality already 
accounts for this.

* Convert some code docs into the auto doc format (#45101)

* Commit Message

* Fixes

* e

* Documents browserOutput.dm (#51439)

* Add autodoc to the callback datum (#45463)

* Autodoc the vending machine (#45468)

* Autodoc the vending machine

* Update code/modules/vending/_vending.dm

Co-Authored-By: Tad Hardesty <tad@platymuus.com>

* autodoc organ helpers (#45464)

* timer proc autodocs (#46530)

* bunch of define autodocs

* ballistic guns autodoc (#45578)

* ballistic guns autodoc

* fixes

* client vars autodoc (#46446)

About The Pull Request

Autodocs client vars

* Autodoc for XB and Research

* shuttle docking autodoc (#48677)

* Add autodocs for reagents (#49478)

* Fix

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Jonathan (JJRcop) Rubenstein <jrubcop@gmail.com>
Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com>
Co-authored-by: alexkar598 <>
Co-authored-by: Tad Hardesty <tad@platymuus.com>
Co-authored-by: spookydonut <github@spooksoftware.com>
Co-authored-by: actioninja <actioninja@gmail.com>
2020-07-24 21:38:47 -04:00

2.8 KiB

Modular computer programs

How module computer programs work

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.

Base setup

This is how the base program is setup. the rest is mostly tgui stuff. I'll use the ntnetmonitor as a base

/datum/computer_file/program/ntnetmonitor
	/// This is obviously the name of the file itself. not much to be said
	filename = "ntmonitor"

	/// This is sort of the official name. it's what shows up on the main menu
	filedesc = "NTNet Diagnostics and Monitoring"

	/// This is what the screen will look like when the program is active
	program_icon_state = "comm_monitor"

	/// This is a sort of a description, visible when looking on the ntnet
	extended_desc = "This program is a dummy."

	/// 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 = "downloader_finished.gif"

Preinstalls

Now. for pre-installing stuff.

Primarily done for consoles, there's an install_programs() proc in the console presets file in the machines folder.

for example, the command console one.

/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())

Basically, you want to do cpu.hard_drive.store_file(new/program path here()) and put it in the subtype's install_programs(). Probably pretty self explanatory, but just in case.

Will probably be expanded when new features come around or I get asked to mention something.