Skip to content

Arguments

Coy-Allen edited this page Feb 19, 2022 · 29 revisions

Arguments are the only way to interact with DRG. Some can only check the game's state while others can also modify the state, such as changing your loadout. These are called "Checks" and "Sets", all Sets can be used as a Check and Sets will automatically Check themselves before running. This is done to prevent Sets from doing something that you shouldn't be able to do.

Fun fact: Any Check with three states can cycle through all possible permutations of that value. This can be cleverly done with inverting the argument to give all possible combinations of 1 or 2 types, with the True argument giving the last 2 combinations. This trick works on the Complexity, Duration, and Structure arguments.

True

A simple check argument. will always return true. Useful for manually enabling or disabling a rarely used or joke statement. Can return false instead by inverting it with a NOT. Remember to update the header when adding or deleting the exclamation point.

True !True

VarInt

A strange Set argument. VarInt references a signed integer in the mod. This integer is set to 0 when the Prog is ran. By setting and checking this integer it is possible to have more complex control flow in the Prog. It can also be used as a simple way to switch/case between statements, theoretically giving you 4,294,967,295 loadouts instead of programmatically made ones. Will return true if the given integer is equal to the variables current value.

Varint:-5 Varint:2000000000

Mission Related Arguments

These arguments are all Checks and only contain 3 parts. The first is the keyword "Mission". The second determines what is checked and the last determines what you check against. As of writing there is no dedicated argument to check if a mission is selected or not. Use Objective1 for a workaround.

Complexity and Duration

Takes an integer between 0 and 2 as its first part. Returns true if the given integer plus one equals the current mission's complexity/duration.

Mission:Complexity:0 Mission:Duration:2

Structure

Takes an integer between 0 and 2 as its first part. Returns true if the given integer is the current mission's structure. Indexes are as follows:
0 = Single Mission, 1 = Deep Dive, 2 = Elite Deep Dive.

Mission:Structure:0

Biome

Takes an integer between 0 and 10 as its first part. Returns true if the given integer is equal to the missions biomes index. Indexes are as follows:
0 = Crystalline Caverns, 1 = Fungus Bogs, 2 = Glacial Strata, 3 = Dense Biozone, 4 = Magma Core, 5 = Radioactive Exclusion Zone, 6 = Salt Pits, 7 = Sandblasted Corridors, 8 = Caustic Mire, 9 = Azure Weald, 10 = Hollow Bough

Mission:Biome:8

Objective1 and Objective2

The primary/secondary objective. Takes an integer between 0 and 7 as its first part. Returns true if the given integer is equal to the missions objective index. Objective1 can be used to check if a mission is selected. It will return true if the mission is not in the mod's hard coded objective list (Since "no mission" can't be in the list).

Primary Objective Indexes:
-1 = No/Unknown Objective 0 = Mining Expedition, 1 = Egg Hunt, 2 = On-site Refining, 3 = Salvage Operation, 4 = Point Extraction, 5 = Escort Duty, 6 = Elimination, 7 = Industrial Sabotage

Secondary Objective Indexes:
-1 = No/Unknown Objective 0 = Alien Fossil, 1 = Apoca Bloom, 2 = Boolo Cap, 3 = Dystrum, 4 = Ebonut, 5 = Fester Flea, 6 = Gunk Seed, 7 = Hollomite

Mission:Objective1:-1 Mission:Objective2:4

Anomaly

Takes an integer between 0 and 7 as its first part. Returns true if the given integer is equal to the missions anomaly index. Currently there is a hard coded limit of one anomaly per mission. Indexes are as follows:
0 = Gold Rush, 1 = Low Gravity, 2 = Mineral Mania, 3 = Golden Bugs, 4 = Rich Atmosphere, 5 = Critical Weakness, 6 = Double XP, 7 = Volatile Guts

Mission:Anomaly:3

Warning

Takes an integer between 0 and 10 as its first part. Returns true if the given integer is equal to the warning index of any warning that currently applies to this mission. DRG's generated mission object can theoretically support every single warning at once. Indexes are as follows:
0 = Exploder Infestation, 1 = Shield Disruption, 2 = Mactera Plague, 3 = Cave Leech Cluster, 4 = Parasites, 5 = Regenerative Bugs, 6 = Low Oxygen, 7 = Lethal Enemies, 8 = Haunted Cave, 9 = Elite Threat, 10 = Swarmageddon

Mission:Warning:6

Hazard

Takes an integer between 0 and 4 as its first part. Returns true if the given integer plus one is equal to the hazard level of the current mission. This is untested on mods that add or modify hazard levels and should be used with caution. Only recognizes base game whole number hazard levels.

Mission:Hazard:0

Self

The self argument is a complex Set argument. It can have multiple different part lengths depending on what is to be checked. The different length self arguments are shown below with what each is doing. An argument will fail if a parent argument would have failed. For example if you're not driller but try to set the drillers perk slots the argument will always fail.

Self
	XXPerks:$
	Class:#
		XXSlots:#
		Inventory:#:#
			Overclock
				$
			Upgrade:#
				#
# perk check (driller: Active Perk Slot: Field Medic)
self:Active_Perks:FieldMedic
# class check (driller)
self:class:0
# perk slot check (driller: Active Perk Slot: 1 slot)
self:class:0:Active_Slots:0
# item check (driller: primary weapon: CRSPR Flamethrower)
self:class:0:Inventory:0:0
# overclock check (driller: primary weapon: CRSPR Flamethrower: Overclock)
self:class:0:Inventory:0:0:overclock
# overclock upgrade check (driller: primary weapon: CRSPR Flamethrower: Overclock: Lighter Tanks)
self:class:0:Inventory:0:0:overclock:Lighter_Tanks
# upgrade tier check (driller: primary weapon: CRSPR Flamethrower: tier 1)
self:class:0:Inventory:0:0:upgrade:0
# upgrade check (driller: primary weapon: CRSPR Flamethrower: tier 1: High Capacity Tanks)
self:class:0:Inventory:0:0:upgrade:0:0

Perk Check

The two types of perk checks are Active_Perks and Passive_Perks. both return true if the given perk is unlocked. The 'New Passive Perk Slot' perk is not accessible here, use the 'Perk Slot' Check instead. The available internal perk names are listed below along with the human readable name:

Active:
BeastMaster, Berzerker, Dash, FieldMedic, HeightenedSenses, HoverBoots, IronWill, DownedBomb, ShieldLink
Beast Master, Berzerker, Dash, Field Medic, Heightened Senses, Hover Boots, Iron Will, See You In Hell, Shield Link

Passive:
BornReady, DeepPockets, TemperatureInsulation, FriendlyFire, BugThing, Resupplier, MarathonGuy, FlareThrower, RedSugarRocks, Thorns, StrongBack, Vampire, ExpertDepositor
Born Ready, Deep Pockets, Elemental Insulation, Friendly, It's a Bug Thing, Resupplier, Second Wind, Strong Arm, Sweet Tooth, Thorns, Unstoppable, Vampire, Veteran Depositor\

self:Active_Perks:ShieldLink self:Passive_Perks:TemperatureInsulation

Class Check

The class check works differently from all other self checks. Instead of checking if a class is unlocked (they are all unlocked by default), it checks if you are currently the specified class. Since the mod can only act upon the currently selected class this check is here to disallow checking items or properties of a non-selected class. It is recommended to organize your statements by class and not have a statement act upon two different classes. Indexes are as follows:
0 = Driller, 1 = Engineer, 2 = Gunner, 3 = Scout/Navigator

Self:Class:0

Perk Slot Check

Returns true if the number of perks slots is greater than or equal to the provided integer. For example if you specify 2 passive perks it will return true if you have 2 or 3 unlocked passive perk slots. Specifying 0 slots should always return true as you unlock 1 of each slot by default.

Self:Class:0:Passive_Slots:3 Self:Class:0:Active_Slots:2

Item Check

returns true if the given item category and index corresponds to an owned item. Most categories only hold one item. Returns false if the item or category doesn't exist or isn't owned. given in the format 'catagoryIndex:itemIndex'. Category indexes are as follows:
0 = Primary Weapon, 1 = Secondary Weapon, 2 = Traversal Tool, 3 = Class Tool, 4 = Grenade, 5 = Flare, 6 = Mining Tool, 7 = Armor

Self:Class:0:Inventory:4:0 Self:Class:0:Inventory:1:1

Overclock Check

Returns true if the specified item has overclocking enabled (A purchased upgrade in all upgrade tiers). Note that this can still return true even if no dwarf has a promotion and/or no overclocks are forged.

self:class:0:Inventory:0:0:overclock

Overclock Upgrade Check

Returns true if the given overclock is owned. Note that due to the parent evaluation this will always return false if the Overclock check fails. Overclocks are as follows:

WIP: I need to buy all the overclocks and dump their internal values. fun.

Overclocks

Driller:
CRSPR Flamethrower: ?, Sticky_Additive, Compact_Feed_Valves, ?, ?, ?
Cryo Cannon: ?, ?, ?, ?, ?, Snowball
Corrosive Sludge Pump: ?, ?, Volatile_Impact_Mixture, ?, ?, ?
Subata 120: ?, ?, ?, ?, Explosive_Reload, ?
Experimental Plasma Charger: Energy_Rerouting, ?, ?, ?, ?, ?

Engineer:
"Warthog" Auto 210: ?, Light-weight_Magazines, ?, ?, ?
"Stubby" Voltaic SMG: ?, ?, ?, ?, ?, ?
LOK-1 Smart Rifle: ?, ?, ?, ?, ?, Neuro-Lasso
Deepcore 40mm PGL: ?, ?, ?, ?, ?, Hyper_Propellant
Breach Cutter: ?, ?, ?, ?, ?, ?, ?

Gunner:
"Lead Storm" Powered Minigun: ?, ?, Burning_Hell, Compact_Feed_Mechanism, ?, ?, ?
"Thunderhead" Heavy Autocannon: ?, ?, ?, ?, ?, ?
"Hurricane" Guided Rocket System: ?, ?, ?, ?, ?, ?, ?
"Bulldog" Heavy Revolver: ?, ?, ?, ?, Elephant_Rounds, ?
BRT7 Burst Fire Gun: ?, ?, Compact_Mags, ?, ?, ?, ?

Scout:
Deepcore GK2: ?, ?, ?, ?, ?, ?, ?
M1000 Classic: ?, Minimal_Clips, ?, Hipster, ?, ?
DRAK-25 Plasma Carbine: ?, ?, ?, ?, ?, ?, ?
Jury-Rigged Boomstick: ?, ?, ?, Stuffed_Shells, Shaped_Shells, ?
Zhukov NUK17: ?, ?, ?, ?, ?

Upgrade Tier Check

Returns true if the specified upgrade tier is unlocked. Returns false if the index is out of bounds or not unlocked.

self:class:0:Inventory:0:0:upgrade:2

Upgrade Check

Returns true if the given upgrade is currently owned or equipped. Returns false if the index is out of bounds or not owned.

self:class:0:Inventory:0:0:upgrade:4:1

Clone this wiki locally