program
Vars | |
NM | If the program uses NanoModule, put it here and it will be automagically opened. Otherwise implement ui_interact. |
---|---|
available_on_ntnet | Whether the program can be downloaded from NTNet. Set to FALSE to disable. |
available_on_syndinet | Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to TRUE to enable. |
category | Category that this program belongs to. |
computer | OS that this program is running on. |
extended_desc | Short description of this program's function. |
filedesc | User-friendly name of this program. |
nanomodule_path | Path to nanomodule, make sure to set this if implementing new program. |
network_destination | Optional string that describes what NTNet server/system this program connects to. Used in default logging. |
operator_skill | Holder for skill value of current/recent operator for programs that tick. |
processing_size | How much processing size the program should take up. |
program_icon_state | Program-specific screen icon state. |
program_key_state | Program-specific keyboard icon state. |
program_menu_icon | Icon to use for program's link in main menu. |
program_state | One of PROGRAM_STATE_* - specifies whether this program is running. |
required_access | List of required accesses to run/download the program. |
requires_access_to_download | Whether the program checks for required_access when downloading. |
requires_access_to_run | Whether the program checks for required_access when run. |
requires_ntnet | Set to TRUE 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 TRUE, checks for specific function of NTNet (One of NTNET_*). |
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 /nano/images/status_icons. |
usage_flags | Bitflags (Any of PROGRAM_* ) or PROGRAM_ALL |
Procs | |
Topic | CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC: Topic calls are automatically forwarded from NanoModule this program contains. Calls beginning with "PRG_" are reserved for programs handling. Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program) ALWAYS INCLUDE PARENT CALL ..() AT THE TOP OF THE PROC OR DIE IN FIRE. Return values should be one of TOPIC_* |
can_run | Check if the user can run program. Only humans can operate computer. Automatically called in run_program(). User has to wear their ID or have it inhand for ID Scan to work. Can also be called manually, with optional parameter being access_to_check to scan the user's ID |
check_eye | Relays the call to nano module, if we have one |
event_idremoved | Called when the ID card is removed from computer. ID is removed AFTER this proc. |
event_networkfailure | Called when the network connectivity fails. Computer does necessary checks and only calls this when requires_ntnet_feature and similar variables are not met. |
event_powerfailure | Called when the computer fails due to power loss. Override when program wants to specifically react to power loss. |
generate_network_log | Attempts to create a log in global ntnet datum. Returns TRUE on success, FALSE on fail. |
get_header_data | This attempts to retrieve header data for NanoUIs. If implementing completely new device of different type than existing ones, always include the device here in this proc. This proc basically relays the request to whatever is running the program. |
on_shutdown | Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client. |
on_startup | When implementing new program based device, use this to run the program. May be overriden to add extra logic. Remember to include ..() call. |
process_tick | Called by Process() on device that runs us, once every tick. Remember to call ..() if overriding |
ui_interact | This is called every tick when the program is enabled. Ensure you do parent call if you override it. If parent returns TRUE continue with UI initialisation. It returns FALSE if it can't run or if NanoModule was used instead. I suggest using NanoModules where applicable. |
update_computer_icon | Relays icon update to the computer. |
Var Details
NM
If the program uses NanoModule, put it here and it will be automagically opened. Otherwise implement ui_interact.
available_on_ntnet
Whether the program can be downloaded from NTNet. Set to FALSE to disable.
available_on_syndinet
Whether the program can be downloaded from SyndiNet (accessible via emagging the computer). Set to TRUE to enable.
category
Category that this program belongs to.
computer
OS that this program is running on.
extended_desc
Short description of this program's function.
filedesc
User-friendly name of this program.
nanomodule_path
Path to nanomodule, make sure to set this if implementing new program.
network_destination
Optional string that describes what NTNet server/system this program connects to. Used in default logging.
operator_skill
Holder for skill value of current/recent operator for programs that tick.
processing_size
How much processing size the program should take up.
program_icon_state
Program-specific screen icon state.
program_key_state
Program-specific keyboard icon state.
program_menu_icon
Icon to use for program's link in main menu.
program_state
One of PROGRAM_STATE_*
- specifies whether this program is running.
required_access
List of required accesses to run/download the program.
requires_access_to_download
Whether the program checks for required_access when downloading.
requires_access_to_run
Whether the program checks for required_access when run.
requires_ntnet
Set to TRUE 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 TRUE, checks for specific function of NTNet (One of NTNET_*).
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 /nano/images/status_icons.
usage_flags
Bitflags (Any of PROGRAM_*
) or PROGRAM_ALL
Proc Details
Topic
CONVENTIONS, READ THIS WHEN CREATING NEW PROGRAM AND OVERRIDING THIS PROC: Topic calls are automatically forwarded from NanoModule this program contains. Calls beginning with "PRG_" are reserved for programs handling. Calls beginning with "PC_" are reserved for computer handling (by whatever runs the program) ALWAYS INCLUDE PARENT CALL ..() AT THE TOP OF THE PROC OR DIE IN FIRE. Return values should be one of TOPIC_*
can_run
Check if the user can run program. Only humans can operate computer. Automatically called in run_program(). User has to wear their ID or have it inhand for ID Scan to work. Can also be called manually, with optional parameter being access_to_check to scan the user's ID
check_eye
Relays the call to nano module, if we have one
event_idremoved
Called when the ID card is removed from computer. ID is removed AFTER this proc.
event_networkfailure
Called when the network connectivity fails. Computer does necessary checks and only calls this when requires_ntnet_feature and similar variables are not met.
event_powerfailure
Called when the computer fails due to power loss. Override when program wants to specifically react to power loss.
generate_network_log
Attempts to create a log in global ntnet datum. Returns TRUE on success, FALSE on fail.
get_header_data
This attempts to retrieve header data for NanoUIs. If implementing completely new device of different type than existing ones, always include the device here in this proc. This proc basically relays the request to whatever is running the program.
on_shutdown
Use this proc to kill the program. Designed to be implemented by each program if it requires on-quit logic, such as the NTNRC client.
on_startup
When implementing new program based device, use this to run the program. May be overriden to add extra logic. Remember to include ..() call.
process_tick
Called by Process() on device that runs us, once every tick. Remember to call ..() if overriding
ui_interact
This is called every tick when the program is enabled. Ensure you do parent call if you override it. If parent returns TRUE continue with UI initialisation. It returns FALSE if it can't run or if NanoModule was used instead. I suggest using NanoModules where applicable.
update_computer_icon
Relays icon update to the computer.