Lua ConstGame

From Spring

Development < Lua Scripting < Lua ConstGame


Engine

string Game.version

Removed from version 104.0 Now in Lua_ConstEngine


string Game.buildFlags

Removed from version 104.0 Now in Lua_ConstEngine


number Game.gameID

Replaced in 89.0 with GameID(string gameID) synced callin


number Game.maxUnits


number Game.maxTeams


number Game.maxPlayers


number Game.squareSize

Divide Game.mapSizeX or Game.mapSizeZ by this to get engine's "mapDims" coordinates


number Game.gameSpeed

Host

number Game.gameMode

Removed from version 83.x


number Game.startPosType


bool Game.commEnds

Removed from version 83.x


bool Game.limitDGun

Removed from version 83.x


bool Game.ghostedBuildings

Checksums

string Game.mapChecksum


string Game.modChecksum

Map

bool Game.mapDamage


string Game.mapName


string Game.mapDescription

= string Game.mapHumanName


number Game.mapHardness


number Game.mapX


number Game.mapY


number Game.mapSizeX

in worldspace/opengl coords. Divide by Game.squareSize to get engine's "mapDims" coordinates


number Game.mapSizeZ

in worldspace/opengl coords. Divide by Game.squareSize to get engine's "mapDims" coordinates


number Game.gravity


number Game.tidal


number Game.windMin


number Game.windMax


number Game.extractorRadius


number Game.waterDamage


table Game.envDamageTypes

Containing {def}IDs of environmental-damage sources New in version 104.0.

Mod

string Game.gameName

New in version 95.0


string Game.gameShortName

New in version 95.0


string Game.gameVersion

New in version 95.0


string Game.gameMutator

New in version 95.0


string Game.gameDesc

New in version 95.0


string Game.modName

deprecated (it is in contrast to gameName appended with gameVersion!)


string Game.modShortName

deprecated


string Game.modVersion

deprecated


string Game.modMutator

deprecated


string Game.modDesc

deprecated


bool Game.allowTeamColors


bool Game.requireSonarUnderWater


number Game.transportAir


number Game.transportShip


number Game.transportHover


number Game.transportGround


number Game.fireAtKilled


number Game.fireAtCrashing

Constructor

bool Game.constructionDecay


bool Game.reclaimAllowEnemies


bool Game.reclaimAllowAllies


number Game.constructionDecayTime


number Game.constructionDecaySpeed


number Game.multiReclaim


number Game.reclaimMethod


number Game.reclaimUnitMethod


number Game.reclaimUnitEnergyCostFactor


number Game.reclaimUnitEfficiency


number Game.reclaimFeatureEnergyCostFactor


number Game.repairEnergyCostFactor


number Game.resurrectEnergyCostFactor


number Game.captureEnergyCostFactor

Categories

table Game.springCategories

 example: {
   ["vtol"]         = 0,  ["special"]      = 1,  ["noweapon"]     = 2,
   ["notair"]       = 3,  ["notsub"]       = 4,  ["all"]          = 5,
   ["weapon"]       = 6,  ["notship"]      = 7,  ["notland"]      = 8,
   ["mobile"]       = 9,  ["kbot"]         = 10, ["antigator"]    = 11,
   ["tank"]         = 12, ["plant"]        = 13, ["ship"]         = 14,
   ["antiemg"]      = 15, ["antilaser"]    = 16, ["antiflame"]    = 17,
   ["underwater"]   = 18, ["hover"]        = 19, ["phib"]         = 20,
   ["constr"]       = 21, ["strategic"]    = 22, ["commander"]    = 23,
   ["paral"]        = 24, ["jam"]          = 25, ["mine"]         = 26,
   ["kamikaze"]     = 27, ["minelayer"]    = 28, ["notstructure"] = 29,
   ["air"]          = 30
 }


table Game.armorTypes

(bidirectional)

 example: {
   [1]  = amphibious,   [2] = anniddm,     [3] = antibomber,
   [4]  = antifighter,  [5] = antiraider,  [6] = atl,
   [7]  = blackhydra,   [8] = bombers,     [9] = commanders,
   [10] = crawlingbombs, ...
   ["amphibious"]   = 1, ["anniddm"]    = 2, ["antibomber"] = 3
   ["antifighter"]  = 4, ["antiraider"] = 5, ["atl"]        = 6
   ["blackhydra"]   = 7, ["bombers"]    = 8, ["commanders"] = 9
   ["crawlingbombs"]= 10, ...
 }

Water Visuals

Removed from version 104.0 - No longer constant as are now runtime mutable (Use gl.GetWaterRendering(name) instead).

bool Game.waterVoid


bool Game.waterPlane


string Game.waterTexture


string Game.waterFoamTexture


string Game.waterNormalTexture


number Game.waterRepeatX


number Game.waterRepeatY


number Game.waterSurfaceAlpha


number Game.waterSpecularFactor


number Game.waterFresnelMin


number Game.waterFresnelMax


number Game.waterFresnelPower


table Game.waterCausticTextures

= {"tex1","tex2",..}


color Game.waterAbsorb

= { number r, number g, number b}


color Game.waterBaseColor


color Game.waterMinColor


color Game.waterSurfaceColor


color Game.waterSpecularColor


color Game.waterPlaneColor


color Game.fogColor

Removed from version 101.0 (Use gl.GetAtmosphere("fogColor") instead)


color Game.groundAmbientColor

Removed from version 101.0 (Use gl.GetSun("ambient") instead)


color Game.groundSpecularColor

Removed from version 101.0 (Use gl.GetSun("specular") instead)


color Game.groundSunColor

Removed from version 101.0 (Use gl.GetSun("diffuse") instead)