Reference lists
Game states, GameConfig keys, status effects, tags, attributes, modifiers, zones.
Game states
Game.GetState() and Game.StateChanged use these values:
| State | Meaning |
|---|---|
Intermission | Between matches. |
VotePrepare | The map vote is about to open. |
Voting | Players vote for the next map. |
Loading | The map and gamemode are loading (GameConfig is reset here). |
Active | The match is running. |
JustEnded | The match just ended (results showing). |
Ended | Clean-up after the match. |
Editor | Map 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.
| Key | Type | Default | Reset during Loading | Effect |
|---|---|---|---|---|
CanAlly | boolean | true | yes | Players may form alliances. |
MaxAllianceSize | number | 2 | yes | Teams per alliance (3-Way Alliance: 3). |
CanBuild | boolean | true | yes | Players and bots may place buildings. |
CanRecruit | boolean | true | yes | Players and bots may queue units and missiles. |
CanSell | boolean | true | yes | Players may sell. |
DamageMultiplier | number | 1 | yes | Scales all combat damage: projectile hits, direct attacks, missiles and abilities. Applied after Damage hooks. 0 turns combat damage off. |
ConstructionSpeedMultiplier | number | 1 | yes | Builder speed. |
RecruitSpeedMultiplier | number | 1 | yes | Recruit queue speed. |
SiloRange | number | 256 | yes, then the map's own range is applied | Missile silo range (studs). |
SplashDamageEnabled | boolean | no | Splash damage on or off. | |
ClientShareSelection | boolean | no | Allies see each other's selection (used by the tutorial). | |
CanFight | boolean | true | yes | Units and turrets attack. When false they hold fire; healing, supplying and building go on, and missiles follow CanNuke. |
CanNuke | boolean | true | yes | Players may launch missiles from silos and queue new missiles. |
AllowMissileFriendlyFire | boolean | true | yes | Player-launched missiles also damage the launcher's team and allies (Survival: false). |
StartingMoney | number | 60 | yes | Money each team starts a match with (Survival: 200). |
IncomeMultiplier | number | 1 | yes | Scales the money buildings generate for every team; the HUD's income per minute shows it. Mods can add a per-team multiplier (Team.IncomeMultiplier). |
SellRefundMultiplier | number | 1 | yes | Scales 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. |
CanTransferMoney | boolean | true | yes | Allies may send each other cash. |
CanResearch | boolean | true | yes | Players may start research. Research already running finishes, and players can still cancel it. |
ResearchSpeedMultiplier | number | 1 | yes | Research speed: 2 halves research times. Applies to research started after the change. |
CanUpgrade | boolean | true | yes | Players 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).
| Id | Shown as | Effect | Applies to |
|---|---|---|---|
Slowness | Slowness | −15% move speed per level | all |
WalkSpeed | Agility | +5% move speed per level | all |
Defense | Toughness | +10% defense per level | all |
Damage | Strength | +5% damage per level | all |
AttackSpeed | Haste | +5% attack speed per level | all |
Missile_CorroderEffect | Corrosion | damage over time (2 × level per second) | non-infantry |
Missile_BlightEffect | Blighted | damage over time (level per second) | infantry |
Bleeding | Bleeding | damage over time (0.5 × level per second) | infantry |
EMP | Disruption | cuts power for the duration | buildings |
HeavyTrooper_Passive | Kinetic Grounding | −50% speed, +40% defense | all |
Scout_Ability | Marked for Death | takes 25% more damage | all |
Builder_Passive | Panicking Haste | +25% speed, +50% attack speed | all |
HeavyTank_Ability | Concussed | −35% speed | infantry |
Chopper_Ability | Rotor Washed | −20% speed | infantry |
CommandCenter_Passive | Emergency Fortress Protocol | +35% damage, invulnerable | all |
Turret_Ability | Turret Blasted | −15% attack speed | all |
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:
| Name | On | Value |
|---|---|---|
Health | both | Current health (same as .Health). |
Ammo | units with ammo | Rounds left. |
Vulnerability | both | Damage taken multiplier (1 = normal). |
Built | buildings | Construction finished (same as .IsBuilt). |
CurrentLevel | buildings | Upgrade level (same as .Level). |
IsFishing | units | The 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.
| Field | Range | Effect |
|---|---|---|
health | 0.01 to 1000 | starting and maximum health (health bar, healing and sell refunds follow) |
speed | 0 to 10 | walk speed |
damage | 0 to 1000 | damage dealt |
attackSpeed | 0.05 to 20 | attacks per second |
defense | 0.01 to 1000 | damage taken is divided by this |
size | 0.25 to 8 | hitbox, physics body and model, every axis |
mass | 0.01 to 100000 | physics weight; defaults to size squared, set it to override |
bounty | 0 to 1000 | multiplier 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).
| Type | Settings |
|---|---|
func_status teams | status_id (effect, required), status_duration (s, required), status_level (default 1). With teams this is also a buff aura |
func_heal teams | rate per second (default 20), percent (rate is % of max health) |
func_damage teams | damage per second (default 50). Environmental: no exp, no hooks |
func_income | team (team or alliance, required), amount (default 5), interval s (default 1), requirePresence |
func_capture | See the table below |
func_hill | target points (default 100, 0 = endless), rate per second (default 1), label. Holding alone scores; contested = frozen. Drawn by the capture-zone client |
func_trigger teams | event (name, required), minUnits (1), cooldown s, once |
func_capture:
| Attribute | Default | Meaning |
|---|---|---|
owner | none | Starting holder (team or alliance name) |
label | Zone | Text on the bar |
captureTime | 10 | Seconds for one unit to capture |
unitBonus | 0.25 | Extra speed per additional unit (fraction) |
maxUnits | 8 | Units beyond this add no speed |
decayTime | 20 | Seconds for a full bar to drain when empty; 0 = never |
income | 0 | Money per second, to each team of the owning faction |