<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Flozi</id>
	<title>Spring - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://springrts-wiki.p2004a.com/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Flozi"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Flozi"/>
	<updated>2026-11-08T18:20:33Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8613</id>
		<title>Gamedev:UnitDefs</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8613"/>
		<updated>2025-04-08T11:16:40Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Categories */ A warning about null categories leading to untargetable units&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Gamedev:Main|Development]] &amp;lt; [[Gamedev:Main]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
==Location==&lt;br /&gt;
UnitDef files are .lua files stored in the &amp;lt;code&amp;gt;Units/&amp;lt;/code&amp;gt; directory of a Spring Game.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
UnitDef files have one purpose; to define the properties of units. They are the main description file for what attributes your unit should have and how it should behave.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The engine source code which loads the tags from these files is viewable here:&lt;br /&gt;
&lt;br /&gt;
* {{sourcelink|file=rts/Sim/Units/UnitDef.cpp}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The engine source which reads the [[#sounds]] subtable can be found here:&lt;br /&gt;
&lt;br /&gt;
* {{sourcelink|file=rts/Sim/Units/UnitDefHandler.cpp}}&lt;br /&gt;
&lt;br /&gt;
==Data Types==&lt;br /&gt;
{{DataTypes}}&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
There follows a comprehensive (certain deprecated tags are not present) list of the tags available, their data type, default value and a brief description of what they do. Bear in mind that the source code linked above is the ultimate reference when dealing with these tags. &lt;br /&gt;
&lt;br /&gt;
In lua tables keys (i.e. the tags) should be lower case, here they are represented in camelCase for readability. In your files you may use the &amp;lt;code&amp;gt;lowerkeys&amp;lt;/code&amp;gt; function on your final table to ensure the keys are properly cased.&lt;br /&gt;
&lt;br /&gt;
It is usual to name the returned UnitDef table the internal &amp;lt;code&amp;gt;unitName&amp;lt;/code&amp;gt; desired for the unit.&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = name&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|lua = humanName&lt;br /&gt;
|description = This is simply the name of the unit as it appears to the player.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = description&lt;br /&gt;
|type = string&lt;br /&gt;
|default = name&lt;br /&gt;
|lua = tooltip&lt;br /&gt;
|description = This is the tooltip description of the unit seen by the player. It defaults to the {{taglink|name}} of the unit.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildPic&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|lua = buildPicName&lt;br /&gt;
|description = The filename of the image to be used as the build picture, assumes &amp;lt;code&amp;gt;Unitpics/&amp;lt;/code&amp;gt; directory (see [[Gamedev:Buildpics]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = objectName&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|lua = modelname&lt;br /&gt;
|description = The filename of the 3D model file for this unit, assumes &amp;lt;code&amp;gt;Objects3D/&amp;lt;/code&amp;gt; directory.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = script&lt;br /&gt;
|type = string&lt;br /&gt;
|default = unitName + &amp;quot;.cob&amp;quot;&lt;br /&gt;
|lua = scriptName&lt;br /&gt;
|description = The filename of the animation script file for this unit, assumes &amp;lt;code&amp;gt;Scripts/&amp;lt;/code&amp;gt; directory. Default assumes .cob file but [[Animation-LuaScripting | LUS]] should be preferred.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxDamage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = health&lt;br /&gt;
|description = The base &#039;hitpoints&#039; the unit will have.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = autoHeal&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much health the unit will regain every second.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = idleAutoHeal&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 10.0&lt;br /&gt;
|description = How much health the unit will regain every second whilst it is idle.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = idleTime&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 600&lt;br /&gt;
|description = The time in [[frames]] taken until a unit is considered to be idle.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildCostMetal&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|lua = metalCost&lt;br /&gt;
|description = The amount of metal resource the unit costs to build. Cannot be below &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildCostEnergy&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = energyCost&lt;br /&gt;
|description = The amount of energy resource the unit costs to build.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The time taken to build the unit, in conjunction with the {{taglink|workerTime}} of the constructor. In [[Gamedev:UnitsOfMeasurement#Time|Resource Frames]], &amp;lt;code&amp;gt;Time to build = (buildTime / workerTime)&amp;lt;/code&amp;gt;. Defaults to &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; but cannot actually be below &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = mass&lt;br /&gt;
|type = float&lt;br /&gt;
|default = buildCostMetal&lt;br /&gt;
|description = The mass of the unit, used in weapon impulse calculations. Cannot be less than &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = reclaimable&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be reclaimed by a builder?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = capturable&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can a unit be stolen by a builder using the capture command?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = repairable&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be repaired by a builder?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxRepairSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1e20&lt;br /&gt;
|description = The maximum cumulative speed at which this unit type can repair a single target.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = iconType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;default&amp;quot;&lt;br /&gt;
|description = The name of the radar icon type this unit should use (see [[Icontypes.lua]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = corpse&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|lua = wreckName&lt;br /&gt;
|description = The name of the feature this unit should leave behind as a wreck when it dies (see [[Gamedev:FeatureDefs]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = explodeAs&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of the weapon this unit should explode as when it is killed (see [[Gamedev:WeaponDefs]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = selfDestructAs&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of the weapon this unit should explode as when it self destructs (see [[Gamedev:WeaponDefs]]). Also used as the {{taglink|kamikaze}} weapon.}}&lt;br /&gt;
&lt;br /&gt;
===Resources===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = harvestStorage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|special = {{new|97.0; ATTENTION: unfinished implementation, can be set in UnitDefs but it can&#039;t be read in-game}}&lt;br /&gt;
|description = How much of the metal resource a unit can store when used as an engine-assisted resource &#039;harvester&#039;. See also [[Lua_SyncedRead#Unit_Informations|Spring.GetUnitHarvestStorage]] and [[Lua_SyncedCtrl#Unit_Resourcing|Spring.SetUnitHarvestStorage]] callouts.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = metalStorage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the metal resource storage the unit contributes.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyStorage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the energy resource storage the unit contributes.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = extractsMetal&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the metal resource the unit extracts from the ground. The amount extracted depends on the metal map defined in the map itself. Works only for structures.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = windGenerator&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The maximum amount of the energy resource the unit generates which is dependant on the map wind. Works only for structures. If wind speed is higher than this, the unit will still only produce this much. If wind speed is less, it will produce as much as windspeed is.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = tidalGenerator&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the energy resource the unit generates which is dependant on the maps tidal power. Clearly, this only works on water structures.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = metalUse&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = metalUpkeep&lt;br /&gt;
|description = The amount of the metal resource the unit consumes per game &#039;tick&#039; when activated.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyUse&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = energyUpkeep&lt;br /&gt;
|description = The amount of the energy resource the unit consumes per game &#039;tick&#039; when activated.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = metalMake&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the metal resource the unit generates unconditionally per game &#039;tick&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyMake&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the energy resource the unit generates unconditionally per game &#039;tick&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = makesMetal&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The amount of the energy resource the unit turns into the metal resource per game &#039;tick&#039;.}}&lt;br /&gt;
&lt;br /&gt;
===Sensors===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = onOffable&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the unit have an on/off button? Currently the activation status tied to this button also turns sensors (other than LOS) on and off.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = activateWhenBuilt&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Should the unit&#039;s activation status be on or off when it is created?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sightDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = losRadius&lt;br /&gt;
|description = The radius of the units sight (LOS is circular in Spring). &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = airSightDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.5 * sightDistance&lt;br /&gt;
|lua = airLosRadius&lt;br /&gt;
|description = How far away the unit can see aircraft (and some FX).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = losEmitHeight&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 20.0&lt;br /&gt;
|lua = losHeight &lt;br /&gt;
|special = {{new|83.0}}&lt;br /&gt;
|description = How high up the unit is the point used to calculate it&#039;s LOS vs. the terrain?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = radarEmitHeight&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 20.0&lt;br /&gt;
|lua = radarHeight&lt;br /&gt;
|special = {{new|83.0}}&lt;br /&gt;
|description = How high up the unit is the point used to calculate it&#039;s radar vs. the terrain?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = radarDistance&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = radarRadius&lt;br /&gt;
|description = The radius of the units radar.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sonarDistance&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = sonarRadius&lt;br /&gt;
|description = The radius of the units sonar.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = radarDistanceJam&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = jammerRadius&lt;br /&gt;
|description = The radius of the units radar jamming.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sonarDistanceJam&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = sonarJamRadius&lt;br /&gt;
|description = The radius of the units sonar jamming.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = stealth&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the unit undetectable by radar?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sonarStealth&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the unit undetectable by sonar?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = seismicDistance&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = seismicRadius&lt;br /&gt;
|description = The radius of the unit&#039;s seismic (movement) sensor.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = seismicSignature&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0 for units with {{taglink|floater}}, {{taglink|canHover}} or {{taglink|canFly}}, otherwise sqrt(mass / 100.0)&lt;br /&gt;
|description = How fast the seismic ring expands in [[elmo]]s per frame. Each ping always lasts 15 [[frames]], so this also determines the maximum radius of the seismic ring.}}&lt;br /&gt;
&lt;br /&gt;
====Cloaking====&lt;br /&gt;
For units with {{taglink|canCloak|true}}:&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cloakCost&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The energy cost per tick to cloak the unit while it is stationary.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cloakCostMoving&lt;br /&gt;
|type = float&lt;br /&gt;
|default = cloakCost&lt;br /&gt;
|description = The energy cost per tick to cloak the unit while it is moving.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = initCloaked&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = startCloaked&lt;br /&gt;
|description = Is the unit cloaked as soon as it is created?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minCloakDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The minimum distance (radius) which the unit must be from any enemy units to remain cloaked.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = decloakSpherical&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does {{taglink|minCloakDistance}} apply in 3D or only 2D? i.e. can aircraft flying above the unit decloak it?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = decloakOnFire&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the unit decloak when it fires a weapon?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cloakTimeout&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 128&lt;br /&gt;
|description = The minimum time, in [[frames]], between a decloak and subsequent re-cloak.}}&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canMove&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the unit be issued Move orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canAttack&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be issued Attack orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canFight&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be issued Fight orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canPatrol&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be issued Patrol orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canGuard&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be issued Guard orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
| name = canCloak&lt;br /&gt;
| type = bool&lt;br /&gt;
| default = false&lt;br /&gt;
| description =&lt;br /&gt;
Can the unit be issued Cloak orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canRepeat&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the unit be issued Repeat orders?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canSelfDestruct&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = canSelfD&lt;br /&gt;
|description = Can the unit be issued a self destruct order?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = moveState&lt;br /&gt;
|type = int&lt;br /&gt;
|default = -1 for mobile units, 1 for structures&lt;br /&gt;
|description = The initial movement state for the unit. Can be {{value|-1}} - Inherits from factory, {{value|0}} - Hold Position, {{value|1}} - Manoeuvre or {{value|2}} - Roam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireState&lt;br /&gt;
|type = int&lt;br /&gt;
|default = -1 for units with {{taglink|noAutoFire|false}}, 2 otherwise&lt;br /&gt;
|description = The initial firing state for the unit. Can be {{value|-1}} - Inherits from factory, {{value|0}} - Hold Fire, {{value|1}} - Return Fire or {{value|2}} - Fire At Will. Since 104.0 there is an additional value {{value|3}} - Fire At Neutral.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = noAutoFire&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = canFireControl&lt;br /&gt;
|description = Controls whether or not the unit has a fire state button.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canManualFire&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = description = Can the unit be issued ManualFire commands? A ManualFire command will fire any weapons with the {{xtaglink|Gamedev:WeaponDefs|commandfire}} tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Builder Commands====&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canRestore&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder &amp;amp;&amp;amp; {{taglink|terraformSpeed}} &amp;gt; 0&lt;br /&gt;
|description = Can the unit be issued restore terrain commands? For builders only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canRepair&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder &amp;amp;&amp;amp; {{taglink|repairSpeed}} &amp;gt; 0&lt;br /&gt;
|description = Can the unit be issued repair commands? For builders only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canReclaim&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder &amp;amp;&amp;amp; {{taglink|reclaimSpeed}} &amp;gt; 0&lt;br /&gt;
|description = Can the unit be issued reclaim commands? For builders only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canResurrect&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder &amp;amp;&amp;amp; {{taglink|resurrectSpeed}} &amp;gt; 0&lt;br /&gt;
|description = Can the unit be issued resurrection commands? For builders only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canCapture&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder &amp;amp;&amp;amp; {{taglink|captureSpeed}} &amp;gt; 0&lt;br /&gt;
|description = Can the unit be issued capture commands? For builders only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Builder===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = builder&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = isBuilder&lt;br /&gt;
|description = Is the unit a builder?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 128.0&lt;br /&gt;
|description = How far away from itself the unit can build, measured to the centre of the unit being built. The minimum value is &amp;lt;code&amp;gt;38.0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildRange3D&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the builders {{taglink|buildDistance}} apply in all 3 dimensions or only 2?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = workerTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = buildSpeed&lt;br /&gt;
|description = How fast the builder builds, used in conjunction with the {{taglink|buildTime}} of the unit being built. Effectively, &amp;lt;code&amp;gt;Time to build = buildTime / workerTime&amp;lt;/code&amp;gt;. If this value is &amp;lt;= &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; then {{taglink|builder}} is set to false.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = repairSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = workerTime&lt;br /&gt;
|description = How fast the builder can repair other units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = reclaimSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = workerTime&lt;br /&gt;
|description = How fast the builder can reclaim other units and features.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = resurrectSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = workerTime&lt;br /&gt;
|description = How fast the builder can resurrect corpse features back into living units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = captureSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = workerTime&lt;br /&gt;
|description = How fast the builder can capture other units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = terraformSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = workerTime&lt;br /&gt;
|description = How fast the builder levels and restores terrain.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canAssist&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = builder&lt;br /&gt;
|description = Can the builder assist other constructions?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canBeAssisted&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can the builder be assisted by other builders?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canSelfRepair&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the builder repair itself?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = showNanoSpray&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the builder emit OTA-style nanospray whilst constructing?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = nanoColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.2, 0.7, 0.2} aka green&lt;br /&gt;
|description = The RGB colour of a builders&#039; emitted nano particles if {{taglink|showNanoSpray|true}}. Also controls the RBG colour of a unit&#039;s own nanoframe if {{taglink|showNanoFrame|true}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fullHealthFactory&lt;br /&gt;
|type = bool&lt;br /&gt;
|defaul[[elmo]]s&lt;br /&gt;
|description = If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;, units are repaired before they are allowed to leave the factory i.e. units from this factory will be healed back to 100% health if they are damaged during construction.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = isAirbase&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = Removed in 101.0 in favour of more flexible lua custom commands&lt;br /&gt;
|description = Is this unit an airbase? Aircraft may land and repair on units which are airbases.}}&lt;br /&gt;
&lt;br /&gt;
===Movement &amp;amp; Placement===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = footprintX&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = &lt;br /&gt;
How wide the unit is in footprint units, left to right. 1 footprint unit = 16 [[elmo]]s. Cannot be below &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. For mobile units this should be the same as the {{xtaglink|Movedefs.lua|footprintX}} of its {{taglink|movementClass}}. Also used for obstacle avoidance.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = footprintZ&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = &lt;br /&gt;
How wide the unit is in footprint units, top to bottom. 1 footprint unit = 16 [[elmo]]s. Cannot be below &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. For mobile units this should be the same as the {{xtaglink|Movedefs.lua|footprintZ}} of its {{taglink|movementClass}}. Also used for obstacle avoidance.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = yardmap&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = &lt;br /&gt;
Used to determine a structure from a mobile unit. A string of characters which defines in detail each &#039;footprint square&#039; of the structure. Each footprint square may be: &lt;br /&gt;
:: &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; - &#039;Yard&#039; - Always open, unblocking, &lt;br /&gt;
:: &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; - &#039;Construction&#039; - Open and unblocking only while constructing (for factories, controlled via &amp;lt;code&amp;gt;COB.YARD_OPEN&amp;lt;/code&amp;gt; see [[Animation-LuaCallouts#Other]]), &lt;br /&gt;
:: &amp;lt;code&amp;gt;i&amp;lt;/code&amp;gt; - &#039;Inversed Construction&#039; - Closed and blocking only while constructing (for factories, controlled via &amp;lt;code&amp;gt;COB.YARD_OPEN&amp;lt;/code&amp;gt; see [[Animation-LuaCallouts#Other]]) ({{new|89.0}}), &lt;br /&gt;
:: &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; - &#039;Geothermal&#039; - Flags that the unit must be placed over a {{xtaglink|Gamedev:FeatureDefs|geoThermal}} feature, does not actually count as a square, &lt;br /&gt;
:: &amp;lt;code&amp;gt;h&amp;lt;/code&amp;gt; - &#039;High Resolution&#039; - Indicates that the yardmap will use double resolution with four times as many characters. Must be the &#039;&#039;&#039;first&#039;&#039;&#039; character, and does not count as a square itself ({{new|93.0}}),&lt;br /&gt;
::&amp;lt;code&amp;gt;o&amp;lt;/code&amp;gt; - &#039;Obstacle&#039; - Always closed, blocking, all other chars are treated the same way.&lt;br /&gt;
: Tip: &#039;Draw&#039; out the yardmap over multiple lines. As of &amp;lt;span class=warning&amp;gt;89.0&amp;lt;/span&amp;gt; all whitespace characters are ignored, including newlines.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildingMask&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = [http://en.wikipedia.org/wiki/Mask_(computing) Bitmask] representing the types of ground that this structure can be built on. Each digit of binary that is set to one means that a ground square with the corresponding digit set via [[Lua_SyncedCtrl#Ground|Spring.SetSquareBuildingMask]] can be built on.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = levelGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = For structures. Does the constructor have to level the ground underneath the build area before beginning to build the structure?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = movementClass&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|lua = moveDef.name&lt;br /&gt;
|description = The name of the movement type a mobile, non aircraft, unit should use. See [[Movedefs.lua]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canHover&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Removed in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|description = Is the unit a hovercraft? Hovercraft can cross water of any depth without a speed penalty. Hover&#039;s must also have &amp;lt;code&amp;gt;HOVER&amp;lt;/code&amp;gt; within the name of their {{taglink|movementClass}} (see [[Movedefs.lua]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = floater&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false if a {{taglink|moveClass}} is defined, if not true if {{taglink|waterline|true}}, false otherwise&lt;br /&gt;
|description = When a mobile unit is crossing water, or a structure is placed on water, does it float on top of the water or crawl / lay on the sea bed?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = upright&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the unit follow the terrain or always remain upright? Generally used for walkers.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxSlope&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = maxHeightDif&lt;br /&gt;
|description = The maximum slope a building can be placed on. Mobile unit&#039;s use the {{xtaglink|Movedefs.lua|maxSlope}} set in their {{taglink|movementClass}}. The value is in degrees and is clamped between &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;89.0&amp;lt;/code&amp;gt;. This value is converted to a &amp;quot;maximum allowed height difference&amp;quot; (call it M), which involves a hard-coded constant. When a building gets placed, the height of each of its footprint squares is compared to a reference height (calculated for the build position). If the difference exceeds M for any square, that build position is rejected. The value readable from lua has been changed from that in the unitdef and reflects the internal engine value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minWaterDepth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = -10e6&lt;br /&gt;
|description = The minimum depth of water a building can be placed on. Mobile unit&#039;s use the {{xtaglink|Movedefs.lua|minWaterDepth}} set in their {{taglink|movementClass}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxWaterDepth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 10e6&lt;br /&gt;
|description = The maximum depth of water a building can be placed on. Mobile unit&#039;s use the {{xtaglink|Movedefs.lua|maxWaterDepth}} set in their {{taglink|movementClass}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = waterline&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How low in the water does a ship sit? Higher values means the ship is lower in the water.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minCollisionSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = The minimum net impact speed that will cause a unit to be damaged by collisions with another unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = pushResistant&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the unit be pushed around by other units? Turning it on doesn&#039;t remove all pushing but is a marked improvement.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxVelocity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = speed&lt;br /&gt;
|description = The maximum speed attainable by the unit in [[elmo]]s per frame. If the value is -ve, the absolute value is used.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxReverseVelocity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = rSpeed &lt;br /&gt;
|special = {{new|99.0}}&lt;br /&gt;
|description = The maximum speed attainable by the unit in reverse in [[elmo]]s per frame. If the value is -ve, the absolute value is used.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = acceleration&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.5&lt;br /&gt;
|lua = maxAcc&lt;br /&gt;
|description = The acceleration of the unit, in [[elmo]]s per frame&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. If the value is -ve, the absolute value is used.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = brakeRate&lt;br /&gt;
|type = float&lt;br /&gt;
|default = acceleration&lt;br /&gt;
|lua = maxDec&lt;br /&gt;
|description = The deceleration of the unit, in [[elmo]]s per frame&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;. If the value is -ve, the absolute value is used. For units with {{taglink|canFly|true}} this is multiplied by &amp;lt;code&amp;gt;0.1&amp;lt;/code&amp;gt;. Prior to 95.0 this was scaled by 0.1 for aircraft and the default was 3x acceleration.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = myGravity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.4&lt;br /&gt;
|description = As Spring aircraft are slower than real aircraft this tag allows to lower gravity to compensate. Multiplies against map gravity for aircraft, replaces map gravity for ground vehicles if non-zero.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = turnRate&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How fast the unit can turn. &amp;lt;code&amp;gt;degrees per seconds = 0.16 * turnRate&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = turnInPlace&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the unit turn on the spot (like a person or tank) or must it be moving forwards to turn (like a car).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = turnInPlaceSpeedLimit&lt;br /&gt;
|type = float&lt;br /&gt;
|default = A complex formula based on {{taglink|turnRate}} and {{taglink|maxVelocity}}&lt;br /&gt;
|description = For units with {{taglink|turnInPlace|false}}, this defines the minimum speed it will slow down to (the speed at which the turn is actually performed can be higher depending on the angular difference and {{taglink|turnRate}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
| name = turnInPlaceAngleLimit&lt;br /&gt;
| type = float&lt;br /&gt;
| default = 0.0&lt;br /&gt;
| special = {{new|86.0}}&lt;br /&gt;
| description = For units with {{taglink|turnInPlace|true}}, defines the maximum angle (in degrees) of a turn above which it starts to brake.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = blocking&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the unit block the movement of other units? (Mines, i.e. non-mobile units with the {{taglink|kamikaze}} tag default to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = crushResistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = mass&lt;br /&gt;
|special = {{new|85.0}}&lt;br /&gt;
|description = How resistant is the unit to being crushed? Any [[Movedefs.lua|&#039;&#039;&#039;MoveClass&#039;&#039;&#039;]] with a {{xtaglink|Movedefs.lua|crushStrength}} greater than this will crush the unit - IFF this has been enabled via [[Lua_SyncedCtrl#Unit_Control|Spring.SetUnitBlocking]] and the collider impulse exceeds that of the colidee.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Flanking===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flankingBonusMode&lt;br /&gt;
|type = int&lt;br /&gt;
|default = flankingBonus.defaultMode set in [[Modrules.lua]]&lt;br /&gt;
|description = The mode of operation of Spring&#039;s inbuilt flanking system. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - No flanking bonus. Mode &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; builds up the ability to move over time, and swings to face attacks, but does not respect the way the unit is facing. Mode &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; also can swing, but moves with the unit as it turns. Mode &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; stays with the unit as it turns and otherwise doesn&#039;t move, the ideal mode to simulate something such as tank armour.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flankingBonusDir&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 1.0}&lt;br /&gt;
|description = This is the direction vector where the armour is facing; i.e. where the least damage is applied. The default is straight forwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flankingBonusMax&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.9&lt;br /&gt;
|description = The maximum multiplier to the damage dealt, when a unit is hit from the opposite direction to {{taglink|flankingBonusDir}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flankingBonusMin&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.9&lt;br /&gt;
|description = The minimum multiplier to the damage dealt, when a unit is hit from the same direction as {{taglink|flankingBonusDir}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flankingBonusMobilityAdd&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.01&lt;br /&gt;
|description = This defines the ability of {{taglink|flankingBonusDir}} to move over time. Its value is added to the mobility every [[SlowUpdate]]. When the unit is attacked, the build up mobility value is multiplied by a vector facing the attack, which is added to {{taglink|flankingBonusDir}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Aircraft===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canFly&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the unit fly, i.e. is it an aircraft?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canSubmerge&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the aircraft land underwater?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = factoryHeadingTakeoff&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Controls the take-off behaviour of aircraft with {{taglink|hoverAttack|true}}. &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; means planes start matching their heading right after taking off from the pad, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; means they maintain the heading of the pad until reaching {{taglink|cruiseAlt}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collide&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the unit collide with other aircraft, or can it occupy the same space?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = hoverAttack&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Controls whether the aircraft flys and attacks like a fighter/bomber or a helicopter/gunship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = airStrafe&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = For aircraft with {{taglink|hoverAttack|true}}, controls if the unit strafes side to side while attacking or remains stationary.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cruiseAlt&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = wantedHeight&lt;br /&gt;
|description = The altitude in [[elmo]]s which the unit attempts to fly at while cruising.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = airHoverFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = -1.0&lt;br /&gt;
|lua = dlHoverFactor&lt;br /&gt;
|description = For aircraft with {{taglink|hoverAttack|true}}, less then &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; means it can land and &amp;gt;= &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; indicates how much the unit will move during hovering on the spot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = bankingAllowed&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = For aircraft with {{taglink|hoverAttack|true}}, controls whether or not the unit banks when moving turning.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = useSmoothMesh&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the aircraft follow the real map terrain or the special smoothed out navigation mesh generated by Spring specifically for aircraft?} Can become problematic for construction aircrafts, building in canyons.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxFuel&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|special = Removed in 101.0 in favour of more flexible lua custom commands&lt;br /&gt;
|description = The maximum flight time in seconds before aircraft must return to an airbase to refuel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = refuelTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 5.0&lt;br /&gt;
|special = Removed in 101.0 in favour of more flexible lua custom commands&lt;br /&gt;
|description = The time in seconds required to refuel the aircraft at an airbase.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minAirbasePower&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|special = Removed in 101.0 in favour of more flexible lua custom commands&lt;br /&gt;
|description = The minimum {{taglink|workerTime}} an airbase must have to repair / refuel this aircraft.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canLoopbackAttack&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the aircraft perform an [http://en.wikipedia.org/wiki/Immelmann_turn Immelmann turn]?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Advanced Air Tags====&lt;br /&gt;
The following set of tags are not well understood and using non-default values can lead to undesired flight behaviours.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
{{tag&lt;br /&gt;
|name = wingDrag&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.07&lt;br /&gt;
|description = The drag caused by the aircraft&#039;s wing. Clamped between &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = wingAngle&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.08&lt;br /&gt;
|description = The angle between the front and the wing plane.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = frontToSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.1&lt;br /&gt;
|description = How far nose can be unaligned to speed vector before accelleration is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = speedToFront&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.07&lt;br /&gt;
|description = Rate for the nose to align to new (true) direction change. Values above 0.1 may lead to cumulative speedup issues.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = crashDrag&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.005&lt;br /&gt;
|description = The drag used when crashing. Clamped between &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxBank&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.8&lt;br /&gt;
|description = The maximum roll (z-axis rotation) the aircraft can achieve.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxPitch&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.45&lt;br /&gt;
|description = The maximum pitch (x-axis rotation) the aircraft tries to keep.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = turnRadius&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 500.0&lt;br /&gt;
|description = Hint to Spring unit AI about the required turning radius.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = verticalSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 3.0&lt;br /&gt;
|description = The speed of takeoff and landing, at least for gunships ({{taglink|hoverAttack|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxAileron&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.015&lt;br /&gt;
|description =  The maximum turn speed around the roll (z) axis.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxElevator&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.01&lt;br /&gt;
|description = The maximum turn speed around the pitch (x) axis.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxRudder&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.004&lt;br /&gt;
|description = The maximum turn speed around the yaw (y) axis.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxAcc&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.065&lt;br /&gt;
|description = The maximum acceleration or &#039;engine power&#039; of the aircraft.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = attackSafetyDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0&lt;br /&gt;
| special = Exists only in version 99.0&lt;br /&gt;
|description = Fighters abort dive toward target if within attackSafetyDistance and try to climb back to normal altitude while still moving toward target. It&#039;s disabled by default. Set to half of the minimum weapon range to avoid collisions, enemy fire, AOE damage. If set to greater than the weapon range, the unit will fly over the target like a bomber. This tag was removed in version 100.0 and changed to a [[Lua_MoveCtrl#MoveType-Controlling|Spring.SetMoveTypeData]] key.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Flares====&lt;br /&gt;
The following set of tags are rarely used and are hardcoded to only work vs. missile weapons. The texture is hardcoded to be &amp;lt;code&amp;gt;flareprojectiletexture&amp;lt;/code&amp;gt; defined in [[Resources.lua]].&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canDropFlare&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can this aircraft drop flares to distract missile weapons?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareReload&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 5.0&lt;br /&gt;
|lua = flareReloadTime&lt;br /&gt;
|description = The time in seconds between successive flare drops.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareDelay&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.3&lt;br /&gt;
|description = The delay between detecting an incoming missile and launching flares. Multiplied by a random number between 1 and 16.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareEfficiency&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.5&lt;br /&gt;
|description = The probability that an incoming missile will target the flare instead of the aircraft.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareDropVector&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|description = The direction vector which flares are emitted in.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareTime&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 3&lt;br /&gt;
|description = The lifetime of a dropped flare in [[frames]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareSalvoSize&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 4&lt;br /&gt;
|description = How many flares are dropped at once?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flareSalvoDelay&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The delay in [[frames]] between the release of each individual flare in a burst.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Transports===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportSize&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The size of units that the transport can pick up, in terms of the passengers {{taglink|footprintX}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minTransportSize&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The smallest size of unit that the transport can pick up, in terms of the passengers {{taglink|footprintX}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportCapacity&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The total number of units that the transport can pick up, with each unit multiplied by it&#039;s {{taglink|footprintX}} size. Prior to 101.0 if this tag is not present, then any Script.AttachUnit and Script.DropUnit call in the animation script will be ignored (See [[Animation-LuaCallouts#Other]]), in successive versions all units can use [[Lua_SyncedCtrl#Unit_Control|Spring.UnitAttach]] et al regardless of this tag.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportMass&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 100000.0&lt;br /&gt;
|description = The total cumulative {{taglink|mass}} of passengers the transport can carry.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minTransportMass&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The minimum {{taglink|mass}} passenger the transport can carry.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = loadingRadius&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 220.0&lt;br /&gt;
|description = How far away in [[elmo]]s can the transporter pick up and drop units?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unloadSpread&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 5.0&lt;br /&gt;
|description = How spread out the passengers are when unloaded. Is multiplied by the passengers radius.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = isFirePlatform&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can transported units still aim and shoot while loaded by this transport?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = holdSteady&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; - passengers are slaved to orientation of transporter attachment piece, if &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; - passengers are slaved to orientation of transporter body.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = releaseHeld&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the transporter unload it&#039;s passengers when it dies?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cantBeTransported&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false for mobile units, true for structures&lt;br /&gt;
|description = Controls if a unit is transportable at all or not. If &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; it is overridden by [[Modrules.lua]] &amp;lt;code&amp;gt;transportability&amp;lt;/code&amp;gt; subtable tags.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportByEnemy&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Controls if a unit can be transported by an enemy transport. i.e. can it be kidnapped.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportUnloadMethod&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = For air transports. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - Land to unload individually, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - Flyover drop (i.e. Parachute), or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - Land and flood unload all passengers. Can be used on ground transports with mixed results.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fallSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.2&lt;br /&gt;
|description = For air transports with {{taglink|transportUnloadMethod|1}}. The speed in [[elmo]]s per second which units will fall at when released from the transport.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unitFallSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Allows you to override {{taglink|fallSpeed}} for an individual passenger.}}&lt;br /&gt;
&lt;br /&gt;
===Categories===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = category&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The category tag is a string of separate words, each representing a category of units. There is a maximum of 32 categories. The primary purpose of categories is weapon targeting (See [[#weapons]]). Be aware that if no category is set, by default the unit will not be targetable due to {{taglink|onlyTargetCategory}} defaulting to a null string also.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = noChaseCategory&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The unit will still target enemies with a matching {{taglink|category}}, but will not chase after it if it moves out of weapon range.}}&lt;br /&gt;
&lt;br /&gt;
===Decals===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = leaveTracks&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the unit leave a track mark decal behind it when it moves? For mobile units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trackType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;stdTank&amp;quot;&lt;br /&gt;
|description = The filename of the image, without extension, assumed to be in &amp;lt;code&amp;gt;Bitmaps/Tracks/&amp;lt;/code&amp;gt;, to be used as the track decal. The red channel of the image controls the brightness and the green channel the alpha (how visible it is) of the track. Blue channel is unused.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trackWidth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 32.0&lt;br /&gt;
|description = The width of the track decal left on the ground, in [[elmo]]s.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trackOffset&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How far back in [[elmo]]s the track should be drawn from the centre of the unit.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trackStrength&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 32.0&lt;br /&gt;
|description = How visible or &#039;deep&#039; the track mark should be. Also used to determine how long the decal should last.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trackStretch&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = How much the track is stretched in the forward direction compared to the sides (i.e. used to change aspect ratio).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = useBuildingGroundDecal&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = For structures, do they display a ground decal on the terrain under their model?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildingGroundDecalType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The filename of the image to be used as ground decal. Assumed to be in &amp;lt;code&amp;gt;Unittextures/&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildingGroundDecalSizeX&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 4&lt;br /&gt;
|description = How wide the decal is left to right, in footprint units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildingGroundDecalSizeY&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 4&lt;br /&gt;
|description = How wide the decal is top to bottom, in footprint units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = buildingGroundDecalDecaySpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.1&lt;br /&gt;
|description = A measure of how quickly the decal should fade out if the structure dies. Essentially this value is multiplied by the time since death and subtracted from the original alpha until the decal is fully transparent.}}&lt;br /&gt;
&lt;br /&gt;
===Collision Volumes===&lt;br /&gt;
For a deeper explanation of these tags, see [[Gamedev:CollisionVolumes]]. Note that all collision checks first do a pre-check with the unit &#039;&#039;radius&#039;&#039; before doing the colvol checks. Ergo the unit &#039;&#039;radius&#039;&#039; must be larger or equal to the colvol!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = usePieceCollisionVolumes&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = collisionVolume.defaultToPieceTree&lt;br /&gt;
|description = When turned on the model and UnitDef collision volumes are ignored and Spring generates a bounding box volume for each piece of the unit model. These volumes can be manipulated or replaced by [[Lua_SyncedCtrl#Unit_Control | Spring.SetUnitPieceCollisionVolumeData]]. Increases the performance cost of collision calculations.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = useFootPrintCollisionVolume&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|92.0}}&lt;br /&gt;
|lua = .collisionVolume.defaultToFootprint&lt;br /&gt;
|description = Replaces any defined collision volume with a box with dimensions equal to the object&#039;s footprint (this also overrides any custom scaling and/or offsets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following three tags can instead be replaced with a [[#collisionVolume]] subtable:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collisionVolumeType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;s&amp;quot;&lt;br /&gt;
|lua = collisionVolume.type&lt;br /&gt;
|description = What shape should the unit&#039;s collision volume be? Can be {{value|&amp;quot;box&amp;quot;}}, {{value|&amp;quot;sphere}} or a cylinder aligned to an axis; {{value|&amp;quot;cylX&amp;quot;}}, {{value|&amp;quot;cylY&amp;quot;}}, {{value|&amp;quot;cylZ&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collisionVolumeScales&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = collisionVolume.scale{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The lengths of the collision volume in each of the three axes. Note that non-spherical ellipsoids and elliptical cylinders are not supported.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collisionVolumeOffsets&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = collisionVolume.offset{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The offset from the unit centre to the hit volume centre in each axis.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following tags have now been removed from the engine:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collisionVolumeTest&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|special = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Removed in 90.0 (Now always continuous)&amp;lt;/span&amp;gt;&lt;br /&gt;
|description = The type of test used to detect collisions. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; (discrete) or &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (continuous). Use the latter for catching high speed projectiles which may otherwise &#039;skip through&#039; small collision volumes, but beware of the increased performance cost.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = modelCenterOffset&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0} &lt;br /&gt;
|special = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Removed in 89.0 (Now set via lua)&amp;lt;/span&amp;gt;&lt;br /&gt;
|description = How far from the model&#039;s defined centre should the centre of the unit be?}}&lt;br /&gt;
&lt;br /&gt;
===Selection Volumes===&lt;br /&gt;
Introduced in 104.0, units may now have custom selection volumes in exactly the same way as collision volumes were already defined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = usePieceSelectionVolumes&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|lua = .selectionVolume.defaultToPieceTree&lt;br /&gt;
|description = When turned on the model and UnitDef selection volumes are ignored and Spring generates a bounding box volume for each piece of the unit model (the same volumes are used for collision and selection). These volumes can be manipulated or replaced by [[Lua_SyncedCtrl#Unit_Control | Spring.SetUnitPieceColisionVolumeData]]. Increases the performance cost of selection calculations.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = useFootPrintSelectionVolume&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|lua = .selectionVolume.defaultToFootprint&lt;br /&gt;
|description = Replaces any defined selection volume with a box with dimensions equal to the object&#039;s footprint (this also overrides any custom scaling and/or offsets).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following three tags can instead be replaced with a [[#selectionVolume]] subtable:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = selectionVolumeType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;s&amp;quot;&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|lua = collisionVolume.type&lt;br /&gt;
|description = What shape should the unit&#039;s selection volume be? Can be {{value|&amp;quot;box&amp;quot;}}, {{value|&amp;quot;sphere}} or a cylinder aligned to an axis; {{value|&amp;quot;cylX&amp;quot;}}, {{value|&amp;quot;cylY&amp;quot;}}, {{value|&amp;quot;cylZ&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = selectionVolumeScales&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|lua = .selectionVolume.scale{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The lengths of the selection volume in each of the three axes. Note that non-spherical ellipsoids and elliptical cylinders are not supported.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = selectionVolumeOffsets&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|lua = .selectionVolume.offset{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The offset from the unit centre to the selection volume centre in each axis.}}&lt;br /&gt;
&lt;br /&gt;
===Attack Behaviours===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = highTrajectory&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|lua = highTrajectoryType&lt;br /&gt;
|description = Can the unit fire it&#039;s (ballistic) weapons in a high trajectory arc? Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - Low trajectory only, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - High trajectory only, or &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - Toggle button.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = kamikaze&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = canKamikaze&lt;br /&gt;
|description = Does the unit attack its target by blowing itself up?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = kamikazeDistance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = kamikazeDist&lt;br /&gt;
|description = How close to the target, in [[elmo]]s, the unit must get before detonating. Measured in 3D, not 2D.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = kamikazeUseLOS&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the target unit have to be in LOS when detonating or only within {{taglink|kamikazeDistance}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = strafeToAttack&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Should the unit move sideways when it can&#039;t shoot?}}&lt;br /&gt;
&lt;br /&gt;
===Other===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = decoyFor&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The UnitDef name (not human {{taglink|name}}) which this unit is a decoy for.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = selfDestructCountdown&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 5&lt;br /&gt;
|lua = selfDCountdown&lt;br /&gt;
|description = The length in seconds taken between issuing self destruct order and the unit exploding.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = damageModifier&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|lua = armoredMultiple&lt;br /&gt;
|description = The multiplier applied to weapon damage when the units ARMORED status (See [[Lua_ConstCOB]]) is turned on.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = isTargetingUpgrade&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = targFac&lt;br /&gt;
|description = Does the unit upgrade the targeting so that units shoot accurately at enemy units which are in radar but not in LOS.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = isFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the unit immediately die into it&#039;s {{taglink|corpse}} feature when built? Used mainly for making walls.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = hideDamage&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Should the units current health be invisible to enemy players?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = showPlayerName&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Should the unit display it&#039;s controlling player as its name instead of {{taglink|name}}. Generally used for commander or hero units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = showNanoFrame&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Does the unit show an OTA-style nanoframe whilst being constructed?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unitRestricted&lt;br /&gt;
|type = int&lt;br /&gt;
|default = MAX_UNITS&lt;br /&gt;
|lua = maxThisUnit&lt;br /&gt;
|description = How many of this unit type may a player control at once? Defaults to being the maximum amount of units controllable. Is overridden by lobby unit restrictions.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = power&lt;br /&gt;
|type = float&lt;br /&gt;
|default = {{taglink|buildCostMetal}} + ({{taglink|buildCostEnergy}} / 60.0)&lt;br /&gt;
|description = The relative power of the unit. Used in weapon targeting priority and experience gain calculations.}}&lt;br /&gt;
&lt;br /&gt;
==Sub Tables==&lt;br /&gt;
&lt;br /&gt;
===collisionVolume===&lt;br /&gt;
The &amp;lt;code&amp;gt;collisionVolume&amp;lt;/code&amp;gt; subtable of a UnitDef replaces the older individual {{taglink|collisionVolumeType}}, {{taglink|collisionVolumeScales}} and {{taglink|collisionVolumeOffsets}} tags.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = type&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;s&amp;quot;&lt;br /&gt;
|lua = .collisionVolume.type&lt;br /&gt;
|description = What shape should the unit&#039;s collision volume be? Can be {{value|&amp;quot;box&amp;quot;}}, {{value|&amp;quot;sphere&amp;quot;}} or a {{value|&amp;quot;cylinder&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = axis&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;z&amp;quot;&lt;br /&gt;
|description = Which axis does the unit&#039;s collision volume lie along? Can be {{value|&amp;quot;x&amp;quot;}}, {{value|&amp;quot;y&amp;quot;}} or {{value|&amp;quot;z&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = scales&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = .collisionVolume.scale{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The lengths of the collision volume in each of the three axes. Note that non-spherical ellipsoids and elliptical cylinders are not supported.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = offsets&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = .collisionVolume.offset{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The offset from the unit centre to the hit volume centre in each axis.}}&lt;br /&gt;
&lt;br /&gt;
===selectionVolume===&lt;br /&gt;
The &amp;lt;code&amp;gt;selectionVolume&amp;lt;/code&amp;gt; subtable of a UnitDef can replace the individual {{taglink|selectionVolumeType}}, {{taglink|selectionVolumeScales}} and {{taglink|selectionVolumeOffsets}} tags.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = type&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;s&amp;quot;&lt;br /&gt;
|lua = .selectionVolume.type&lt;br /&gt;
|description = What shape should the unit&#039;s selection volume be? Can be {{value|&amp;quot;box&amp;quot;}}, {{value|&amp;quot;sphere&amp;quot;}} or a {{value|&amp;quot;cylinder&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = axis&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;z&amp;quot;&lt;br /&gt;
|description = Which axis does the unit&#039;s selection volume lie along? Can be {{value|&amp;quot;x&amp;quot;}}, {{value|&amp;quot;y&amp;quot;}} or {{value|&amp;quot;z&amp;quot;}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = scales&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = .selectionVolume.scale{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The lengths of the selection volume in each of the three axes. Note that non-spherical ellipsoids and elliptical cylinders are not supported.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = offsets&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 0.0}&lt;br /&gt;
|lua = .selectionVolume.offset{X{{pipe}}Y{{pipe}}Z}&lt;br /&gt;
|description = The offset from the unit centre to the selection volume centre in each axis.}}&lt;br /&gt;
&lt;br /&gt;
===weapons===&lt;br /&gt;
The &amp;lt;code&amp;gt;weapons&amp;lt;/code&amp;gt; subtable of a UnitDef tells Spring which weapons the unit has. It is a simple array (number indexed table) of &amp;lt;code&amp;gt;weaponName&amp;lt;/code&amp;gt;s (not the human readable &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;!).&lt;br /&gt;
&lt;br /&gt;
The following additional tags are associated with this subtable:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = name&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The &amp;lt;code&amp;gt;weaponName&amp;lt;/code&amp;gt; of the weapon (See [[Gamedev:WeaponDefs]]). If using the [[weapondefs_post.lua]] provided by [[springcontent.sdz]], you may include the WeaponDef tables within the UnitDef as the &amp;lt;code&amp;gt;weaponDefs&amp;lt;/code&amp;gt; subtable, and refer to them with &amp;lt;code&amp;gt;def&amp;lt;/code&amp;gt; rather than &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;. This can be a useful way to organise definitions if units do not generally share weapons.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = badTargetCategory&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = A string of unit {{taglink|category}} entries which this weapon prefers to avoid targeting. i.e. given two units which &#039;&#039;can&#039;&#039; be targeted, any unit whose {{taglink|category}} matches any entry in this tag, will be targeted last. (See [[#Categories]])}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = onlyTargetCategory&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = A string of unit {{taglink|category}} entries which this weapon can target. i.e. any unit whose {{taglink|category}} does not match any entry in this tag, cannot be targeted by this weapon. (See [[#Categories]])}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = slaveTo&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The number of the weapon which this weapon is slaved to. A slaved weapon can only target what it&#039;s master is targeting. Weapon numbers start at &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and correspond to the index of the weapon within the subtable.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = mainDir&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.0, 0.0, 1.0} i.e. forwards&lt;br /&gt;
|description = A vector representing the firing direction of this weapon if it has a limited firing arc. Used in conjunction with {{taglink|maxAngleDif}} (See [[Gamedev:WeaponMainDir]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxAngleDif&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 360.0&lt;br /&gt;
|description = How wide this weapons limited firing arc is in degrees. Symmetrical about {{taglink|mainDir}} i.e. &amp;lt;code&amp;gt;180.0&amp;lt;/code&amp;gt; is 90 degree freedom either way (See [[Gamedev:WeaponMainDir]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fuelUsage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much fuel in seconds is deducted from the units initial {{taglink|maxFuel}} when this weapon fires.}}&lt;br /&gt;
&lt;br /&gt;
===buildOptions===&lt;br /&gt;
The &amp;lt;code&amp;gt;buildOptions&amp;lt;/code&amp;gt; subtable of a UnitDef tells Spring which other units the unit can build (in the case of a builder) or produce (in the case of a factory).&lt;br /&gt;
It is a simple array (number indexed table) of &amp;lt;code&amp;gt;unitName&amp;lt;/code&amp;gt;s (not the human readable {{taglink|name}}!).&lt;br /&gt;
&lt;br /&gt;
There are no additional tags specific to this subtable.&lt;br /&gt;
&lt;br /&gt;
===SFXTypes===&lt;br /&gt;
The &amp;lt;code&amp;gt;SFXTypes&amp;lt;/code&amp;gt; subtable of a UnitDef tells Spring which [[CEG]] effects are associated with the unit. It consists of two further subtables, with no additional tags specific to them.&lt;br /&gt;
&lt;br /&gt;
====explosionGenerators====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;explosionGenerators&amp;lt;/code&amp;gt; subtable of &amp;lt;code&amp;gt;SFXTypes&amp;lt;/code&amp;gt; tells Spring which [[CEG]]s the unit&#039;s script can call, via the &amp;lt;code&amp;gt;EmitSFX()&amp;lt;/code&amp;gt; callout (See [[Animation-LuaCallouts#Effects]]). It is a simple array (number indexed table) of CEG names, prefaced by the string &amp;lt;code&amp;gt;&amp;quot;custom:&amp;quot;&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
====pieceExplosionGenerators====&lt;br /&gt;
{{new|83.0}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;pieceExplosionGenerators&amp;lt;/code&amp;gt; subtable of &amp;lt;code&amp;gt;SFXTypes&amp;lt;/code&amp;gt; tells Spring which [[CEG]]s the unit&#039;s script can pick at random to attach to a flying unit piece, created from the &amp;lt;code&amp;gt;Explode()&amp;lt;/code&amp;gt; callout (See [[Animation-LuaCallouts#Effects]]). It is a simple array (number indexed table) of CEG names, with no prefix.&lt;br /&gt;
&lt;br /&gt;
Forum thread (with examples): {{forumlink|topic=27554|title=pieceExplosionGenerators}}&lt;br /&gt;
&lt;br /&gt;
===sounds===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sounds&amp;lt;/code&amp;gt; subtable of a UnitDef tells Spring which sound files to play when the unit triggers various events.&lt;br /&gt;
&lt;br /&gt;
Files are assumed to be in the &amp;lt;code&amp;gt;Sounds/&amp;lt;/code&amp;gt; directory; accepted formats are .wav and .ogg, the former being assumed if no extension is given.&lt;br /&gt;
&lt;br /&gt;
Sounds can be defined in one of three ways:&lt;br /&gt;
&lt;br /&gt;
# Each event can be used as though it were a &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; tag referring to the filename.&lt;br /&gt;
# Each event can be the name of a subtable, which is a simple array containing the filenames. One sound is picked at random from the list each time the event occurs.&lt;br /&gt;
# Each event can be the name of a subtable, which is a simple array containing further tables, which contain the following tags:&lt;br /&gt;
{{tag&lt;br /&gt;
|name = file&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The filename of the sound to play.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = volume&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = The default volume of the sound.}}&lt;br /&gt;
&lt;br /&gt;
Spring checks any referenced sound filename to see if a SoundItem has been created, which allows greater control over how it is played (See [[Sounds.lua]]).&lt;br /&gt;
&lt;br /&gt;
====sounds Example====&lt;br /&gt;
&lt;br /&gt;
For clarification, here is an example of all three methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;sounds = {&lt;br /&gt;
  -- Method 1&lt;br /&gt;
  ok = &#039;oksound&#039;, -- .wav appended&lt;br /&gt;
  -- Method 2&lt;br /&gt;
  arrived = {&lt;br /&gt;
    &#039;arrived1.wav&#039;,&lt;br /&gt;
    &#039;arrived2.wav&#039;,&lt;br /&gt;
  },&lt;br /&gt;
  -- Method 3&lt;br /&gt;
  select = {&lt;br /&gt;
    { file = &#039;selsound1.ogg&#039;, volume = 2.0 },&lt;br /&gt;
    { file = &#039;selsound2.ogg&#039;, volume = 2.5 },&lt;br /&gt;
  },&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====sounds Events====&lt;br /&gt;
&lt;br /&gt;
The events called by the engine are as follows:&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = ok&lt;br /&gt;
|description = Unit is issued a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = select&lt;br /&gt;
|description = Unit is selected by the player.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = arrived&lt;br /&gt;
|description = Unit has arrived at its destination. Mobile ground units only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = build&lt;br /&gt;
|description = Unit begins building. Called for both factories and mobile construction units.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = activate&lt;br /&gt;
|description = Unit is activated, i.e. Is turned on. Also called when a mobile ground unit starts moving.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = deactivate&lt;br /&gt;
|description = Unit deactivates, i.e. Is turned off.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = cant&lt;br /&gt;
|description = Unit cannot carry out this order. Loaded but not currently called by the engine.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{ItemType&lt;br /&gt;
|name = underattack&lt;br /&gt;
|description = Unit gets attacked. Loaded but not currently called by the engine.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===customParams===&lt;br /&gt;
The &amp;lt;code&amp;gt;customParams&amp;lt;/code&amp;gt; subtable of a UnitDef allows the game designer to give their units custom attributes, which can then be accessed via lua gadgets and widgets. It is a map (key-value pair indexed table) of strings. When accessing these attributes in lua the strings can be turned back into numbers, bools or even tables. This gives great control to game designers to essentially implement their own behaviour tags.&lt;br /&gt;
&lt;br /&gt;
There are no additional tags specific to this subtable&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
MC:L implements OO with inheritance (base classes in [http://sourceforge.net/p/mwspring/code/HEAD/tree/Gamedata/unitdefs_pre.lua#l36 unitdefs_pre.lua])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ExampleRepoLinks&lt;br /&gt;
|path = units/&lt;br /&gt;
|entity = UnitDefs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Dev]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:Main&amp;diff=8291</id>
		<title>Gamedev:Main</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:Main&amp;diff=8291"/>
		<updated>2022-11-17T19:44:23Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Animation of units */ link to examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Game Development =&lt;br /&gt;
This information is meant to help newcomers learn how to develop their own games for the Spring Engine. If you are interested in creating maps for Spring, see [[Mapdev:Main]].&lt;br /&gt;
&lt;br /&gt;
= Templates &amp;amp; Examples =&lt;br /&gt;
* [[Gamedev:SpringABC|SpringABC]] - A hierarchical set of empty template games, without examples&lt;br /&gt;
* [[SpringTutorialGame|Spring Tutorial Game]] - A tutorial template game with full examples&lt;br /&gt;
* [[Gamedev:PublicRepos|Public Repos]] - Publicly readable Spring game code repositories&lt;br /&gt;
&lt;br /&gt;
= Technical Documentation =&lt;br /&gt;
== GameData ==&lt;br /&gt;
* [[Armordefs.lua]] - armor classes&lt;br /&gt;
* [[Icontypes.lua]] - strategic unit icons&lt;br /&gt;
* [[Modinfo.lua]] - game identifier file (name, version,...)&lt;br /&gt;
* [[Modrules.lua]] - Global game variables&lt;br /&gt;
* [[Movedefs.lua]] - MoveClasses for pathfinding&lt;br /&gt;
* [[Resources.lua]] - index file for textures&lt;br /&gt;
* [[Sidedata.lua]] - playable factions/races/sides&lt;br /&gt;
* [[Sounds.lua]] - index file for sounds&lt;br /&gt;
* [[Messages.lua]] - Team death messages {{new|95.0}}:deprecated&lt;br /&gt;
&lt;br /&gt;
== Definition Files ==&lt;br /&gt;
* [[Gamedev:UnitDefs]] - define the attributes of units&lt;br /&gt;
* [[Gamedev:WeaponDefs]] - define the attributes of weapons/projectiles&lt;br /&gt;
* [[Gamedev:FeatureDefs]] - define the attributes of static map features and wrecks&lt;br /&gt;
* [[CEG:Main]] Particle effects (explosions etc)&lt;br /&gt;
&lt;br /&gt;
== Lua API &amp;amp; Libraries (excerpt) ==&lt;br /&gt;
* [[Lua_Scripting|Lua API Documentation]]&lt;br /&gt;
* [[Lua_Libraries|Lua Libraries]]&lt;br /&gt;
&lt;br /&gt;
== Animation of units ==&lt;br /&gt;
Lua Animations (LUS)&lt;br /&gt;
*[[Animation-LuaScripting]]&lt;br /&gt;
**[[Animation-LuaCallins]]&lt;br /&gt;
**[[Animation-LuaCallouts]]&lt;br /&gt;
**[[Animation-CobLuaDifferences]]&lt;br /&gt;
**[[Animation:LuaExamples]]&lt;br /&gt;
&lt;br /&gt;
COB Animations (Antiquated)&lt;br /&gt;
*[[Animation-CobOverview]]&lt;br /&gt;
**[[Animation-CobAnimation]]&lt;br /&gt;
**[[Animation-CobCallins]]&lt;br /&gt;
**[[Animation-CobConstants]]&lt;br /&gt;
**[[Animation-CobThreads]]&lt;br /&gt;
**[[Animation-CobHitByWeaponID]]&lt;br /&gt;
**[[Lua-LuaCOB]] - how to interface COB with LUA&lt;br /&gt;
**[[CEG_For_Units|Game Development:Calling basic CEGs from COB]]&lt;br /&gt;
**{{forumlink|topic=7457|title=GPL COB Examples}}&lt;br /&gt;
&lt;br /&gt;
== Models &amp;amp; Textures ==&lt;br /&gt;
* [[About_s3o|.s3o]]&lt;br /&gt;
* [[Assimp]]&lt;br /&gt;
** [[3DModels:AssimpWorkflow]]&lt;br /&gt;
* [[3DModels:Textures]]&lt;br /&gt;
* [[Shaders:CustomUnitShadingFramework]]&lt;br /&gt;
** [[Shaders:PBRShaders]]&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
* [[Gamedev:DebugDrawModes]]&lt;br /&gt;
* [[Gamedev:Archives]] - packing game/map&lt;br /&gt;
* [[Gamedev:Buildpics]]&lt;br /&gt;
* [[Gamedev:CollisionVolumes]]&lt;br /&gt;
* [[Gamedev:Glossary]]&lt;br /&gt;
* [[Gamedev:MouseCursors]]&lt;br /&gt;
* [[Gamedev:Sidepics]]&lt;br /&gt;
* [[Gamedev:Structure]]&lt;br /&gt;
* [[VirtualFileSystem]]&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
== In-Game Tools ==&lt;br /&gt;
*[http://springboard-core.readthedocs.io/en/latest/ SpringBoard] - Powerful map and scenario editor&lt;br /&gt;
*[[Map Making: Feature Placer|Feature Placer]] - A Map Feature &amp;amp; NPC Unit Placement Tool&lt;br /&gt;
&lt;br /&gt;
== External Tools ==&lt;br /&gt;
* [[Upspring]]&lt;br /&gt;
* [[Map,_Mod,_And_Unit_Development_Programs|Development Tools]]&lt;br /&gt;
&lt;br /&gt;
= Engine Related =&lt;br /&gt;
* [[Download_Testing]] - Test the compatibility of your game on upcoming versions of the Spring engine.&lt;br /&gt;
&lt;br /&gt;
* [[EngineChangelogForContentDevs]] - New engine versions sometimes require games to adjust. A list of common problems.&lt;br /&gt;
&lt;br /&gt;
* [[EngineSource_for_GameDevs]] - Notes about the engine source, from modding point of view.&lt;br /&gt;
&lt;br /&gt;
= Tutorials =&lt;br /&gt;
== Tips, Tricks &amp;amp; Testing ==&lt;br /&gt;
[[TestingYourGame|These tricks and commands]] are useful for testing or debugging.&lt;br /&gt;
&lt;br /&gt;
== Game Development Tutorials ==&lt;br /&gt;
*[[The Complete Guide To Making A Spring Game]] - A fairly comprehensive getting started tutorial.&lt;br /&gt;
*[http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=26409| Porting TA content to Spring]&lt;br /&gt;
*&amp;lt;strike&amp;gt;[[Simple Mod Tutorial|Simple Game Tutorial]]&amp;lt;/strike&amp;gt; - needs to be updated&lt;br /&gt;
&lt;br /&gt;
==Modelling Tutorials==&lt;br /&gt;
&#039;&#039;&#039;Wings3D&#039;&#039;&#039;&lt;br /&gt;
* [[3DModels:Wings3DTutorial]]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?t=10612 Wings UV Mapping Tutorial]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Blender&#039;&#039;&#039;&lt;br /&gt;
* [[TutorialBlenderWorkFlow|Blender Workflow Tutorial]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;3DS Max&#039;&#039;&#039;&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?t=10503 Runecrafter&#039;s 3DS Max UV Mapping Tutorial]&lt;br /&gt;
&lt;br /&gt;
==Texturing Tutorials==&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?f=57&amp;amp;t=22392 DDS Textures:  How To]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?t=10947 Greeble Tutorial 1]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?f=9&amp;amp;t=12356 Greeble Tutorial 2]&lt;br /&gt;
&lt;br /&gt;
=Misc=&lt;br /&gt;
* [[Ren&#039;Py]]: a visual novel engine that can be used with Spring&lt;br /&gt;
* &amp;lt;strike&amp;gt;[http://answers.springlobby.info/ Q&amp;amp;A Site for the Spring Engine]&amp;lt;/strike&amp;gt; Currently down.&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Dev]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10912</id>
		<title>Lua:Main</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10912"/>
		<updated>2022-11-17T19:43:51Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Lua FAQ=&lt;br /&gt;
Lua scripting is the primary way for developers to customize their games and add new features. Most aspects of the Spring engine can be controlled and extensively modified through the Lua API.&lt;br /&gt;
&lt;br /&gt;
[[Lua_Beginners_FAQ|Introduction to Lua in Spring]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Lua:Tutorial_GettingStarted|Easy widget examples]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces {{HeaderNotice|(last update: 104)}}=&lt;br /&gt;
[[Lua:Environments]] (Details the available environments and shows which interfaces are loaded by each)&lt;br /&gt;
&lt;br /&gt;
[[Lua:Callins]] (Entry points to lua addons)&lt;br /&gt;
{{LuaInterfaces}}&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[Lua:Tutorial_GettingStarted|Easy example widgets]]&lt;br /&gt;
* [[LuaTutorials::InterCommunications]] (i.e. synced &amp;lt;-&amp;gt; unsynced communications)&lt;br /&gt;
* [[Animation:LuaExamples| Lua animation UnitScript examples]]&lt;br /&gt;
&lt;br /&gt;
=Other useful information=&lt;br /&gt;
* [[Lua_Libraries | Lua libraries]]&lt;br /&gt;
* [[Lua_Performance | Lua performance tips]]&lt;br /&gt;
* [[UI_commands]]&lt;br /&gt;
* [[Animation-LuaScripting | Unit animation scripting with Lua]]&lt;br /&gt;
* [https://github.com/spring/spring/tree/develop/rts/Lua#Source_Code Source code for Lua API]&lt;br /&gt;
&lt;br /&gt;
=Official Lua documentation=&lt;br /&gt;
[http://www.lua.org/pil/ &#039;Programming in Lua&#039; book online]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.lua.org/manual/5.1/ Lua 5.1 Reference manual]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://lua-users.org/wiki/TutorialDirectory Lua tutorials]&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2103</id>
		<title>Animation-LuaScripting</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2103"/>
		<updated>2022-11-17T19:38:15Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Further reading */ add a link through to skeleton examples page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
Lua unit animation is implemented partially in the engine, and partially in a Lua gadget which is shipped with Spring in [[springcontent.sdz]]. By default, gadget is not loaded, so a bit of setup is required to enable Lua unit scripts. (In some games, gadget is alredy activated, for example in Zero:k)&lt;br /&gt;
&lt;br /&gt;
To enable Lua unit scripts, create a file &#039;&#039;LuaRules/Gadgets/unit_script.lua&#039;&#039;, and paste the following into it:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;4&amp;quot;&lt;br /&gt;
|style=&amp;quot;background: #41545c; border: 1px #aaa solid;&amp;quot;|&lt;br /&gt;
&amp;lt;small&amp;gt;&lt;br /&gt;
 -- Enables Lua unit scripts by including the gadget from springcontent.sdz&lt;br /&gt;
 &lt;br /&gt;
 -- Uncomment to override the directory which is scanned for *.lua unit scripts.&lt;br /&gt;
 --UNITSCRIPT_DIR = &amp;quot;scripts/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 return include(&amp;quot;LuaGadgets/Gadgets/unit_script.lua&amp;quot;)&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Also, do check whether your [http://github.com/spring/spring/blob/master/installer/builddata/springcontent/LuaGadgets/system.lua &#039;&#039;LuaRules/system.lua&#039;&#039;] is up to date, if you copied this verbatim into your game. (Must be from a later date than 5 september 2009)&lt;br /&gt;
&lt;br /&gt;
Now this is done, you can start putting *.lua files in your &#039;&#039;scripts/&#039;&#039; folder.&lt;br /&gt;
&lt;br /&gt;
=== Workflow ===&lt;br /&gt;
&lt;br /&gt;
Lua has the major advantage over BOS/COB that you do not need to compile it, which can reduce the time to develop scripts quite a bit.&lt;br /&gt;
&lt;br /&gt;
To save further time, do not restart Spring for each small change. Simply run Spring in an window so you can easily switch between your editor and Spring, and use &#039;&#039;/cheat&#039;&#039; and &#039;&#039;/luarules reload&#039;&#039; to reload all Lua unit scripts.&lt;br /&gt;
&lt;br /&gt;
To be able to use commands above, unzip your game into directory named &amp;quot;myGame.sdd&amp;quot;, then you can directly change lua scripts (animations etc.) and reload.&lt;br /&gt;
&lt;br /&gt;
Additionally, for Lua unit scripts operating on Assimp models (primarily .dae and .blend), it is possible to do most of your animating in Blender using the [https://github.com/Anarchid/blender2lus blender2lus] export addon.&lt;br /&gt;
&lt;br /&gt;
=== Workflow for animating S3o models in Blender ===&lt;br /&gt;
&lt;br /&gt;
Anarchids Blendertools can be used to animate (within limits) S3O models. Here are the steps:&lt;br /&gt;
&lt;br /&gt;
1. Export your model into Blender.&lt;br /&gt;
&lt;br /&gt;
2. Restore the Hierarchy in Blender.&lt;br /&gt;
&lt;br /&gt;
https://blender.stackexchange.com/questions/26108/how-do-i-parent-objects&lt;br /&gt;
(Ctrl + P) is your friend .&lt;br /&gt;
&lt;br /&gt;
3. If all Pivots are set correctly, create the Animations, one by one.&lt;br /&gt;
&lt;br /&gt;
4. Export the Animations with Anarchids Skript Export tool. &lt;br /&gt;
&lt;br /&gt;
5. Open the resulting Animationskript for postprocesing.&lt;br /&gt;
&lt;br /&gt;
6. Find Move commands like {[&#039;c&#039;]=&#039;move&#039;,[&#039;p&#039;]=LowerJaw, [&#039;a&#039;]=x_axis, [&#039;t&#039;]=-0.000000, [&#039;s&#039;]=0.012682}, and purge them. Replace them with todos- you will have to insert them manually later, with correct axis and values.&lt;br /&gt;
&lt;br /&gt;
7.In the turn commands - exchange the [&#039;a&#039;]=z_axis with [&#039;a&#039;]=y_axisz and the old [&#039;a&#039;]=y_axis with [&#039;a&#039;]=z_axis.&lt;br /&gt;
Here is a Regex, to make the text-search easier.&lt;br /&gt;
&lt;br /&gt;
{\[&#039;c&#039;]=&#039;turn&#039;,\[&#039;p&#039;]=([^\s]+), \[&#039;a&#039;]=z_axis, \[&#039;t&#039;]=\*&lt;br /&gt;
&lt;br /&gt;
{\[&#039;c&#039;]=&#039;turn&#039;,\[&#039;p&#039;]=([^\s]+), \[&#039;a&#039;]=y_axis, \[&#039;t&#039;]=\*&lt;br /&gt;
&lt;br /&gt;
8. Invert (change the sign) of the y_axis values.&lt;br /&gt;
&lt;br /&gt;
9. Start the game and call the Animation you want to debug in a Loop.&lt;br /&gt;
&lt;br /&gt;
10. Congratulations you now have smoothly animated S3o Models.&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
* [[Animation:LuaExamples]]&lt;br /&gt;
* [http://tvo.github.com/spring/2010/04/19/lus-stumpy.html Stumpy tutorial]&lt;br /&gt;
* [http://tvo.github.com/spring/2010/04/26/lus-stumpy-2.html Polishing the stumpy]&lt;br /&gt;
* [[Animation-LuaCallins]]&lt;br /&gt;
* [[Animation-LuaCallouts]]&lt;br /&gt;
* [[Animation-CobLuaDifferences | comparing Lua and COB unit scripts]]&lt;br /&gt;
* [[SpringTutorialGame]] contains simple  examples unit scripts&lt;br /&gt;
* [[SpringRtsTutorialAnimDef]] examples animation scripts&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
* Conversion tool&lt;br /&gt;
* Performance measurements&lt;br /&gt;
* Link to article in piro&#039;s magazine&lt;br /&gt;
* Coordinate system (axis, direction of rotation, picture)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Armordefs.lua&amp;diff=2140</id>
		<title>Armordefs.lua</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Armordefs.lua&amp;diff=2140"/>
		<updated>2021-01-23T12:27:37Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* More efficient with Lua */ delete this section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This file sorts units into different armor classes. Weapons can deal different amount of damage to different armor classes. &lt;br /&gt;
&lt;br /&gt;
=Location=&lt;br /&gt;
&amp;lt;code&amp;gt;armordefs.lua&amp;lt;/code&amp;gt; is a file in the &amp;lt;code&amp;gt;Gamedata/&amp;lt;/code&amp;gt; directory of a Spring Game.&lt;br /&gt;
&lt;br /&gt;
=Source=&lt;br /&gt;
The engine source code which parses the data from this file is viewable here:&lt;br /&gt;
&lt;br /&gt;
* {{sourcelink|file=rts/Sim/Misc/DamageArrayHandler.cpp}}&lt;br /&gt;
&lt;br /&gt;
=Details=&lt;br /&gt;
By default a damage class named &amp;quot;default&amp;quot; exists and every unit is in it.&lt;br /&gt;
So if all your weapons only deal &amp;quot;default&amp;quot; damage then this file is not needed.&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
local armorDefs = {&lt;br /&gt;
	tanks = {&lt;br /&gt;
		&amp;quot;supertank&amp;quot;,&lt;br /&gt;
		&amp;quot;megatank&amp;quot;,&lt;br /&gt;
	},&lt;br /&gt;
&lt;br /&gt;
	infantry = {&lt;br /&gt;
		&amp;quot;dude&amp;quot;,&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--NOTE: only needed for &amp;lt;95.0 (before engine was expecting a cryptic format)&lt;br /&gt;
if not(Game) or not(Game.version) then&lt;br /&gt;
  for categoryName, categoryTable in pairs(armorDefs) do&lt;br /&gt;
    local t = {}&lt;br /&gt;
    for _, unitName in pairs(categoryTable) do&lt;br /&gt;
      t[unitName] = 1&lt;br /&gt;
    end&lt;br /&gt;
    armorDefs[categoryName] = t&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return armorDefs&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Weapon Example=&lt;br /&gt;
Goes with above example, a weapon that deals 60 damage to infantry but only 5 damage to tanks:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
damage = {&lt;br /&gt;
	infantry = 60,&lt;br /&gt;
	tanks = 5,&lt;br /&gt;
},&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Shields=&lt;br /&gt;
In engine versions =&amp;lt; 96.0 the damage dealt to shields is the weapon&#039;s &#039;&#039;default&#039;&#039; value.&lt;br /&gt;
This [https://springrts.com/mantis/view.php?id=4450 changed] in v98.0&lt;br /&gt;
&lt;br /&gt;
Putting a shield into an armor class is analogical to units, ie. the armorDefs entry is its weaponDef name:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
armorDefs = {&lt;br /&gt;
  units = { &amp;quot;shieldbot&amp;quot; },&lt;br /&gt;
  shields = { &amp;quot;shieldbot_shield&amp;quot; }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in some damage table:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;damage = {&lt;br /&gt;
  default = 123,&lt;br /&gt;
  units = 456,&lt;br /&gt;
  shields = 789&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Links to more Examples=&lt;br /&gt;
[http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/gamedata/armordefs.lua zero-K]&amp;lt;br&amp;gt;&lt;br /&gt;
Contains scripting to take into account various things like EMP damage.&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/springtutorialgame/source/browse/trunk/SpringTutorialGame.sdd/Gamedata/armordefs.lua|Spring Tutorial Game]&amp;lt;br&amp;gt;&lt;br /&gt;
Uses default damage class, except for one unit that is &amp;quot;armored.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[http://sourceforge.net/p/mwspring/code/899/tree/Gamedata/armordefs.lua MechCommander: Legacy]&amp;lt;br&amp;gt;&lt;br /&gt;
Automatically assigns units to an armor class based on [[Gamedev:UnitDefs|UnitDef]] tags and custom params.&lt;br /&gt;
&lt;br /&gt;
[[Category:gamedata]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedRead&amp;diff=12064</id>
		<title>Lua SyncedRead</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedRead&amp;diff=12064"/>
		<updated>2020-06-30T20:23:10Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Unit Weapon Informations */ some bare minimum doc on what TestTarget/TestRange/TryTarget/HaveFreeLineOfFire actually do&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
== Game ==&lt;br /&gt;
&lt;br /&gt;
=== Special TeamID Variables ===&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(those special TeamIDs are not supported by all functions)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.ALL_UNITS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.MY_UNITS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.ALLY_UNITS&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.ENEMY_UNITS&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;For Widgets, instead of Spring.MY_UNITS, use Spring.GetLocalTeamID()&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGaiaTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number teamID&lt;br /&gt;
&lt;br /&gt;
=== GameStates ===&lt;br /&gt;
&#039;&#039;&#039;Spring.IsGodModeEnabled&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsCheatingEnabled&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsDevLuaEnabled&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsEditDefsEnabled&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.AreHelperAIsEnabled&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.FixedAllies&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.IsGameOver&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
=== RulesParams ===&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Those functions allow to save data per Game,Team and Unit.&amp;lt;br&amp;gt;The advantage of it is that it can be read from anywhere (even from LuaUI and AIs!)&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;string values are new since 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetRulesInfoMap&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;REMOVED in 0.82!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; { [key1] = string value1, [key2] = string value2, ... }&lt;br /&gt;
  ( string &amp;quot;key&amp;quot; ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number ruleIndex | string ruleName ) -&amp;gt; nil | number value | string value&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameRulesParams&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | { [ruleName1] = number | string value1, ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number index | string ruleName ) -&amp;gt; nil | number value | string value&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamRulesParams&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | { [ruleName1] = number | string value1, ... }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number index | string ruleName ) -&amp;gt; nil | number value | string value&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitRulesParams&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { [ruleName1] = number | string value1, ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number index | string ruleName ) -&amp;gt; nil | number value | string value&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureRulesParams&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | { [ruleName1] = number | string value1, ... }&lt;br /&gt;
&lt;br /&gt;
=== Mod-/Map-Options ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetModOptions&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {} | { &amp;quot;keyName1&amp;quot; = string &amp;quot;value&amp;quot;, &amp;quot;keyName2&amp;quot; = string &amp;quot;value&amp;quot;, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMapOptions&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {} | { &amp;quot;keyName1&amp;quot; = string &amp;quot;value&amp;quot;, &amp;quot;keyName2&amp;quot; = string &amp;quot;value&amp;quot;, ... }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
! bool values are not transfered from C to Lua correctly, so in IF theres needed to use this condition:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&amp;quot;if (tonumber(Spring.GetModOptions.exampleOption) == 1) then...end&amp;quot;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
not only:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;quot;if (Spring.GetModOptions.exampleOption) then...end&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Speed/Time ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameSpeed&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;As of 98.0 moved to [[Lua_UnsyncedRead]] due to desyncs in replays/demos&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; number userSpeedFactor, number speedFactor, boolean paused&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameFrame&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number frameNum%dayFrames, number frameNum/dayFrames&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameSeconds&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number seconds&lt;br /&gt;
&lt;br /&gt;
=== Vectors ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetWind&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number dirX, number dirY, number dirZ, &lt;br /&gt;
         number strength,  number normDirX, number normDirY, number normDirZ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetHeadingFromVector&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number heading&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVectorFromHeading&#039;&#039;&#039;&lt;br /&gt;
  ( number heading ) -&amp;gt; number x, number z&lt;br /&gt;
&lt;br /&gt;
== Sides/Factions ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSideData&#039;&#039;&#039;&lt;br /&gt;
  ( string sideName ) -&amp;gt; nil | string startUnit, string caseSensitiveSideName&lt;br /&gt;
  ( number sideID ) -&amp;gt; nil | string sideName, string startUnit, string caseSensitiveSideName&lt;br /&gt;
  ( ) -&amp;gt; { [1] = { sideName=string,caseName=string,startUnit=string}, [2] = .., .. }&lt;br /&gt;
&lt;br /&gt;
== Teams ==&lt;br /&gt;
=== StartBoxes/StartPositions ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAllyTeamStartBox&#039;&#039;&#039;&lt;br /&gt;
  ( number allyID ) -&amp;gt; nil | number xmin, number zmin, number xmax, number zmax&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamStartPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&lt;br /&gt;
=== Player,Team,Ally Lists/Info ===&lt;br /&gt;
&lt;br /&gt;
Note: AIs are associated to teamIDs (and do not have playerIDs). Code to cycle through AI teamIDs can be found [https://springrts.com/phpbb/viewtopic.php?f=21&amp;amp;t=36873#p586026 here] &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerList&#039;&#039;&#039;&lt;br /&gt;
  ( [number teamID = -1 | boolean onlyActive = false] [, number teamID | boolean onlyActive])&lt;br /&gt;
  -&amp;gt; nil | { [1] = number playerID, etc... }&lt;br /&gt;
From 104.0 onwards spectators will be ignored if a valid (&amp;gt;=0) teamID is given&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamList&#039;&#039;&#039;&lt;br /&gt;
  ( [number allyTeamID = -1] ) -&amp;gt; nil | { [1] = number teamID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAllyTeamList&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [1] = number allyTeamID, etc... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID ) -&amp;gt; &lt;br /&gt;
    nil | string  &amp;quot;name&amp;quot;,  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(PRE-83.0: in synced code this is &amp;quot;SYNCED_NONAME&amp;quot;!)&amp;lt;/span&amp;gt;&lt;br /&gt;
          boolean active,&lt;br /&gt;
          boolean spectator,&lt;br /&gt;
          number  teamID,&lt;br /&gt;
          number  allyTeamID,&lt;br /&gt;
          number  pingTime,&lt;br /&gt;
          number  cpuUsage,&lt;br /&gt;
          string  country,&lt;br /&gt;
          number  rank&lt;br /&gt;
          table   customPlayerKeys&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerControlledUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAIInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; &lt;br /&gt;
          number  skirmishAIID,&lt;br /&gt;
          string  name,&lt;br /&gt;
          number  hostingPlayerID,&lt;br /&gt;
          string  shortName, &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(synced =&amp;gt; &amp;quot;SYNCED_NOSHORTNAME&amp;quot;; non-local =&amp;gt; &amp;quot;UNKNOWN&amp;quot;)&amp;lt;/span&amp;gt;&lt;br /&gt;
          string  version,   &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(synced =&amp;gt; &amp;quot;SYNCED_NOVERSION&amp;quot;;   non-local =&amp;gt; &amp;quot;UNKNOWN&amp;quot;)&amp;lt;/span&amp;gt;&lt;br /&gt;
          table   options    &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(synced &amp;amp; non-local =&amp;gt; empty-table)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Note: Before 0.82, the first argument was teamID, and then every other argument with a shifted position.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAllyTeamInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number allyteamID ) -&amp;gt; nil | table   customTeamKeys&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt;&lt;br /&gt;
    nil | number  teamID,&lt;br /&gt;
          number  leader, &amp;lt;span class=note&amp;gt;(:= a player id)&amp;lt;/span&amp;gt;&lt;br /&gt;
          boolean isDead,&lt;br /&gt;
          boolean isAiTeam,&lt;br /&gt;
          string  &amp;quot;side&amp;quot;,&lt;br /&gt;
          number  allyTeam,&lt;br /&gt;
          number  incomeMultiplier,&lt;br /&gt;
          table   customTeamKeys&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamResources&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot; ) -&amp;gt;&lt;br /&gt;
    nil | number currentLevel,&lt;br /&gt;
          number storage,&lt;br /&gt;
          number pull,&lt;br /&gt;
          number income,&lt;br /&gt;
          number expense,&lt;br /&gt;
          number share,&lt;br /&gt;
          number sent,&lt;br /&gt;
          number received&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitStats&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt;&lt;br /&gt;
    nil | number killed,&lt;br /&gt;
          number died,&lt;br /&gt;
          number capturedBy,&lt;br /&gt;
          number capturedFrom,&lt;br /&gt;
          number received,&lt;br /&gt;
          number sent&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamResourceStats&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;0.82 and later&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number teamID,  string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot; ) -&amp;gt;&lt;br /&gt;
    nil | number used,&lt;br /&gt;
          number produced,&lt;br /&gt;
          number excessed,&lt;br /&gt;
          number received,&lt;br /&gt;
          number sent&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamStatsHistory&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID [, number startIndex [, number endIndex = startIndex ]]) -&amp;gt;&lt;br /&gt;
    nil |&lt;br /&gt;
    number cur_max_index |&lt;br /&gt;
    {&lt;br /&gt;
      [1] = {&lt;br /&gt;
        &amp;quot;time&amp;quot;             = number,&lt;br /&gt;
        &amp;quot;frame&amp;quot;            = number,&lt;br /&gt;
        &amp;quot;metalUsed&amp;quot;        = number,&lt;br /&gt;
        &amp;quot;metalProduced&amp;quot;    = number,&lt;br /&gt;
        &amp;quot;metalExcess&amp;quot;      = number,&lt;br /&gt;
        &amp;quot;metalReceived&amp;quot;    = number,&lt;br /&gt;
        &amp;quot;metalSent&amp;quot;        = number,&lt;br /&gt;
        &amp;quot;energyUsed&amp;quot;       = number,&lt;br /&gt;
        &amp;quot;energyProduced&amp;quot;   = number,&lt;br /&gt;
        &amp;quot;energyExcess&amp;quot;     = number,&lt;br /&gt;
        &amp;quot;energyReceived&amp;quot;   = number,&lt;br /&gt;
        &amp;quot;energySent&amp;quot;       = number,&lt;br /&gt;
        &amp;quot;damageDealt&amp;quot;      = number,&lt;br /&gt;
        &amp;quot;damageReceived&amp;quot;   = number,&lt;br /&gt;
        &amp;quot;unitsProduced&amp;quot;    = number,&lt;br /&gt;
        &amp;quot;unitsDied&amp;quot;        = number,&lt;br /&gt;
        &amp;quot;unitsReceived&amp;quot;    = number,&lt;br /&gt;
        &amp;quot;unitsSent&amp;quot;        = number,&lt;br /&gt;
        &amp;quot;unitsCaptured&amp;quot;    = number,&lt;br /&gt;
        &amp;quot;unitsOutCaptured&amp;quot; = number,&lt;br /&gt;
        &amp;quot;unitsKilled&amp;quot;      = number&lt;br /&gt;
      }, ...&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;if called with just teamID as argument it returns the current possible range for startIndex/endIndex :={1..cur_max_index}&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamLuaAI&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; string &amp;quot;luaAI&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Returns string containing name of AI defined in file LuaAI.lua as name=&amp;quot;&amp;lt;AI name&amp;gt;&amp;quot;. Maybe it returns whole table with all values there, so maybe depends, but in my LuaAI.lua name is on first position...&lt;br /&gt;
&lt;br /&gt;
=== Teams/PlayersAllied ===&lt;br /&gt;
&#039;&#039;&#039;Spring.AreTeamsAllied&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID1, number teamID2 ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.ArePlayersAllied&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID1, number playerID2 ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
== Units ==&lt;br /&gt;
=== GetUnits ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAllUnits&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | unitTable = { [1] = number unitID, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnits&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitsSorted&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil |&lt;br /&gt;
    unitDefTable = {&lt;br /&gt;
      [number unitDefID] = { [1] = [number unitID], etc... },&lt;br /&gt;
      etc...&lt;br /&gt;
    }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitsCounts&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | countTable = { [number unitDefID] = count, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitsByDefs&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number unitDefID | { number unitDefID1, ... } )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitDefCount&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number unitDefID ) -&amp;gt; nil | number count&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamUnitCount&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number count&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitsInRectangle&#039;&#039;&#039;&lt;br /&gt;
  ( number xmin, number zmin, number xmax, number zmax [,number teamID] ) &lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitsInBox&#039;&#039;&#039;&lt;br /&gt;
  ( number xmin, number ymin, number zmin,&lt;br /&gt;
    number xmax, number ymax, number zmax [,number teamID] )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitsInSphere&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius [,number teamID] )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitsInCylinder&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z, number radius [,number teamID] )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitsInPlanes&#039;&#039;&#039;&lt;br /&gt;
  ( planes = { [1] = { number nx, number ny, number nz, number d }, etc... } )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, etc... }&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  plane normals point towards accepted space,&lt;br /&gt;
  so the acceptance criteria for each plane is:&lt;br /&gt;
    radius     = unit radius&lt;br /&gt;
    px, py, pz = unit position&lt;br /&gt;
    [(nx * px) + (ny * py) + (nz * pz) + (d - radius)]  &amp;lt;=  0&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNearestAlly&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number range ] ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNearestEnemy&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number range [, bool useLOS]] ) -&amp;gt; nil | number unitID&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Post 95.0 this no longer returns neutral units&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unit Informations ===&lt;br /&gt;
&#039;&#039;&#039;Spring.ValidUnitID&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsDead&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Returns false if unit exists and is alive, true for a brief period of time after unit dies, nil otherwise&amp;lt;br/&amp;gt;&lt;br /&gt;
keep this in mind when using (not Spring.GetUnitIsDead())&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | string tooltip&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitDefID&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitDefID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number teamID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitAllyTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number allyID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLineage&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Removed from version 0.83.x&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number lineage | number lineage, boolean lineageIsRoot&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNeutral&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean neutral&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number health, number maxHealth, number paralyzeDamage,&lt;br /&gt;
                             number captureProgress, number buildProgress&lt;br /&gt;
build Progress is returned as floating Point between 0.0 and 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitArmored&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;armorMultiple new in version 0.83.x&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean armored, number armorMultiple&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsStunned&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean stunned_or_inbuild, boolean stunned, boolean inbuild&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitMaxRange&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number maxEngagementRange&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitResources&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number metalMake, number metalUse,&lt;br /&gt;
                             number energyMake, number energyUse&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitHarvestStorage&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number metal&lt;br /&gt;
&amp;lt;span class = &amp;quot;note&amp;quot;&amp;gt;See also {{xtaglink|Gamedev:UnitDefs|harvestStorage}} UnitDef tag.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitMetalExtraction&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;0.82+ and later&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitExperience&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number experience&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitStates&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | {&lt;br /&gt;
    &amp;quot;firestate&amp;quot; = number,&lt;br /&gt;
    &amp;quot;movestate&amp;quot; = number,&lt;br /&gt;
    &amp;quot;repeat&amp;quot; = boolean,&lt;br /&gt;
    &amp;quot;cloak&amp;quot; = boolean,&lt;br /&gt;
    &amp;quot;active&amp;quot; = boolean,&lt;br /&gt;
    &amp;quot;trajectory&amp;quot; = boolean,&lt;br /&gt;
    [&amp;quot;autoland&amp;quot; = boolean,]&lt;br /&gt;
    [&amp;quot;autorepairlevel&amp;quot; = number,]&lt;br /&gt;
    [&amp;quot;loopbackattack&amp;quot; = boolean]&lt;br /&gt;
  } &lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsActive&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsCloaked&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSelfDTime&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitStockpile&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number numStockpiled, number numStockpileQued,&lt;br /&gt;
                             number buildPercent&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitHeight&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitBlocking&#039;&#039;&#039; {{new|85.0}}&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean blocking, boolean crushable&lt;br /&gt;
{{new|95.0}} Now return values are: &lt;br /&gt;
  boolean isBlocking,&lt;br /&gt;
  boolean isSolidObjectCollidable,&lt;br /&gt;
  boolean isProjectileCollidable,&lt;br /&gt;
  boolean isRaySegmentCollidable,&lt;br /&gt;
  boolean crushable,&lt;br /&gt;
  boolean blockEnemyPushing,&lt;br /&gt;
  boolean blockHeightChanges&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, [, boolean midPos [, boolean aimPos ] ] ) -&amp;gt;&lt;br /&gt;
    nil |&lt;br /&gt;
    number bpx, number bpy, number bpz&lt;br /&gt;
    [, number mpx, number mpy, number mpz ]&lt;br /&gt;
    [, number apx, number apy, number apz ]&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;since 89.0, returns the base (default), middle or aim position of the unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitBasePosition&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Deprecated in 89.0, use GetUnitPosition&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns the bottom of the unit.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number dx, number dy, number dz&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;returns the direction vector&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitHeading&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number heading&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;returns heading directions used in COB scripts&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitRotation&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   (number unitID) --&amp;gt; nil | number pitch, number yaw, number roll &lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Marked as (WIP) in changelog&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitVelocity&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;velw new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number velx, number vely, number velz, number velLength&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsBuilding&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns what unit a constructor/factory is currently building&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCurrentBuildPower&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number buildPower&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNanoPieces&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { [1] = number piece1, etc ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTransporter&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsTransporting&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number weaponID = -1] ) -&amp;gt; nil | number isEnabled, number curPower&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTravel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number travel, number travelPeriod&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitFuel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitFlanking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;dir&amp;quot; ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
  ( number unitID, string &amp;quot;mode&amp;quot; | &amp;quot;moveFactor&amp;quot; | &amp;quot;minDamage&amp;quot; | &amp;quot;maxDamage&amp;quot; ) -&amp;gt; nil | number&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number mode, number modilityAdd,&lt;br /&gt;
    number minDamage, number maxDamage, number dirX, number dirY, number dirZ&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSensorRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string type ) -&amp;gt; nil | number radius&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;possible types are:&amp;lt;br&amp;gt;los, airLos, radar, sonar, seismic, radarJammer &amp;amp; sonarJammer&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLosState&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;raw is only available in gadgets&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID [, number allyTeamID [, boolean raw] ] ) -&amp;gt; nil | number raw |&lt;br /&gt;
  { [&amp;quot;los&amp;quot; = true] [, &amp;quot;radar&amp;quot; = true] [, &amp;quot;typed&amp;quot; = true] }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSeparation&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;surfaceDist new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID1, number unitID2 [, boolean 2D] [, boolean surfaceDist] ) -&amp;gt; nil | number distance&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns the distance of 2 units, surfaceDist calculates the distance between the unitsphere surfaces instead of their midpos&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitFeatureSeparation&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number featureID [, boolean 2D] ) -&amp;gt; nil | number distance&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitDefDimensions&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID ) -&amp;gt; nil |&lt;br /&gt;
    {&lt;br /&gt;
      &amp;quot;height&amp;quot; = number,&lt;br /&gt;
      &amp;quot;radius&amp;quot; = number,&lt;br /&gt;
      &amp;quot;midx&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;minx&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;maxx&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;midy&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;miny&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;maxy&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;midz&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;minz&amp;quot;   = number,&lt;br /&gt;
      &amp;quot;maxz&amp;quot;   = number&lt;br /&gt;
    }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLastAttacker&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLastAttackedPiece&#039;&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | string pieceName, number gameframe&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitMoveTypeData&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;new in version 0.80+&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { movetype data }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID )&lt;br /&gt;
  -&amp;gt; number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
  number offsetX, number offsetY, number offsetZ,&lt;br /&gt;
  number volumeType, number testType, number primaryAxis, boolean disabled&lt;br /&gt;
&lt;br /&gt;
==== Unit Weapon Informations ====&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponNum ) -&amp;gt; nil |&lt;br /&gt;
    boolean angleGood, boolean loaded, number reloadFrame, number salvoLeft, number numStockpiled&lt;br /&gt;
  ( number unitID, number weaponNum, string tag ) -&amp;gt; nil | number&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`tag` can be:&lt;br /&gt;
  &amp;quot;reloadState&amp;quot; == &amp;quot;reloadFrame&amp;quot;&lt;br /&gt;
  &amp;quot;reloadTime&amp;quot;&lt;br /&gt;
  &amp;quot;accuracy&amp;quot;&lt;br /&gt;
  &amp;quot;sprayAngle&amp;quot;&lt;br /&gt;
  &amp;quot;range&amp;quot;&lt;br /&gt;
  &amp;quot;projectileSpeed&amp;quot;&lt;br /&gt;
  &amp;quot;burst&amp;quot;&lt;br /&gt;
  &amp;quot;burstRate&amp;quot;&lt;br /&gt;
  &amp;quot;projectiles&amp;quot;&lt;br /&gt;
  The following 4 tags were added in 104.0:&lt;br /&gt;
  &amp;quot;salvoError&amp;quot;&lt;br /&gt;
  &amp;quot;salvoLeft&amp;quot;&lt;br /&gt;
  &amp;quot;nextSalvo&amp;quot;&lt;br /&gt;
  &amp;quot;targetMoveError&amp;quot;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, string tag ) -&amp;gt; nil | number&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`tag` can be:&lt;br /&gt;
  &amp;quot;paralyzeDamageTime&amp;quot;&lt;br /&gt;
  &amp;quot;impulseFactor&amp;quot;&lt;br /&gt;
  &amp;quot;impulseBoost&amp;quot;&lt;br /&gt;
  &amp;quot;craterMult&amp;quot;&lt;br /&gt;
  &amp;quot;craterBoost&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageExp&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageMin&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageRange&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageInverted&amp;quot;&lt;br /&gt;
  &amp;quot;craterAreaOfEffect&amp;quot;&lt;br /&gt;
  &amp;quot;damageAreaOfEffect&amp;quot;&lt;br /&gt;
  &amp;quot;edgeEffectiveness&amp;quot;&lt;br /&gt;
  &amp;quot;explosionSpeed&amp;quot;&lt;br /&gt;
  - or -&lt;br /&gt;
  an armor type index to get the damage against it.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponVectors&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponNum ) -&amp;gt; nil | number posX, number posY, number posZ,&lt;br /&gt;
    number dirX, number dirY, number dirZ&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponTryTarget&#039;&#039;&#039; {{new|94.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, &lt;br /&gt;
    number targetID | number posX, number posY, number posZ ) -&amp;gt; nil | boolean success&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;For a position just checks if the weapon can attackGround. For a unit checks that it exists, category, death status, crashing status, LOS status, neutral status, ally status and transport status.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponTestTarget&#039;&#039;&#039; {{new|94.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, &lt;br /&gt;
    number targetID | number posX, number posY, number posZ ) -&amp;gt; nil | boolean success&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Checks TryTarget, TestRange, and that weapon emit point is not below ground, then checks FreLineOfFire.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponTestRange&#039;&#039;&#039; {{new|94.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, &lt;br /&gt;
    number targetID | number posX, number posY, number posZ ) -&amp;gt; nil | boolean success&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Checks target is in range including height modifiers and cylinder targeting if set.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponHaveFreeLineOfFire&#039;&#039;&#039; {{new|94.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, &lt;br /&gt;
    number targetID | number posX, number posY, number posZ ) -&amp;gt; nil | boolean success&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Runs a raytrace from unit aimpoint respecting collision flags.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From 104.0 onwards the param list changes so that source firing position can also be passed:&lt;br /&gt;
&lt;br /&gt;
  ( unitID, weaponNum, &lt;br /&gt;
    targetID | [srcPosX [, srcPosY [, srcPosZ [, tgtPosX [, tgtPosY [, tgtPosZ ]]]]]] ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponCanFire&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number unitID, number weaponNum ) -&amp;gt; nil | boolean canFire&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitWeaponTarget&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number unitID, number weaponNum ) -&amp;gt; nil |&lt;br /&gt;
  number 0 | number 1, bool isUserTarget, number unitID | &lt;br /&gt;
  number 2, bool isUserTarget, { number posX, number posY, number posZ } | &lt;br /&gt;
  number 3, bool isUserTarget, number ProjectileID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;returned number of args is always 3 if targetType != None&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetRadarErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number allyTeamID) --&amp;gt; nil | &lt;br /&gt;
  number allyteamErrorSize, number baseErrorSize, number baseErrorMult&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPosErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number unitID) --&amp;gt; nil |&lt;br /&gt;
       number posErrorVector.x, number posErrorVector.y, number posErrorVector.z,&lt;br /&gt;
       number posErrorDelta.x, number posErrorDelta.y, number posErrorDelta.z,&lt;br /&gt;
       number nextPosErrorUpdate&lt;br /&gt;
&lt;br /&gt;
==== Unit LOS ====&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInLos&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInAirLos&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInRadar&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInJammer&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
=== Unit Pieces ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitVectors&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | {frontX,frontY,frontZ}, {upX,upY,upZ}, {rightX,rightY,rightZ}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPiecePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number piece ) -&amp;gt; number posx, number posy, number posz&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Returns piece position in unit space. Also remember to multiply the x-axis value with -1 if you want  move a piece to another piece.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceDirection&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Fixed since 101. Now returns the same direction as Spring.GetUnitPiecePosDir&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number piece ) -&amp;gt; number dirx, number diry, number dirz&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPiecePosDir&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pieceNum ) -&amp;gt; nil | number posX, number posY, number posZ,&lt;br /&gt;
    number dirX, number dirZ, number dirY&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Returns piece position and direction in world space. The direction (dirX, dirY, dirZ) is not necessarily normalized. The position is defined as the position of the first vertex of the piece and it defines direction as the direction in which the line from the first vertex to the second vertex points.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number piece ) -&amp;gt; { [1] = number, ... , [16] = number }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceList&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; { [1] = string &amp;quot;piecename&amp;quot;, ... , [pieceNumN] = string &amp;quot;piecename&amp;quot; }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceMap&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; { &amp;quot;piecename1&amp;quot; = pieceNum1, ... , &amp;quot;piecenameN&amp;quot; = pieceNumN }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number piece ) -&amp;gt; {&lt;br /&gt;
    &amp;quot;name&amp;quot;     = string &amp;quot;piecename&amp;quot;,&lt;br /&gt;
    &amp;quot;isEmpty&amp;quot;  = boolean,&lt;br /&gt;
    &amp;quot;children&amp;quot; = { [1] = string &amp;quot;piecename&amp;quot;, ... },&lt;br /&gt;
    &amp;quot;min&amp;quot;      = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    &amp;quot;max&amp;quot;      = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    &amp;quot;offset&amp;quot;   = { [1] = number x, [2] = number y, [3] = number z }, &lt;br /&gt;
    &amp;quot;parent&amp;quot; = string &amp;quot;parentpiecename&amp;quot;,   &lt;br /&gt;
  }&lt;br /&gt;
{{new|95.0}} &amp;quot;parent&amp;quot; field&lt;br /&gt;
{{new|101.0}} parent for root pieces is now &amp;quot;[null]&amp;quot; instead of &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitScriptPiece&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number scriptPiece ] )&lt;br /&gt;
   -&amp;gt; nil | { scriptPieceNum = number modelPieceNum } | number modelPieceNum&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;This functions translate the COB ScriptPiece numbers into the ModelPiece numbers (the set of ScriptPieces is a subset of the ModelPieces, means #ScriptPieces &amp;lt;= #ModelPieces), which is used in all other functions (the &amp;quot;number piece&amp;quot; means always the modelpiece). So if you get via Cob2Lua a pieceID you have to translate it with this function. Btw the COB ScriptPiece number is equal with the piece position in the &amp;lt;i&amp;gt;piece&amp;lt;/i&amp;gt; definition in your cob/bos.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitScriptNames&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID )&lt;br /&gt;
   -&amp;gt; { &amp;quot;cobpiecename1&amp;quot; = ScriptPieceNum1, ... , &amp;quot;cobpiecenameN&amp;quot; = ScriptPieceNumN }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPieceCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pieceID )&lt;br /&gt;
  -&amp;gt; number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
  number offsetX, number offsetY, number offsetZ,&lt;br /&gt;
  number volumeType, number testType, number primaryAxis, boolean disabled&lt;br /&gt;
As of 101.0 this is 1-based piece index argument (was 0-based).&lt;br /&gt;
&lt;br /&gt;
=== CommandQueues ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCommands&#039;&#039;&#039; &amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCommandQueue&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(Alias)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, number count = 0 ) -&amp;gt; nil | number commandQueueSize {{new|96}}&lt;br /&gt;
  ( number unitID [, number count = -1] ) &lt;br /&gt;
  -&amp;gt; nil | table commandQueueTable = {&lt;br /&gt;
     [1] = {&lt;br /&gt;
       &amp;quot;id&amp;quot;      = number,&lt;br /&gt;
       &amp;quot;params&amp;quot;  = { [1] = number, ...},&lt;br /&gt;
       &amp;quot;options&amp;quot; = {&lt;br /&gt;
         &amp;quot;coded&amp;quot;    = number,&lt;br /&gt;
         &amp;quot;alt&amp;quot;      = boolean,&lt;br /&gt;
         &amp;quot;ctrl&amp;quot;     = boolean,&lt;br /&gt;
         &amp;quot;shift&amp;quot;    = boolean,&lt;br /&gt;
         &amp;quot;right&amp;quot;    = boolean,&lt;br /&gt;
         &amp;quot;internal&amp;quot; = boolean,&lt;br /&gt;
         &amp;quot;meta&amp;quot;    = boolean&lt;br /&gt;
       }&lt;br /&gt;
     }, ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;This function can trigger an error if called too often without passing a second parameter. Refer to [https://github.com/spring/spring/blob/92c54d5b15775c39a8c67b203c28fe9b9db51cea/rts/Lua/LuaSyncedRead.cpp#L3983-L3996 LuaSyncedRead.cpp#L3983-L3996]&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFullBuildQueue&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt;&lt;br /&gt;
  nil | buildOrders = {&lt;br /&gt;
          [1] = { [number unitDefID] = number count },  etc...&lt;br /&gt;
        }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetRealBuildQueue&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(cleans the buildqueue of things the unit can&#039;t build itself)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt;&lt;br /&gt;
  nil | buildOrders = {&lt;br /&gt;
          [1] = { [number unitDefID] = number count },  etc...&lt;br /&gt;
        }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFactoryCommands&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number count = 0 ) -&amp;gt; nil | number commandQueueSize {{new|96}}&lt;br /&gt;
  ( number unitID [, number count = -1 ] ) &lt;br /&gt;
  -&amp;gt; nil | table commandQueueTable = {&lt;br /&gt;
     [1] = {&lt;br /&gt;
       &amp;quot;id&amp;quot;      = number,&lt;br /&gt;
       &amp;quot;params&amp;quot;  = { [1] = number, ...},&lt;br /&gt;
       &amp;quot;options&amp;quot; = {&lt;br /&gt;
         &amp;quot;coded&amp;quot;    = number,&lt;br /&gt;
         &amp;quot;alt&amp;quot;      = boolean,&lt;br /&gt;
         &amp;quot;ctrl&amp;quot;     = boolean,&lt;br /&gt;
         &amp;quot;shift&amp;quot;    = boolean,&lt;br /&gt;
         &amp;quot;right&amp;quot;    = boolean,&lt;br /&gt;
         &amp;quot;internal&amp;quot; = boolean,&lt;br /&gt;
         &amp;quot;meta&amp;quot;    = boolean&lt;br /&gt;
       }&lt;br /&gt;
     }, ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFactoryCounts&#039;&#039;&#039; (used to get the buildqueue of a factory, seems screwed o_O)&lt;br /&gt;
  ( number unitID [, number count [, boolean addCMDs ] ] ) -&amp;gt; nil | commandQueueTable = {&lt;br /&gt;
     [2] = { [number unitDefID | number -cmdID] = number count }, ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
=== Command Descriptions/Buttons ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCmdDescs&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number startIndex [, number endIndex ] ] ) -&amp;gt; nil | {&lt;br /&gt;
      [1] = {&lt;br /&gt;
        &amp;quot;id&amp;quot;          = number,&lt;br /&gt;
        &amp;quot;type&amp;quot;        = number,&lt;br /&gt;
        &amp;quot;name&amp;quot;        = string,&lt;br /&gt;
        &amp;quot;action&amp;quot;      = string,&lt;br /&gt;
        &amp;quot;tooltip&amp;quot;     = string,&lt;br /&gt;
        &amp;quot;texture&amp;quot;     = string,&lt;br /&gt;
        &amp;quot;cursor&amp;quot;      = string,&lt;br /&gt;
        &amp;quot;hidden&amp;quot;      = boolean,&lt;br /&gt;
        &amp;quot;disabled&amp;quot;    = boolean,&lt;br /&gt;
        &amp;quot;showUnique&amp;quot;  = boolean,&lt;br /&gt;
        &amp;quot;onlyTexture&amp;quot; = boolean,&lt;br /&gt;
&lt;br /&gt;
        &amp;quot;params&amp;quot;      = { [1] = string, ... }&lt;br /&gt;
     }, ...&lt;br /&gt;
   }&lt;br /&gt;
&#039;&#039;&#039;Spring.FindUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number cmdID ) -&amp;gt; nil | number index&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
=== GetFeatures ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturesInRectangle&#039;&#039;&#039;&lt;br /&gt;
  ( number xmin, number zmin, number xmax, number zmax )&lt;br /&gt;
    -&amp;gt; featureTable = { [1] = number featureID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturesInSphere&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number radius )&lt;br /&gt;
    -&amp;gt; featureTable = { [1] = number featureID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturesInCylinder&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z, number radius )&lt;br /&gt;
    -&amp;gt; featureTable = { [1] = number featureID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetAllFeatures&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [1] = number featureID, ... }&lt;br /&gt;
&lt;br /&gt;
=== Feature Informations ===&lt;br /&gt;
&#039;&#039;&#039;Spring.ValidFeatureID&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureDefID&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number featureDefID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number teamID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureAllyTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number allyID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number health, number maxHealth, number resurrectProgress&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureHeight&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureSeparation&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID1, number featureID2 [, boolean 2D] ) -&amp;gt; nil | number distance&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, [, boolean midPos [, boolean aimPos ] ] ) -&amp;gt;&lt;br /&gt;
  nil |&lt;br /&gt;
  number bpx, number bpy, number bpz [,&lt;br /&gt;
  number mpx, number mpy, number mpz [,&lt;br /&gt;
  number apx, number apy, number apz ]]&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;since 89.0, returns the base (default), middle or aim position of the feature.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureVelocity&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number featureID [, boolean norm] )&lt;br /&gt;
  -&amp;gt; nil | number velx, number vely, number velz, number velLength&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number dirx, number diry, number dirz&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureRotation&#039;&#039;&#039; {{New|101.0}}&lt;br /&gt;
   (number featureID) --&amp;gt; nil | number pitch, number yaw, number roll &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureHeading&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number heading&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureResources&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;reclaimTime&amp;lt;/span&amp;gt; {{new|105.0}}&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number RemainingMetal, number maxMetal,&lt;br /&gt;
                                number RemainingEnergy, number maxEnergy, number reclaimLeft, number reclaimTime&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | boolean noSelect&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureResurrect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | string UnitDefName, number buildFacing&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID )&lt;br /&gt;
  -&amp;gt; number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
  number offsetX, number offsetY, number offsetZ,&lt;br /&gt;
  number volumeType, number testType, number primaryAxis, boolean disabled&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceCollisionVolumeData&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featuerID, number pieceID )&lt;br /&gt;
  -&amp;gt; number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
  number offsetX, number offsetY, number offsetZ,&lt;br /&gt;
  number volumeType, number testType, number primaryAxis, boolean disabled&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureBlocking&#039;&#039;&#039;&lt;br /&gt;
  (number featureID) --&amp;gt; boolean collidable, boolean crushable, boolean blocking&lt;br /&gt;
{{new|95.0}} Now return values are: &lt;br /&gt;
  boolean isBlocking,&lt;br /&gt;
  boolean isSolidObjectCollidable,&lt;br /&gt;
  boolean isProjectileCollidable,&lt;br /&gt;
  boolean isRaySegmentCollidable,&lt;br /&gt;
  boolean crushable,&lt;br /&gt;
  boolean blockEnemyPushing,&lt;br /&gt;
  boolean blockHeightChanges&lt;br /&gt;
&lt;br /&gt;
=== Feature Pieces ===&lt;br /&gt;
See #Unit_Pieces for full details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureLastAttackedPiece&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceMap&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceList&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceInfo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePiecePosition&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceDirection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePiecePosDir&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeaturePieceMatrix&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== COB ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBUnitVar&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, integer varID [, boolean unpack = false ] )&lt;br /&gt;
   -&amp;gt; nil | number value | number unpackedX, number unpackedY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBTeamVar&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, integer varID [, boolean unpack = false ] )&lt;br /&gt;
   -&amp;gt; nil | number value | number unpackedX, number unpackedY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBAllyTeamVar&#039;&#039;&#039;&lt;br /&gt;
  ( number allyID, integer varID [, boolean unpack = false ] )&lt;br /&gt;
   -&amp;gt; nil | number value | number unpackedX, number unpackedY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBGlobalVar&#039;&#039;&#039;&lt;br /&gt;
  ( integer varID [, boolean unpack = false ] )&lt;br /&gt;
   -&amp;gt; nil | number value | number unpackedX, number unpackedY&lt;br /&gt;
&lt;br /&gt;
== Ground ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Elevation is y. Water level is always at y=0. Ground height can be changed during play (terraform or deformation).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundHeight&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number y&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundOrigHeight&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number y&lt;br /&gt;
&#039;&#039;This returns the ground original (before terraforming) height at a given x,z position&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundNormal&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z [, smoothedNormal] ) -&amp;gt; number x, number y, number z, number slope &lt;br /&gt;
{{new|100.0}}&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;: smoothedNormal and slope&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundInfo&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; string &amp;quot;Type&amp;quot;, number metal, number hardness,&lt;br /&gt;
                            number tankSpeed, number kbotSpeed, number hoverSpeed,&lt;br /&gt;
                            number shipSpeed, boolean receiveTracks&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundBlocked&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z |&lt;br /&gt;
    number x1, number z1, number x2, number z2 )&lt;br /&gt;
    -&amp;gt; nil |  string &amp;quot;feature&amp;quot;, number featureID  |  string &amp;quot;unit&amp;quot;, number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroundExtremes&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number minHeight, number maxHeight&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSmoothMeshHeight&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number y&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMetalMapSize&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number sizeX, number sizeY&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMetalAmount&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number metalAmount &lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;where x &amp;amp; z are in metal map coordinates (worldspace/16)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMetalExtraction&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number extractionAmount &lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;where x &amp;amp; z are in metal map coordinates (worldspace/16)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTerrainTypeData&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number i )&lt;br /&gt;
    -&amp;gt; nil |  string &amp;quot;name&amp;quot;, number hardness,&lt;br /&gt;
              number tankSpeed, number kbotSpeed, number hoverSpeed, number shipSpeed,&lt;br /&gt;
              boolean receiveTracks&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number 0 | 1 &lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;where x &amp;amp; z are in worldspace coordinates&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Test Orders ===&lt;br /&gt;
&#039;&#039;&#039;Spring.TestMoveOrder&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number x, number y, number z) -&amp;gt; boolean validMove&lt;br /&gt;
{{New|95.0}} parameters now are:&lt;br /&gt;
    number unitDefID,&lt;br /&gt;
    number pos.x, number pos.y, number pos.z&lt;br /&gt;
    [, number dir.x&lt;br /&gt;
    [, number dir.y&lt;br /&gt;
    [, number dir.z&lt;br /&gt;
    [, boolean testTerrain&lt;br /&gt;
    [, boolean testObjects&lt;br /&gt;
    [, boolean centerOnly ]]]]]]&lt;br /&gt;
    ) --&amp;gt; boolean &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TestBuildOrder&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID, number x, number y, number z, number facing)&lt;br /&gt;
    -&amp;gt; number blocking [,number featureID]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;blocking can be:&lt;br /&gt;
    0 - blocked&lt;br /&gt;
    1 - mobile unit in the way&lt;br /&gt;
    2 - free  (or if featureID is != nil then with a blocking feature that can be reclaimed)&lt;br /&gt;
  facing can be:&lt;br /&gt;
    0, &amp;quot;s&amp;quot;, &amp;quot;south&amp;quot;&lt;br /&gt;
    1, &amp;quot;e&amp;quot;, &amp;quot;east&amp;quot;&lt;br /&gt;
    2, &amp;quot;n&amp;quot;, &amp;quot;north&amp;quot;&lt;br /&gt;
    3, &amp;quot;w&amp;quot;, &amp;quot;west&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.Pos2BuildPos&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#FF0000&amp;quot;&amp;gt;optional param &#039;&#039;facing&#039;&#039; supported in 0.83 and later&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, number x, number y, number z[, number facing] ) &lt;br /&gt;
    -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&lt;br /&gt;
=== PathFinding ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitEstimatedPath&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | {&lt;br /&gt;
     [1] = { x,y,z }, ...&lt;br /&gt;
   },{&lt;br /&gt;
     [1] = startIdxOfDetailedPath,&lt;br /&gt;
     [2] = startIdxOfDetailedEstimatedPath1,&lt;br /&gt;
     [3] = startIdxOfDetailedEstimatedPath2,&lt;br /&gt;
   }&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;GetUnitEstimatedPath() returns 2 tables:&lt;br /&gt;
    1 table the waypoints and 1 table with indices (in the waypoint table)&lt;br /&gt;
    when a new (more lazy) pathfinding algorithm  begins.&lt;br /&gt;
    So the waypoint table contains 3 different levels of details.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LOS ===&lt;br /&gt;
&#039;&#039;&#039;Spring.IsPosInLos&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsPosInRadar&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsPosInAirLos&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z, number allyID ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPositionLosState&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;jammed new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number y, number z [, number allyID] )&lt;br /&gt;
    -&amp;gt; boolean LosOrRadar, boolean inLos, boolean inRadar, boolean jammed&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;jammed indicates if a position is actively being radar- or sonar-jammed by &#039;&#039;&#039;any&#039;&#039;&#039; allyteam&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetClosestValidPosition&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;//NOT FINISHED YET&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitDefID, number x, number z, number r ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Projectiles ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectilesInRectangle&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ( number xmin, number zmin, number xmax, number zmax&lt;br /&gt;
   [, boolean excludeWeaponProjectiles&lt;br /&gt;
   [, boolean excludePieceProjectiles] ] )&lt;br /&gt;
   -&amp;gt; nil | projectileTable = { [1] = number projectileID, etc... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileOwnerID&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
   (number projectileID) -&amp;gt; nil | number unitID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileTeamID&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
   (number projectileID) -&amp;gt; nil | number teamID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileDefID&#039;&#039;&#039;&lt;br /&gt;
   (number projectileID) -&amp;gt; nil | number weaponDefID&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;using this to get a weaponDefID is HIGHLY preferred &amp;lt;br/&amp;gt; to indexing WeaponDefNames via GetProjectileName&amp;lt;span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileName&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | string name&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileType&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | boolean weapon, boolean piece&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileTarget&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID )&lt;br /&gt;
  &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Pre 95.0:&amp;lt;/span&amp;gt;  -&amp;gt; nil | number targetID, string &amp;lt;span class=note&amp;gt;targetTypeStr&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Post 95.0:&amp;lt;/span&amp;gt; -&amp;gt; nil | [number &amp;lt;span class=note&amp;gt;targetTypeInt&amp;lt;/span&amp;gt;, number targetID | table targetPos = {x, y, z}]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;targetTypeStr can be one of: &lt;br /&gt;
    &#039;u&#039; - unit&lt;br /&gt;
    &#039;f&#039; - feature&lt;br /&gt;
    &#039;p&#039; - projectile&lt;br /&gt;
  while targetTypeInt is one of:&lt;br /&gt;
    string.byte(&#039;g&#039;) := GROUND&lt;br /&gt;
    string.byte(&#039;u&#039;) := UNIT&lt;br /&gt;
    string.byte(&#039;f&#039;) := FEATURE&lt;br /&gt;
    string.byte(&#039;p&#039;) := PROJECTILE&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileIntercepted&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | boolean isBeingIntercepted&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectilePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number px, number py, number pz&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number vx, number vy, number vz&lt;br /&gt;
  {{new|95.0}}: returns (targetPos - startPos) for Beamlasers and similar weapons&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileGravity&#039;&#039;&#039;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number gravity&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPieceProjectileParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil |  number explosionFlags, number spinAngle, &lt;br /&gt;
  number spinSpeed, number spinVector.x, number spinVector.y, number spinVector.z&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Where explosionFlags use binary flags with the following integer equivalents: &lt;br /&gt;
   more info [http://springrts.com/wiki/Animation-CobConstants#explode here]&lt;br /&gt;
   SHATTER = 1,  EXPLODE = 2, EXPLODE_ON_HIT = 2, FALL = 4, SMOKE = 8, FIRE = 16&lt;br /&gt;
   NONE = 32, NO_CEG_TRAIL = 64, NO_HEATCLOUD = 128   &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileTimeToLive&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number ttl&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileDirection&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number dir.x, number dir.y, number dir.z&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileSpinAngle&#039;&#039;&#039;  &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Deprecated in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number angle&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileSpinSpeed&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Deprecated in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number spinSpeed&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileSpinVec&#039;&#039;&#039;  &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Deprecated in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projectileID ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetProjectileDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, string tag ) -&amp;gt; nil | number&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`tag` can be:&lt;br /&gt;
  &amp;quot;paralyzeDamageTime&amp;quot;&lt;br /&gt;
  &amp;quot;impulseFactor&amp;quot;&lt;br /&gt;
  &amp;quot;impulseBoost&amp;quot;&lt;br /&gt;
  &amp;quot;craterMult&amp;quot;&lt;br /&gt;
  &amp;quot;craterBoost&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageExp&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageMin&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageRange&amp;quot;&lt;br /&gt;
  &amp;quot;dynDamageInverted&amp;quot;&lt;br /&gt;
  &amp;quot;craterAreaOfEffect&amp;quot;&lt;br /&gt;
  &amp;quot;damageAreaOfEffect&amp;quot;&lt;br /&gt;
  &amp;quot;edgeEffectiveness&amp;quot;&lt;br /&gt;
  &amp;quot;explosionSpeed&amp;quot;&lt;br /&gt;
  - or -&lt;br /&gt;
  an armor type index to get the damage against it.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:DebugDrawModes&amp;diff=8201</id>
		<title>Gamedev:DebugDrawModes</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:DebugDrawModes&amp;diff=8201"/>
		<updated>2020-06-25T14:46:40Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* /DebugColVol (alt+v) */ about the points&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Debug Drawing Modes =&lt;br /&gt;
Spring has several drawing modes which are useful for debugging and performance checking. &lt;br /&gt;
They are listed below by [[UI commands]] with their default key binding.&lt;br /&gt;
&lt;br /&gt;
== /Debug (alt+b) ==&lt;br /&gt;
[[File:Debug.jpg|400px|left|/Debug]]&lt;br /&gt;
Draws a toggleable list of engine functions and a breakdown of how much time is spent computing them. When toggled on a line graph is drawn to illustrate the change in performance over time. &lt;br /&gt;
&lt;br /&gt;
Since 97.0 there is a new &#039;&#039;&#039;Frame Grapher&#039;&#039;&#039; visualisation which shows how the last half-second was spent:&lt;br /&gt;
&lt;br /&gt;
* Green are video frames&lt;br /&gt;
* Red are simframes&lt;br /&gt;
* Blue is swapBuffer (gpu/vsync)&lt;br /&gt;
* Pink is lua gc&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== /DebugColVol (alt+v) ==&lt;br /&gt;
[[File:DebugColVol.jpg|400px|left|/DebugColVol]]&lt;br /&gt;
Draws unit and feature [[Gamedev:CollisionVolumes|collision volumes]] as purple meshes. When hit by a weapon the meshes turn red. Since 99.0 weapon debug spheres are also drawn in this mode for the [[Animation-LuaCallins#Weapons|AimFromWeapon()]] position, [[Animation-LuaCallins#Weapons|QueryWeapon()]] (muzzle) position and unit target position. Shields spheres are drawn in blue. Weapon &#039;Query&#039; points are in red, orange if aiming. Weapon &#039;AimFrom&#039; points are in yellow. The unit centre is in magenta, and if it is different the target point of the unit is in red.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugPath (alt+p) ==&lt;br /&gt;
[[File:DebugPath_Close.jpg|400px|left|/DebugPath Close up view]][[File:DebugPath_Far.jpg|400px|left|/DebugPath Far out view]]&lt;br /&gt;
&lt;br /&gt;
Draws pathfinder routes, colour coded by accuracy.&lt;br /&gt;
&lt;br /&gt;
* Red is the most finely computed pathing&lt;br /&gt;
* Green is intermediate paths&lt;br /&gt;
* Blue is least accurate long range path&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugTraceRay ==&lt;br /&gt;
It is meant for debugging trajectories of ballistic projectiles. [https://springrts.com/mantis/view.php?id=4664 Currently broken in 98.0]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugDrawAI ==&lt;br /&gt;
[[File:DebugDrawAI_E232AI.jpg|400px|left|/DebugDrawAI implemented in E232AI]]&lt;br /&gt;
This mode is toggled through the engine but is up to the native AI to implement itself. The image shows how [[AI:Skirmish:List|E232AI]] implements a real-time threatmap rendering and a real-time performance profiler.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Dev]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=2003</id>
		<title>Animation-LuaCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=2003"/>
		<updated>2020-06-10T08:52:52Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Transports */ no s&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Call-ins are calls from the engine, into the unit script. In other words, these functions are called, if they are defined, when a particular &#039;&#039;event&#039;&#039; happens.&lt;br /&gt;
&lt;br /&gt;
For Lua unit scripts, a new call-in mechanism has been implemented, which is faster than the regular call-in mechanism used for widgets and gadgets.&lt;br /&gt;
&lt;br /&gt;
Types for arguments are only shown where they&#039;re ambiguous. For a number of (common) arguments, the types are:&lt;br /&gt;
&lt;br /&gt;
* unitID: number&lt;br /&gt;
* piece: number&lt;br /&gt;
* axis: number (1 = x axis, 2 = y axis, 3 = z axis)&lt;br /&gt;
* heading/pitch: number (radians)&lt;br /&gt;
&lt;br /&gt;
== Generic ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Create&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called just after the unit script has been created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartMoving&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopMoving&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These are called whenever the unit starts or stops moving. Typical use for them is to trigger wheels to start spinning, animate treads, or start/stop a walking animation. Since 95.0 they are only run when a unit transitions from zero to non-zero speed or vice versa, and no longer during in-place rotations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.ChangeHeading&#039;&#039;&#039; ( number deltaHeading ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Called when the unit changes heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartSkidding&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopSkidding&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Called when a (ground) unit reacts to an impulse. The start-skidding threshold (&#039;sqSkidSpeedMult&#039;) is configurable via [[Lua_MoveCtrl#MoveType-Controlling|MoveCtrl.SetGroundMoveTypeData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Killed&#039;&#039;&#039; ( number recentDamage, number maxHealth ) -&amp;gt; number corpseType&lt;br /&gt;
&lt;br /&gt;
This is called when the unit is killed. The severity of the kill may be calculated as severity=recentDamage/maxHealth &#039;&#039;(*100 so that it&#039;s in percent, no? at least that is how severity was expressed in Cob/bos, I think. Of course there&#039;s no reason to emulate that, just pointing it out for people &amp;quot;converting&amp;quot;)&#039;&#039;. Typically, this function would play a death animation for the unit, and finally return a corpse type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.WindChanged&#039;&#039;&#039; ( number heading, number strength ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called for wind generators whenever the wind direction or strength changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.ExtractionRateChanged&#039;&#039;&#039; ( number rate ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called for metal extractors each time their extraction rate (metal per second) changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.setSFXoccupy&#039;&#039;&#039; ( number curTerrainType ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when terrain type changes. Terrain type is calculated with the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If unit is being transported -&amp;gt; curTerrainType = 0&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is always upright -&amp;gt; curTerrainType = 2&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is not always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* If ground height &amp;lt; 0 and unit is always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* Otherwise -&amp;gt; curTerrainType = 4&lt;br /&gt;
&lt;br /&gt;
Where is curTerrainType = 3 ? :-)&lt;br /&gt;
&lt;br /&gt;
Candidate to be changed to something saner later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.MoveRate&#039;&#039;&#039; ( number curRate ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called only for certain types of aircraft (those which use &#039;&#039;CTAAirMoveType&#039;&#039;.) The move rate is determined by the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If the aircraft is landing or taking off -&amp;gt; curRate = 1&lt;br /&gt;
* Otherwise -&amp;gt; curRate = floor(curSpeed / maxSpeed * 3), clamped to be in the range [0, 2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryLandingPads&#039;&#039;&#039; ( ) -&amp;gt; { number piece1, number piece2, ... }&lt;br /&gt;
&lt;br /&gt;
Called one time for units with landing pads. Should return a table with pieces which should be used as landing pads. The number of pieces returned also determines the number of pads, so for Lua unit scripts there is no QueryLandingPadCount.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Activate&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.Deactivate&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Exact situation these are called depends a lot on the unit type. Factories are activated when they open their yard and deactivated when they close it. Aircraft are activated when they take off and deactivated when the land. Any unit that can be turned on or off is activated when it&#039;s turned on and deactivated when it&#039;s turned off. On &#039;&#039;script.SetUnitValue(COB.ACTIVATION, ...)&#039;&#039; one of these call-ins may be called too.&lt;br /&gt;
&lt;br /&gt;
== Weapons ==&lt;br /&gt;
&lt;br /&gt;
Weapon functions come in two variants.&lt;br /&gt;
&lt;br /&gt;
* Separate function with numeric weapon number suffix. (e.g. &#039;&#039;script.AimWeapon&amp;lt;u&amp;gt;1&amp;lt;/u&amp;gt;(heading, pitch)&#039;&#039;)&lt;br /&gt;
* Combined function which gets weapon number as second argument. (e.g. &#039;&#039;script.AimWeapon(&amp;lt;u&amp;gt;weaponNum&amp;lt;/u&amp;gt;, heading, pitch)&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Only the first variant is listed here, so whenever you see a function whose name ends with a numeric one (&amp;quot;1&amp;quot;), you should either replace it with the actual weapon number, or you can write a single combined function that takes a &#039;&#039;weaponNum&#039;&#039; argument. For each script, all functions should use the same variant. Either all using name suffix, or all using combined functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryWeapon1&#039;&#039;&#039; ( ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimFromWeapon1&#039;&#039;&#039; ( ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimWeapon1&#039;&#039;&#039; ( heading, pitch ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimShield1&#039;&#039;&#039; ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Weapon support. The return value of QueryWeapon and AimFromWeapon determines the pieces which will be used for aiming: typically e.g. the barrel for QueryWeapon and the turret for AimFromWeapon. AimWeapon is then called to allow the script to turn the weapons in the target direction, which is passed as the heading and pitch argument (in radians). Only if AimWeapon returns true, the weapon is actually fired. AimWeapon is called repeatedly, at a rate determined by the {{xtaglink|Gamedev:WeaponDefs|fireTolerance}} tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.FireWeapon1&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.Shot1&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.EndBurst1&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
If after aiming the unit actually fires it&#039;s weapon, FireWeapon is called once at the beginning of the salvo. Shot is called just before each projectile is fired. RockUnit (see below) is called just after all projectiles for that frame have been fired. At the end of the salvo, EndBurst is called.&lt;br /&gt;
&lt;br /&gt;
Of these call-ins, FireWeapon is the more generic one and Shot and EndBurst are more specialized. FireWeapon is usually used to play a recoil animation or emit some smoke near the weapon&#039;s barrel using EmitSfx.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.BlockShot1&#039;&#039;&#039; ( targetUnitID, boolean userTarget ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Allows you to block a weapon from shooting. TargetUnitID may be nil: in this case the unit has a ground-attack order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TargetWeight1&#039;&#039;&#039; ( targetUnitID ) -&amp;gt; number&lt;br /&gt;
&lt;br /&gt;
Allows you to tweak the priority of the target for this particular weapon. The target priority is multiplied by the return value of this function. Lower priority targets are targeted first, so return a value smaller than 1 to prioritize a target, or return a value larger than 1 to avoid a target.&lt;br /&gt;
&lt;br /&gt;
The exact behavior of specific values shouldn&#039;t be relied upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.RockUnit&#039;&#039;&#039; ( x, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
A bit like the weapon-specific FireWeapon function, although this is called after any weapon fires. As argument it gets a two dimensional vector in the direction the unit just fired. This may be used to â€œrockâ€ the unit as a whole a bit as part of the firing animation. Note though that this vector is in world space, so for a truly realistic rock direction it needs to be rotated according to the unit&#039;s current heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.HitByWeapon&#039;&#039;&#039; ( x, z, weaponDefID, damage ) -&amp;gt; nil | number newDamage&lt;br /&gt;
&lt;br /&gt;
This is called if a unit has been hit by a weapon. (x, z) is the direction from which the projectile came in unit space (the reverse direction of the impulse, to be exact.) It also gets the weaponDefID of the weapon which is dealing the damage, and the amount of damage. If HitByWeapon returns a number, this number will replace the damage value calculated by the engine.&lt;br /&gt;
&lt;br /&gt;
Note: Pre Spring 95, this call-in runs just before the LuaRules UnitPreDamaged callin (see also [[LuaCallinReturn]]). If HitByWeapon overrides the damage, UnitPreDamaged will see the new damage value, and may override again the damage value. Starting Spring 95, it is run after UnitPreDamaged.&lt;br /&gt;
&lt;br /&gt;
== Builders and factories ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartBuilding&#039;&#039;&#039; ( heading, pitch ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StartBuilding&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopBuilding&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These notify the script when a builder or factory starts or stops building.&lt;br /&gt;
&lt;br /&gt;
The first variant (with heading and pitch arguments) is called for builders. For factories, the second variant is used. In this case the heading and pitch are not necessary, because the factory script specifies the build location itself using QueryBuildInfo.&lt;br /&gt;
&lt;br /&gt;
BTW, don&#039;t forget to set INBUILDSTANCE to 1 to start building! For lua script, that is&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
  function script.StartBuilding(heading, pitch)&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, 1)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  function script.StopBuilding()&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, 0)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryBuildInfo&#039;&#039;&#039; ( ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For factories only. Should return the piece to which the unit which is going to be build will be attached while it&#039;s being build.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryNanopiece&#039;&#039;&#039; ( ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
Called each time a nano particle is to be created. Should return the piece at which the particle will be spawned. This may be used to iterate through a few pieces, to simulate the factory/builder having multiple nanolathes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;N.B. As of 92.0 the results are cached and the function is called 31 times only. Deprecated in favour of Spring.SetUnitNanoPieces, which disables this callin when used.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Transports ==&lt;br /&gt;
&lt;br /&gt;
There are some different code paths inside Spring related to transports, each (unfortunately) also associated with a different set of unit script call-ins.&lt;br /&gt;
&lt;br /&gt;
This table shows for the three different {{xtaglink|Gamedev:UnitDefs|transportUnloadMethod}} for both air transports and ground transports which callins are used and roughly when and how often they are called. Refer to the documentation below for a description of the call-ins.&lt;br /&gt;
&lt;br /&gt;
The entire behavior around transports should be considered subject to change; it is obvious it is far from a perfect design currently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; style=&amp;quot;border-spacing:0px;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!&lt;br /&gt;
!Load&lt;br /&gt;
!UnloadLand (0)&lt;br /&gt;
!UnloadDrop (1)&lt;br /&gt;
!UnloadLandFlood (2)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|default unload&lt;br /&gt;
|fly over and drop unit&lt;br /&gt;
|land, then release all units at once&lt;br /&gt;
|-&lt;br /&gt;
|air&lt;br /&gt;
|BeginTransport (each)&amp;lt;br&amp;gt;QueryTransport (each)&lt;br /&gt;
|EndTransport (last)&lt;br /&gt;
|EndTransport (each)&lt;br /&gt;
|StartUnload (first)&amp;lt;br&amp;gt;TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|-&lt;br /&gt;
|ground&lt;br /&gt;
|TransportPickup (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Air transports ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.BeginTransport&#039;&#039;&#039; ( passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.QueryTransport&#039;&#039;&#039; ( passengerID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For an air transport, if any one unit is picked up, these two are called in succession and the passenger is attached to the piece returned by the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartUnload&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Signals the start of an unload cycle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportDrop&#039;&#039;&#039; ( passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Called when a passenger will be unloaded. Contrary to ground transports, Spring will detach the passenger after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.EndTransport&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
In UnloadLand and UnloadLandFlood behaviors, these are called one time after all units are unloaded. (The transport is empty.) For the UnloadDrop behavior, this is called for every unit that is unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ground transports ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportPickup&#039;&#039;&#039; ( passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be loaded into the transport. This should eventually call AttachUnit to actually attach the unit. Assuming the transport is in range of the next passenger, this will be called again for the next passenger 16 frames later, &#039;&#039;unless&#039;&#039; the script enters the BUSY state: then Spring will not move on to the next passenger until the script leaves the BUSY state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportDrop&#039;&#039;&#039; ( passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be unloaded. This should eventually call DetachUnit to actually detach the unit, &#039;&#039;unless&#039;&#039; the used unload method is UnloadLandFlood, in which case Spring will actually detach the unit after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.EndTransport&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior, after the last unit has been unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Passenger ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Falling&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
For a unit dropped from an UnloadDrop transport, this is called every frame to inform the script the unit is still falling. It may be used to show a parachute for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Landed&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called one time after the unit reached the ground. May be used to hide a parachute for example.&lt;br /&gt;
&lt;br /&gt;
== Internal ==&lt;br /&gt;
&lt;br /&gt;
These call-ins are NOT available to Lua unit scripts. They are called by the engine however, but always &#039;intercepted&#039; by the framework gadget. For completeness (or if you are poking at the gadget), they are listed here anyway.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.MoveFinished&#039;&#039;&#039; ( piece, axis ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.TurnFinished&#039;&#039;&#039; ( piece, axis ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a move or turn finished. The framework gadget uses this to resume the coroutines which are waiting for the particular move or turn to be finished.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Destroy&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called right before the unit&#039;s script is destroyed. This may happen if the unit is being destroyed, but also if the unit&#039;s script is being replaced by another script. The framework gadget uses this to stop all threads and remove the unit from some internal data structures.&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=2002</id>
		<title>Animation-LuaCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=2002"/>
		<updated>2020-06-10T08:44:04Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Transports */ taglink&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Call-ins are calls from the engine, into the unit script. In other words, these functions are called, if they are defined, when a particular &#039;&#039;event&#039;&#039; happens.&lt;br /&gt;
&lt;br /&gt;
For Lua unit scripts, a new call-in mechanism has been implemented, which is faster than the regular call-in mechanism used for widgets and gadgets.&lt;br /&gt;
&lt;br /&gt;
Types for arguments are only shown where they&#039;re ambiguous. For a number of (common) arguments, the types are:&lt;br /&gt;
&lt;br /&gt;
* unitID: number&lt;br /&gt;
* piece: number&lt;br /&gt;
* axis: number (1 = x axis, 2 = y axis, 3 = z axis)&lt;br /&gt;
* heading/pitch: number (radians)&lt;br /&gt;
&lt;br /&gt;
== Generic ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Create&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called just after the unit script has been created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartMoving&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopMoving&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These are called whenever the unit starts or stops moving. Typical use for them is to trigger wheels to start spinning, animate treads, or start/stop a walking animation. Since 95.0 they are only run when a unit transitions from zero to non-zero speed or vice versa, and no longer during in-place rotations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.ChangeHeading&#039;&#039;&#039; ( number deltaHeading ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Called when the unit changes heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartSkidding&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopSkidding&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Called when a (ground) unit reacts to an impulse. The start-skidding threshold (&#039;sqSkidSpeedMult&#039;) is configurable via [[Lua_MoveCtrl#MoveType-Controlling|MoveCtrl.SetGroundMoveTypeData]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Killed&#039;&#039;&#039; ( number recentDamage, number maxHealth ) -&amp;gt; number corpseType&lt;br /&gt;
&lt;br /&gt;
This is called when the unit is killed. The severity of the kill may be calculated as severity=recentDamage/maxHealth &#039;&#039;(*100 so that it&#039;s in percent, no? at least that is how severity was expressed in Cob/bos, I think. Of course there&#039;s no reason to emulate that, just pointing it out for people &amp;quot;converting&amp;quot;)&#039;&#039;. Typically, this function would play a death animation for the unit, and finally return a corpse type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.WindChanged&#039;&#039;&#039; ( number heading, number strength ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called for wind generators whenever the wind direction or strength changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.ExtractionRateChanged&#039;&#039;&#039; ( number rate ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called for metal extractors each time their extraction rate (metal per second) changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.setSFXoccupy&#039;&#039;&#039; ( number curTerrainType ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when terrain type changes. Terrain type is calculated with the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If unit is being transported -&amp;gt; curTerrainType = 0&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is always upright -&amp;gt; curTerrainType = 2&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is not always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* If ground height &amp;lt; 0 and unit is always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* Otherwise -&amp;gt; curTerrainType = 4&lt;br /&gt;
&lt;br /&gt;
Where is curTerrainType = 3 ? :-)&lt;br /&gt;
&lt;br /&gt;
Candidate to be changed to something saner later on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.MoveRate&#039;&#039;&#039; ( number curRate ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called only for certain types of aircraft (those which use &#039;&#039;CTAAirMoveType&#039;&#039;.) The move rate is determined by the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If the aircraft is landing or taking off -&amp;gt; curRate = 1&lt;br /&gt;
* Otherwise -&amp;gt; curRate = floor(curSpeed / maxSpeed * 3), clamped to be in the range [0, 2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryLandingPads&#039;&#039;&#039; ( ) -&amp;gt; { number piece1, number piece2, ... }&lt;br /&gt;
&lt;br /&gt;
Called one time for units with landing pads. Should return a table with pieces which should be used as landing pads. The number of pieces returned also determines the number of pads, so for Lua unit scripts there is no QueryLandingPadCount.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Activate&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.Deactivate&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Exact situation these are called depends a lot on the unit type. Factories are activated when they open their yard and deactivated when they close it. Aircraft are activated when they take off and deactivated when the land. Any unit that can be turned on or off is activated when it&#039;s turned on and deactivated when it&#039;s turned off. On &#039;&#039;script.SetUnitValue(COB.ACTIVATION, ...)&#039;&#039; one of these call-ins may be called too.&lt;br /&gt;
&lt;br /&gt;
== Weapons ==&lt;br /&gt;
&lt;br /&gt;
Weapon functions come in two variants.&lt;br /&gt;
&lt;br /&gt;
* Separate function with numeric weapon number suffix. (e.g. &#039;&#039;script.AimWeapon&amp;lt;u&amp;gt;1&amp;lt;/u&amp;gt;(heading, pitch)&#039;&#039;)&lt;br /&gt;
* Combined function which gets weapon number as second argument. (e.g. &#039;&#039;script.AimWeapon(&amp;lt;u&amp;gt;weaponNum&amp;lt;/u&amp;gt;, heading, pitch)&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Only the first variant is listed here, so whenever you see a function whose name ends with a numeric one (&amp;quot;1&amp;quot;), you should either replace it with the actual weapon number, or you can write a single combined function that takes a &#039;&#039;weaponNum&#039;&#039; argument. For each script, all functions should use the same variant. Either all using name suffix, or all using combined functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryWeapon1&#039;&#039;&#039; ( ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimFromWeapon1&#039;&#039;&#039; ( ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimWeapon1&#039;&#039;&#039; ( heading, pitch ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.AimShield1&#039;&#039;&#039; ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Weapon support. The return value of QueryWeapon and AimFromWeapon determines the pieces which will be used for aiming: typically e.g. the barrel for QueryWeapon and the turret for AimFromWeapon. AimWeapon is then called to allow the script to turn the weapons in the target direction, which is passed as the heading and pitch argument (in radians). Only if AimWeapon returns true, the weapon is actually fired. AimWeapon is called repeatedly, at a rate determined by the {{xtaglink|Gamedev:WeaponDefs|fireTolerance}} tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.FireWeapon1&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.Shot1&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.EndBurst1&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
If after aiming the unit actually fires it&#039;s weapon, FireWeapon is called once at the beginning of the salvo. Shot is called just before each projectile is fired. RockUnit (see below) is called just after all projectiles for that frame have been fired. At the end of the salvo, EndBurst is called.&lt;br /&gt;
&lt;br /&gt;
Of these call-ins, FireWeapon is the more generic one and Shot and EndBurst are more specialized. FireWeapon is usually used to play a recoil animation or emit some smoke near the weapon&#039;s barrel using EmitSfx.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.BlockShot1&#039;&#039;&#039; ( targetUnitID, boolean userTarget ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Allows you to block a weapon from shooting. TargetUnitID may be nil: in this case the unit has a ground-attack order.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TargetWeight1&#039;&#039;&#039; ( targetUnitID ) -&amp;gt; number&lt;br /&gt;
&lt;br /&gt;
Allows you to tweak the priority of the target for this particular weapon. The target priority is multiplied by the return value of this function. Lower priority targets are targeted first, so return a value smaller than 1 to prioritize a target, or return a value larger than 1 to avoid a target.&lt;br /&gt;
&lt;br /&gt;
The exact behavior of specific values shouldn&#039;t be relied upon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.RockUnit&#039;&#039;&#039; ( x, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
A bit like the weapon-specific FireWeapon function, although this is called after any weapon fires. As argument it gets a two dimensional vector in the direction the unit just fired. This may be used to â€œrockâ€ the unit as a whole a bit as part of the firing animation. Note though that this vector is in world space, so for a truly realistic rock direction it needs to be rotated according to the unit&#039;s current heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.HitByWeapon&#039;&#039;&#039; ( x, z, weaponDefID, damage ) -&amp;gt; nil | number newDamage&lt;br /&gt;
&lt;br /&gt;
This is called if a unit has been hit by a weapon. (x, z) is the direction from which the projectile came in unit space (the reverse direction of the impulse, to be exact.) It also gets the weaponDefID of the weapon which is dealing the damage, and the amount of damage. If HitByWeapon returns a number, this number will replace the damage value calculated by the engine.&lt;br /&gt;
&lt;br /&gt;
Note: Pre Spring 95, this call-in runs just before the LuaRules UnitPreDamaged callin (see also [[LuaCallinReturn]]). If HitByWeapon overrides the damage, UnitPreDamaged will see the new damage value, and may override again the damage value. Starting Spring 95, it is run after UnitPreDamaged.&lt;br /&gt;
&lt;br /&gt;
== Builders and factories ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartBuilding&#039;&#039;&#039; ( heading, pitch ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StartBuilding&#039;&#039;&#039; ( ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.StopBuilding&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These notify the script when a builder or factory starts or stops building.&lt;br /&gt;
&lt;br /&gt;
The first variant (with heading and pitch arguments) is called for builders. For factories, the second variant is used. In this case the heading and pitch are not necessary, because the factory script specifies the build location itself using QueryBuildInfo.&lt;br /&gt;
&lt;br /&gt;
BTW, don&#039;t forget to set INBUILDSTANCE to 1 to start building! For lua script, that is&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
  function script.StartBuilding(heading, pitch)&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, 1)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  function script.StopBuilding()&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, 0)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryBuildInfo&#039;&#039;&#039; ( ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For factories only. Should return the piece to which the unit which is going to be build will be attached while it&#039;s being build.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.QueryNanopiece&#039;&#039;&#039; ( ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
Called each time a nano particle is to be created. Should return the piece at which the particle will be spawned. This may be used to iterate through a few pieces, to simulate the factory/builder having multiple nanolathes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;N.B. As of 92.0 the results are cached and the function is called 31 times only. Deprecated in favour of Spring.SetUnitNanoPieces, which disables this callin when used.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Transports ==&lt;br /&gt;
&lt;br /&gt;
There are some different code paths inside Spring related to transports, each (unfortunately) also associated with a different set of unit script call-ins.&lt;br /&gt;
&lt;br /&gt;
This table shows for the three different {{xtaglink|Gamedev:UnitDefs|transportUnloadMethods}} for both air transports and ground transports which callins are used and roughly when and how often they are called. Refer to the documentation below for a description of the call-ins.&lt;br /&gt;
&lt;br /&gt;
The entire behavior around transports should be considered subject to change; it is obvious it is far from a perfect design currently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; style=&amp;quot;border-spacing:0px;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!&lt;br /&gt;
!Load&lt;br /&gt;
!UnloadLand (0)&lt;br /&gt;
!UnloadDrop (1)&lt;br /&gt;
!UnloadLandFlood (2)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|default unload&lt;br /&gt;
|fly over and drop unit&lt;br /&gt;
|land, then release all units at once&lt;br /&gt;
|-&lt;br /&gt;
|air&lt;br /&gt;
|BeginTransport (each)&amp;lt;br&amp;gt;QueryTransport (each)&lt;br /&gt;
|EndTransport (last)&lt;br /&gt;
|EndTransport (each)&lt;br /&gt;
|StartUnload (first)&amp;lt;br&amp;gt;TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|-&lt;br /&gt;
|ground&lt;br /&gt;
|TransportPickup (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Air transports ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.BeginTransport&#039;&#039;&#039; ( passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.QueryTransport&#039;&#039;&#039; ( passengerID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For an air transport, if any one unit is picked up, these two are called in succession and the passenger is attached to the piece returned by the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.StartUnload&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Signals the start of an unload cycle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportDrop&#039;&#039;&#039; ( passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Called when a passenger will be unloaded. Contrary to ground transports, Spring will detach the passenger after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.EndTransport&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
In UnloadLand and UnloadLandFlood behaviors, these are called one time after all units are unloaded. (The transport is empty.) For the UnloadDrop behavior, this is called for every unit that is unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ground transports ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportPickup&#039;&#039;&#039; ( passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be loaded into the transport. This should eventually call AttachUnit to actually attach the unit. Assuming the transport is in range of the next passenger, this will be called again for the next passenger 16 frames later, &#039;&#039;unless&#039;&#039; the script enters the BUSY state: then Spring will not move on to the next passenger until the script leaves the BUSY state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.TransportDrop&#039;&#039;&#039; ( passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be unloaded. This should eventually call DetachUnit to actually detach the unit, &#039;&#039;unless&#039;&#039; the used unload method is UnloadLandFlood, in which case Spring will actually detach the unit after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.EndTransport&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior, after the last unit has been unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Passenger ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Falling&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
For a unit dropped from an UnloadDrop transport, this is called every frame to inform the script the unit is still falling. It may be used to show a parachute for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Landed&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called one time after the unit reached the ground. May be used to hide a parachute for example.&lt;br /&gt;
&lt;br /&gt;
== Internal ==&lt;br /&gt;
&lt;br /&gt;
These call-ins are NOT available to Lua unit scripts. They are called by the engine however, but always &#039;intercepted&#039; by the framework gadget. For completeness (or if you are poking at the gadget), they are listed here anyway.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.MoveFinished&#039;&#039;&#039; ( piece, axis ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;script.TurnFinished&#039;&#039;&#039; ( piece, axis ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a move or turn finished. The framework gadget uses this to resume the coroutines which are waiting for the particular move or turn to be finished.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;script.Destroy&#039;&#039;&#039; ( ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called right before the unit&#039;s script is destroyed. This may happen if the unit is being destroyed, but also if the unit&#039;s script is being replaced by another script. The framework gadget uses this to stop all threads and remove the unit from some internal data structures.&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2128</id>
		<title>Animation:LuaExamples</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2128"/>
		<updated>2020-06-09T15:38:15Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Factory */ should really call YARD_OPEN, too&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LUS Script Examples =&lt;br /&gt;
&lt;br /&gt;
== How to use ==&lt;br /&gt;
* &amp;lt;code&amp;gt;FIXME&amp;lt;/code&amp;gt; - Indicates a section of code you will need to tweak to suit your own unit / model&lt;br /&gt;
* &amp;lt;code&amp;gt;TODO&amp;lt;/code&amp;gt; - Indicates an optional section of code is missing that you may wish to pad out e.g. with an animation&lt;br /&gt;
&lt;br /&gt;
== Script Scaffolds ==&lt;br /&gt;
=== Air Transport ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- FIXME: This should be whatever piece name you want to attach to in your model&lt;br /&gt;
local attachPiece = piece &amp;quot;attach&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- called for each unit loaded, returns the attaching piece&lt;br /&gt;
function script.QueryTransport(passengerID)&lt;br /&gt;
    return attachPiece&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for each unit loaded to animate the load process&lt;br /&gt;
function script.BeginTransport(passengerID)&lt;br /&gt;
    -- TODO: any loading animations here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--how this is called depends on https://springrts.com/wiki/Gamedev:UnitDefs#transportUnloadMethod&lt;br /&gt;
-- 0 (Default) called once on the last unit dropped&lt;br /&gt;
-- 1 called for each unit dropped in mid-air&lt;br /&gt;
-- 2 called for the last unit dropped&lt;br /&gt;
function script.EndTransport(passengerID)&lt;br /&gt;
    -- TODO: relevant end of transport sequence animations&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Only called if transportUnloadMethod = 2&lt;br /&gt;
function script.TransportDrop(passengerID, x,y,z)&lt;br /&gt;
    -- TODO: animation to unload each individual passenger on the ground&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Builder ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding(heading, pitch)&lt;br /&gt;
    -- TODO: This is where you would add your unpack / point towards animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, true)&lt;br /&gt;
end&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: This is where you would add your pack-up animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Factory ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.QueryBuildInfo()&lt;br /&gt;
    -- FIXME: the pad piece is named buildPad in the model&lt;br /&gt;
    return piece(&amp;quot;buildPad&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function OpenCloseAnim(open)&lt;br /&gt;
    Signal(1) -- Kill any other copies of this thread&lt;br /&gt;
    SetSignalMask(1) -- Allow this thread to be killed by fresh copies&lt;br /&gt;
    if open then&lt;br /&gt;
        -- TODO: This is where you would add your opening up anim&lt;br /&gt;
    else&lt;br /&gt;
        -- TODO: This is where you would add your closing up anim&lt;br /&gt;
    end&lt;br /&gt;
    SetUnitValue(COB.YARD_OPEN, open)&lt;br /&gt;
    SetUnitValue(COB.BUGGER_OFF, open)&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, open)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard opens&lt;br /&gt;
function script.Activate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard closes&lt;br /&gt;
function script.Deactivate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that continues throughout the build process here e.g. spin pad&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that signifies the end of the build process here&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Wind Generator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- FIXME: Assumes model has pieces named &#039;tower&#039; and &#039;blades&#039;&lt;br /&gt;
local tower, blades = piece(&amp;quot;tower&amp;quot;, &amp;quot;blades&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
function script.WindChanged (number heading, number strength)&lt;br /&gt;
  -- Turn the tower to face the wind at 30deg/s&lt;br /&gt;
  Turn(tower, y_axis, heading, math.rad(30))&lt;br /&gt;
  -- Spin the turbine blades relative to wind strength&lt;br /&gt;
  -- FIXME: Here I set rotational speed to half of strength&lt;br /&gt;
  Spin(blades, z_axis, strength * 0.5)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2127</id>
		<title>Animation:LuaExamples</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2127"/>
		<updated>2020-06-09T15:34:17Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Script Scaffolds */ Add Air Transport&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LUS Script Examples =&lt;br /&gt;
&lt;br /&gt;
== How to use ==&lt;br /&gt;
* &amp;lt;code&amp;gt;FIXME&amp;lt;/code&amp;gt; - Indicates a section of code you will need to tweak to suit your own unit / model&lt;br /&gt;
* &amp;lt;code&amp;gt;TODO&amp;lt;/code&amp;gt; - Indicates an optional section of code is missing that you may wish to pad out e.g. with an animation&lt;br /&gt;
&lt;br /&gt;
== Script Scaffolds ==&lt;br /&gt;
=== Air Transport ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- FIXME: This should be whatever piece name you want to attach to in your model&lt;br /&gt;
local attachPiece = piece &amp;quot;attach&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-- called for each unit loaded, returns the attaching piece&lt;br /&gt;
function script.QueryTransport(passengerID)&lt;br /&gt;
    return attachPiece&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- called for each unit loaded to animate the load process&lt;br /&gt;
function script.BeginTransport(passengerID)&lt;br /&gt;
    -- TODO: any loading animations here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--how this is called depends on https://springrts.com/wiki/Gamedev:UnitDefs#transportUnloadMethod&lt;br /&gt;
-- 0 (Default) called once on the last unit dropped&lt;br /&gt;
-- 1 called for each unit dropped in mid-air&lt;br /&gt;
-- 2 called for the last unit dropped&lt;br /&gt;
function script.EndTransport(passengerID)&lt;br /&gt;
    -- TODO: relevant end of transport sequence animations&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Only called if transportUnloadMethod = 2&lt;br /&gt;
function script.TransportDrop(passengerID, x,y,z)&lt;br /&gt;
    -- TODO: animation to unload each individual passenger on the ground&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Builder ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding(heading, pitch)&lt;br /&gt;
    -- TODO: This is where you would add your unpack / point towards animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, true)&lt;br /&gt;
end&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: This is where you would add your pack-up animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Factory ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.QueryBuildInfo()&lt;br /&gt;
    -- FIXME: the pad piece is named buildPad in the model&lt;br /&gt;
    return piece(&amp;quot;buildPad&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function OpenCloseAnim(open)&lt;br /&gt;
    Signal(1) -- Kill any other copies of this thread&lt;br /&gt;
    SetSignalMask(1) -- Allow this thread to be killed by fresh copies&lt;br /&gt;
    if open then&lt;br /&gt;
        -- TODO: This is where you would add your opening up anim&lt;br /&gt;
    else&lt;br /&gt;
        -- TODO: This is where you would add your closing up anim&lt;br /&gt;
    end&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, open)&lt;br /&gt;
    SetUnitValue(COB.BUGGER_OFF, open)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard opens&lt;br /&gt;
function script.Activate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard closes&lt;br /&gt;
function script.Deactivate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that continues throughout the build process here e.g. spin pad&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that signifies the end of the build process here&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Wind Generator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- FIXME: Assumes model has pieces named &#039;tower&#039; and &#039;blades&#039;&lt;br /&gt;
local tower, blades = piece(&amp;quot;tower&amp;quot;, &amp;quot;blades&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
function script.WindChanged (number heading, number strength)&lt;br /&gt;
  -- Turn the tower to face the wind at 30deg/s&lt;br /&gt;
  Turn(tower, y_axis, heading, math.rad(30))&lt;br /&gt;
  -- Spin the turbine blades relative to wind strength&lt;br /&gt;
  -- FIXME: Here I set rotational speed to half of strength&lt;br /&gt;
  Spin(blades, z_axis, strength * 0.5)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Xtaglink&amp;diff=23270</id>
		<title>Template:Xtaglink</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Xtaglink&amp;diff=23270"/>
		<updated>2020-06-02T17:55:12Z</updated>

		<summary type="html">&lt;p&gt;Flozi: update xtaglink for changed anchors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#css:&lt;br /&gt;
   span.mono {&lt;br /&gt;
       font-family: courier, monospace;&lt;br /&gt;
   }&lt;br /&gt;
   span.value {&lt;br /&gt;
       color: #ff6600;&lt;br /&gt;
   }&lt;br /&gt;
}}&amp;lt;includeonly&amp;gt;[[{{{1}}}#{{{2}}}|{{{var|{{{2}}}}}}]]{{#if: {{{3|}}}|&amp;lt;span class=&amp;quot;mono&amp;quot;&amp;gt; = &amp;lt;/span&amp;gt;{{value|{{{3}}}}}|}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
A template to simplify cross-referencing definition [[Template:Tag|tags]] between different pages. Use [[Template:Taglink]] for links to tags within the same page.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{xtaglink|Gamedev:UnitDefs|builder}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{xtaglink|Gamedev:UnitDefs|builder}}&lt;br /&gt;
&lt;br /&gt;
Usage (Optional 3rd param to link to a tag with a given value):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{xtaglink|Gamedev:UnitDefs|builder|true}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
{{xtaglink|Gamedev:UnitDefs|builder|true}}&lt;br /&gt;
&lt;br /&gt;
N.B. Please do not use this tag &#039;&#039;within&#039;&#039; a &amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt; block when documenting a formula tags are used in - it will break the markup and is confusing. See [[Gamedev:WeaponDefs#Tag:burstRate]] for an example of the proper usage in this case.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Taglink&amp;diff=23219</id>
		<title>Template:Taglink</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Taglink&amp;diff=23219"/>
		<updated>2020-06-02T17:54:55Z</updated>

		<summary type="html">&lt;p&gt;Flozi: update taglink for changed anchors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#css:&lt;br /&gt;
   span.mono {&lt;br /&gt;
       font-family: courier, monospace;&lt;br /&gt;
   }&lt;br /&gt;
   span.value {&lt;br /&gt;
       color: #ff6600;&lt;br /&gt;
   }&lt;br /&gt;
}}&amp;lt;includeonly&amp;gt;[[#{{{1}}}|{{{var|{{{1}}}}}}]]{{#if: {{{2|}}}|&amp;lt;span class=&amp;quot;mono&amp;quot;&amp;gt; = &amp;lt;/span&amp;gt;{{value|{{{2}}}}}|}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
A template to simplify cross-referencing definition [[Template:Tag|tags]] (currently only within a page).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{taglink|foo}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
&lt;br /&gt;
{{taglink|foo}}&lt;br /&gt;
&lt;br /&gt;
Usage (Optional 2nd param to link to a tag with a given value):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{taglink|foo|bar}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
{{taglink|foo|bar}}&lt;br /&gt;
&lt;br /&gt;
N.B. Please do not use this tag &#039;&#039;within&#039;&#039; a &amp;lt;nowiki&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/nowiki&amp;gt; block when documenting a formula tags are used in - it will break the markup and is confusing. See [[Gamedev:WeaponDefs#Tag:burstRate]] for an example of the proper usage in this case.&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:DebugDrawModes&amp;diff=8200</id>
		<title>Gamedev:DebugDrawModes</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:DebugDrawModes&amp;diff=8200"/>
		<updated>2020-05-28T12:04:59Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* /DebugColVol (alt+v) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Debug Drawing Modes =&lt;br /&gt;
Spring has several drawing modes which are useful for debugging and performance checking. &lt;br /&gt;
They are listed below by [[UI commands]] with their default key binding.&lt;br /&gt;
&lt;br /&gt;
== /Debug (alt+b) ==&lt;br /&gt;
[[File:Debug.jpg|400px|left|/Debug]]&lt;br /&gt;
Draws a toggleable list of engine functions and a breakdown of how much time is spent computing them. When toggled on a line graph is drawn to illustrate the change in performance over time. &lt;br /&gt;
&lt;br /&gt;
Since 97.0 there is a new &#039;&#039;&#039;Frame Grapher&#039;&#039;&#039; visualisation which shows how the last half-second was spent:&lt;br /&gt;
&lt;br /&gt;
* Green are video frames&lt;br /&gt;
* Red are simframes&lt;br /&gt;
* Blue is swapBuffer (gpu/vsync)&lt;br /&gt;
* Pink is lua gc&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== /DebugColVol (alt+v) ==&lt;br /&gt;
[[File:DebugColVol.jpg|400px|left|/DebugColVol]]&lt;br /&gt;
Draws unit and feature [[Gamedev:CollisionVolumes|collision volumes]] as purple meshes. When hit by a weapon the meshes turn red. Since 99.0 weapon debug spheres are also drawn in this mode for the [[Animation-LuaCallins#Weapons|AimFromWeapon()]] position, [[Animation-LuaCallins#Weapons|QueryWeapon()]] (muzzle) position and unit target position. Shields spheres are drawn in blue.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugPath (alt+p) ==&lt;br /&gt;
[[File:DebugPath_Close.jpg|400px|left|/DebugPath Close up view]][[File:DebugPath_Far.jpg|400px|left|/DebugPath Far out view]]&lt;br /&gt;
&lt;br /&gt;
Draws pathfinder routes, colour coded by accuracy.&lt;br /&gt;
&lt;br /&gt;
* Red is the most finely computed pathing&lt;br /&gt;
* Green is intermediate paths&lt;br /&gt;
* Blue is least accurate long range path&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugTraceRay ==&lt;br /&gt;
It is meant for debugging trajectories of ballistic projectiles. [https://springrts.com/mantis/view.php?id=4664 Currently broken in 98.0]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /DebugDrawAI ==&lt;br /&gt;
[[File:DebugDrawAI_E232AI.jpg|400px|left|/DebugDrawAI implemented in E232AI]]&lt;br /&gt;
This mode is toggled through the engine but is up to the native AI to implement itself. The image shows how [[AI:Skirmish:List|E232AI]] implements a real-time threatmap rendering and a real-time performance profiler.&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Dev]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:API&amp;diff=22317</id>
		<title>Template:API</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:API&amp;diff=22317"/>
		<updated>2020-03-28T18:43:36Z</updated>

		<summary type="html">&lt;p&gt;Flozi: make name linkable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{prefix|{{{prefix}}}}}{{name|{{anchor|{{{name}}}}}[[#{{{name}}}|{{{name}}}]]}}{{var|1=({{{args}}})}}{{#if: {{{return|}}}|&amp;lt;br&amp;gt;return: {{var|1={{{return}}}}}|}}{{#if: {{{output|}}}|{{var|1=&amp;lt;br&amp;gt;-&amp;gt; {{{output}}}}}|}}&lt;br /&gt;
&lt;br /&gt;
:{{{info}}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|UseTeamResource}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20700</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20700"/>
		<updated>2020-03-28T18:26:02Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* test */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|[[#UseTeamResource|UseTeamResource]]}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
=== Using syntaxhighlight instead ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;Spring.CreateUnit // offmap positions are clamped! (you still can use MoveCtrl todo so)&lt;br /&gt;
 ( string &amp;quot;defName&amp;quot; | int unitDefID,&lt;br /&gt;
   int x, int y, int z,&lt;br /&gt;
   (int facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
   int teamID&lt;br /&gt;
   [, bool build = false] &lt;br /&gt;
   [, bool flattenGround = true]&lt;br /&gt;
   [, int unitID]&lt;br /&gt;
   [, int builderID]) -&amp;gt; int unitID | nil&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23174</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23174"/>
		<updated>2020-03-28T18:24:37Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|{{anchor|{{{name|name}}}}}[[#{{{name|name}}}|{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23173</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23173"/>
		<updated>2020-03-28T18:24:07Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|{{anchor|{{{name|name}}}}}[[{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23172</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23172"/>
		<updated>2020-03-28T18:23:24Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|{{anchor|{{{name|name}}}}}[[#{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Anchor&amp;diff=22321</id>
		<title>Template:Anchor</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Anchor&amp;diff=22321"/>
		<updated>2020-03-28T17:27:16Z</updated>

		<summary type="html">&lt;p&gt;Flozi: Undo revision 31203 by Flozi (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;{{{1|{{{anchor}}}}}}&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A small template to manually create an anchor link, see http://meta.wikimedia.org/wiki/Template:Anchor&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{anchor|foo}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an invisible anchor which you can link to within the page as &amp;lt;pre&amp;gt;[[#foo]]&amp;lt;/pre&amp;gt; or externally by &amp;lt;pre&amp;gt;[[page_name#foo]]&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20699</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20699"/>
		<updated>2020-03-28T17:21:31Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* test */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|[[#UseTeamResource|UseTeamResource]]}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
=== Using syntaxhighlight instead ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;Spring.CreateUnit // offmap positions are clamped! (you still can use MoveCtrl todo so)&lt;br /&gt;
 ( string &amp;quot;defName&amp;quot; | int unitDefID,&lt;br /&gt;
   int x, int y, int z,&lt;br /&gt;
   (int facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
   int teamID&lt;br /&gt;
   [, bool build = false] &lt;br /&gt;
   [, bool flattenGround = true]&lt;br /&gt;
   [, int unitID]&lt;br /&gt;
   [, int builderID]) -&amp;gt; int unitID | nil&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;br /&gt;
&lt;br /&gt;
==test==&lt;br /&gt;
{{tag&lt;br /&gt;
|name = [[#Tag:buildCostEnergy|buildCostEnergy]]&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = energyCost&lt;br /&gt;
|description = The amount of energy resource the unit costs to build.}}&lt;br /&gt;
&lt;br /&gt;
{{anchor|foo|bar}}&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23171</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23171"/>
		<updated>2020-03-28T17:15:54Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|{{anchor|{{{name|name|name}}}}}{{{name|name}}}}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23170</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23170"/>
		<updated>2020-03-28T16:35:04Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|{{anchor|{{{name|name}}}}}[[#{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23169</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23169"/>
		<updated>2020-03-28T16:34:26Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|[[#{{anchor|{{{name|name}}}}}{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23168</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23168"/>
		<updated>2020-03-28T16:01:52Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} [[#{{name|{{anchor|{{{name|name}}}}}{{{name|name}}}}}]] &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23167</id>
		<title>Template:Tag</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Tag&amp;diff=23167"/>
		<updated>2020-03-28T16:00:30Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{type|{{{type|type}}}}} {{name|[[#{{anchor|{{{name|name}}}}}{{{name|name}}}]]}} &amp;amp;emsp;default: {{value|{{{default|?}}}}}{{#if: {{{range|}}}|&amp;amp;emsp;range: {{value|{{{range|}}}}}|}}{{#if: {{{lua|}}}|&amp;amp;emsp;lua: {{var|{{{lua|}}}}}|}}&amp;amp;emsp;{{{special|}}}&lt;br /&gt;
: {{{description|{{FIXME}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;A template for documenting various tags used in the engine (gamedata files, defs etc)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
result:&lt;br /&gt;
{{tag}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|range=[0-100]|special=Required|default=10|description=Then type your description}}&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag|name=foo|type=int|default=10|description=Then type your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
{{tag|name=foo|type=int|default=10|description=Then type your description}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Usage:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Result: &lt;br /&gt;
{{tag&lt;br /&gt;
|name = bar&lt;br /&gt;
|type = float&lt;br /&gt;
|range = [0-100]&lt;br /&gt;
|default = 3.14&lt;br /&gt;
|special = {{new|88.0}}&lt;br /&gt;
|description = Then your description}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Anchor&amp;diff=22320</id>
		<title>Template:Anchor</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Anchor&amp;diff=22320"/>
		<updated>2020-03-28T15:50:17Z</updated>

		<summary type="html">&lt;p&gt;Flozi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span id=&amp;quot;{{{1|{{{anchor}}}}}}&amp;quot;&amp;gt;{{{1|}}}&amp;lt;/span&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A small template to manually create an anchor link, see http://meta.wikimedia.org/wiki/Template:Anchor&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;{{anchor|foo}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;{{anchor|foo|bar}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates an invisible anchor which you can link to within the page as &amp;lt;pre&amp;gt;[[#foo]]&amp;lt;/pre&amp;gt; or externally by &amp;lt;pre&amp;gt;[[page_name#foo]]&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20698</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20698"/>
		<updated>2020-03-28T13:55:52Z</updated>

		<summary type="html">&lt;p&gt;Flozi: hmmmm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|[[#UseTeamResource|UseTeamResource]]}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
=== Using syntaxhighlight instead ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;Spring.CreateUnit // offmap positions are clamped! (you still can use MoveCtrl todo so)&lt;br /&gt;
 ( string &amp;quot;defName&amp;quot; | int unitDefID,&lt;br /&gt;
   int x, int y, int z,&lt;br /&gt;
   (int facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
   int teamID&lt;br /&gt;
   [, bool build = false] &lt;br /&gt;
   [, bool flattenGround = true]&lt;br /&gt;
   [, int unitID]&lt;br /&gt;
   [, int builderID]) -&amp;gt; int unitID | nil&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;br /&gt;
&lt;br /&gt;
==test==&lt;br /&gt;
{{tag&lt;br /&gt;
|name = [[#Tag:buildCostEnergy|buildCostEnergy]]&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = energyCost&lt;br /&gt;
|description = The amount of energy resource the unit costs to build.}}&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20697</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20697"/>
		<updated>2020-03-28T13:50:36Z</updated>

		<summary type="html">&lt;p&gt;Flozi: testing linked names in tag / api&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|[[#UseTeamResource|UseTeamResource]]}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
=== Using syntaxhighlight instead ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;Spring.CreateUnit // offmap positions are clamped! (you still can use MoveCtrl todo so)&lt;br /&gt;
 ( string &amp;quot;defName&amp;quot; | int unitDefID,&lt;br /&gt;
   int x, int y, int z,&lt;br /&gt;
   (int facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
   int teamID&lt;br /&gt;
   [, bool build = false] &lt;br /&gt;
   [, bool flattenGround = true]&lt;br /&gt;
   [, int unitID]&lt;br /&gt;
   [, int builderID]) -&amp;gt; int unitID | nil&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;br /&gt;
&lt;br /&gt;
==test==&lt;br /&gt;
{{tag&lt;br /&gt;
|name = [[#buildCostEnergy|buildCostEnergy]]&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|lua = energyCost&lt;br /&gt;
|description = The amount of energy resource the unit costs to build.}}&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=MediaWiki:Sidebar&amp;diff=22253</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=MediaWiki:Sidebar&amp;diff=22253"/>
		<updated>2020-03-03T20:38:22Z</updated>

		<summary type="html">&lt;p&gt;Flozi: capitalise&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* navigation&lt;br /&gt;
** About|About&lt;br /&gt;
** Games|Games&lt;br /&gt;
** Media|Media&lt;br /&gt;
** Main_Page|Documentation&lt;br /&gt;
** https://springrts.com/phpbb/|Forum&lt;br /&gt;
** https://springrts.com/mantis/my_view_page.php|Report a bug&lt;br /&gt;
** Download|Download&lt;br /&gt;
* special links&lt;br /&gt;
** recentchanges-url|Recent changes&lt;br /&gt;
** http://www.google.com/search?as_sitesearch=springrts.com/wiki|Site search&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=MediaWiki:Sidebar&amp;diff=22252</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=MediaWiki:Sidebar&amp;diff=22252"/>
		<updated>2020-03-03T20:35:50Z</updated>

		<summary type="html">&lt;p&gt;Flozi: google site search&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* navigation&lt;br /&gt;
** About|about&lt;br /&gt;
** Games|games&lt;br /&gt;
** Media|media&lt;br /&gt;
** Main_Page|documentation&lt;br /&gt;
** https://springrts.com/phpbb/|forum&lt;br /&gt;
** https://springrts.com/mantis/my_view_page.php|report a bug&lt;br /&gt;
** Download|download&lt;br /&gt;
* special links&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** http://www.google.com/search?as_sitesearch=springrts.com/wiki|site search&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Movedefs.lua&amp;diff=14821</id>
		<title>Movedefs.lua</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Movedefs.lua&amp;diff=14821"/>
		<updated>2019-08-29T11:12:28Z</updated>

		<summary type="html">&lt;p&gt;Flozi: flow :/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Movedefs.lua=&lt;br /&gt;
==Location==&lt;br /&gt;
&amp;lt;code&amp;gt;movedefs.lua&amp;lt;/code&amp;gt; is a file in the &amp;lt;code&amp;gt;Gamedata/&amp;lt;/code&amp;gt; directory of a Spring Game.&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
This file defines &#039;&#039;&#039;MoveClasses&#039;&#039;&#039; which are used to determine pathing for units.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The engine source code which parses the data from this file is viewable here: &lt;br /&gt;
* {{sourcelink|file=rts/Sim/MoveTypes/MoveDefHandler.cpp}}&lt;br /&gt;
&lt;br /&gt;
==Data Types==&lt;br /&gt;
{{DataTypes}}&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
A mobile unit is assigned a &#039;&#039;&#039;MoveClass&#039;&#039;&#039; using the {{xtaglink|Gamedev:UnitDefs|movementClass}} tag. The engine determines the unit&#039;s pathfinding based on the properties of the &#039;&#039;&#039;MoveClass&#039;&#039;&#039;, so analogous properties (e.g. {{xtaglink|Gamedev:UnitDefs|footprintX}}) in the [[Gamedev:UnitDefs|UnitDef]] should be the same for optimal behaviour.&lt;br /&gt;
&lt;br /&gt;
All &#039;&#039;&#039;MoveClasses&#039;&#039;&#039; must belong to one of four possible types. A &#039;&#039;&#039;MoveClass&#039;&#039;&#039; is assigned a type simply by including it within the name string e.g. &amp;lt;code&amp;gt;Tank_MyMoveClassName&amp;lt;/code&amp;gt;. Types are used in &#039;&#039;&#039;[[Mapdev:terraintype|TypeMaps]]&#039;&#039;&#039; of Spring maps, which allow mappers to set per-type speed multipliers. &lt;br /&gt;
&lt;br /&gt;
===Types===&lt;br /&gt;
* &amp;lt;code&amp;gt;Bot&amp;lt;/code&amp;gt; - A ground based &#039;&#039;&#039;MoveClass&#039;&#039;&#039;. The default type if no matching type string is found.&lt;br /&gt;
* &amp;lt;code&amp;gt;Tank&amp;lt;/code&amp;gt; - A ground based &#039;&#039;&#039;MoveClass&#039;&#039;&#039;. Identical to &amp;lt;code&amp;gt;Bot&amp;lt;/code&amp;gt; other than interaction with &#039;&#039;&#039;TypeMaps&#039;&#039;&#039;.&lt;br /&gt;
* &amp;lt;code&amp;gt;Ship&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Boat&amp;lt;/code&amp;gt; - Are synonyms. All ships / boat &#039;&#039;&#039;MoveClasses&#039;&#039;&#039; must belong to this type to behave as ships.&lt;br /&gt;
* &amp;lt;code&amp;gt;Hover&amp;lt;/code&amp;gt; - All hovercraft &#039;&#039;&#039;MoveClasses&#039;&#039;&#039; (traverse any depth of water without speed reduction) must belong to this class, as well as having {{xtaglink|Gamedev:UnitDefs|canHover}} in their [[Gamedev:UnitDefs|UnitDef]] to behave as hovers.&lt;br /&gt;
&lt;br /&gt;
==MoveClass Tags==&lt;br /&gt;
{{tag&lt;br /&gt;
|name = name&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of the &#039;&#039;&#039;MoveClass&#039;&#039;&#039;. Usually passed by the sub-table variable name rather than using this tag (See [[#Example]]). Prior to 9.50 this had to contain &amp;quot;tank&amp;quot;, &amp;quot;hover&amp;quot;, &amp;quot;ship&amp;quot; or &amp;quot;boat&amp;quot; respectively for non-Bot types. This is now set using {{taglink|speedModClass}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = speedModClass&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|special = {{new|95.0}}&lt;br /&gt;
|description = Determines the speed modifier class used (See [[Mapdev:terraintype]]). Accepted values are &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = Tank, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; = KBot, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; = Hover, &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; = Ship.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = footprintX&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = How wide the &#039;&#039;&#039;MoveClass&#039;&#039;&#039; is in footprint units, left to right. 1 footprint unit = 16 [[elmo]]s. Cannot be below &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. For mobile units this should be the same as the {{xtaglink|Gamedev:UnitDefs|footprintX}} of its [[Gamedev:UnitDefs|UnitDef]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = footprintZ&lt;br /&gt;
|type = int&lt;br /&gt;
|default = footprintX&lt;br /&gt;
|description = How wide the &#039;&#039;&#039;MoveClass&#039;&#039;&#039; is in footprint units, top to bottom. 1 footprint unit = 16 [[elmo]]s. Cannot be below &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;. For mobile units this should be the same as the {{xtaglink|Gamedev:UnitDefs|footprintZ}} of its [[Gamedev:UnitDefs|UnitDef]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = crushStrength&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 10.0&lt;br /&gt;
|description = Power of a unit with this &#039;&#039;&#039;MoveClass&#039;&#039;&#039; to crush features and units. Any features with a {{xtaglink|Gamedev:FeatureDefs|crushResistance}} less than this value will be crushed on contact. Any units with crushing enabled via [[Lua_SyncedCtrl#Unit_Control|Spring.SetUnitBlocking]]), in an impact where collider impulse exceeds collidee impulse and whose {{xtaglink|Gamedev:UnitDefs|crushResistance}} is less than this value will also be crushed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxSlope&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 60.0 (15.0 for hover types)&lt;br /&gt;
|description = The maximum steepness of slope a unit with this &#039;&#039;&#039;MoveClass&#039;&#039;&#039; can climb in degrees. For further details see [[#How_slope_is_determined]].}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = slopeMod&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 4.0 / (maxSlope + 0.001)&lt;br /&gt;
|description = How much a slope will slow a unit, &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; means no slowdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = avoidMobilesOnPath&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Do the units attempt to avoid other mobile units when pathing?&lt;br /&gt;
* Pro: groups moving without a ctrl-order clump much less&lt;br /&gt;
* Contra: groups moving with a ctrl-order are less organized&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowTerrainCollisions&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|96.0}}&lt;br /&gt;
|description = Disable this to improve handling of large (&amp;gt;4 x 4) footprint units (See {{mantis|4217}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowRawMovement&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|104.0}}&lt;br /&gt;
|description = Enables native &amp;quot;raw move&amp;quot; (straight-line path) support  (See also [[Lua_SyncedCtrl|Spring.SetUnitMoveGoal]] and {{mantis|4412}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Heat Tags ===&lt;br /&gt;
These tags are used in unit avoidance. &lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = heatMapping&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = This enables/disables generation and usage of path heats.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = heatMod&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0042&lt;br /&gt;
|description = The pathfinder cost modifier that is multiplied by the heat of the current square.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = heatProduced&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 30&lt;br /&gt;
|description = How much heat to place on a square if a path goes through it. &amp;lt;code&amp;gt;heat set = max(currentSquareHeat, heatProduced)&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Flow Field Tags ===&lt;br /&gt;
These tags are used in unit avoidance. &lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flowMapping&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = This enables/disables [https://leifnode.com/2013/12/flow-field-pathfinding/ flow field mapping].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flowMod&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = Multiplied by the objects {{xtaglink|Gamedev:UnitDefs|mass}} for the y-component (up) of the flow vector. No idea what effect this has.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Tank &amp;amp; Bot-Only Tags ===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = depthMod&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.1&lt;br /&gt;
|description =  How much water will slow amphibious units. The deeper the water, the slower the movement.&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Replaced with a subtable in Spring 86.x&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxWaterDepth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The maximum depth of water in [[elmo]]s the unit can wade through.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Ship-Only Tags ===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minWaterDepth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 10.0&lt;br /&gt;
|description = The minimum depth of water in [[elmo]]s the ship requires to float in.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = subMarine&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the ship a submarine; can it move underneath other ships?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Sub Tables==&lt;br /&gt;
===depthModParams===&lt;br /&gt;
Only read for &amp;lt;code&amp;gt;Bot&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Tank&amp;lt;/code&amp;gt; &#039;&#039;&#039;MoveClasses&#039;&#039;&#039;, the depthModParams group contains several sub-tags. Depthmod is a system for changing the speed of units depending on how deep they are underwater.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
       new formula is given by&lt;br /&gt;
         if h &amp;lt; depthModParams.minHeight: 1.0&lt;br /&gt;
         if h &amp;gt; depthModParams.maxHeight: 0.0&lt;br /&gt;
         else:&lt;br /&gt;
           depthScale = MAX(0.01, MIN(depthModParams.maxScale, (a * h * h) + (b * h) + c))&lt;br /&gt;
           depthMod = 1 / depthScale&lt;br /&gt;
       where&lt;br /&gt;
         h = unit&#039;s absolute height below water surface&lt;br /&gt;
         a = depthModParams.quadraticCoeff&lt;br /&gt;
         b = depthModParams.linearCoeff&lt;br /&gt;
         c = depthModParams.constantCoeff&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minHeight &lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description =  The minimum depth where the depthMod curve applies.  If the unit is shallower than the minHeight, no change in speed occurs. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxHeight &lt;br /&gt;
|type = float&lt;br /&gt;
|default = MAX_FLOAT&lt;br /&gt;
|description =  The maximum depth where the depthMod curve applies.  If the unit is deeper than the maxHeight, the unit is immobilized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The following tags control the behavior of the unit within the active portion of the curve (depth is greater than {{taglink|minHeight}} but less than {{taglink|maxHeight}}). It would be best to simply open up your graphing program of choice and use the provided formula, but if you&#039;re scared of graphs you should read the descriptions below:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxScale&lt;br /&gt;
|type = float&lt;br /&gt;
|default = MAX_FLOAT&lt;br /&gt;
|description =  This is the cap on how severe the depth effect can be. For example, lets say that you use a maxScale value of 2. If a unit is at the depth where its scale reaches the max (usually near its maximum depth; with a maxScale value of 2), the slowest it will go is half of its maximum speed. In other words, (maxVelocity / maxScale). Therefore, as another example, a value of 4 would cause the unit&#039;s maximum speed (near the units maximum depth) to be 25% of it&#039;s maxVelocity.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = quadraticCoeff&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description =  The application of the speed-divider effect is modelled as a quadratic.  This is the &amp;quot;depth-squared&amp;quot; component of that.  That is, a value set here will be applied exponentially as the unit gets deeper, therefore it is best to use very small numbers for this tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = linearCoeff&lt;br /&gt;
|type = float&lt;br /&gt;
|default = depthMod&lt;br /&gt;
|description =  The application of the speed-divider effect is modelled as a quadratic.  This component makes divisor increase linearly with the depth of the unit.  So with a value of 0.1, for example, a unit would go from 1/2 speed to 1/3 speed and 1/3 speed to 1/4 speed each time it goes 10 units deeper.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = constantCoeff &lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description =  The application of the speed-divider effect is modelled as a quadratic.  This is the constant component of the divisor.  If you want a gradual decrease of speed and your {{taglink|minHeight|0}} (the waterline) then this value &#039;&#039;&#039;must&#039;&#039;&#039; be 1.  Using less than 1 will cause the unit to go &#039;&#039;faster&#039;&#039; as it hits the water, and using greater than 1 will cause the unit to abruptly slow down the moment it gets its feet wet.  If you&#039;re not using {{taglink|minHeight|0}}, you&#039;ll have to adjust this value accordingly to get a smooth application of the depthMod divider.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===speedModMults===&lt;br /&gt;
{{new|86.0}}&lt;br /&gt;
&lt;br /&gt;
These previously hard-coded variables allow control over how the pathfinder (default only, not [[QTPFS]], see [[Modrules.lua]]) calculates the cost for a &#039;&#039;&#039;MoveClass&#039;&#039;&#039; for squares containing mobile units, if and only if {{taglink|avoidMobilesOnPath|true}}.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = mobileBusyMult&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.1&lt;br /&gt;
|description = The cost multiplier for mobile units which are &#039;Busy&#039;; Not currently being built and with a non-empty command queue, but not moving on a path. Clamped to values above &amp;lt;code&amp;gt;0.01&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = mobileIdleMult&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.35&lt;br /&gt;
|description = The cost multiplier for mobile units which are &#039;Idle&#039;; Either currently being built or with an empty command queue. Clamped to values above &amp;lt;code&amp;gt;0.01&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = mobileMoveMult&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.65&lt;br /&gt;
|description = The cost multiplier for mobile units which are &#039;Moving&#039;; Trying to follow their own path. Clamped to values above &amp;lt;code&amp;gt;0.01&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==How slope is determined==&lt;br /&gt;
Spring doesn&#039;t represent terrain slopes in degrees, internally it uses&lt;br /&gt;
&amp;lt;code&amp;gt;(1.0 - the terrain normal&#039;s y-component)&amp;lt;/code&amp;gt; so the slope of vertical faces is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; and that of horizontal ones &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;. A unit&#039;s &amp;lt;code&amp;gt;maxSlope&amp;lt;/code&amp;gt; value (which is in&lt;br /&gt;
degrees in its movedef) is converted so that the &amp;quot;can we go here?&amp;quot; (ie&lt;br /&gt;
&amp;quot;&amp;lt;code&amp;gt;maxSlope &amp;gt; terrainSlope&amp;lt;/code&amp;gt;?&amp;quot;) comparisons are meaningful, the formula&lt;br /&gt;
is &amp;lt;code&amp;gt;1.0 - cos(DEG2RAD(maxSlope * 1.5))&amp;lt;/code&amp;gt;. If you want to know the terrain angle in degrees, compute &amp;lt;code&amp;gt;RAD2DEG(arccos(1.0 - terrainSlope))&amp;lt;/code&amp;gt;. For a bot with a &amp;lt;code&amp;gt;maxSlope&amp;lt;/code&amp;gt; of 36 degrees (~0.41221 in &amp;quot;Spring format&amp;quot;), the maximum tolerable terrain angle is approximately&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;RAD2DEG(arccos(1.0 - 0.41221))&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or 54 degrees. If &amp;lt;code&amp;gt;maxSlope&amp;lt;/code&amp;gt; was &amp;lt;code&amp;gt;30&amp;lt;/code&amp;gt;, the MTTA would be 45, and if it was &amp;lt;code&amp;gt;60&amp;lt;/code&amp;gt; (the highest sensible value due to that 1.5 scalar and the absence of overhanging cliffs) the bot could mount any terrain. In other words you do not need the long mathematical derivation, just remember that&lt;br /&gt;
&amp;lt;code&amp;gt;maxTerrainAngle = maxSlope * 1.5&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--kloot, Thu Jul 31, 2008&lt;br /&gt;
&lt;br /&gt;
==Code to check your movdefs==&lt;br /&gt;
{{forumlink|topic=24866|title=A resource to check movedefs}} that game developers have used for years and find it quite useful.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===External Examples===&lt;br /&gt;
[http://imolarpg.dyndns.org/trac/balatest/browser/trunk/gamedata/movedefs.lua &#039;Balanced Annihilation&#039; movedefs.lua]&lt;br /&gt;
&lt;br /&gt;
[http://spring1944.svn.sourceforge.net/viewvc/spring1944/trunk/S44Main.sdd/gamedata/movedefs.lua?&amp;amp;view=markup &#039;Spring: 1944&#039; movedefs.lua]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/springtutorialgame/source/browse/trunk/SpringTutorialGame.sdd/Gamedata/movedefs.lua &#039;Spring Tutorial Game&#039; movedefs.lua]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/gamedata/movedefs.lua &#039;ZeroK&#039; movedefs.lua]&lt;br /&gt;
&lt;br /&gt;
[[Category:Gamedata]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Modrules.lua&amp;diff=14471</id>
		<title>Modrules.lua</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Modrules.lua&amp;diff=14471"/>
		<updated>2019-04-21T20:32:40Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* los */ fix heading level&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Location==&lt;br /&gt;
&amp;lt;code&amp;gt;modrules.lua&amp;lt;/code&amp;gt; is a file in the &amp;lt;code&amp;gt;Gamedata/&amp;lt;/code&amp;gt; directory of a Spring game. &lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
This file controls various global parameters of the game, for example how fast units gain experience, what unit types can be transported, how fine grained the LOS system is, etc.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The engine source code which parses the data from this file is viewable here:&lt;br /&gt;
&lt;br /&gt;
* {{sourcelink|file=rts/Sim/Misc/ModInfo.cpp}}&lt;br /&gt;
&lt;br /&gt;
==Data Types==&lt;br /&gt;
{{DataTypes}}&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
&amp;lt;code&amp;gt;Modrules.lua&amp;lt;/code&amp;gt; is divided into several sub-tables containing tags specific to each section, as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===capture===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyCostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much of the original energy cost it requires to capture something.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===construction===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = constructionDecay&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Do uncompleted building frames begin to decay if no builder is working on them?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = constructionDecayTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 6.66&lt;br /&gt;
|description = The time in seconds before abandoned building frames begin to decay.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = constructionDecaySpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.03&lt;br /&gt;
|description = How fast build progress decays for abandoned building frames. Note that the rate is inversely proportional to the {{xtaglink|Gamedev:UnitDefs|buildtime}} i.e. a building with a larger {{xtaglink|Gamedev:UnitDefs|buildtime}} will decay more slowly for a given value of this tag than a building with a shorter {{xtaglink|Gamedev:UnitDefs|buildtime}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===experience===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = experienceMult&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = Controls the amount of experience gained by units engaging in combat. The formulae used are: &lt;br /&gt;
::&amp;lt;code&amp;gt;xp for damage = 0.1 * experienceMult * damage / target_HP * target_power / attacker_power&amp;lt;/code&amp;gt; &lt;br /&gt;
::&amp;lt;code&amp;gt;xp for kill = 0.1 * experienceMult * target_power / attacker_power&amp;lt;/code&amp;gt;. &lt;br /&gt;
: Where {{xtaglink|Gamedev:UnitDefs|power}} can be set by the UnitDef tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = powerScale&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = Controls how gaining experience changes the relative {{xtaglink|Gamedev:UnitDefs|power}} of the unit. The formula used is &amp;lt;code&amp;gt;Power multiplier = powerScale * (1 + xp / (xp + 1))&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = healthScale&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.7&lt;br /&gt;
|description = Controls how gaining experience increases the {{xtaglink|Gamedev:UnitDefs|maxDamage}} (total hitpoints) of the unit. The formula used is &amp;lt;code&amp;gt;Health multiplier = healthScale * (1 + xp / (xp + 1))&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = reloadScale&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.4&lt;br /&gt;
|description = Controls how gaining experience decreases the {{xtaglink|Gamedev:UnitDefs|reloadTime}} of the unit&#039;s weapons. The formula used is &amp;lt;code&amp;gt;Rate of fire multiplier = reloadScale * (1 + xp / (xp + 1))&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===featureLOS===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = featureVisibility&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 3&lt;br /&gt;
|description = Controls the visibility of features. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - no default LOS for features, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - Gaia features always visible, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - allyteam &amp;amp; Gaia features always visible, or &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; - all features always visible.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===fireAtDead===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireAtKilled&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Will units continue to target and fire on enemies which are running their &amp;lt;code&amp;gt;Killed()&amp;lt;/code&amp;gt; animation? (See [[Animation-LuaCallins#Generic]])&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireAtCrashing&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Will units continue to target and fire on enemy aircraft which are in the &#039;crashing&#039; state? (See [[Lua_SyncedCtrl#Unit_Control]])&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===flankingBonus===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = defaultMode&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = The default {{xtaglink|Gamedev:UnitDefs|flankingBonusMode}} for units. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - No flanking bonus. Mode &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; builds up the ability to move over time, and swings to face attacks, but does not respect the way the unit is facing. Mode &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; also can swing, but moves with the unit as it turns. Mode &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; stays with the unit as it turns and otherwise doesn&#039;t move, the ideal mode to simulate something such as tank armour. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===los===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = losMipLevel&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = Controls the resolution of the LOS calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the LOS map in both x and y direction. Must be between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt; inclusive.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = losMul&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|special = {{removed|101.0}}&lt;br /&gt;
|description = Multiplies all unit&#039;s {{xtaglink|Gamedev:UnitDefs|sightDistance}} by this value. Generally speaking you should always use the default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = airMipLevel&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = Controls the resolution of the LOS vs. aircraft calculations. A higher value means lower resolution but increased performance. An increase by one level means half the resolution of the air-LOS map in both x and y direction. Must be between &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;30&amp;lt;/code&amp;gt; inclusive. [http://springrts.com/mantis/view.php?id=4031#c11709] - jK describe for you what the value means.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = airLosMul&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|special = {{removed|101.0}}&lt;br /&gt;
|description = Multiplies all unit&#039;s {{xtaglink|Gamedev:UnitDefs|airSightDistance}} by this value. Generally speaking you should always use the default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = radarMipLevel&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 2&lt;br /&gt;
|description = Controls the resolution of the radar. See description of airMipLevel for details.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===movement===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowAirPlanesToLeaveMap&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Are (gunship) aircraft allowed to fly outside the bounds of the map?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowAircraftToHitGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|90.0}}&lt;br /&gt;
|description = Are aircraft allowed to hit the ground whilst manoeuvring?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowPushingEnemyUnits&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|83.0}}&lt;br /&gt;
|description = Can enemy ground units push each other during collisions?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowCrushingAlliedUnits&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|85.0}}&lt;br /&gt;
|description = Can allied ground units crush each other during collisions? Units still have to be explicitly set as crushable using the &amp;lt;code&amp;gt;crushable&amp;lt;/code&amp;gt; parameter of [[Lua_SyncedCtrl#Unit_Control|Spring.SetUnitBlocking]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowUnitCollisionDamage&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|85.0}}&lt;br /&gt;
|description = Do unit-unit (skidding) collisions cause damage?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowUnitCollisionOverlap&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|89.0}}&lt;br /&gt;
|description = Can mobile units collision volumes overlap one another? Allows unit movement like [http://www.youtube.com/watch?v=mRtePUdVk2o this (video)] at the cost of more &#039;clumping&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowGroundUnitGravity&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|92.0}}&lt;br /&gt;
|description = Allows fast moving mobile units to &#039;catch air&#039; as they move over terrain.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowHoverUnitStrafing&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true if using QTPFS pathfinder&lt;br /&gt;
|special = {{new|92.0}}&lt;br /&gt;
|description = Allows hovercraft units to slide in turns.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = useClassicGroundMoveType&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|89.0}} {{removed|102.0}}&lt;br /&gt;
|description = A ticket back to unit movement circa 2009: no reversing, no {{xtaglink|Gamedev:UnitDefs|turninplace|false}}, no smooth collision handling, no nothing. For comparison of pathfinding code.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===paralyze===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = paralyzeOnMaxHealth&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Are units paralyzed when the level of emp is greater than their current health or their maximum health?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===reclaim===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = multiReclaim&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = Can multiple units reclaim a feature or only one? &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; implies the latter, all other values the former.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = reclaimMethod&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = Controls how features are reclaimed. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - gradual reclaim, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - all reclaimed at end, any other positive value &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; - reclaim in &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; chunks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unitMethod&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = Controls how units are reclaimed. Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - gradual reclaim, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - all reclaimed at end, any other positive value &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; - reclaim in &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; chunks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = featureEnergyCostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much energy should reclaiming a feature cost? Multiplier against the fraction of the features&#039; {{xtaglink|Gamedev:FeatureDefs|metal}} content reclaimed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unitEnergyCostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much energy should reclaiming a unit cost? Multiplier against the fraction of the unit&#039;s {{xtaglink|Gamedev:UnitDefs|buildCostEnergy}} reclaimed. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = unitEfficiency&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = How much metal should reclaiming a unit return? Multiplier against the unit&#039;s {{xtaglink|Gamedev:UnitDefs|buildCostMetal}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowEnemies&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can enemy units be reclaimed?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowAllies&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can allied units be reclaimed?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===repair===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyCostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much of the original energy cost it requires to repair something.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===resurrect===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyCostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.5&lt;br /&gt;
|description = How much of the original energy cost it requires to resurrect something.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===sensors===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = requireSonarUnderWater&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; then when underwater, units only get LOS if they also have sonar.&lt;br /&gt;
}}&lt;br /&gt;
{{tag&lt;br /&gt;
|name = alwaysVisibleOverridesCloaked&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|101.0}}&lt;br /&gt;
|description = If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; then units will be visible even when cloaked (probably?).&lt;br /&gt;
}}&lt;br /&gt;
{{tag&lt;br /&gt;
|name = separateJammers&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|101.0}}&lt;br /&gt;
|description = When &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; each allyTeam only jams their own units.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===system===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = pathFinderSystem&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|special={{new|85.0}}&lt;br /&gt;
|description = Which pathfinder does the game use? Can be &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - The legacy default pathfinder, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - Quad-Tree Pathfinder System ([[QTPFS]])}} or &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; - disabled.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = pathFinderUpdateRate&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.007&lt;br /&gt;
|special={{new|98.0}}&lt;br /&gt;
|description = Controls how often the pathfinder updates; larger values means more rapid updates.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowTake&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|103.0}}&lt;br /&gt;
|description = Enables and disables the {{var|/take}} [[UI_commands|UI command]].}}&lt;br /&gt;
&lt;br /&gt;
===transportability===&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportAir&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can aircraft be transported?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportShip&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can ships be transported?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportHover&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can hovercraft be transported?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = transportGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Can ground units be transported?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = targetableTransportedUnits&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|89.0}}&lt;br /&gt;
|description = Can transported units be targeted by weapons? &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; allows both manual and automatic targeting.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
===Empty===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modrules.lua&amp;lt;/code&amp;gt; can simply return an empty table like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
return {}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you do this, Spring will use the default values.&lt;br /&gt;
&lt;br /&gt;
===Configurable by modoptions===&lt;br /&gt;
Interestingly &amp;lt;code&amp;gt;modrules.lua&amp;lt;/code&amp;gt; can read [[Modoptions.lua|modoptions]], so these parameters can be scripted to be configurable from the lobby.&lt;br /&gt;
For example to allow selecting either legacy default pathfinder or [[QTPFS]] via a modoption:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  system = {&lt;br /&gt;
    pathFinderSystem = (Spring.GetModOptions() and (Spring.GetModOptions().qtpfs == &amp;quot;1&amp;quot;) and 1) or 0,&lt;br /&gt;
  },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===External Examples===&lt;br /&gt;
[http://imolarpg.dyndns.org/trac/balatest/browser/trunk/gamedata/modrules.lua &#039;Balanced Annihilation&#039; Modrules.lua]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/conflictterra/source/browse/games/CT/gamedata/modrules.lua &#039;Conflict Terra&#039; Modrules.lua]&lt;br /&gt;
&lt;br /&gt;
[https://code.google.com/p/evolutionrts/source/browse/trunk/evolutiondev.sdd/Gamedata/modrules.lua &#039;Evolution RTS&#039; Modrules.lua]&lt;br /&gt;
&lt;br /&gt;
[http://spring1944.svn.sourceforge.net/viewvc/spring1944/trunk/S44Main.sdd/gamedata/modrules.lua?&amp;amp;view=markup &#039;Spring: 1944&#039; Modrules.lua]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/gamedata/modrules.lua &#039;ZeroK&#039; Modrules.lua]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:gamedata]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2126</id>
		<title>Animation:LuaExamples</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:LuaExamples&amp;diff=2126"/>
		<updated>2018-10-21T17:02:04Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* LUS Script Examples */ &amp;lt;code&amp;gt; -&amp;gt; &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= LUS Script Examples =&lt;br /&gt;
&lt;br /&gt;
== How to use ==&lt;br /&gt;
* &amp;lt;code&amp;gt;FIXME&amp;lt;/code&amp;gt; - Indicates a section of code you will need to tweak to suit your own unit / model&lt;br /&gt;
* &amp;lt;code&amp;gt;TODO&amp;lt;/code&amp;gt; - Indicates an optional section of code is missing that you may wish to pad out e.g. with an animation&lt;br /&gt;
&lt;br /&gt;
== Script Scaffolds ==&lt;br /&gt;
=== Builder ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding(heading, pitch)&lt;br /&gt;
    -- TODO: This is where you would add your unpack / point towards animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, true)&lt;br /&gt;
end&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: This is where you would add your pack-up animation&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, false)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Factory ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local nanoPieces = {}&lt;br /&gt;
-- FIXME: this example has 2 nano pieces to alternate between&lt;br /&gt;
for i = 1, 2 do &lt;br /&gt;
     -- FIXME: the pieces are named nanoPiece1 and nanoPiece2 in the model&lt;br /&gt;
    nanoPieces[i] = piece(&amp;quot;nanoPiece&amp;quot; .. i)&lt;br /&gt;
end&lt;br /&gt;
Spring.SetUnitNanoPieces(unitID, nanoPieces)&lt;br /&gt;
&lt;br /&gt;
function script.QueryBuildInfo()&lt;br /&gt;
    -- FIXME: the pad piece is named buildPad in the model&lt;br /&gt;
    return piece(&amp;quot;buildPad&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function OpenCloseAnim(open)&lt;br /&gt;
    Signal(1) -- Kill any other copies of this thread&lt;br /&gt;
    SetSignalMask(1) -- Allow this thread to be killed by fresh copies&lt;br /&gt;
    if open then&lt;br /&gt;
        -- TODO: This is where you would add your opening up anim&lt;br /&gt;
    else&lt;br /&gt;
        -- TODO: This is where you would add your closing up anim&lt;br /&gt;
    end&lt;br /&gt;
    SetUnitValue(COB.INBUILDSTANCE, open)&lt;br /&gt;
    SetUnitValue(COB.BUGGER_OFF, open)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard opens&lt;br /&gt;
function script.Activate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Called when factory yard closes&lt;br /&gt;
function script.Deactivate()&lt;br /&gt;
    -- OpenCloseAnim must be threaded to call Sleep() or WaitFor functions&lt;br /&gt;
    StartThread(OpenCloseAnim, false)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StartBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that continues throughout the build process here e.g. spin pad&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function script.StopBuilding()&lt;br /&gt;
    -- TODO: You can run any animation that signifies the end of the build process here&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Wind Generator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- FIXME: Assumes model has pieces named &#039;tower&#039; and &#039;blades&#039;&lt;br /&gt;
local tower, blades = piece(&amp;quot;tower&amp;quot;, &amp;quot;blades&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
function script.WindChanged (number heading, number strength)&lt;br /&gt;
  -- Turn the tower to face the wind at 30deg/s&lt;br /&gt;
  Turn(tower, y_axis, heading, math.rad(30))&lt;br /&gt;
  -- Spin the turbine blades relative to wind strength&lt;br /&gt;
  -- FIXME: Here I set rotational speed to half of strength&lt;br /&gt;
  Spin(blades, z_axis, strength * 0.5)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20696</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20696"/>
		<updated>2018-01-05T22:51:04Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Template:API proposal */ or use syntaxhighlight with c ?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|UseTeamResource}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
=== Using syntaxhighlight instead ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;Spring.CreateUnit // offmap positions are clamped! (you still can use MoveCtrl todo so)&lt;br /&gt;
 ( string &amp;quot;defName&amp;quot; | int unitDefID,&lt;br /&gt;
   int x, int y, int z,&lt;br /&gt;
   (int facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
   int teamID&lt;br /&gt;
   [, bool build = false] &lt;br /&gt;
   [, bool flattenGround = true]&lt;br /&gt;
   [, int unitID]&lt;br /&gt;
   [, int builderID]) -&amp;gt; int unitID | nil&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20695</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20695"/>
		<updated>2018-01-05T22:42:00Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Template:API proposal */ check how ugly this style is with something with long params list like CreateUnit (ugly :( )&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|UseTeamResource}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|CreateUnit}}{{var|1=( {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} number unitDefID, {{type|number}} x, {{type|number}} y, {{type|number z}},&lt;br /&gt;
({{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot;),&lt;br /&gt;
{{type|number}} teamID&lt;br /&gt;
[, {{type|boolean}} build = {{value|false}}] &lt;br /&gt;
[, {{type|boolean}} flattenGround = {{value|true}}]&lt;br /&gt;
[, {{type|number}} unitID]&lt;br /&gt;
[, {{type|number}} builderID ])}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|number}} unitID {{pipe}} {{type|nil}}}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20694</id>
		<title>User:Flozi</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=User:Flozi&amp;diff=20694"/>
		<updated>2018-01-03T18:25:38Z</updated>

		<summary type="html">&lt;p&gt;Flozi: remove some crap&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= My User Subpages = &lt;br /&gt;
{{Special:PrefixIndex/User:Flozi/}}&lt;br /&gt;
&lt;br /&gt;
= Scratchpad =&lt;br /&gt;
&lt;br /&gt;
== Template:API proposal ==&lt;br /&gt;
Note that the number of &#039;arg1&#039; etc is fixed (i.e. 10) but can be omitted without issue. the &#039;type&#039; template is just a way to make inserting different styles within the param list easier, [[Template:Pipe]] already exists and is required as it is a special char within mediawiki syntax, could use &amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt; as a shorter alternative to pipe. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callout example --&amp;gt;&lt;br /&gt;
|prefix = Spring&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|output = {{type|nil}} {{pipe}} {{type|bool}} hadEnough&lt;br /&gt;
|info = Imposes a one-off usage of resources on the given team. The return value indicates whether or not the team had sufficient resources to meet the usage demand.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{prefix|Spring.}}{{name|UseTeamResource}}{{var|1=({{type|number}} teamID, {{type|string}} {{value|&amp;quot;metal&amp;quot;}} {{pipe}} {{value|&amp;quot;energy&amp;quot;}}, {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount })}}&lt;br /&gt;
&lt;br /&gt;
{{var|-&amp;gt; {{type|nil}} {{pipe}} {{type|bool}} hadEnough}}&lt;br /&gt;
&lt;br /&gt;
:Deduct the specified amount from the team&#039;s metal or energy resource.&lt;br /&gt;
&lt;br /&gt;
vs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{API &amp;lt;!-- Callin example --&amp;gt;&lt;br /&gt;
|prefix = addon &amp;lt;!-- May use gadget: instead? --&amp;gt;&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID&lt;br /&gt;
|arg3 = {{type|number}} oldTeam&lt;br /&gt;
|arg4 = {{type|number}} newTeam&lt;br /&gt;
|arg5 = {{type|bool}} capture&lt;br /&gt;
|return = {{type|bool}} allow &amp;lt;!-- note that this is a different entry than output above --&amp;gt;&lt;br /&gt;
|info = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{prefix|addon.}}{{name|AllowUnitTransfer}}{{var|1=({{type|number}} unitID, {{type|number}} unitDefID, {{type|number}} oldTeam, &lt;br /&gt;
{{type|number}} newTeam, {{type|bool}} capture)}}&lt;br /&gt;
&lt;br /&gt;
return: {{var|{{type|bool}} allow}}&lt;br /&gt;
&lt;br /&gt;
:Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
&lt;br /&gt;
= TODO: =&lt;br /&gt;
&lt;br /&gt;
==Major==&lt;br /&gt;
* [[:Category:ShowCase]] template, main page, S44 &amp;amp; MCL as examples&lt;br /&gt;
* [[:Category:Tutorial]]&lt;br /&gt;
* Continue to improve [[Lua:Callins]] - Fill in blank explanations&lt;br /&gt;
* Clickable / right-click copy paste-able anchors in &amp;lt;nowiki&amp;gt;{{tag}}&amp;lt;/nowiki&amp;gt; et al&lt;br /&gt;
* [[Assimp]] build upon, metadata doc, split tutorial again &amp;gt;_&amp;gt;&lt;br /&gt;
* Cleanup old [[:Category:Map_making]] into new [[:Category:Map Dev]]&lt;br /&gt;
&lt;br /&gt;
==Minor==&lt;br /&gt;
* Page on spring wiki etiquette ([[SpringWiki]]) / style guide &amp;amp; template usage ([[Mapdev:WikiGuide]]) /namespace conventions ([[Spring:PageNamingConventions]]) - pages are good already; put these in revamped community portal?&lt;br /&gt;
* Move all pages in [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation-&amp;amp;namespace=0 Animation-] to [http://springrts.com/mediawiki/index.php?title=Special%3APrefixIndex&amp;amp;prefix=Animation%3A&amp;amp;namespace=0 Animation:]&lt;br /&gt;
* Continue to improve [[Gamedev:Main]] up to the high standard of [[Mapdev:Main]]&lt;br /&gt;
&lt;br /&gt;
==Undocumented Features==&lt;br /&gt;
* cmdcolors.txt (c.f. {{forumlink|topic=7099|title=GUI modifications in SVN}})&lt;br /&gt;
* ctrlpanel.txt (c.f. as above)&lt;br /&gt;
* isolated mode (isolated.txt 99+ c.f. {{forumlink|topic=26359|title=portable/isolation mode}}, [http://springrts.com/dl/buildbot/default/master/99.0/manpages/spring.6.html Spring manpages])&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Libraries&amp;diff=11338</id>
		<title>Lua Libraries</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Libraries&amp;diff=11338"/>
		<updated>2017-12-26T12:56:47Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Single file libraries */ MCL vector library is extended from s44&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Lua libraries=&lt;br /&gt;
This page lists all common Lua libraries that can be used in Spring game and map archives.&lt;br /&gt;
&lt;br /&gt;
If you want to extend this page, please only add working, well-documented libraries and frameworks, and their official links.&lt;br /&gt;
It&#039;s possible to add early work, but try to make sure it has some documentation, and keep it in its separate repository.&lt;br /&gt;
&lt;br /&gt;
Libraries:&lt;br /&gt;
* [https://github.com/jk3064/chiliui ChiliUI]: UI framework [[Chili | docs]]&lt;br /&gt;
* [https://github.com/jk3064/lups LUPS]: Lua Particle System for Spring [[LUPS | docs]]&lt;br /&gt;
* [https://github.com/jk3064/Custom-Unit-Shader-Framework Custom Unit Shader Framework]: Unit rendering with shaders&lt;br /&gt;
* [https://github.com/gajop/liblobby LibLobby]: Spring Lobby protocol library&lt;br /&gt;
* [https://github.com/gajop/i18n i18n]: Translations library&lt;br /&gt;
* [https://github.com/gajop/Lua-Class-System LCS]: OOP (classes) in Lua&lt;br /&gt;
* [https://github.com/gajop/analytics analytics]: Usage analytics reporting [WIP]&lt;br /&gt;
* [https://github.com/gajop/chilifx ChiliFX]: Chili effects [WIP]&lt;br /&gt;
* [https://github.com/gajop/chotify Chotify]: Notification library in Chili [WIP]&lt;br /&gt;
&lt;br /&gt;
==Single file libraries==&lt;br /&gt;
There is also a number of single file libraries that don&#039;t have their own repository but can technically still be considered libraries.&lt;br /&gt;
&lt;br /&gt;
Library files:&lt;br /&gt;
* [https://github.com/SpringMCLegacy/SpringMCLegacy/blob/master/LuaRules/Gadgets/api_vector.lua Vector]: Small utility for vector operations&lt;br /&gt;
* [https://github.com/gajop/liblobby/blob/master/lobby/json.lua JSON]: Serializing to the JSON format&lt;br /&gt;
* [https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_delay.lua Delay]: Delaying gadget calls&lt;br /&gt;
* [https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/network.lua Network]: Delta compression for binary strings&lt;br /&gt;
* [https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/camera.lua Camera]: Camera state serialization&lt;br /&gt;
* Deferred rendering [http://imolarpg.dyndns.org/svn/branches/BAR/shaders/deferred_lighting.glsl Shader] &amp;amp; [http://imolarpg.dyndns.org/svn/branches/BAR/luaui/widgets/gfx_deferred_rendering.lua Widget]: Deferred rendering (projectile) based lights&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]] [[Category:Libraries]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11043</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11043"/>
		<updated>2017-12-26T12:24:19Z</updated>

		<summary type="html">&lt;p&gt;Flozi: category lua - &amp;gt; deprecated, use Lua:Callins instead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
==Engine Source==&lt;br /&gt;
If you can understand Lua code well and wish to get the most up to date info, you can refer to:&lt;br /&gt;
{{sourcelink|file=cont/base/springcontent/LuaGadgets/actions.lua}}, &lt;br /&gt;
{{sourcelink|file=cont/LuaUI/widgets.lua}} and &amp;lt;br&amp;gt;&lt;br /&gt;
{{sourcelink|file=cont/base/springcontent/LuaGadgets/gadgets.lua}} &amp;lt;br&amp;gt;&lt;br /&gt;
to see how widget/gadget call-ins are distributed, find call-in and widgetHandler function definitions, see how they are processed and what values should be returned from some call ins&lt;br /&gt;
(are these the only files?)&lt;br /&gt;
&lt;br /&gt;
==What is a callin anyway?==&lt;br /&gt;
Call-ins are calls from the engine, into the gadget or widget script. In other words, these functions are called when a particular &#039;&#039;event&#039;&#039; happens.&lt;br /&gt;
Some call-in functions can return values to the engine.&lt;br /&gt;
===Blocking events with return values===&lt;br /&gt;
The call-in functions named &#039;&#039;&#039;&#039;&#039;Allow&#039;&#039;&#039;&#039;&#039;XXX can block their event by returning &#039;&#039;false&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
For example &#039;&#039;AllowUnitTransfer()&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;return true&amp;lt;/code&amp;gt; = allow transfer &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;return false&amp;lt;/code&amp;gt; = deny transfer&lt;br /&gt;
&lt;br /&gt;
==Commands, general-purpose:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Initialize()&amp;lt;/font&amp;gt; --&amp;gt; none.&amp;lt;br&amp;gt;&lt;br /&gt;
called when widget/gadget gets (re-)loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Shutdown()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;PlayerChanged&amp;lt;/font&amp;gt; --&amp;gt; (playerID).&lt;br /&gt;
gadget/widget: Use this to check whether a player has become spectator for instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;LayoutButtons()&amp;lt;/font&amp;gt; --&amp;gt; unknown, please document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ConfigureLayout()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;command&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandNotify()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;id, params, options&amp;quot;, where id = the CommandID&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;KeyPress()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;key, mods, isRepeat&amp;quot;, where key = keymap, mods = SHIFT, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;KeyRelease()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;key&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseMove()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, dx, dy, button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MousePress()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, button&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;button parameter values: left - 1, middle - 2, right - 3&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{new|&amp;gt;96.0}} buttom param removed  {{Sourcelinkhash|4c104344e92256e33d79820e9012c5e1178e212b}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseRelease()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, button&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Please note that in order to have Spring call MouseRelease, you need to have a MousePress call-in in the same widget that returns true.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseWheel()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;up, value&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;IsAbove()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y&amp;quot; where x,y = screen coordinates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GetTooltip()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y&amp;quot; where x,y = screen coordinates.  Returns WorldTooltip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AddConsoleLine()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;msg, priority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MapDrawCmd()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;playerID, cmdType, px, py, pz, labeltext&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandFallback()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandsChanged()&amp;lt;/font&amp;gt; --&amp;gt; unknown (none?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitCreation()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitDefID, builderID, builderTeam, x, y, z, facing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitTransfer()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, oldTeam, newTeam, capture&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitBuildStep()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;builderID, builderTeam, unitID, unitDefID, part&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowFeatureCreation()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureDefID, teamID, x, y, z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowFeatureBuildStep()&amp;lt;/font&amp;gt; --&amp;gt; unknown, please document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowResourceLevel()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;teamID, res, level&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowResourceTransfer()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;teamID, res, level&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Update()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;dt&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;called every screenframe. dt is the time since the last screenframe&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DefaultCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;type,id&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;can return an [[Lua_CMDs|CMD]] to change cursor and command. {{forumlink|topic=26438|title=example usage}}&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID)   &amp;lt;/font&amp;gt; -&amp;gt; allowFpsControl&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;return true&#039;&#039; allows fps mode, &#039;&#039;return false&#039;&#039; blocks it.&lt;br /&gt;
&lt;br /&gt;
==Unit-Specific:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(prior to 94.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 94.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Can overwrite the taken damage by returning a new number value.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
As of 88.0 for both UnitDamaged and UnitPreDamaged:&lt;br /&gt;
     weaponDefID -1 --&amp;gt; debris collision&lt;br /&gt;
     weaponDefID -2 --&amp;gt; ground collision&lt;br /&gt;
     weaponDefID -3 --&amp;gt; object collision&lt;br /&gt;
     weaponDefID -4 --&amp;gt; fire damage&lt;br /&gt;
     weaponDefID -5 --&amp;gt; water damage&lt;br /&gt;
     weaponDefID -6 --&amp;gt; kill damage&lt;br /&gt;
     weaponDefID -7 --&amp;gt; crush damage&lt;br /&gt;
&lt;br /&gt;
As of 96.0 {Unit,Feature}{Pre}Damaged events receive the &#039;attacker&#039; ID when object is crushed&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitExperience()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, experience, oldExperience&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Spring.SetExperienceGrade must be called first to determine how often it is called&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCreated()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, builderID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitFinished()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitFromFactory()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, factID, factDefID, userOrders&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDestroyed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitTaken()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, newTeam&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit still belongs to old team&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitGiven()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, oldTeam&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit now belongs to new team&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitIdle()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams, cmdTag&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(cmdTag only available from version 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitSeismicPing()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, z, strength&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredRadar()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredLos()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftRadar()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftLos()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLoaded()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, transportID, transportTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitUnloaded()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, transportID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCloaked()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDecloaked)&amp;lt;/font&amp;gt;--&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitMoveFailed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for unitDefIDs registered via [[Lua_System#Synced|Script.SetWatchUnit]] since 85.0&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;StockpileChanged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredWater()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredAir()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftWater()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftAir()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ShieldPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitUnitCollision(colliderID, collideeID)&amp;lt;/font&amp;gt; -- needs SetWatchUnit enabled for both parties&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowWeaponTargetCheck(attackerID, attackerWeaponNum, attackerWeaponDefID)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]] since 92.0&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowWeaponTarget(attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defaultPriority)&amp;lt;/font&amp;gt; &lt;br /&gt;
 --&amp;gt; &amp;lt;code&amp;gt;return &amp;quot;targetAllowed, targetPriority&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;defaultPriority new in 89.0&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]] since 92.0&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawShield(number unitID, number weaponID)&amp;lt;/font&amp;gt; --&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;true&#039;&#039; (&amp;lt;-?) skips Spring&#039;s own drawing of shield &amp;lt;weaponID&amp;gt; owned by unit &amp;lt;unitID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring/spring/commit/7bbfd9464d4f74c12163ea0740c8c60d1ba978f1 maybe new in 86.0+]&lt;br /&gt;
&lt;br /&gt;
==Feature-Specific:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;FeatureCreated()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureID, allyTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;FeatureDestroyed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureID, allyTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;TerraformComplete()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCmdDone()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdTag, cmdParams, cmdOptions&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;cmdParams and cmdOptions are only available from version 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitFeatureCollision(colliderID, collideeID, crushKilled)&amp;lt;/font&amp;gt; -- needs SetWatchUnit for first and SetWatchFeature for second party&lt;br /&gt;
&lt;br /&gt;
{{new|95.0}} &amp;lt;font color=#55ee99&amp;gt;FeatureDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{new|95.0}} &amp;lt;font color=#55ee99&amp;gt;FeaturePreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;--&amp;gt; return newDamage, impulseMult (=0)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drawing:==&lt;br /&gt;
Inside these functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=#55ee99&amp;gt;DrawGenesis()&amp;lt;/font&amp;gt; --&amp;gt; none.  Don&#039;t render here.&lt;br /&gt;
&lt;br /&gt;
 Spring draws the sky, the map, some water types, and unit selection.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=#55ee99&amp;gt;DrawWorldPreUnit()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
 Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;font color=#55ee99&amp;gt;DrawWorld()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
 Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
&lt;br /&gt;
Each unit might also have a DrawUnit call, [[Lua_UnitRendering|enabled here.]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawUnit(unitID,DrawMode)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
With enum DrawMode {&amp;lt;br&amp;gt;&lt;br /&gt;
	notDrawing     = 0,&amp;lt;br&amp;gt;&lt;br /&gt;
	normalDraw     = 1,&amp;lt;br&amp;gt;&lt;br /&gt;
	shadowDraw     = 2,&amp;lt;br&amp;gt;&lt;br /&gt;
	reflectionDraw = 3,&amp;lt;br&amp;gt;&lt;br /&gt;
	refractionDraw = 4&amp;lt;br&amp;gt;&lt;br /&gt;
	};&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawFeature(featureID, DrawMode)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawShield(unitID, weaponID, DrawMode)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawProjectile(projectileID, DrawMode)&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawScreenEffects()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;vsx, vsy&amp;quot; where vsx, vsy are screen coords.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawScreen()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawInMiniMap()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;sx, sy&amp;quot; where sx,sy are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawWorldShadow()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawWorldReflection()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawWorldRefraction()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DrawLoadScreen()&amp;lt;/font&amp;gt; --&amp;gt; none. {{new|95.0}}&lt;br /&gt;
&lt;br /&gt;
Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
&lt;br /&gt;
==Game Events:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameID()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;gameID&amp;quot; {{new|89.0}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Explosion()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;weaponID, px, py, pz, ownerID&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via Script.SetWatchWeapon&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;return true to hide the weapon&#039;s CEG&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ShockFront()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;power, dx, dy, dz&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Not yet implemented!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameFrame()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;frameNum&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CobCallback()&amp;lt;/font&amp;gt; --&amp;gt; unknown, marked FIXME.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GroupChanged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;groupID&amp;quot; where groupID is the value of Group whose table value changed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;WorldTooltip()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;ttType, data1, data2, data3&amp;quot; special, should be documented in detail. &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Not yet implemented!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GamePreload()&amp;lt;/font&amp;gt;  --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameStart()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameProgress()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;serverFrameNum&amp;quot; ( called every 60 frames, calculating delta between GameFrame and GameProgress can give an ETA about catching up with simulation )&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Not yet implemented!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameOver()&amp;lt;/font&amp;gt; --&amp;gt;  &amp;quot;[ [1] = allyTeamID1, [2] = allyTeamID2, ... ]&amp;quot;,  a list of winning allyteams, if empty the game result was undecided ( like when dropping from an host )&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;   Will return nil in pre 0.83.x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;TeamDied()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;TeamID&amp;quot; where TeamID = the team that has been eliminated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowStartPosition()&amp;lt;/font&amp;gt; --&amp;gt; &lt;br /&gt;
   number clampedPos.x, number clampedPos.y, number clampedPos.z,&lt;br /&gt;
   number playerID,&lt;br /&gt;
   number readyState,&lt;br /&gt;
   number rawPickPos.x, number rawPickPos.y, number rawPickPos.z&lt;br /&gt;
&lt;br /&gt;
clampedPos = coordinates clamped into startbox, rawPickPos = where player tried to start&lt;br /&gt;
&lt;br /&gt;
{{New|95.0}} the default &#039;failed to choose&#039; start-position is now just (0,0,0), not (0,-500,0) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
readyState can be any one of:&lt;br /&gt;
    PLAYER_RDYSTATE_UPDATED = 0 -- player picked a position&lt;br /&gt;
    PLAYER_RDYSTATE_READIED = 1 -- player clicked ready&lt;br /&gt;
    PLAYER_RDYSTATE_FORCED = 2 -- game was force-started (player did not click ready)&lt;br /&gt;
    PLAYER_RDYSTATE_FAILED = 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GameSetup()&amp;lt;/font&amp;gt; --&amp;gt; string &amp;quot;state&amp;quot;, boolean &amp;quot;ready&amp;quot;, table &amp;quot;playerStates&amp;quot; &lt;br /&gt;
&amp;lt;br&amp;gt;return success, newReady&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GamePaused()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;playerID, paused&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;PlayerAdded()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;playerID&amp;quot; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;PlayerRemoved()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;playerID, reason&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==Projectiles:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ProjectileCreated()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;proID, proOwnerID, weaponDefID&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via Script.SetWatchWeapon&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ProjectileDestroyed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;proID&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via Script.SetWatchWeapon&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowWeaponInterceptTarget&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;number interceptorUnitID, number interceptorWeaponID, number targetProjectileID&amp;quot;&lt;br /&gt;
returns boolean&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for weaponDefIDs registered via Script.SetWatchWeapon&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Deprecated]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11122</id>
		<title>Lua Beginners FAQ</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11122"/>
		<updated>2017-12-26T12:18:15Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* What is the difference between LuaUI, LuaRules, widgets and gadgets? */ update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is an introduction to using Lua in Spring - it only tries to answer general questions, for more specific Questions please ask in the forum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Where should I start?==&lt;br /&gt;
&lt;br /&gt;
You can start by reading general Lua tutorials  [http://lua-users.org/wiki/LuaTutorial here]. &lt;br /&gt;
&lt;br /&gt;
After that, you could look at the example widget [[Lua:Tutorial_GettingStarted|here]], and try to add some functionality of your own!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re a pro, have a look at the game repos [https://springrts.com/wiki/Gamedev:PublicRepos here], especially their /luaui/Widgets and /luarules/gadgets dirs.&lt;br /&gt;
&lt;br /&gt;
==Where can I find help?==&lt;br /&gt;
&lt;br /&gt;
You can find documentation of Springs Lua API on the [[Lua_Scripting|Lua_Scripting]] page. Discussion of lua coding takes place on the [https://springrts.com/wiki/Read_Me_First lobby] in #moddev and #lua, and there is also a [https://springrts.com/phpbb/viewforum.php?f=23 Lua sub-forum].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How do I open &amp;quot;.lua&amp;quot; files?==&lt;br /&gt;
&lt;br /&gt;
Any text editor is enough. On Windows i.e. use [http://notepad-plus.sourceforge.net/uk/site.htm Notepad++]. There are also IDEs able to work with Lua, such as Eclipse, if you look for them.&lt;br /&gt;
&lt;br /&gt;
==What is a call-in? And a call-out?==&lt;br /&gt;
&lt;br /&gt;
Call-ins are functions defined in your script that Spring calls when a determined event takes place. For example, the widget:Initialize() call-in is run by Spring when the widget is loaded.&lt;br /&gt;
Call-outs are functions defined in Spring you can run at whichever moment you desire. For example, when you call Spring.GetUnitTeam(unitID), the engine returns the teamID of the unit identified by &amp;quot;unitID&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What is the difference between unsynced and synced lua code?==&lt;br /&gt;
&lt;br /&gt;
Synced code is code that runs, identically and at the same time, on every connected client. In practice, this means code which controls the game state. Unsynced code is code that will run differently (or maybe not at all) on each connected client. Typically, this means the user interface.&lt;br /&gt;
&lt;br /&gt;
For example, lua code to make units explode if they fell down a cliff would need to be synced. But, code that warned a player when one of their own units was getting near a cliff edge, would need to be unsynced.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What is the difference between LuaUI, LuaRules, widgets and gadgets?==&lt;br /&gt;
&lt;br /&gt;
Spring allows various [[Lua:Environments|Lua Environments]], each with differing functionality. Inside each Lua environment, developers can write addons, which are self-contained pieces of code. There are:&lt;br /&gt;
* &amp;lt;b&amp;gt;LuaUI&amp;lt;/b&amp;gt;: Used for unsynced GUI related code. Addons in here are often called widgets. Clients can (if the game permits it) control which widgets are running. Widgets contain only unsynced code. They can be bundled inside the game, or loaded from the users &amp;quot;Spring/LuaUI/Wigets&amp;quot; directory.&lt;br /&gt;
* &amp;lt;b&amp;gt;LuaRules&amp;lt;/b&amp;gt;: Addons in here are often called gadgets. Clients cannot choose which gadgets run. Gadgets can include both synced and unsynced code, and must be bundled inside the game.&lt;br /&gt;
&lt;br /&gt;
Intended for mappers, there is also LuaGaia, which behaves like LuaRules but is separated from it. To see which of the lua environoments has access to which data/functionality, see [[Lua:Environments#Interfaces]] and [[Lua:Callins]].&lt;br /&gt;
&lt;br /&gt;
==What can&#039;t Lua do in the current version of Spring?==&lt;br /&gt;
&lt;br /&gt;
Springs Lua interface is very powerful. To work out if some idea is possible you need to ask &lt;br /&gt;
* When do I need the engine to tell me something has happened? Check against [[Lua:Callins|Callins]].&lt;br /&gt;
* What information will I need to know about the game state? Check against [[Lua_SyncedRead]] (synced) and [[Lua_UnsyncedRead]] (unsynced).&lt;br /&gt;
* What do I then need to do about it? Check against [[Lua_SyncedCtrl]] (synced) and[[Lua_UnsyncedCtrl]] (unsynced).&lt;br /&gt;
Sometimes you need special functionality, like disk access or OpenGL calls, in which case check against [[Lua_Scripting#Interfaces|Interfaces]].&lt;br /&gt;
&lt;br /&gt;
For completeness, some examples of things you (currently) can&#039;t do:&lt;br /&gt;
*control the ground LOS - but you can set the los status of units!&lt;br /&gt;
*add custom parameters to CEG definitions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Where can I find/edit examples?==&lt;br /&gt;
&lt;br /&gt;
You can find some easy example widgets [[Lua:Tutorial_GettingStarted|here]]. The best source of more complicated examples is inside games themselves, in the LuaUI/Widgets and Luarules/gadgets directories. See [[Gamedev:PublicRepos]] for a list of repositories. &lt;br /&gt;
&lt;br /&gt;
To make your own widgets, simply place individual .lua files into your Spring/LuaUI/Widgets dir (create the dir if it is not present. Case-sensitive!!!). Game repositories can be checked out into a folder named &amp;quot;SomeAwesomeGame.sdd&amp;quot;, placed in your &amp;quot;/Spring/games&amp;quot; dir; this shoudl give a local copy of the game, recognized by Spring, where you can edit files. Make sure to check the licenses before doing this!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Can I reload a script without restarting Spring?==&lt;br /&gt;
&lt;br /&gt;
Yes, you can type &amp;quot;/luaui reload&amp;quot; to reload widgets, and if you have &amp;quot;cheats&amp;quot; enabled you can also &amp;quot;/luarules reload&amp;quot; to reload gadgets.&lt;br /&gt;
&lt;br /&gt;
==Why does the print function seem to do nothing?==&lt;br /&gt;
&lt;br /&gt;
Its output is displayed in stdout. If you have no easy way to see it, you can Spring.Echo(&amp;quot;some text&amp;quot;) which prints to the ingame chat and infolog.txt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GadgetDatabase&amp;diff=7827</id>
		<title>GadgetDatabase</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GadgetDatabase&amp;diff=7827"/>
		<updated>2017-12-26T12:11:18Z</updated>

		<summary type="html">&lt;p&gt;Flozi: Category lua -&amp;gt; historical, never went anywhere (flawed concept imo)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[b]Some Logistics thoughts:[/b]&lt;br /&gt;
&lt;br /&gt;
There&#039;s already been some worthy gadgets suggested for inclusion (on the thread this idea was discussed). And of course I&#039;d like to see them online! While it wouldn&#039;t be too great an effort for me to upload them, for two reasons, I&#039;d prefer not too: &lt;br /&gt;
&lt;br /&gt;
- First, if we get even a fraction of the potential general use gadgets that are out there onto the database, that&#039;d be a considerable workload for me to shoulder alone. &lt;br /&gt;
- Second (and perhaps more importantly), a good number of them will continue to be improved or kept up to date - and would thus be outdated pretty soon on the database, if the authors can&#039;t easily update it themselves.&lt;br /&gt;
&lt;br /&gt;
For the second reason, I&#039;d also be happy to set up shared accounts for game development groups (since you can only edit gadgets you&#039;ve uploaded with your account, and there&#039;s no way of allowing other accounts edit-powers).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the Gadget-DB builds on the great system made for the Widget-Database, if you&#039;ve ever used the Browser-based interface of that ([url=http://www.springinfo.info/?page_id=690]as seen on Springinfo[/url]) - this is the same. Accordingly, if you happen to have managed Widgets, the system is the same here :) !&lt;br /&gt;
&lt;br /&gt;
some technicalities/suggestions regarding documentation of Gadgets you upload and such&lt;br /&gt;
Finally, the technicalities (I&#039;m wondering if there&#039;d be a better place for this info - maybe wiki ?):&lt;br /&gt;
&lt;br /&gt;
And/or have a look at the docu I included with [url=http://gadgetdb.springrts.de/lua_manager.php?m=10&amp;amp;id=356]the KeyboardSteering Gadget[/url]&lt;br /&gt;
&lt;br /&gt;
[b]&amp;quot;Modules&amp;quot;[/b] - As pointed out repeatedly, a lot of gadgets actually require multiple files, and potentially entries in unitdefs (or whatnot) to work properly. Thanks to the setup vbs has made though, it is trivial to upload multiple files and specify different places for them to go different :).&lt;br /&gt;
&lt;br /&gt;
I would suggest that where eg unitdefs are required. I realise anyone more savvy with lua will not require this per se - I think with a little extra effort though, we can keep the database accessible to people with little grasp of lua.&lt;br /&gt;
&lt;br /&gt;
In that vein, the following also seem a pretty much &amp;quot;must-have&amp;quot; to me:&lt;br /&gt;
As well as including an &amp;quot;Api&amp;quot; text file explaining how the gadget interfaces with the rest of Spring:&lt;br /&gt;
- ie what unitdefs it needs;&lt;br /&gt;
- any &amp;quot;calls&amp;quot; it requires (ie global vars be set) from non-generalisable seperate gadgets;&lt;br /&gt;
Or to pick up your example:&lt;br /&gt;
- what info it passes on to GUI elements;&lt;br /&gt;
- CMDs it depends on being given, etc.&lt;br /&gt;
&lt;br /&gt;
Finally, I&#039;d suggest some categories (if you want to categorise that is - as of now there&#039;s no functionality, since it&#039;s made with SpringDownloader in mind).&lt;br /&gt;
&lt;br /&gt;
UI, (GUI), Map, Unitbehaviour, Unitdefs, Unitvars, Antihack,&lt;br /&gt;
(I&#039;m sure there&#039;s some more that might be added.)&lt;br /&gt;
&lt;br /&gt;
[[Category: Historical]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10820</id>
		<title>Lua:Environments</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10820"/>
		<updated>2017-12-26T01:31:27Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Environments */ underp links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Environments ==&lt;br /&gt;
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.&lt;br /&gt;
=== LuaMenu === &lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaMenu.cpp}}&lt;br /&gt;
&lt;br /&gt;
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.&lt;br /&gt;
=== LuaParser ===&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaParser.cpp}}&lt;br /&gt;
&lt;br /&gt;
Minimal environment used to parse and load definition files.&lt;br /&gt;
=== LuaIntro === &lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaIntro.cpp}}&lt;br /&gt;
&lt;br /&gt;
Introduced in 95.0, to allow visual customisation of the loading process.&lt;br /&gt;
=== LuaRules (synced) ===&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaHandle.cpp}}&lt;br /&gt;
&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaHandleSynced.cpp#L305}}&lt;br /&gt;
&lt;br /&gt;
The main environment for synced game-controlling mechanics (&amp;quot;gadgets&amp;quot;).&lt;br /&gt;
=== LuaRules (unsynced) ===&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaHandle.cpp}}&lt;br /&gt;
&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaHandleSynced.cpp#L57}}&lt;br /&gt;
&lt;br /&gt;
The main environment for unsynced game effects, rendering, UI etc. (&amp;quot;gadgets&amp;quot;)&lt;br /&gt;
=== LuaGaia (synced) ===&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaGaia.cpp}}&lt;br /&gt;
&lt;br /&gt;
As LuaRules (synced) but for maps.&lt;br /&gt;
=== LuaGaia (unsynced) ===&lt;br /&gt;
Source: {{sourcelink|file=rts/Lua/LuaGaia.cpp}}&lt;br /&gt;
&lt;br /&gt;
As LuaRules (unsynced) but for maps.&lt;br /&gt;
=== LuaUI ===&lt;br /&gt;
The main environment for toggleable UI elements and controls (&amp;quot;widgets&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Interfaces == &lt;br /&gt;
The following table demonstrates which interfaces are available to each environment.&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaMenu&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaIntro&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaParser&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(synced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(unsynced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaUI&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGame]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstEngine]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstPlatform]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_WeaponDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FeatureDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstCOB]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_CMDs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +**&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MoveCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_PathFinder]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_OpenGL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_GLSL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FBO_and_RBO]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitRendering ]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Fonts]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGL]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_VFS]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +*&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Scream]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_BitOps]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MathExtra]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Socket]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | *&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| only VFS.ZIP_ONLY&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | **&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| with special LOS handling and decoy unit handling&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | ***&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| stripped down environment with certain functions removed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Talk:Lua_Scripting&amp;diff=20260</id>
		<title>Talk:Lua Scripting</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Talk:Lua_Scripting&amp;diff=20260"/>
		<updated>2017-12-26T00:21:05Z</updated>

		<summary type="html">&lt;p&gt;Flozi: Flozi moved page Talk:Lua Scripting to Talk:Lua:Main: consistency with Gamedev:Main and MapDev:Main and leaving redirect anyway&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Lua:Main]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Scripting&amp;diff=11580</id>
		<title>Lua Scripting</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Scripting&amp;diff=11580"/>
		<updated>2017-12-26T00:21:05Z</updated>

		<summary type="html">&lt;p&gt;Flozi: Flozi moved page Lua Scripting to Lua:Main: consistency with Gamedev:Main and MapDev:Main and leaving redirect anyway&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Lua:Main]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10909</id>
		<title>Lua:Main</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10909"/>
		<updated>2017-12-26T00:21:05Z</updated>

		<summary type="html">&lt;p&gt;Flozi: Flozi moved page Lua Scripting to Lua:Main: consistency with Gamedev:Main and MapDev:Main and leaving redirect anyway&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Lua FAQ=&lt;br /&gt;
Lua scripting is the primary way for developers to customize their games and add new features. Most aspects of the Spring engine can be controlled and extensively modified through the Lua API.&lt;br /&gt;
&lt;br /&gt;
[[Lua_Beginners_FAQ|Introduction to Lua in Spring]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Lua:Tutorial_GettingStarted|Easy widget examples]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces {{HeaderNotice|(last update: 104)}}=&lt;br /&gt;
[[Lua:Environments]] (Details the available environments and shows which interfaces are loaded by each)&lt;br /&gt;
&lt;br /&gt;
[[Lua:Callins]] (Entry points to lua addons)&lt;br /&gt;
{{LuaInterfaces}}&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[Lua:Tutorial_GettingStarted|Easy example widgets]]&lt;br /&gt;
* [[LuaTutorials::InterCommunications]] (i.e. synced &amp;lt;-&amp;gt; unsynced communications)&lt;br /&gt;
&lt;br /&gt;
=Other useful information=&lt;br /&gt;
* [[Lua_Libraries | Lua libraries]]&lt;br /&gt;
* [[Lua_Performance | Lua performance tips]]&lt;br /&gt;
* [http://springrts.com/wiki/COB_Constants#Custom_Variables COB Custom Variables]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?f=12&amp;amp;t=19560 Font Drawing System]&lt;br /&gt;
* [[UI_commands]]&lt;br /&gt;
* [[Animation-LuaScripting | Unit animation scripting with Lua]]&lt;br /&gt;
&lt;br /&gt;
=Official Lua documentation=&lt;br /&gt;
[http://www.lua.org/pil/ &#039;Programming in Lua&#039; book online]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.lua.org/manual/5.1/ Lua 5.1 Reference manual]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://lua-users.org/wiki/TutorialDirectory Lua tutorials]&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Sourcelink&amp;diff=23083</id>
		<title>Template:Sourcelink</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Sourcelink&amp;diff=23083"/>
		<updated>2017-12-25T22:59:35Z</updated>

		<summary type="html">&lt;p&gt;Flozi: usage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
A small template to link to an engine source file on github.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;nowiki&amp;gt;{{sourcelink|file=path/to/file.cpp}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;[https://github.com/spring/spring/blob/{{EngineVersion:Stable}}/{{{file|}}} {{{file|}}}] &amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10819</id>
		<title>Lua:Environments</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10819"/>
		<updated>2017-12-25T22:46:48Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Environments */ some source links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Environments ==&lt;br /&gt;
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.&lt;br /&gt;
=== LuaMenu === &lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaMenu.cpp}}&lt;br /&gt;
&lt;br /&gt;
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.&lt;br /&gt;
=== LuaParser ===&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaParser.cpp}}&lt;br /&gt;
&lt;br /&gt;
Minimal environment used to parse and load definition files.&lt;br /&gt;
=== LuaIntro === &lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaIntro.cpp}}&lt;br /&gt;
&lt;br /&gt;
Introduced in 95.0, to allow visual customisation of the loading process.&lt;br /&gt;
=== LuaRules (synced) ===&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaHandle.cpp}}&lt;br /&gt;
&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaHandleSynced.cpp}}&lt;br /&gt;
&lt;br /&gt;
The main environment for synced game-controlling mechanics (&amp;quot;gadgets&amp;quot;).&lt;br /&gt;
=== LuaRules (unsynced) ===&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaHandle.cpp}}&lt;br /&gt;
&lt;br /&gt;
The main environment for unsynced game effects, rendering, UI etc. (&amp;quot;gadgets&amp;quot;)&lt;br /&gt;
=== LuaGaia (synced) ===&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaGaia.cpp}}&lt;br /&gt;
&lt;br /&gt;
As LuaRules (synced) but for maps.&lt;br /&gt;
=== LuaGaia (unsynced) ===&lt;br /&gt;
Source: {{sourcelink|file=Lua/LuaGaia.cpp}}&lt;br /&gt;
&lt;br /&gt;
As LuaRules (unsynced) but for maps.&lt;br /&gt;
=== LuaUI ===&lt;br /&gt;
The main environment for toggleable UI elements and controls (&amp;quot;widgets&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Interfaces == &lt;br /&gt;
The following table demonstrates which interfaces are available to each environment.&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaMenu&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaIntro&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaParser&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(synced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(unsynced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaUI&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGame]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstEngine]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstPlatform]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_WeaponDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FeatureDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstCOB]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_CMDs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +**&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MoveCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_PathFinder]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_OpenGL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_GLSL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FBO_and_RBO]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitRendering ]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Fonts]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGL]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_VFS]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +*&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Scream]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_BitOps]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MathExtra]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Socket]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | *&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| only VFS.ZIP_ONLY&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | **&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| with special LOS handling and decoy unit handling&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | ***&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| stripped down environment with certain functions removed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10908</id>
		<title>Lua:Main</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10908"/>
		<updated>2017-12-25T21:21:58Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Interfaces {{HeaderNotice|(last update: 101)}} */  -&amp;gt; 104&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Lua FAQ=&lt;br /&gt;
Lua scripting is the primary way for developers to customize their games and add new features. Most aspects of the Spring engine can be controlled and extensively modified through the Lua API.&lt;br /&gt;
&lt;br /&gt;
[[Lua_Beginners_FAQ|Introduction to Lua in Spring]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Lua:Tutorial_GettingStarted|Easy widget examples]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces {{HeaderNotice|(last update: 104)}}=&lt;br /&gt;
[[Lua:Environments]] (Details the available environments and shows which interfaces are loaded by each)&lt;br /&gt;
&lt;br /&gt;
[[Lua:Callins]] (Entry points to lua addons)&lt;br /&gt;
{{LuaInterfaces}}&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[Lua:Tutorial_GettingStarted|Easy example widgets]]&lt;br /&gt;
* [[LuaTutorials::InterCommunications]] (i.e. synced &amp;lt;-&amp;gt; unsynced communications)&lt;br /&gt;
&lt;br /&gt;
=Other useful information=&lt;br /&gt;
* [[Lua_Libraries | Lua libraries]]&lt;br /&gt;
* [[Lua_Performance | Lua performance tips]]&lt;br /&gt;
* [http://springrts.com/wiki/COB_Constants#Custom_Variables COB Custom Variables]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?f=12&amp;amp;t=19560 Font Drawing System]&lt;br /&gt;
* [[UI_commands]]&lt;br /&gt;
* [[Animation-LuaScripting | Unit animation scripting with Lua]]&lt;br /&gt;
&lt;br /&gt;
=Official Lua documentation=&lt;br /&gt;
[http://www.lua.org/pil/ &#039;Programming in Lua&#039; book online]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.lua.org/manual/5.1/ Lua 5.1 Reference manual]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://lua-users.org/wiki/TutorialDirectory Lua tutorials]&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10817</id>
		<title>Lua:Environments</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Environments&amp;diff=10817"/>
		<updated>2017-12-22T16:33:23Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Interfaces */ add LuaIntro, LuaParser&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Environments ==&lt;br /&gt;
Here is an exhaustive list of the different lua environments within Spring, roughly in execution order as a game is loaded.&lt;br /&gt;
=== LuaMenu === &lt;br /&gt;
Introduced in 104.0, a stripped down environment that starts before the game is loaded and persists through reload.&lt;br /&gt;
=== LuaParser ===&lt;br /&gt;
Minimal environment used to parse and load definition files.&lt;br /&gt;
=== LuaIntro === &lt;br /&gt;
Introduced in 95.0, to allow visual customisation of the loading process.&lt;br /&gt;
=== LuaRules (synced) ===&lt;br /&gt;
The main environment for synced game-controlling mechanics (&amp;quot;gadgets&amp;quot;).&lt;br /&gt;
=== LuaRules (unsynced) ===&lt;br /&gt;
The main environment for unsynced game effects, rendering, UI etc. (&amp;quot;gadgets&amp;quot;)&lt;br /&gt;
=== LuaGaia (synced) ===&lt;br /&gt;
As LuaRules (synced) but for maps.&lt;br /&gt;
=== LuaGaia (unsynced) ===&lt;br /&gt;
As LuaRules (unsynced) but for maps.&lt;br /&gt;
=== LuaUI ===&lt;br /&gt;
The main environment for toggleable UI elements and controls (&amp;quot;widgets&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Interfaces == &lt;br /&gt;
The following table demonstrates which interfaces are available to each environment.&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaMenu&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaIntro&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaParser&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(synced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaRules/Gaia&amp;lt;br&amp;gt;&amp;lt;font style=&amp;quot;font-size:80%&amp;quot;&amp;gt;(unsynced)&amp;lt;/font&amp;gt;&lt;br /&gt;
! align=&amp;quot;center&amp;quot; | LuaUI&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGame]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstEngine]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstPlatform]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_WeaponDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FeatureDefs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstCOB]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_CMDs]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnsyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedRead]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +**&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_SyncedCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MoveCtrl]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_PathFinder]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_OpenGL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_GLSL_Api]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +***&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_FBO_and_RBO]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_UnitRendering ]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Fonts]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_ConstGL]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_VFS]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#888800&amp;quot; | +*&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Scream]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_BitOps]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_MathExtra]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;left&amp;quot;  | [[Lua_Socket]]&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#772222&amp;quot; | -&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  bgcolor=&amp;quot;#227722&amp;quot; | +&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;4&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em; border: 1px #aaa solid; border-collapse: collapse;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | *&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| only VFS.ZIP_ONLY&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | **&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| with special LOS handling and decoy unit handling&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | ***&lt;br /&gt;
| align=&amp;quot;left&amp;quot;| stripped down environment with certain functions removed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10907</id>
		<title>Lua:Main</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Main&amp;diff=10907"/>
		<updated>2017-12-22T15:27:50Z</updated>

		<summary type="html">&lt;p&gt;Flozi: /* Interfaces {{HeaderNotice|(last update: 101)}} */ update links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Lua FAQ=&lt;br /&gt;
Lua scripting is the primary way for developers to customize their games and add new features. Most aspects of the Spring engine can be controlled and extensively modified through the Lua API.&lt;br /&gt;
&lt;br /&gt;
[[Lua_Beginners_FAQ|Introduction to Lua in Spring]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Lua:Tutorial_GettingStarted|Easy widget examples]]&lt;br /&gt;
&lt;br /&gt;
=Interfaces {{HeaderNotice|(last update: 101)}}=&lt;br /&gt;
[[Lua:Environments]] (Details the available environments and shows which interfaces are loaded by each)&lt;br /&gt;
&lt;br /&gt;
[[Lua:Callins]] (Entry points to lua addons)&lt;br /&gt;
{{LuaInterfaces}}&lt;br /&gt;
&lt;br /&gt;
=Tutorials=&lt;br /&gt;
* [[Lua:Tutorial_GettingStarted|Easy example widgets]]&lt;br /&gt;
* [[LuaTutorials::InterCommunications]] (i.e. synced &amp;lt;-&amp;gt; unsynced communications)&lt;br /&gt;
&lt;br /&gt;
=Other useful information=&lt;br /&gt;
* [[Lua_Libraries | Lua libraries]]&lt;br /&gt;
* [[Lua_Performance | Lua performance tips]]&lt;br /&gt;
* [http://springrts.com/wiki/COB_Constants#Custom_Variables COB Custom Variables]&lt;br /&gt;
* [http://springrts.com/phpbb/viewtopic.php?f=12&amp;amp;t=19560 Font Drawing System]&lt;br /&gt;
* [[UI_commands]]&lt;br /&gt;
* [[Animation-LuaScripting | Unit animation scripting with Lua]]&lt;br /&gt;
&lt;br /&gt;
=Official Lua documentation=&lt;br /&gt;
[http://www.lua.org/pil/ &#039;Programming in Lua&#039; book online]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.lua.org/manual/5.1/ Lua 5.1 Reference manual]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://lua-users.org/wiki/TutorialDirectory Lua tutorials]&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Flozi</name></author>
	</entry>
</feed>