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

dynamic

Vars

candidatesList of candidates used on roundstart rulesets.
configurationDynamic configuration, loaded on pre_setup
current_midround_rulesetsThe last drafted midround rulesets (without the current one included). Used for choosing different midround injections.
current_rulesRules that are processed, rule_process is called on the rules in this list.
executed_rulesList of executed rulesets.
forced_latejoin_ruleForced ruleset to be executed for the next latejoin.
high_impact_ruleset_executedIf a high impact ruleset was executed. Only one will run at a time in most circumstances.
hijacked_random_event_injection_chance_modifierThe extra chance multiplier that a heavy impact midround ruleset will run next time. For example, if this is set to 50, then the next heavy roll will be about 50% more likely to happen.
initial_round_start_budgetThe initial round start budget for logging purposes, set once at the beginning of the round.
last_midround_injection_attemptThe time when the last midround injection was attempted, whether or not it was successful
late_forced_injectionIf TRUE, the next player to latejoin will guarantee roll for a random latejoin antag (this does not guarantee they get said antag roll, depending on preferences and circumstances)
latejoin_delay_maxThe maximum time the recurring latejoin ruleset timer is allowed to be.
latejoin_delay_minThe minimum time the recurring latejoin ruleset timer is allowed to be.
latejoin_injection_cooldownWhen world.time is over this number the mode tries to inject a latejoin ruleset.
latejoin_roll_chanceThe chance for latejoins to roll when ready
latejoin_rulesList of latejoin rules used for selecting the rules.
low_pop_maximum_threatThe maximum threat that can roll with zero players. As the number of players approaches low_pop_player_threshold, the maximum threat level will increase. For example, if low_pop_maximum_threat is 50, low_pop_player_threshold is 20, and the number of readied players is 10, then the highest threat that can roll is lerp(50, 100, 10 / 20), AKA 75.
low_pop_player_thresholdIf there are less than this many players readied, threat level will be lowered. This number should be kept fairly low, as there are other measures that population impacts Dynamic, such as the requirements variable on rulesets.
max_threat_levelA number between 0 and 100. The maximum amount of threat allowed to generate.
mid_forced_injectionIf TRUE, a midround ruleset will be rolled
mid_round_budgetSet at the beginning of the round. Spent by midrounds and latejoins.
midround_heavy_lower_boundAny midround after this point is guaranteed to be heavy
midround_injection_timer_idThe timer ID for the cancellable midround rule injection
midround_light_upper_boundAny midround before this point is guaranteed to be light
midround_lower_boundThe low bound for the midround roll time splits. This number influences where to place midround rolls, making this smaller will make midround rolls more frequent, and vice versa. A midround will never be able to roll before this.
midround_roll_distanceThe distance between the chosen midround roll point (which is deterministic), and when it can actually roll. Basically, if this is set to 5 minutes, and a midround roll point is decided to be at 20 minutes, then it can roll anywhere between 15 and 25 minutes.
midround_rulesList of midround rules used for selecting the rules.
midround_upper_boundThe upper bound for the midround roll time splits. This number influences where to place midround rolls, making this larger will make midround rolls less frequent, and vice versa. A midround will never be able to roll farther than this.
only_ruleset_executedIf a only ruleset has been executed.
peaceful_percentageHow many percent of the rounds are more peaceful.
pop_per_requirement
random_event_hijack_maximumThe maximum amount of time for antag random events to be hijacked.
random_event_hijack_minimumThe minimum amount of time for antag random events to be hijacked.
random_event_hijackedWhether or not a random event has been hijacked this midround cycle
round_start_budgetSet at the beginning of the round. Spent by the mode to "purchase" rules. Everything else goes in the postround budget.
roundend_threat_logThreat log shown on the roundend report. Should only list player-made edits.
roundstart_pop_readyNumber of players who were ready on roundstart.
roundstart_split_curve_centreA number between -5 and +5. Equivalent to threat_curve_centre, but for the budget split. A negative value will weigh towards midround rulesets, and a positive value will weight towards roundstart ones.
roundstart_split_curve_widthA number between 0.5 and 4. Equivalent to threat_curve_width, but for the budget split. Higher value will favour more variance in splits and lower value rounds closer to the average.
shown_threatThe amount of threat shown on the piece of paper. Can differ from the actual threat amount.
snapshotsA list of recorded "snapshots" of the round, stored in the dynamic.json log
threat_curve_centreA number between -5 and +5. A negative value will give a more peaceful round and a positive value will give a round with higher threat.
threat_curve_widthA number between 0.5 and 4. Higher value will favour extreme rounds and lower value rounds closer to the average.
threat_levelThe "threat cap", threat shouldn't normally go above this and is used in ruleset calculations
threat_logRunning information about the threat. Can store text or datum entries.
threat_per_midround_rollThe amount of threat per midround roll. Basically, if this is set to 5, then for every 5 threat, one midround roll will be added. The equation this is used in rounds up, meaning that if this is set to 5, and you have 6 threat, then you will get 2 midround rolls.
waittime_hWhat is the higher bound of when the roundstart announcement is sent out?
waittime_lWhat is the lower bound of when the roundstart announcement is sent out?

Procs

admin_cancel_midroundFired when an admin cancels the current midround injection.
admin_different_midroundFired when an admin requests a different midround injection.
check_blockingChecks if a type in blocking_list is in rule_list.
configure_rulesetApply configurations to rule.
configure_station_traitApply configuration for station trait costs
configure_station_trait_costsGet station traits and call for their config
create_threatGenerate threat and increase the threat_level if it goes beyond, capped at 100
execute_midround_latejoin_ruleMainly here to facilitate delayed rulesets. All midround/latejoin rulesets are executed with a timered callback to this proc.
execute_midround_ruleFired after admins do not cancel a midround injection.
execute_roundstart_ruleMainly here to facilitate delayed rulesets. All roundstart rulesets are executed with a timered callback to this proc.
generate_advisory_levelGenerate the advisory level depending on the shown threat level.
generate_budgetsGenerates the midround and roundstart budgets
generate_threatGenerates the threat level using lorentz distribution and assigns peaceful_percentage.
generate_unfavourable_eventsFilter the below list by which events can actually run on this map
generate_unfavourable_heavy_rulesetsReturn a valid heavy dynamic ruleset, or an empty list if there's no time to run any rulesets
get_heavy_midround_injection_chanceGets the chance for a heavy ruleset midround injection, the dry_run argument is only used for forced injection.
handle_executing_latejoinThis proc handles the execution of a latejoin ruleset, including removing it from latejoin rulesets if not repeatable, upping the injection cooldown, and starting a timer to execute the ruleset on delay.
init_rulesetsReturns a list of the provided rulesets. Configures their variables to match config.
log_dynamic_and_announceLog to dynamic and message admins
lorentz_to_amountReturns the comulative distribution of threat centre and width, and a random location of -5 to 5 plus or minus the otherwise unattainable lower and upper percentiles. All multiplied by the maximum threat and then rounded to the nearest interval. rand() calls without arguments returns a value between 0 and 1, allowing for smaller intervals.
make_antag_chanceHandles late-join antag assignments
new_snapshotCreates a new snapshot with the given rulesets chosen, and writes to the JSON output.
next_midround_injectionReturns the world.time of the next midround injection. Will return a cached result from next_midround_injection, the variable. If that variable is null, will generate a new one.
pick_midround_ruleExecutes a random midround ruleset from the list of drafted rules.
pick_rulesetFrom a list of rulesets, returns one based on weight and availability. Mutates the list that is passed into it to remove invalid rules.
picking_roundstart_ruleInitializes the round start ruleset provided to it. Returns how much threat to spend.
picking_specific_ruleAn experimental proc to allow admins to call rules on the fly or have rules call other rules.
refund_threatRefund threat, but no more than threat_level.
remove_from_listRemoves type from the list
rigged_roundstartA simple roundstart proc used when dynamic_forced_roundstart_ruleset has rules in it.
setup_rulesetsInitializes the internal ruleset variables
spend_midround_budgetExpend midround threat, can't fall under 0.
spend_roundstart_budgetExpend round start threat, can't fall under 0.
unfavorable_situationAn easy interface to make...waves hands bad things happen. This is used for impactful events like traitors hacking and creating more threat, or a revolutions victory. It tries to spawn a heavy midround if possible, otherwise it will trigger a "bad" random event after a short period. Calling this function will not use up any threat.
update_logUpdates the log for the current snapshots.

Var Details

candidates

List of candidates used on roundstart rulesets.

configuration

Dynamic configuration, loaded on pre_setup

current_midround_rulesets

The last drafted midround rulesets (without the current one included). Used for choosing different midround injections.

current_rules

Rules that are processed, rule_process is called on the rules in this list.

executed_rules

List of executed rulesets.

forced_latejoin_rule

Forced ruleset to be executed for the next latejoin.

high_impact_ruleset_executed

If a high impact ruleset was executed. Only one will run at a time in most circumstances.

hijacked_random_event_injection_chance_modifier

The extra chance multiplier that a heavy impact midround ruleset will run next time. For example, if this is set to 50, then the next heavy roll will be about 50% more likely to happen.

initial_round_start_budget

The initial round start budget for logging purposes, set once at the beginning of the round.

last_midround_injection_attempt

The time when the last midround injection was attempted, whether or not it was successful

late_forced_injection

If TRUE, the next player to latejoin will guarantee roll for a random latejoin antag (this does not guarantee they get said antag roll, depending on preferences and circumstances)

latejoin_delay_max

The maximum time the recurring latejoin ruleset timer is allowed to be.

latejoin_delay_min

The minimum time the recurring latejoin ruleset timer is allowed to be.

latejoin_injection_cooldown

When world.time is over this number the mode tries to inject a latejoin ruleset.

latejoin_roll_chance

The chance for latejoins to roll when ready

latejoin_rules

List of latejoin rules used for selecting the rules.

low_pop_maximum_threat

The maximum threat that can roll with zero players. As the number of players approaches low_pop_player_threshold, the maximum threat level will increase. For example, if low_pop_maximum_threat is 50, low_pop_player_threshold is 20, and the number of readied players is 10, then the highest threat that can roll is lerp(50, 100, 10 / 20), AKA 75.

low_pop_player_threshold

If there are less than this many players readied, threat level will be lowered. This number should be kept fairly low, as there are other measures that population impacts Dynamic, such as the requirements variable on rulesets.

max_threat_level

A number between 0 and 100. The maximum amount of threat allowed to generate.

mid_forced_injection

If TRUE, a midround ruleset will be rolled

mid_round_budget

Set at the beginning of the round. Spent by midrounds and latejoins.

midround_heavy_lower_bound

Any midround after this point is guaranteed to be heavy

midround_injection_timer_id

The timer ID for the cancellable midround rule injection

midround_light_upper_bound

Any midround before this point is guaranteed to be light

midround_lower_bound

The low bound for the midround roll time splits. This number influences where to place midround rolls, making this smaller will make midround rolls more frequent, and vice versa. A midround will never be able to roll before this.

midround_roll_distance

The distance between the chosen midround roll point (which is deterministic), and when it can actually roll. Basically, if this is set to 5 minutes, and a midround roll point is decided to be at 20 minutes, then it can roll anywhere between 15 and 25 minutes.

midround_rules

List of midround rules used for selecting the rules.

midround_upper_bound

The upper bound for the midround roll time splits. This number influences where to place midround rolls, making this larger will make midround rolls less frequent, and vice versa. A midround will never be able to roll farther than this.

only_ruleset_executed

If a only ruleset has been executed.

peaceful_percentage

How many percent of the rounds are more peaceful.

pop_per_requirement

random_event_hijack_maximum

The maximum amount of time for antag random events to be hijacked.

random_event_hijack_minimum

The minimum amount of time for antag random events to be hijacked.

random_event_hijacked

Whether or not a random event has been hijacked this midround cycle

round_start_budget

Set at the beginning of the round. Spent by the mode to "purchase" rules. Everything else goes in the postround budget.

roundend_threat_log

Threat log shown on the roundend report. Should only list player-made edits.

roundstart_pop_ready

Number of players who were ready on roundstart.

roundstart_split_curve_centre

A number between -5 and +5. Equivalent to threat_curve_centre, but for the budget split. A negative value will weigh towards midround rulesets, and a positive value will weight towards roundstart ones.

roundstart_split_curve_width

A number between 0.5 and 4. Equivalent to threat_curve_width, but for the budget split. Higher value will favour more variance in splits and lower value rounds closer to the average.

shown_threat

The amount of threat shown on the piece of paper. Can differ from the actual threat amount.

snapshots

A list of recorded "snapshots" of the round, stored in the dynamic.json log

threat_curve_centre

A number between -5 and +5. A negative value will give a more peaceful round and a positive value will give a round with higher threat.

threat_curve_width

A number between 0.5 and 4. Higher value will favour extreme rounds and lower value rounds closer to the average.

threat_level

The "threat cap", threat shouldn't normally go above this and is used in ruleset calculations

threat_log

Running information about the threat. Can store text or datum entries.

threat_per_midround_roll

The amount of threat per midround roll. Basically, if this is set to 5, then for every 5 threat, one midround roll will be added. The equation this is used in rounds up, meaning that if this is set to 5, and you have 6 threat, then you will get 2 midround rolls.

waittime_h

What is the higher bound of when the roundstart announcement is sent out?

waittime_l

What is the lower bound of when the roundstart announcement is sent out?

Proc Details

admin_cancel_midround

Fired when an admin cancels the current midround injection.

admin_different_midround

Fired when an admin requests a different midround injection.

check_blocking

Checks if a type in blocking_list is in rule_list.

configure_ruleset

Apply configurations to rule.

configure_station_trait

Apply configuration for station trait costs

configure_station_trait_costs

Get station traits and call for their config

create_threat

Generate threat and increase the threat_level if it goes beyond, capped at 100

execute_midround_latejoin_rule

Mainly here to facilitate delayed rulesets. All midround/latejoin rulesets are executed with a timered callback to this proc.

execute_midround_rule

Fired after admins do not cancel a midround injection.

execute_roundstart_rule

Mainly here to facilitate delayed rulesets. All roundstart rulesets are executed with a timered callback to this proc.

generate_advisory_level

Generate the advisory level depending on the shown threat level.

generate_budgets

Generates the midround and roundstart budgets

generate_threat

Generates the threat level using lorentz distribution and assigns peaceful_percentage.

generate_unfavourable_events

Filter the below list by which events can actually run on this map

generate_unfavourable_heavy_rulesets

Return a valid heavy dynamic ruleset, or an empty list if there's no time to run any rulesets

get_heavy_midround_injection_chance

Gets the chance for a heavy ruleset midround injection, the dry_run argument is only used for forced injection.

handle_executing_latejoin

This proc handles the execution of a latejoin ruleset, including removing it from latejoin rulesets if not repeatable, upping the injection cooldown, and starting a timer to execute the ruleset on delay.

init_rulesets

Returns a list of the provided rulesets. Configures their variables to match config.

log_dynamic_and_announce

Log to dynamic and message admins

lorentz_to_amount

Returns the comulative distribution of threat centre and width, and a random location of -5 to 5 plus or minus the otherwise unattainable lower and upper percentiles. All multiplied by the maximum threat and then rounded to the nearest interval. rand() calls without arguments returns a value between 0 and 1, allowing for smaller intervals.

make_antag_chance

Handles late-join antag assignments

new_snapshot

Creates a new snapshot with the given rulesets chosen, and writes to the JSON output.

next_midround_injection

Returns the world.time of the next midround injection. Will return a cached result from next_midround_injection, the variable. If that variable is null, will generate a new one.

pick_midround_rule

Executes a random midround ruleset from the list of drafted rules.

pick_ruleset

From a list of rulesets, returns one based on weight and availability. Mutates the list that is passed into it to remove invalid rules.

picking_roundstart_rule

Initializes the round start ruleset provided to it. Returns how much threat to spend.

picking_specific_rule

An experimental proc to allow admins to call rules on the fly or have rules call other rules.

refund_threat

Refund threat, but no more than threat_level.

remove_from_list

Removes type from the list

rigged_roundstart

A simple roundstart proc used when dynamic_forced_roundstart_ruleset has rules in it.

setup_rulesets

Initializes the internal ruleset variables

spend_midround_budget

Expend midround threat, can't fall under 0.

spend_roundstart_budget

Expend round start threat, can't fall under 0.

unfavorable_situation

An easy interface to make...waves hands bad things happen. This is used for impactful events like traitors hacking and creating more threat, or a revolutions victory. It tries to spawn a heavy midround if possible, otherwise it will trigger a "bad" random event after a short period. Calling this function will not use up any threat.

update_log

Updates the log for the current snapshots.