# Lua in SpringRTS/Variables and Constants

Here follows global constants and variables that can be read at any time in game.

## Constants

| Constant name | Type | Description | Synced Read | Unsynced Read |
| Spring.ALL_UNITS | integer | Number of all units in the game | Yes | No |
| Spring.MY_UNITS | integer | Number of your units | Yes | No |
| Spring.ALLY_UNITS | integer | Number of your ally units | Yes | No |
| Spring.ENEMY_UNITS | integer | Number of your enemy units | Yes | No |

## Variables

Variables starting with the "Game" are variables that have to do with the mod. Variables starting with "Spring" are variables that have to do with the engine.
| Variable name | Type | Description |
| Game.allowTeamColors | boolean | |
| Game.armorTypes | table | |
| Game.captureEnergyCostFactor | number | |
| Game.constructionDecay | boolean | |
| Game.constructionDecaySpeed | number | |
| Game.constructionDecayTime | number | |
| Game.extractorRadius | number | |
| Game.fireAtCrashing | number | |
| Game.fireAtKilled | number | |
| Game.fogColor | color | |
| Game.gameID | integer | |
| Game.gameSpeed | integer | |
| Game.ghostedBuildings | boolean | |
| Game.gravity | number | |
| Game.groundAmbientColor | color | |
| Game.groundSpecularColor | color | |
| Game.groundSunColor | color | |
| Game.mapChecksum | string | |
| Game.mapDamage | boolean | |
| Game.mapHumanName | string | |
| Game.mapName | string | |
| Game.mapSizeX | number | in worldspace/opengl coords |
| Game.mapSizeZ | number | in worldspace/opengl coords |
| Game.mapX | number | |
| Game.mapY | number | |
| Game.maxPlayers | integer | |
| Game.maxTeams | integer | |
| Game.maxUnits | integer | |
| Game.modChecksum | string | |
| Game.modDesc | string | |
| Game.modMutator | string | |
| Game.modName | string | |
| Game.modShortName | string | |
| Game.modVersion | string | |
| Game.multiReclaim | number | |
| Game.reclaimAllowAllies | boolean | |
| Game.reclaimAllowEnemies | boolean | |
| Game.reclaimFeatureEnergyCostFactor | number | |
| Game.reclaimMethod | number | |
| Game.reclaimUnitEfficiency | number | |
| Game.reclaimUnitEnergyCostFactor | number | |
| Game.reclaimUnitMethod | number | |
| Game.repairEnergyCostFactor | number | |
| Game.requireSonarUnderWater | boolean | |
| Game.resurrectEnergyCostFactor | number | |
| Game.springCategories | table | |
| Game.squareSize | integer | |
| Game.startPosType | integer | |
| Game.tidal | number | |
| Game.transportAir | number | |
| Game.transportGround | number | |
| Game.transportHover | number | |
| Game.transportShip | number | |
| Game.version | string | Not implemented as of version 0.81.2.1 |
| Game.waterAbsorb | color | |
| Game.waterBaseColor | color | |
| Game.waterCausticTextures | table | |
| Game.waterDamage | number | |
| Game.waterFoamTexture | string | |
| Game.waterFresnelMax | number | |
| Game.waterFresnelMin | number | |
| Game.waterFresnelPower | number | |
| Game.waterMinColor | color | |
| Game.waterNormalTexture | string | |
| Game.waterPlane | boolean | |
| Game.waterPlaneColor | color | |
| Game.waterRepeatX | number | |
| Game.waterRepeatY | number | |
| Game.waterSpecularColor | color | |
| Game.waterSpecularFactor | number | |
| Game.waterSurfaceAlpha | number | |
| Game.waterSurfaceColor | color | |
| Game.waterTexture | string | |
| Game.waterVoid | boolean | |
| Game.windMax | number | |
| Game.windMin | number | |