Tiny Strats Modding

Reference lists

Game states, GameConfig keys, status effects, tags, attributes, modifiers, zones.

Game states

Game.GetState() and Game.StateChanged use these values:

StateMeaning
IntermissionBetween matches.
VotePrepareThe map vote is about to open.
VotingPlayers vote for the next map.
LoadingThe map and gamemode are loading (GameConfig is reset here).
ActiveThe match is running.
JustEndedThe match just ended (results showing).
EndedClean-up after the match.
EditorMap editor servers only.

GameConfig keys

Game.GetConfigKeys() lists them: the place's GameConfig values, plus any key of the default gamemode below that the server creates at boot. Mods set the rules, so the mod API's own actions (:Sell(), :Upgrade(), GrantResearch, :Recruit) ignore the Can* switches. Values are booleans or numbers (numbers must be within ±1e6). Reset during Loading means each match load writes the key back to the gamemode's value, so a change made between matches is lost. Set these in MatchStarted or through RegisterGamemode.

Server rules. Owners can change most of these keys from the Server Manager's RULES tab. An owner's value lasts for the rest of the server's life and is applied on top of every gamemode (and the map's silo range) at each load, except in the tutorial. A key an owner set therefore comes back on the next match load even if your mod changed it, so set it again in MatchStarted if your mod depends on it.

KeyTypeDefaultReset during LoadingEffect
CanAllybooleantrueyesPlayers may form alliances.
MaxAllianceSizenumber2yesTeams per alliance (3-Way Alliance: 3).
CanBuildbooleantrueyesPlayers and bots may place buildings.
CanRecruitbooleantrueyesPlayers and bots may queue units and missiles.
CanSellbooleantrueyesPlayers may sell.
DamageMultipliernumber1yesScales all combat damage: projectile hits, direct attacks, missiles and abilities. Applied after Damage hooks. 0 turns combat damage off.
ConstructionSpeedMultipliernumber1yesBuilder speed.
RecruitSpeedMultipliernumber1yesRecruit queue speed.
SiloRangenumber256yes, then the map's own range is appliedMissile silo range (studs).
SplashDamageEnabledbooleannoSplash damage on or off.
ClientShareSelectionbooleannoAllies see each other's selection (used by the tutorial).
CanFightbooleantrueyesUnits and turrets attack. When false they hold fire; healing, supplying and building go on, and missiles follow CanNuke.
CanNukebooleantrueyesPlayers may launch missiles from silos and queue new missiles.
AllowMissileFriendlyFirebooleantrueyesPlayer-launched missiles also damage the launcher's team and allies (Survival: false).
StartingMoneynumber60yesMoney each team starts a match with (Survival: 200).
IncomeMultipliernumber1yesScales the money buildings generate for every team; the HUD's income per minute shows it. Mods can add a per-team multiplier (Team.IncomeMultiplier).
SellRefundMultipliernumber1yesScales sell refunds (normally half the cost, or the full cost of an unfinished building, by health). 0 = selling pays nothing. A refund never exceeds the cost.
CanTransferMoneybooleantrueyesAllies may send each other cash.
CanResearchbooleantrueyesPlayers may start research. Research already running finishes, and players can still cancel it.
ResearchSpeedMultipliernumber1yesResearch speed: 2 halves research times. Applies to research started after the change.
CanUpgradebooleantrueyesPlayers may upgrade buildings.

Status effects

Ids for :AddStatus(effect, level?, duration?). Effects listed "per level" scale with the level, so at the default level 0 they do nothing: pass a level, for example unit:AddStatus("Slowness", 3, 10).

IdShown asEffectApplies to
SlownessSlowness−15% move speed per levelall
WalkSpeedAgility+5% move speed per levelall
DefenseToughness+10% defense per levelall
DamageStrength+5% damage per levelall
AttackSpeedHaste+5% attack speed per levelall
Missile_CorroderEffectCorrosiondamage over time (2 × level per second)non-infantry
Missile_BlightEffectBlighteddamage over time (level per second)infantry
BleedingBleedingdamage over time (0.5 × level per second)infantry
EMPDisruptioncuts power for the durationbuildings
HeavyTrooper_PassiveKinetic Grounding−50% speed, +40% defenseall
Scout_AbilityMarked for Deathtakes 25% more damageall
Builder_PassivePanicking Haste+25% speed, +50% attack speedall
HeavyTank_AbilityConcussed−35% speedinfantry
Chopper_AbilityRotor Washed−20% speedinfantry
CommandCenter_PassiveEmergency Fortress Protocol+35% damage, invulnerableall
Turret_AbilityTurret Blasted−15% attack speedall

An effect that does not apply to the target's class (for example Bleeding on a tank) wears off without doing anything.

Tags

:HasTag(tag): every object has object, units have unit and selectable, and buildings have building and selectable. Index entries add their own: human (infantry; the default for units), vehicle and naval.

Attributes

Useful :GetAttribute(name) keys:

NameOnValue
HealthbothCurrent health (same as .Health).
Ammounits with ammoRounds left.
VulnerabilitybothDamage taken multiplier (1 = normal).
BuiltbuildingsConstruction finished (same as .IsBuilt).
CurrentLevelbuildingsUpgrade level (same as .Level).
IsFishingunitsThe unit is fishing.

Other attributes are internal and may change without notice.

Unit modifiers

Multipliers for Units.Spawn(type, team, position, { Modifiers = { ... } }). 1 means unchanged; values out of range are clamped. Modifiers are read when the unit spawns, so a giant is a giant from its first tick.

FieldRangeEffect
health0.01 to 1000starting and maximum health (health bar, healing and sell refunds follow)
speed0 to 10walk speed
damage0 to 1000damage dealt
attackSpeed0.05 to 20attacks per second
defense0.01 to 1000damage taken is divided by this
size0.25 to 8hitbox, physics body and model, every axis
mass0.01 to 100000physics weight; defaults to size squared, set it to override
bounty0 to 1000multiplier on the cash a unit pays out when killed (waves only)

Speed, damage, attack speed and defense stack with status effects such as Slowness.

Zone settings

Keys for the Data table of Zones.Create(type, { ..., Data = { ... } }). Types marked teams also take teams (comma separated team or alliance names; empty = everyone) and teamMode (only or except).

TypeSettings
func_status teamsstatus_id (effect, required), status_duration (s, required), status_level (default 1). With teams this is also a buff aura
func_heal teamsrate per second (default 20), percent (rate is % of max health)
func_damage teamsdamage per second (default 50). Environmental: no exp, no hooks
func_incometeam (team or alliance, required), amount (default 5), interval s (default 1), requirePresence
func_captureSee the table below
func_hilltarget points (default 100, 0 = endless), rate per second (default 1), label. Holding alone scores; contested = frozen. Drawn by the capture-zone client
func_trigger teamsevent (name, required), minUnits (1), cooldown s, once

func_capture:

AttributeDefaultMeaning
ownernoneStarting holder (team or alliance name)
labelZoneText on the bar
captureTime10Seconds for one unit to capture
unitBonus0.25Extra speed per additional unit (fraction)
maxUnits8Units beyond this add no speed
decayTime20Seconds for a full bar to drain when empty; 0 = never
income0Money per second, to each team of the owning faction