/tg/ Station 13 - Modules - TypesVar Details - Proc Details

program

Vars

available_on_ntnetWhether the program can be downloaded from NTNet. Set to 0 to disable.
available_on_syndinetWhether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.
computerDevice that runs this program.
extended_descShort description of this program's function.
filedescUser-friendly name of this program.
filenameFile name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET!
ntnet_statusNTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.
program_iconFont Awesome icon to use as this program's icon in the modular computer main menu. Defaults to a basic program maximize window icon if not overridden.
program_icon_stateProgram-specific screen icon state
program_statePROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running.
required_accessList of required accesses to run the program.
requires_ntnetSet to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.
requires_ntnet_featureOptional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION)
tgui_idName of the tgui interface
transfer_accessList of required access to download or file host the program
ui_headerExample: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!
usage_flagsBitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL

Procs

can_runCheck if the user can run program. Only humans can operate computer. Automatically called in run_program() ID must be inserted into a card slot to be read. If the program is not currently installed (as is the case when NT Software Hub is checking available software), a list can be given to be used instead. Arguments: user is a ref of the mob using the device. loud is a bool deciding if this proc should use to_chats access_to_check is an access level that will be checked against the ID transfer, if TRUE and access_to_check is null, will tell this proc to use the program's transfer_access in place of access_to_check access can contain a list of access numbers to check against. If access is not empty, it will be used istead of checking any inserted ID.
run_emagCalled by the device when it is emagged.

Var Details

available_on_ntnet

Whether the program can be downloaded from NTNet. Set to 0 to disable.

available_on_syndinet

Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to 1 to enable.

computer

Device that runs this program.

extended_desc

Short description of this program's function.

filedesc

User-friendly name of this program.

filename

File name. FILE NAME MUST BE UNIQUE IF YOU WANT THE PROGRAM TO BE DOWNLOADABLE FROM NTNET!

ntnet_status

NTNet status, updated every tick by computer running this program. Don't use this for checks if NTNet works, computers do that. Use this for calculations, etc.

program_icon

Font Awesome icon to use as this program's icon in the modular computer main menu. Defaults to a basic program maximize window icon if not overridden.

program_icon_state

Program-specific screen icon state

program_state

PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running.

required_access

List of required accesses to run the program.

requires_ntnet

Set to 1 for program to require nonstop NTNet connection to run. If NTNet connection is lost program crashes.

requires_ntnet_feature

Optional, if above is set to 1 checks for specific function of NTNet (currently NTNET_SOFTWAREDOWNLOAD, NTNET_PEERTOPEER, NTNET_SYSTEMCONTROL and NTNET_COMMUNICATION)

tgui_id

Name of the tgui interface

transfer_access

List of required access to download or file host the program

ui_header

Example: "something.gif" - a header image that will be rendered in computer's UI when this program is running at background. Images are taken from /icons/program_icons. Be careful not to use too large images!

usage_flags

Bitflags (PROGRAM_CONSOLE, PROGRAM_LAPTOP, PROGRAM_TABLET combination) or PROGRAM_ALL

Proc Details

can_run

Check if the user can run program. Only humans can operate computer. Automatically called in run_program() ID must be inserted into a card slot to be read. If the program is not currently installed (as is the case when NT Software Hub is checking available software), a list can be given to be used instead. Arguments: user is a ref of the mob using the device. loud is a bool deciding if this proc should use to_chats access_to_check is an access level that will be checked against the ID transfer, if TRUE and access_to_check is null, will tell this proc to use the program's transfer_access in place of access_to_check access can contain a list of access numbers to check against. If access is not empty, it will be used istead of checking any inserted ID.

run_emag

Called by the device when it is emagged.

Emagging the device allows certain programs to unlock new functions. However, the program will need to be downloaded first, and then handle the unlock on their own in their run_emag() proc. The device will allow an emag to be run multiple times, so the user can re-emag to run the override again, should they download something new. The run_emag() proc should return TRUE if the emagging affected anything, and FALSE if no change was made (already emagged, or has no emag functions).