/tg/ Station 13 - Modules - Types — Var Details - Proc Details

job

Vars

all_occupationsList of all jobs.
assigned_captainIf TRUE, some player has been assigned Captaincy or Acting Captaincy at some point during the shift and has been given the spare ID safe code.
chain_of_commandKeys should be assigned job roles. Values should be >= 1. Represents the chain of command on the station. Lower numbers mean higher priority. Used to give the Cap's Spare safe code to a an appropriate player. Assumed Captain is always the highest in the chain of command. See [/datum/controller/subsystem/ticker/proc/equip_characters]
config_documentationThis is just the message we prepen and put into all of the config files to ensure documentation. We use this in more than one place, so let's put it in the SS to make life a bit easier.
experience_jobs_mapDictionary of jobs indexed by the experience type they grant.
forced_occupationsLazylist of mob:occupation_string pairs. Forces mobs into certain occupations with highest priority.
job_config_datum_singletonsList of job config type datum singletons, as in you can access it via the static key "name" of the job_config_type and then be able to dynamically alter any type of value on runtime load
job_priorities_to_stringsDictionary that maps job priorities to low/medium/high. Keys have to be number-strings as assoc lists cannot be indexed by integers. Set in setup_job_lists.
joinable_departmentsList of all departments with joinable jobs.
joinable_departments_by_typeList of all joinable departments indexed by their typepath, sorted by their own display order.
joinable_occupationsList of jobs that can be joined through the starting menu.
legacy_modeAre we using the old job config system (txt) or the new job config system (TOML)? IF we are going to use the txt file, then we are in "legacy mode", and this will flip to TRUE.
name_occupationsDictionary of all jobs, keys are titles.
overflow_baselinesThe defaults for the current overflow role
overflow_invokerA string related to whatever last set the overflow role through set_overflow_role.
prevented_occupationsLazylist of mob:list(occupation_string) pairs. Prevents mobs from taking certain occupations at all.
safe_code_request_locThe loc to which the emergency safe code has been requested for delivery.
safe_code_requestedWhether the emergency safe code has been requested via a comms console on shifts with no Captain or Acting Captain.
safe_code_timer_idTimer ID for the emergency safe code request.
type_occupationsDictionary of all jobs, keys are types.

Procs

apply_overflow_overridesPuts the overflow restrictions on a given job. We will store the old configuration for a restoration as needed.
assign_priority_positionsAssigns roles that are considered high priority, either due to dynamic needing to force a specific role for a specific ruleset or making sure roles critical to round progression exist where possible every shift.
assign_roleAssigns the given job role to the player.
check_job_eligibilityRuns a standard suite of eligibility checks to make sure the player can take the reqeusted job.
divide_occupations
encode_job_config_lineHelper for encoding a single TOML line with potential commenting
export_tomlProc that we call to generate a new jobconfig.toml file and send it to the requesting client. Returns TRUE if a file is successfully generated. data is an associative list of job config key -> (associative list of config datum key -> job_config_line()).
fill_ai_positionsAttempts to fill out all available AI positions.
fill_all_head_positions_at_priorityAttempts to fill out all possible head positions for players with that job at a a given job priority level. Returns the number of Head positions assigned.
generate_blank_job_configThis will just return a list for a completely new job that doesn't need to be migrated from an old config (completely new). Just done here to reduce copypasta
generate_configWill generate a new jobconfig.toml file if one does not exist, or if one does exist, will migrate the old jobs.txt file into the new TOML format for download Returns TRUE if a file is successfully generated, FALSE otherwise.
generate_config_singletonsReturns an associated list of all of the job config types that we have in the codebase.
generate_job_config_excluding_legacyLike generate_blank_job_config, but we opt-out of adding the legacy variables in case we handle it elsewhere.
get_all_headsReturns a list of minds of all heads of staff
get_all_secReturns a list of minds of all security members
get_config_baseline_valueDoes nothing but read the stored variables of a given occupation as it should exist in either the config or the codebase.
get_configurable_jobsGets a list of all jobs with the JOB_NEW_PLAYER_JOINABLE flag, for config use only. This is just so that loading/regenerating the config still works even if some jobs don't exist in joinable occupations. Ultimately, this here to ensure that server operators will not have their config randomly drop jobs if they make a file at the wrong time (i.e. a map disabling a job)
get_living_headsReturns a list of minds of all heads of staff who are alive
get_living_secReturns a list of minds of all security members who are alive
get_valid_overflow_jobsReturns a list of jobs that we are allowed to fuck with during random events
has_minimum_jobsCheck if the station manifest has at least a certain amount of this staff type. If a matching head of staff is on the manifest, automatically passes (returns TRUE)
import_config_from_txtLoads the job config from the TXT and creates a new TOML file from it. Returns TRUE if a file is successfully generated, FALSE otherwise.
job_config_lineBuilds one entry of a job's section for export_toml. commented is a bool for if the toml entry should have a #-prefix on the whole line.
job_priority_level_to_stringTakes a job priority #define such as JP_LOW and gets its string representation for logging.
legacy_loadOperates the legacy jobs.txt parser to load jobs from the old config system.
load_jobs_from_configSets all of the job datum configurable values to what they've been set to in the config file, jobconfig.toml.
regenerate_job_configIf we add a new job or more fields to config a job with, quickly spin up a brand new config that inherits all of your old settings, but adds the new job with codebase defaults. Returns TRUE if a file is successfully generated, FALSE otherwise.
revert_overflow_overridesUndoes apply_overflow_overrides, restoring back whatever the job held before it became the overflow role.
send_spare_id_safe_codeSend a drop pod containing a piece of paper with the spare ID safe code to loc
set_overflow_roleChanges the overflow role to a new job type. We want to log/otherwise track who set it and when using a string that invoked this public proc.
setup_job_listsBuilds various lists of jobs based on station, centcom and additional jobs with icons associated with them.

Var Details

all_occupations

List of all jobs.

assigned_captain

If TRUE, some player has been assigned Captaincy or Acting Captaincy at some point during the shift and has been given the spare ID safe code.

chain_of_command

Keys should be assigned job roles. Values should be >= 1. Represents the chain of command on the station. Lower numbers mean higher priority. Used to give the Cap's Spare safe code to a an appropriate player. Assumed Captain is always the highest in the chain of command. See [/datum/controller/subsystem/ticker/proc/equip_characters]

config_documentation

This is just the message we prepen and put into all of the config files to ensure documentation. We use this in more than one place, so let's put it in the SS to make life a bit easier.

experience_jobs_map

Dictionary of jobs indexed by the experience type they grant.

forced_occupations

Lazylist of mob:occupation_string pairs. Forces mobs into certain occupations with highest priority.

job_config_datum_singletons

List of job config type datum singletons, as in you can access it via the static key "name" of the job_config_type and then be able to dynamically alter any type of value on runtime load

job_priorities_to_strings

Dictionary that maps job priorities to low/medium/high. Keys have to be number-strings as assoc lists cannot be indexed by integers. Set in setup_job_lists.

joinable_departments

List of all departments with joinable jobs.

joinable_departments_by_type

List of all joinable departments indexed by their typepath, sorted by their own display order.

joinable_occupations

List of jobs that can be joined through the starting menu.

legacy_mode

Are we using the old job config system (txt) or the new job config system (TOML)? IF we are going to use the txt file, then we are in "legacy mode", and this will flip to TRUE.

name_occupations

Dictionary of all jobs, keys are titles.

overflow_baselines

The defaults for the current overflow role

overflow_invoker

A string related to whatever last set the overflow role through set_overflow_role.

prevented_occupations

Lazylist of mob:list(occupation_string) pairs. Prevents mobs from taking certain occupations at all.

safe_code_request_loc

The loc to which the emergency safe code has been requested for delivery.

safe_code_requested

Whether the emergency safe code has been requested via a comms console on shifts with no Captain or Acting Captain.

safe_code_timer_id

Timer ID for the emergency safe code request.

type_occupations

Dictionary of all jobs, keys are types.

Proc Details

apply_overflow_overrides

Puts the overflow restrictions on a given job. We will store the old configuration for a restoration as needed.

assign_priority_positions

Assigns roles that are considered high priority, either due to dynamic needing to force a specific role for a specific ruleset or making sure roles critical to round progression exist where possible every shift.

assign_role

Assigns the given job role to the player.

Arguments:

check_job_eligibility

Runs a standard suite of eligibility checks to make sure the player can take the reqeusted job.

Checks:

Arguments:

divide_occupations

encode_job_config_line

Helper for encoding a single TOML line with potential commenting

export_toml

Proc that we call to generate a new jobconfig.toml file and send it to the requesting client. Returns TRUE if a file is successfully generated. data is an associative list of job config key -> (associative list of config datum key -> job_config_line()).

fill_ai_positions

Attempts to fill out all available AI positions.

fill_all_head_positions_at_priority

Attempts to fill out all possible head positions for players with that job at a a given job priority level. Returns the number of Head positions assigned.

Arguments:

generate_blank_job_config

This will just return a list for a completely new job that doesn't need to be migrated from an old config (completely new). Just done here to reduce copypasta

generate_config

Will generate a new jobconfig.toml file if one does not exist, or if one does exist, will migrate the old jobs.txt file into the new TOML format for download Returns TRUE if a file is successfully generated, FALSE otherwise.

generate_config_singletons

Returns an associated list of all of the job config types that we have in the codebase.

generate_job_config_excluding_legacy

Like generate_blank_job_config, but we opt-out of adding the legacy variables in case we handle it elsewhere.

get_all_heads

Returns a list of minds of all heads of staff

get_all_sec

Returns a list of minds of all security members

get_config_baseline_value

Does nothing but read the stored variables of a given occupation as it should exist in either the config or the codebase.

get_configurable_jobs

Gets a list of all jobs with the JOB_NEW_PLAYER_JOINABLE flag, for config use only. This is just so that loading/regenerating the config still works even if some jobs don't exist in joinable occupations. Ultimately, this here to ensure that server operators will not have their config randomly drop jobs if they make a file at the wrong time (i.e. a map disabling a job)

get_living_heads

Returns a list of minds of all heads of staff who are alive

get_living_sec

Returns a list of minds of all security members who are alive

get_valid_overflow_jobs

Returns a list of jobs that we are allowed to fuck with during random events

has_minimum_jobs

Check if the station manifest has at least a certain amount of this staff type. If a matching head of staff is on the manifest, automatically passes (returns TRUE)

Arguments:

import_config_from_txt

Loads the job config from the TXT and creates a new TOML file from it. Returns TRUE if a file is successfully generated, FALSE otherwise.

job_config_line

Builds one entry of a job's section for export_toml. commented is a bool for if the toml entry should have a #-prefix on the whole line.

job_priority_level_to_string

Takes a job priority #define such as JP_LOW and gets its string representation for logging.

legacy_load

Operates the legacy jobs.txt parser to load jobs from the old config system.

load_jobs_from_config

Sets all of the job datum configurable values to what they've been set to in the config file, jobconfig.toml.

regenerate_job_config

If we add a new job or more fields to config a job with, quickly spin up a brand new config that inherits all of your old settings, but adds the new job with codebase defaults. Returns TRUE if a file is successfully generated, FALSE otherwise.

revert_overflow_overrides

Undoes apply_overflow_overrides, restoring back whatever the job held before it became the overflow role.

send_spare_id_safe_code

Send a drop pod containing a piece of paper with the spare ID safe code to loc

set_overflow_role

Changes the overflow role to a new job type. We want to log/otherwise track who set it and when using a string that invoked this public proc.

setup_job_lists

Builds various lists of jobs based on station, centcom and additional jobs with icons associated with them.