dynamic_ruleset 
Dynamic ruleset datum
These datums (which are not singletons) are used by dynamic to create antagonists
Vars | |
blacklisted_roles | List of roles that are blacklisted from this ruleset For roundstart rulesets, it will prevent players from being selected for this ruleset if they have one of these roles For latejoin or midround rulesets, it will prevent players from being assigned to this ruleset if they have one of these roles |
---|---|
config_tag | Tag the ruleset uses for configuring. Don't change this unless you know what you're doing. |
jobban_flag | What flag to check for jobbans? Optional, if unset, uses pref_flag |
max_antag_cap | How many candidates will be this ruleset try to select? Ie. "We have 10 cadidates, but we only want x of them to be antags" |
min_antag_cap | How many candidates are needed for this ruleset to be selected? Ie. "We won't even bother attempting to run this ruleset unless at least x players want to be it" |
min_pop | The min population for which this ruleset is available. |
minimum_required_age | Players whose account is less than this many days old will be filtered out of the candidate list |
name | Human-readable name of the ruleset. |
pref_flag | What flag to check for prefs? Required if the antag has an associated preference |
preview_antag_datum | Points to what antag datum this ruleset will use for generating a preview icon in the prefs menu |
repeatable | If set to TRUE, dynamic will be able to draft this ruleset again later on |
repeatable_weight_decrease | Every time this ruleset is selected, the weight will be decreased by this amount |
ruleset_flags | Flags for this ruleset |
ruleset_lazy_templates | Templates necessary for this ruleset to be executed |
selected_minds | List of all minds selected for this ruleset |
weight | The chance the ruleset is picked when selecting from the pool of rulesets. |
Procs | |
assign_role | Used by the ruleset to actually assign the role to the player This is ran after they have a player character spawned, and after they're in their job (with all their job equipment) |
can_be_selected | Any additional checks to see if this ruleset can be selected |
configure_ruleset | Allows admins to configure rulesets before prepare_execution() is called. |
create_execute_args | Allows you to supply extra arguments to assign_role() if needed |
execute | Executes the ruleset, assigning the selected players to their roles. No backing out now, at this point it's guaranteed to run. |
get_always_blacklisted_roles | Returns a list of roles that are always blacklisted from this ruleset, for mechanical reasons (an AI can't be a changeling) |
get_antag_cap | Returns what the antag cap with the given population is. |
get_blacklisted_roles | Returns a list of roles that cannot be selected for this ruleset |
get_candidate_mind | Gets the mind of a candidate, can be overridden to return a different mind if necessary |
get_config_blacklisted_roles | Returns all the jobs the config says this ruleset cannot select |
get_weight | Calculates the weight of this ruleset for the given tier. |
is_valid_candidate | Any additional checks to see if this player is a valid candidate for this ruleset |
load_templates | Handles loading map templates that this ruleset requires |
load_tier_list | Used to create tier lists for weights and min_pop values |
prepare_execution | Prepares the ruleset for execution, primarily used for selecting the players who will be assigned to this ruleset |
prepare_for_role | Handles any special logic that needs to be done for a player before they are assigned to this ruleset This is ran before the player is in their job position, and before they even have a player character |
round_result | Handles setting SSticker news report / mode result for more impactful rulsets |
select_candidates | Returns a list of players picked for this ruleset |
set_config_value | Used for parsing config entries to validate them |
trim_candidates | Takes in a list of players and returns a list of players who are valid candidates for this ruleset Don't touch this proc if you need to trim candidates further - override is_valid_candidate() instead |
Var Details
blacklisted_roles 
List of roles that are blacklisted from this ruleset For roundstart rulesets, it will prevent players from being selected for this ruleset if they have one of these roles For latejoin or midround rulesets, it will prevent players from being assigned to this ruleset if they have one of these roles
config_tag 
Tag the ruleset uses for configuring. Don't change this unless you know what you're doing.
jobban_flag 
What flag to check for jobbans? Optional, if unset, uses pref_flag
max_antag_cap 
How many candidates will be this ruleset try to select? Ie. "We have 10 cadidates, but we only want x of them to be antags"
This can either be
- A number Or
- A list in the form of list("denominator" = x, "offset" = y) which will divide the population size by x and add y to it to calculate the number of candidates
If null, defaults to min_antag_cap
min_antag_cap 
How many candidates are needed for this ruleset to be selected? Ie. "We won't even bother attempting to run this ruleset unless at least x players want to be it"
This can either be
- A number Or
- A list in the form of list("denominator" = x, "offset" = y) which will divide the population size by x and add y to it to calculate the number of candidates
min_pop 
The min population for which this ruleset is available.
This can either be
- A list of min populations corresponding to dynamic tiers. If a tier is not specified, it will use the next highest tier. Or
- A single min population for all tiers.
minimum_required_age 
Players whose account is less than this many days old will be filtered out of the candidate list
name 
Human-readable name of the ruleset.
pref_flag 
What flag to check for prefs? Required if the antag has an associated preference
preview_antag_datum 
Points to what antag datum this ruleset will use for generating a preview icon in the prefs menu
repeatable 
If set to TRUE, dynamic will be able to draft this ruleset again later on
repeatable_weight_decrease 
Every time this ruleset is selected, the weight will be decreased by this amount
ruleset_flags 
Flags for this ruleset
ruleset_lazy_templates 
Templates necessary for this ruleset to be executed
selected_minds 
List of all minds selected for this ruleset
weight 
The chance the ruleset is picked when selecting from the pool of rulesets.
This can either be
- A list of weight corresponding to dynamic tiers. If a tier is not specified, it will use the next highest tier. Or
- A single weight for all tiers.
Proc Details
assign_role
Used by the ruleset to actually assign the role to the player This is ran after they have a player character spawned, and after they're in their job (with all their job equipment)
Override this proc to give out antag datums or special items or whatever
can_be_selected
Any additional checks to see if this ruleset can be selected
configure_ruleset
Allows admins to configure rulesets before prepare_execution() is called.
Only called if RULESET_ADMIN_CONFIGURABLE is set in ruleset_flags. Also only called by midrounds currently.
create_execute_args
Allows you to supply extra arguments to assign_role() if needed
execute
Executes the ruleset, assigning the selected players to their roles. No backing out now, at this point it's guaranteed to run.
Prefer to override assign_role() instead of this proc
get_always_blacklisted_roles
Returns a list of roles that are always blacklisted from this ruleset, for mechanical reasons (an AI can't be a changeling)
get_antag_cap
Returns what the antag cap with the given population is.
get_blacklisted_roles
Returns a list of roles that cannot be selected for this ruleset
get_candidate_mind
Gets the mind of a candidate, can be overridden to return a different mind if necessary
get_config_blacklisted_roles
Returns all the jobs the config says this ruleset cannot select
get_weight
Calculates the weight of this ruleset for the given tier.
- population_size - How many players are alive
- tier - The dynamic tier to calculate the weight for
is_valid_candidate
Any additional checks to see if this player is a valid candidate for this ruleset
load_templates
Handles loading map templates that this ruleset requires
load_tier_list
Used to create tier lists for weights and min_pop values
prepare_execution
Prepares the ruleset for execution, primarily used for selecting the players who will be assigned to this ruleset
- antag_candidates - List of players who are candidates for this ruleset This list is mutated by this proc!
Returns TRUE if execution is ready, FALSE if it should be canceled
prepare_for_role
Handles any special logic that needs to be done for a player before they are assigned to this ruleset This is ran before the player is in their job position, and before they even have a player character
Override this proc to do things like set forced jobs, DON'T assign roles or give out equipments here!
round_result
Handles setting SSticker news report / mode result for more impactful rulsets
Return TRUE if any result was set
select_candidates
Returns a list of players picked for this ruleset
set_config_value
Used for parsing config entries to validate them
trim_candidates
Takes in a list of players and returns a list of players who are valid candidates for this ruleset Don't touch this proc if you need to trim candidates further - override is_valid_candidate() instead