<?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=Maddox</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=Maddox"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Maddox"/>
	<updated>2026-11-08T17:24:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Example_Hello_World&amp;diff=4184</id>
		<title>Chili:Example Hello World</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Example_Hello_World&amp;diff=4184"/>
		<updated>2024-06-17T16:08:44Z</updated>

		<summary type="html">&lt;p&gt;Maddox: /* Chili Hello World */ Syntaxhighlight was failing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Chili Hello World ==&lt;br /&gt;
&lt;br /&gt;
This is the &#039;Hello World&#039; example of a Chili widget, to accompany the [[Chili:Tutorial|Chili Tutorial]].&lt;br /&gt;
&lt;br /&gt;
function widget:GetInfo()&lt;br /&gt;
  return {&lt;br /&gt;
    name    = &amp;quot;Chili Hello World&amp;quot;,&lt;br /&gt;
    desc    = &amp;quot;&amp;quot;,&lt;br /&gt;
    author  = &amp;quot;&amp;quot;,&lt;br /&gt;
    date    = &amp;quot;&amp;quot;,&lt;br /&gt;
    license = &amp;quot;GNU GPL v2&amp;quot;,&lt;br /&gt;
    layer   = 0,&lt;br /&gt;
    enabled = true&lt;br /&gt;
  }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local Chili, Screen0&lt;br /&gt;
 &lt;br /&gt;
local helloWorldWindow&lt;br /&gt;
local helloWorldLabel&lt;br /&gt;
 &lt;br /&gt;
function widget:Initialize()	&lt;br /&gt;
  if (not WG.Chili) then&lt;br /&gt;
    -- don&#039;t run if we can&#039;t find Chili&lt;br /&gt;
    widgetHandler:RemoveWidget()&lt;br /&gt;
    return&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  -- Get ready to use Chili&lt;br /&gt;
  Chili = WG.Chili&lt;br /&gt;
  Screen0 = Chili.Screen0&lt;br /&gt;
&lt;br /&gt;
  -- Create the window&lt;br /&gt;
  helloWorldWindow = Chili.Window:New{&lt;br /&gt;
    parent = Screen0,&lt;br /&gt;
    x = &#039;40%&#039;,&lt;br /&gt;
    y = &#039;40%&#039;,&lt;br /&gt;
    width  = &#039;20%&#039;,&lt;br /&gt;
    height = &#039;20%&#039;,	&lt;br /&gt;
  }	&lt;br /&gt;
&lt;br /&gt;
  -- Create some text inside the window&lt;br /&gt;
  helloWorldLabel = Chili.Label:New{&lt;br /&gt;
    parent = helloWorldWindow,&lt;br /&gt;
    width  = &#039;100%&#039;,&lt;br /&gt;
    height = &#039;100%&#039;,&lt;br /&gt;
    caption = &amp;quot;Hello world&amp;quot;,&lt;br /&gt;
  }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
[[Category:Libraries]][[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:PublicRepos&amp;diff=8363</id>
		<title>Gamedev:PublicRepos</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:PublicRepos&amp;diff=8363"/>
		<updated>2022-07-21T18:01:42Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added TAP github to the list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What Is This?==&lt;br /&gt;
This is a small collection of publicly known and readable code repositories for established Spring games. The intention being to provide a wealth of examples to all game developers from noob to pro.&lt;br /&gt;
&lt;br /&gt;
Most of these repositories can be downloaded with one of the [[Rapid_Tags]].&lt;br /&gt;
&lt;br /&gt;
== Known Repos ==&lt;br /&gt;
[https://github.com/KingRaptor/air-raid-spring Air Raid]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/balanced-annihilation Balanced Annihilation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring-archive/basically-ota BOTA]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring-archive/conflictterra Conflict Terra]&lt;br /&gt;
&lt;br /&gt;
[http://www.petro.darkstars.co.uk/damned/ Damned]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/EvolutionRTS/Evolution-RTS Evolution RTS]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SpringCabal/Gravitas Gravitas]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/imperialwinter/swiw.sdd Imperial Winter]&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/PicassoCT/journeywar Journeywar]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/PicassoCT/MOSAIC MOSAIC]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jk3064?tab=repositories jK]&lt;br /&gt;
* [[Chili]]&lt;br /&gt;
* [[LUPS]]&lt;br /&gt;
* Custom-Unit-Shader-Framework&lt;br /&gt;
* [[Mapdev:Main#Blueprint | Map-Blueprint]]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/David-Becker/mods KDR_11k] &lt;br /&gt;
* Cuberors&#039; Finest&lt;br /&gt;
* CvC&lt;br /&gt;
* Doserz&lt;br /&gt;
* Fibre&lt;br /&gt;
* GINTA&lt;br /&gt;
* Gun Wings Test&lt;br /&gt;
* Light Side of Spring&lt;br /&gt;
* MicroModules&lt;br /&gt;
* Pong&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SpringMCLegacy/SpringMCLegacy MechCommander: Legacy]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring1944/spring1944 Spring: 1944]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring-archive/springtanks Spring Tanks]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/spring-archive/springtutorialgame.sdd/ Spring Tutorial Game]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/n3wm1nd/TA Tech Annihilation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/fluidplay/TAP Total Atomic Power - TAP]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/KingRaptor/THIS THIS]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/xta-springrts/ XTA]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/ZeroK-RTS/Zero-K/ Zero-K]&lt;br /&gt;
&lt;br /&gt;
[[Category:Game Dev]]&lt;br /&gt;
[[Category:Download Systems]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Movedefs.lua&amp;diff=14822</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=14822"/>
		<updated>2022-07-06T19:51:16Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Fixed comment about hover class: canHover was removed in 95.0&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.&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11051</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11051"/>
		<updated>2022-05-24T19:52:46Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added params and description to AllowFeatureBuildStep&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;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Synced only.&amp;lt;/font&amp;gt;&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; &amp;quot;builderID, builderTeam, featureID, featureDefID, part&amp;quot;&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Called just before a feature updates its build percentage. Returns a bool to allow the change.&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit started being built (it&#039;s in wireframe mode)&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;No commands in this unit&#039;s queue. Beware, might be fired while &#039;guarding&#039;.&amp;lt;/font&amp;gt;&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, shieldEmitterWeaponNum, shieldCarrierUnitID, boolBounceProjectile, beamEmitterWaponNumber, beamCarrierUnitID, startx, starty, startz, hitx, hity, hitz&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;
FIXME: apparently the above is incorrect and parameters are AllowStartPosition(playerID, teamID, readyState, cx, cy, cz, rx, ry, rz)&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10813</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10813"/>
		<updated>2022-05-24T19:48:50Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Fix to the AllowFeatureBuildStep description, added description for &amp;quot;part&amp;quot; with a numerical example (provided by Sprung)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame (including when the game is paused) and at least once per sim frame except when catching up. The parameter is the time since the last update. }}&lt;br /&gt;
&lt;br /&gt;
=== Draw* Functions ===&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Avoid doing heavy calculations inside these callins; ideally, do the calculations elsewhere and use Draw callins only for drawing.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitHarvestStorageFull&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit&#039;s harvestStorage is full (according to its unitDef&#039;s entry).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam. Its called after the unit is in LOS, so you can query that unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam. For widgets, this one is called just before the unit leaves los, so you can still get the position of a unit that left los. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam. Also called when a unit enters LOS without any radar coverage. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam. Also called when a unit leaves LOS without any radar coverage. For widgets, this is called just after a unit leaves radar coverage, so widgets cannot get the position of units that left their radar. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature changes its build percentage, the boolean return value determines whether or not the change is permitted. Note that this is also called for resurrecting features, and for refilling features with resources before resurrection. On reclaim the part values are negative, and on refill and ressurect they are positive. Part is the percentage the feature be built or reclaimed per frame. Eg. for a 30 workertime builder, that&#039;s a build power of 1 per frame. For a 50 buildtime feature reclaimed by this builder, part will be 100/-50(/1) = -2%, or -0.02 numerically.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]] or [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaUIMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_sync_to_unsync&amp;diff=12546</id>
		<title>Lua sync to unsync</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_sync_to_unsync&amp;diff=12546"/>
		<updated>2022-03-05T04:37:33Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added link to jK&amp;#039;s thread with further info on the matter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Synced -&amp;gt; Unsynced Communication =&lt;br /&gt;
&lt;br /&gt;
==Using SendToUnsynced==&lt;br /&gt;
Currently, the recommended way is to use the SendToUnsynced call-in to send an event to the unsynced portion of a gadget. It&#039;s also possible to send an event from a gadget to a Widget. First, you send an &#039;internal event&#039; from synced to unsynced space, within the gadget, then you can create an event which may be subscribed to by any widget. Follows an image showcasing that flow and working/tested code:&lt;br /&gt;
&lt;br /&gt;
[[File:Sync unsync comm.png|670px]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
https://pastebin.com/b1eVWn1d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;Bear in mind that only one widget can hook to one LuaUI event at once, trying to listen to it in multiple widgets will lead to erratic behavior. Workaround here would be firing multiple LuaUI events, one for each consuming widget.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;The first parameter in the event handler (in the example, it&#039;s named &#039;cmd&#039; in HandleCommCountEvent) is rarely used. It holds the name of the synced event, so you know what synced event fired the function, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local function func(str)&lt;br /&gt;
    if str == &amp;quot;abcd&amp;quot; then&lt;br /&gt;
        -- do something&lt;br /&gt;
    elseif str == &amp;quot;efgh&amp;quot;&lt;br /&gt;
        -- do another thing&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
gadgetHandler:AddSyncAction(&amp;quot;abcd&amp;quot;, func)&lt;br /&gt;
gadgetHandler:AddSyncAction(&amp;quot;efgh&amp;quot;, func)&lt;br /&gt;
&lt;br /&gt;
SendToUnsynced(&amp;quot;abcd&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Futher reading in the following forum thread: &lt;br /&gt;
https://springrts.com/phpbb/viewtopic.php?t&amp;amp;t=11408&lt;br /&gt;
&lt;br /&gt;
==Using globals (96.0 and previous) ==&lt;br /&gt;
When making a gadget you will sometimes want to combine synced and unsynced code.&lt;br /&gt;
&lt;br /&gt;
For example if you do some things with units, that code will need to be synced.&lt;br /&gt;
&lt;br /&gt;
The UnitDestroyed, UnitFinished etc. callins can only be called in synced code. Using them inside unsynced code is not going to work.&lt;br /&gt;
&lt;br /&gt;
If you want to draw on the screen (for example to mark units) then the drawing will have to happen in unsynced code.&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates how to change the value inside the synced block of code and read the value in the unsynced block of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (gadgetHandler:IsSyncedCode()) then&lt;br /&gt;
   --SYNCED CODE&lt;br /&gt;
   local number = 10               -- declaring local variable &#039;number&#039;&lt;br /&gt;
   function gadget:SomeSyncedCallin(...)&lt;br /&gt;
      number=number+1              -- increment variable&#039;s value by one&lt;br /&gt;
      _G.number=number             -- save the new value into a global variable&lt;br /&gt;
   end&lt;br /&gt;
else&lt;br /&gt;
   --UNSYNCED CODE&lt;br /&gt;
   function gadget:SomeUnsyncedCallin(...)&lt;br /&gt;
      Spring.Echo(SYNCED.number)   -- print the global variable&#039;s value on screen&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 97.0+ ==&lt;br /&gt;
As of 97.0 unsynced gets most of the [[Lua:Callins|callins]] available to synced (excepting those which control synced actions e.g. AllowUnitCreation etc) which means that forwarding data from synced to unsynced is now not always required. Additionally in 97.0 there were changes to the behaviour of the &amp;lt;code&amp;gt;SYNCED&amp;lt;/code&amp;gt; table described above.&lt;br /&gt;
&lt;br /&gt;
Change 1: &amp;lt;code&amp;gt;SYNCED&amp;lt;/code&amp;gt; does a copy on access now and so is slow:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Bad:    &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for i=1,100 do ... SYNCED.foo[i] ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Good:   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local foo = SYNCED.foo; for i=1,100 do ... foo[i] ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 2: &amp;lt;code&amp;gt;SYNCED.&amp;lt;/code&amp;gt; can&#039;t be localized in global scope anymore:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Bad:    &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local foo = SYNCED.foo;    function gadget:DrawWorld() ... foo ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Good:   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function gadget:DrawWorld() local foo = SYNCED.foo; ... foo ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Here is a (older) description by quantum:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[LCC]quantum[0K] every time there  is a new target, i send &amp;quot;addTarget&amp;quot; and its number to unsynced&lt;br /&gt;
[LCC]quantum[0K] when a target is removed from the list, i send &amp;quot;removeTarget&amp;quot; and its number&lt;br /&gt;
[LCC]quantum[0K] this wierd stuff:&lt;br /&gt;
[LCC]quantum[0K]   _G.laserEventArgs = eventArgs&lt;br /&gt;
[LCC]quantum[0K]   SendToUnsynced(&amp;quot;LaserEvent&amp;quot;)&lt;br /&gt;
[LCC]quantum[0K]   _G.laserEventArgs = nil&lt;br /&gt;
[LCC]quantum[0K] puts the eventArgs table somewhere were unsynced can find it&lt;br /&gt;
[LCC]quantum[0K] sends a signal to unsynced called &amp;quot;LaserEvent&amp;quot;&lt;br /&gt;
[LCC]quantum[0K] and removes the table&lt;br /&gt;
[LCC]quantum[0K] on the unsynced side, _G.laserEventArgs becomes SYNCED.laserEventArgs&lt;br /&gt;
[LCC]quantum[0K] this copies it to another table, ready for reuse:   for k, v in spairs(SYNCED.laserEventArgs) do&lt;br /&gt;
[LCC]quantum[0K]     eventArgs[k] = v&lt;br /&gt;
[LCC]quantum[0K]   end&lt;br /&gt;
[LCC]quantum[0K] also, this: gadgetHandler:AddSyncAction(&amp;quot;LaserEvent&amp;quot;, HandleLaserEvent)&lt;br /&gt;
[LCC]quantum[0K] means that i want the HandleLaserEvent function to be called every time i do SendToUnsynced(&amp;quot;LaserEvent&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://pastebin.com/hMHv3Lrf&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10810</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10810"/>
		<updated>2022-02-17T16:52:20Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added Spring.SendLuaUIMsg as possible sender for RecvLuaMsg (tested and works, got the info from DavetheBrave)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame (including when the game is paused) and at least once per sim frame except when catching up. The parameter is the time since the last update. }}&lt;br /&gt;
&lt;br /&gt;
=== Draw* Functions ===&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Avoid doing heavy calculations inside these callins; ideally, do the calculations elsewhere and use Draw callins only for drawing.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitHarvestStorageFull&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit&#039;s harvestStorage is full (according to its unitDef&#039;s entry).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted. Note that this is also called for resurrecting features, and for refilling features with resources before resurrection. On reclaim the part values are negative, and on refill and reclaim they are positive. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]] or [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaUIMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10809</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10809"/>
		<updated>2022-02-07T21:17:21Z</updated>

		<summary type="html">&lt;p&gt;Maddox: after -&amp;gt; when&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame (including when the game is paused) and at least once per sim frame except when catching up. The parameter is the time since the last update. }}&lt;br /&gt;
&lt;br /&gt;
=== Draw* Functions ===&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Avoid doing heavy calculations inside these callins; ideally, do the calculations elsewhere and use Draw callins only for drawing.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitHarvestStorageFull&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit&#039;s harvestStorage is full (according to its unitDef&#039;s entry).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted. Note that this is also called for resurrecting features, and for refilling features with resources before resurrection. On reclaim the part values are negative, and on refill and reclaim they are positive. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10808</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10808"/>
		<updated>2022-02-07T21:15:57Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added UnitHarvestStorageFull description (was undocumented)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame (including when the game is paused) and at least once per sim frame except when catching up. The parameter is the time since the last update. }}&lt;br /&gt;
&lt;br /&gt;
=== Draw* Functions ===&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Avoid doing heavy calculations inside these callins; ideally, do the calculations elsewhere and use Draw callins only for drawing.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitHarvestStorageFull&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called after a unit&#039;s harvestStorage is full (according to its unitDef&#039;s entry).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted. Note that this is also called for resurrecting features, and for refilling features with resources before resurrection. On reclaim the part values are negative, and on refill and reclaim they are positive. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8612</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=8612"/>
		<updated>2022-02-01T19:16:29Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added alert that &amp;#039;harvestStorage&amp;#039; isn&amp;#039;t working&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedRead&amp;diff=12420</id>
		<title>Lua UnsyncedRead</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedRead&amp;diff=12420"/>
		<updated>2021-12-14T04:28:42Z</updated>

		<summary type="html">&lt;p&gt;Maddox: GetLocalAllyTeamID was written as GetLocalTeamID&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
=Unsynced Read=&lt;br /&gt;
&lt;br /&gt;
== Replay/Spectating ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsReplay&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isReplay&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetReplayLength&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} timeInSeconds&lt;br /&gt;
|info = {{new|92.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSpectatingState&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} spectating, {{type|bool}} fullView, {{type|bool}} fullSelect&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Game/Menu Name ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGameName&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} name&lt;br /&gt;
|info = {{new|104.0}}&amp;lt;br&amp;gt;Apparently returns {{xtaglink|Modinfo.lua|name}} .. {{xtaglink|Modinfo.lua|version}} from [[Modinfo.lua]]. E.g. &amp;quot;Spring: 1944 test-5640-ac2d15b&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMenuName&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} name&lt;br /&gt;
|info = {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== ModUI ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetModUICtrl&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} ModUICtrl&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== MyInfo ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMyAllyTeamID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} allyTeamID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMyTeamID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} teamID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMyPlayerID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} playerID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Local Player,Team,Ally ==&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Redundant same as the GetMyXYZ functions!&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLocalPlayerID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} playerID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLocalTeamID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} teamID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLocalAllyTeamID&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} allyID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Team/Player Info ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetPlayerRoster&lt;br /&gt;
|arg1 = {{bracket}}{{type|number}} sortType{{rbracket}} {{pipe}} {{bracket}}{{type|number}} sortType{{rbracket}}, {{bracket}}{{type|bool}} showPathingPlayers{{rbracket}}&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} playerTable &lt;br /&gt;
|info = &amp;quot;playerTable&amp;quot; contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;playerTable = {&lt;br /&gt;
            [1] = {&lt;br /&gt;
              string  name,&lt;br /&gt;
              number  playerID,&lt;br /&gt;
              number  teamID,&lt;br /&gt;
              number  allyTeamID,&lt;br /&gt;
              boolean spectator,&lt;br /&gt;
              number  cpuUsage,&lt;br /&gt;
              number  pingTime&lt;br /&gt;
            },&lt;br /&gt;
            etc...&lt;br /&gt;
          }&lt;br /&gt;
&lt;br /&gt;
   if pingTime == -1, the player is pathfinding, in order to find the progress, use:&lt;br /&gt;
   cpuUsage&amp;amp;0x1 if it&#039;s PC or BO, cpuUsage&amp;amp; 0xFE to get path res, (cpuUsage&amp;gt;&amp;gt;8)*1000&lt;br /&gt;
   for the progress&lt;br /&gt;
  Sort codes:&lt;br /&gt;
     1 = Sort by allies  (the default)&lt;br /&gt;
     2 = Sort by teamID&lt;br /&gt;
     3 = Sort by playerName&lt;br /&gt;
     4 = Sort by CPU usage&lt;br /&gt;
     5 = Sort by ping time&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetTeamColor&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} r, {{type|number}} g, {{type|number}} b, {{type|number}} a&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetTeamOrigColor&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} r, {{type|number}} g, {{type|number}} b, {{type|number}} a&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetPlayerTraffic&lt;br /&gt;
|arg1 = {{type|number}} playerID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} packetID {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} traffic&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSoundStreamTime&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} playedTime, {{type|number}} totalTime,&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Camera ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraNames&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket|camName}} = {{type|number}} camNum, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraState&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { &amp;quot;name&amp;quot; = string, &amp;quot;mode&amp;quot; = number camIdx, state1 = number, state2 = number, ... }&lt;br /&gt;
|info = See [[Lua_camState]] for details about Spring.GetCameraState output.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraPosition&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} x, {{type|number}} y, {{type|number}} z&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraDirection&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} forward_x, {{type|number}} forward_y, {{type|number}} forward_z&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraFOV&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} vFov, {{type|number}} hFov&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCameraVectors&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|table}} vectorTable&lt;br /&gt;
|info = vectorTable contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;vectorTable = {&lt;br /&gt;
    forward   = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    up        = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    right     = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    top       = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    bottom    = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    leftside  = { [1] = number x, [2] = number y, [3] = number z },&lt;br /&gt;
    rightside = { [1] = number x, [2] = number y, [3] = number z }&lt;br /&gt;
  }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Inview ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetVisibleUnits&lt;br /&gt;
|arg1 = {{bracket}}{{type|number}} teamID = -1 {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} radius = 30 {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} Icons = true {{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg4 =&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} unitTable = { {{bracket|1}} = {{type|number}} unitID, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetVisibleFeatures&lt;br /&gt;
|arg1 = {{bracket}}{{type|number}} allyTeamID = -1 {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} radius = 30 {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} Icons = true {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} geos = true {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} featureTable = { {{bracket|1}} = {{type|number}} featureID, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsAABBInView&lt;br /&gt;
|arg1 = {{type|number}} minX, {{type|number}} minY, {{type|number}} minZ&lt;br /&gt;
|arg2 = {{type|number}} maxX, {{type|number}} maxY, {{type|number}} maxZ&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isInView&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsSphereInView&lt;br /&gt;
|arg1 = {{type|number}} x, {{type|number}} y, {{type|number}} z {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} radius {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isInView&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsUnitIcon&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isUnitIcon&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsUnitInView&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isUnitInView&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsUnitVisible&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} radius {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} checkIcons {{rbracket}}{{rbracket}}&lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isVisible&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Screen Trace ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = WorldToScreenCoords&lt;br /&gt;
|arg1 = {{type|number}} x, {{type|number}} y, {{type|number}} z&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 =&lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} x, {{type|number}} y, {{type|number}} z&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = TraceScreenRay&lt;br /&gt;
|arg1 = {{type|number}} mouseX, {{type|number}} mouseY,  {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} onlyCoords {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} useMinimap {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} includeSky {{bracket}}&lt;br /&gt;
|arg5 = {{type|bool}} ignoreWater {{bracket}}&lt;br /&gt;
|arg6 ={{type|number}} D {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|string}} unit, {{type|number}} unitID {{pipe}} {{type|string}} feature, {{type|number}} featureID {{pipe}} {{type|string}} ground, {{type|table}} coords = { {{bracket|1}} = {{type|number}} x, {{bracket|2}} = {{type|number}} y, {{bracket|3}} = {{type|number}} z }&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;Extended to allow a custom plane, parameters are (0, 1, 0, D=0) where D is the offset D can be specified in the third argument (if all the bools are false) or in the seventh (as shown). Intersection coordinates are returned in t[4],t[5],t[6] when the ray goes offmap and includeSky is true), or when no unit or feature is hit (or onlyCoords is true). This will only work for units &amp;amp; objects with the default collission sphere. Per Piece collission and custom collission objects are not supported. The unit must be selectable, to appear to a screen trace ray.&lt;br /&gt;
&lt;br /&gt;
To get map coordinates under mouse cursor: input mouse coordinates obtained via GetMouseState() and pass true for the onlyCoords parameter. Be careful as going off map will result in nil:&lt;br /&gt;
   local mouseX, mouseY = Spring.GetMouseState()&lt;br /&gt;
   print (&amp;quot;Mouse coordinates: (&amp;quot; .. mouseX .. &amp;quot;, &amp;quot; .. mouseY .. &amp;quot;)&amp;quot;)&lt;br /&gt;
   local desc, args = Spring.TraceScreenRay(mouseX, mouseY, true)&lt;br /&gt;
   if nil == desc then return end -- off map&lt;br /&gt;
   local x = args[1]&lt;br /&gt;
   local y = args[2]&lt;br /&gt;
   local z = args[3]&lt;br /&gt;
   print (&amp;quot;World coordinates: (&amp;quot; .. x .. &amp;quot;, &amp;quot; .. y .. &amp;quot;, &amp;quot; .. z .. &amp;quot;)&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetPixelDir&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} y&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} dirX, {{type|number}} dirY, {{type|number}} dirZ&lt;br /&gt;
|info = {{New|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Screen &amp;amp; Window Geometry ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetViewGeometry&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} viewSizeX, {{type|number}} viewSizeY, {{type|number}} viewPosX, {{type|number}} viewPosY&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetWindowGeometry&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} winSizeX, {{type|number}} winSizeY, {{type|number}} winPosX, {{type|number}} winPosY&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetScreenGeometry&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} screenSizeX, {{type|number}} screenSizeY, {{type|number}} ZERO, {{type|number}} ZERO&lt;br /&gt;
|info = Is missing multiscreen support!&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unit ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsUnitAllied&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isAllied&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitViewPosition&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} midPos = false {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} x, {{type|number}} y, {{type|number}} z&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitTransformMatrix&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} invert = false {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} a11, {{type|number}} a12 ..., {{type|number}} a44 (4x4 matrix)&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitSelectionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ, {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ, {{type|number}} volumeType, {{type|number}} testType, {{type|number}} primaryAxis, {{type|bool}} disabled&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Selected Units ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSelectedUnits&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket|1}} = {{type|number}} unitID, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSelectedUnitsSorted&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket}}{{type|number}} unitDefID{{rbracket}} = { {{bracket|1}} = {{bracket}}{{type|number}} unitID{{rbracket}}, etc... }, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSelectedUnitsCounts&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket}}{{type|number}} unitDefID{{rbracket}} = {{type|number}} count, etc... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSelectedUnitsCount&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} count&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsUnitSelected&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isSelected&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unit Groups ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitGroup&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} groupNumber&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupList&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|number}} = {{type|number}} unitCount, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetSelectedGroup&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} groupNumber&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupAIName&lt;br /&gt;
|arg1 = {{type|number}} groupID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} aiName&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupAIList&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket|1}} = {{type|string}} aiName, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupUnits&lt;br /&gt;
|arg1 = {{type|number}} groupID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = {{type|number}} unitID, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupUnitsSorted&lt;br /&gt;
|arg1 = {{type|number}} groupID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket}}{{type|number}} unitDefID{{rbracket}} = { {{type|number}} unitID, ... }, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupUnitsCounts&lt;br /&gt;
|arg1 = {{type|number}} groupID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket}}{{type|number}} unitDefID{{rbracket}} = {{type|number}} count, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGroupUnitsCount&lt;br /&gt;
|arg1 = {{type|number}} groupID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} count&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Feature ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFeatureSelectionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ, {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ, {{type|number}} volumeType, {{type|number}} testType, {{type|number}} primaryAxis, {{type|bool}} disabled&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Projectiles ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetVisibleProjectiles&lt;br /&gt;
|arg1 = {{bracket}} {{type|number}} allyTeamID = -1 {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} addSyncedProjectiles = true {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} addWeaponProjectiles = true {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} addPieceProjectiles = true {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = {{type|number}} projectileID, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== UI ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUICommands&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = { command={{type|string}}, description={{type|string}}, synced={{type|bool}}, cheat={{type|bool}}}, ... }&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;gt;Returns a list of available [[UI commands]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== GUI Settings ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsGUIHidden&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}}  {{type|bool}} isHidden&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = HaveShadows&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}}  {{type|bool}} haveShadows&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = HaveAdvShading&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} haveShading&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetWaterMode&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} mode, {{type|string}} mode&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;  mode numbers:&lt;br /&gt;
      0 - basic&lt;br /&gt;
      1 - reflective&lt;br /&gt;
      2 - dynamic&lt;br /&gt;
      3 - refractive&lt;br /&gt;
      4 - bumpwater&lt;br /&gt;
      default - unknown&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMapDrawMode&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|string}} &amp;quot;normal&amp;quot; {{pipe}} {{type|string}} &amp;quot;height&amp;quot; {{pipe}} {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} {{type|string}} &amp;quot;pathTraversability&amp;quot; {{pipe}} {{type|string}} &amp;quot;los&amp;quot;&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetDrawSelectionInfo&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} drawSelectInfo&lt;br /&gt;
|info = Returns whether &amp;amp;quot;Selected units&amp;amp;quot; text is displayed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Unit &amp;amp; Feature GUI States ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitLuaDraw&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} unitDraw&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitNoDraw&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} noDraw&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitNoMinimap&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} noMinimap&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetUnitNoSelect&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} noSelect&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFeatureLuaDraw&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} featureDraw&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFeatureNoDraw&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} noDraw&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Minimap ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMiniMapGeometry&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} posX, {{type|number}} posY, {{type|number}} sizeX, {{type|number}} sizeY, {{type|bool}} minimized, {{type|bool}} maximized&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMiniMapDualScreen&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} false {{pipe}} {{type|string}} &amp;quot;left&amp;quot; {{pipe}} {{type|string}} &amp;quot;right&amp;quot;&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = IsAboveMiniMap&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} y&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} isAbove&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== (Build-)Menu ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetActiveCommand&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} index {{bracket}}, {{type|number}} cmd_id, {{type|number}} cmd_type, {{type|string}} cmd_name {{rbracket}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetDefaultCommand&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} index {{bracket}}, {{type|number}} cmd_id, {{type|number}} cmd_type, {{type|string}} cmd_name {{rbracket}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetActiveCmdDescs&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} cmdDesc&lt;br /&gt;
|info = cmdDesc contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;cmdDesc = {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      id=number,&lt;br /&gt;
      type=number,&lt;br /&gt;
      name=string,&lt;br /&gt;
      action=string,&lt;br /&gt;
      tooltip=string,&lt;br /&gt;
      texture=string,&lt;br /&gt;
      cursor=string,&lt;br /&gt;
      hidden=boolean,&lt;br /&gt;
      disabled=boolean,&lt;br /&gt;
      showUnique=boolean,&lt;br /&gt;
      onlyTexture=boolean,&lt;br /&gt;
      params = { [1] = string, .. }&lt;br /&gt;
    }, ...&lt;br /&gt;
  }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetActiveCmdDesc&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} cmdDesc&lt;br /&gt;
|info = cmdDesc contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;cmdDesc = {&lt;br /&gt;
      id=number,&lt;br /&gt;
      type=number,&lt;br /&gt;
      name=string,&lt;br /&gt;
      action=string,&lt;br /&gt;
      tooltip=string,&lt;br /&gt;
      texture=string,&lt;br /&gt;
      cursor=string,&lt;br /&gt;
      hidden=boolean,&lt;br /&gt;
      disabled=boolean,&lt;br /&gt;
      showUnique=boolean,&lt;br /&gt;
      onlyTexture=boolean,&lt;br /&gt;
      params = { [1] = string, .. }&lt;br /&gt;
  }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCmdDescIndex&lt;br /&gt;
|arg1 = {{type|number}} cmdID&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} index&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetActivePage&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} pageNum, {{type|number}} maxPages&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Build Facing ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetBuildFacing&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} facing&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetBuildSpacing&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} spacing&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== GatherMode &amp;amp; InvertQueueKey ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGatherMode&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} gatherMode&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetInvertQueueKey&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} queueKey&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Mouse States ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMouseState&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} x, {{type|number}} y, {{type|bool}} leftPressed, {{type|bool}} middlePressed, {{type|bool}} rightPressed, {{type|bool}} offscreen&lt;br /&gt;
|info = {{new|104.0}} Sixth return value offscreen.&amp;lt;br&amp;gt;X, Y are the screen coordinates, not world ones. This coordinate system starts in the lower left corner. For world coordinates see Spring.TraceScreenRay.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMouseCursor&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string }} name, {{type|number}} scale&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMouseStartPosition&lt;br /&gt;
|arg1 = {{type|number}} mouseButton &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} pressedX, {{type|number}} pressedY, {{type|number}} camPosX, {{type|number}} camPosY, {{type|number}} camPosZ, {{type|number}} dirX, {{type|number}} dirY, {{type|number}} dirZ&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== (Hot-)Keys ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetKeyState&lt;br /&gt;
|arg1 = {{type|number}} key&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} keyState&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetModKeyState&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} alt, {{type|bool}} ctrl, {{type|bool}} meta, {{type|bool}} shift&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetPressedKeys&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = { {{bracket}}{{type|number}} code{{rbracket}} = {{type|bool}}, {{bracket}}{{type|string}} name{{rbracket}} = {{type|bool}}, ... }&lt;br /&gt;
|info = {{new|99.0}}: {{type|string}} name &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetKeyCode&lt;br /&gt;
|arg1 = {{type|string}} keysym&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} keyCode&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetKeySymbol&lt;br /&gt;
|arg1 = {{type|number}} key&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} &amp;quot;keysym1&amp;quot;, {{type|string}} &amp;quot;keysym2&amp;quot;&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetKeyBindings&lt;br /&gt;
|arg1 = {{type|string}} keyset &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|table}} keyBindings&lt;br /&gt;
|info = keyBindings contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;keyBindings = {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      [string actionCmd] = string actionExtra,&lt;br /&gt;
      command   = string actionCmd,    {{new|97}}&lt;br /&gt;
      boundWith = string boundWith,    {{new|97}}&lt;br /&gt;
      extra     = string actionExtra,  {{new|97}}&lt;br /&gt;
    }, ...&lt;br /&gt;
  }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetActionHotKeys&lt;br /&gt;
|arg1 = {{type|string}} action&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = {{type|string}} hotKey, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLastMessagePositions&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = { {{type|number}} x, {{type|number}} y, {{type|number}} z }, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetConsoleBuffer&lt;br /&gt;
|arg1 = {{bracket}}{{type|number}} maxLines{{rbracket}}&lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} { {{bracket|1}} = { text = {{type|string}}, priority = {{type|number}} }, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetCurrentTooltip&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== LOS Colors ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLosViewColors&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|table}} always = {r,g,b}, {{type|table}} LOS = {r,g,b}, {{type|table}} radar = {r,g,b}, {{type|table}} jam = {r,g,b}, {{type|table}} radar2 = {r,g,b}&lt;br /&gt;
|info = {{new|100}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Config ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetConfigParams&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|table}} configParams&lt;br /&gt;
|info = Same information as &amp;lt;code&amp;gt;spring --list-config-vars&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;configParams contains:&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;gt;configParams = {&lt;br /&gt;
    {&lt;br /&gt;
      name = string,&lt;br /&gt;
      type = string,&lt;br /&gt;
      [ description = string, ]&lt;br /&gt;
      [ defaultValue = string, ]&lt;br /&gt;
      [ minimumValue = string, ]&lt;br /&gt;
      [ maximumValue = string, ]&lt;br /&gt;
      [ safemodeValue = string, ]&lt;br /&gt;
      [ declarationFile = string, ]&lt;br /&gt;
      [ declarationLine = number, ]&lt;br /&gt;
      [ readOnly = bool, ]&lt;br /&gt;
    },&lt;br /&gt;
    ...&lt;br /&gt;
  }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetConfigInt&lt;br /&gt;
|arg1 = {{type|string}} name {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} default {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} configInt&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetConfigFloat&lt;br /&gt;
|arg1 = {{type|string}} name {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} default {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} configFloat&lt;br /&gt;
|info = {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetConfigString&lt;br /&gt;
|arg1 = {{type|string}} name {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} default {{rbracket}}&lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|string}} configString&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== FPS &amp;amp; GetDrawFrame ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFPS&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} fps&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetDrawFrame&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} low_16bit, {{type|number}} high_16bit&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetVideoCapturingMode&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} videoCaptureAllowed&lt;br /&gt;
|info = {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGameSpeed&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} userSpeedFactor, {{type|number}} speedFactor, {{type|bool}} paused&lt;br /&gt;
|info = {{new|98.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetGameState&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} finishedLoading, {{type|bool}} loadedFromSave, {{type|bool}} locallyPaused, {{type|bool}} laggingWrtExpectedFromSimtime&lt;br /&gt;
|info = {{new|105.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFrameTimeOffset&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} offset&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLastUpdateSeconds&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|number}} lastUpdateSeconds&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetHasLag&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} hasLag&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetTimer&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|timer}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetFrameTimer&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|timer}}&lt;br /&gt;
|info = {{new|102.0}}&amp;lt;br&amp;gt;Get a timer for the start of the frame, this should give better results for camera interpolations.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = DiffTimers&lt;br /&gt;
|arg1 = {{type|timer}} cur&lt;br /&gt;
|arg2 = {{type|timer}} ago {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} inMilliseconds {{rbracket}}&lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|number}} seconds&lt;br /&gt;
|info = {{New|95.0}}&amp;lt;br&amp;gt;Optional third argument (boolean) to return dt in milliseconds.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetMapSquareTexture&lt;br /&gt;
|arg1 = {{type|number}} texSqrX, {{type|number}} texSqrY&lt;br /&gt;
|arg2 = {{type|number}} texMipLvl&lt;br /&gt;
|arg3 = {{type|string}} luaTexName&lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|bool}} success&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetLogSections&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|table}} logSections = { &amp;quot;KeyBindings&amp;quot; = LOG.INFO, &amp;quot;Font&amp;quot; = LOG.INFO, &amp;quot;Sound&amp;quot; = LOG.WARNING, ... }&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GetClipboard&lt;br /&gt;
|arg1 = &lt;br /&gt;
|arg2 = &lt;br /&gt;
|arg3 = &lt;br /&gt;
|arg4 = &lt;br /&gt;
|arg5 = &lt;br /&gt;
|arg6 =&lt;br /&gt;
|arg7 =&lt;br /&gt;
|arg8 =&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|string}} text&lt;br /&gt;
|info = {{new|98.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_sync_to_unsync&amp;diff=12545</id>
		<title>Lua sync to unsync</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_sync_to_unsync&amp;diff=12545"/>
		<updated>2021-12-13T00:42:21Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Two terms were inverted (synced/unsynced)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Synced -&amp;gt; Unsynced Communication =&lt;br /&gt;
&lt;br /&gt;
==Using SendToUnsynced==&lt;br /&gt;
Currently, the recommended way is to use the SendToUnsynced call-in to send an event to the unsynced portion of a gadget. It&#039;s also possible to send an event from a gadget to a Widget. First, you send an &#039;internal event&#039; from synced to unsynced space, within the gadget, then you can create an event which may be subscribed to by any widget. Follows an image showcasing that flow and working/tested code:&lt;br /&gt;
&lt;br /&gt;
[[File:Sync unsync comm.png|670px]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
https://pastebin.com/b1eVWn1d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;Bear in mind that only one widget can hook to one LuaUI event at once, trying to listen to it in multiple widgets will lead to erratic behavior. Workaround here would be firing multiple LuaUI events, one for each consuming widget.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;The first parameter in the event handler (in the example, it&#039;s named &#039;cmd&#039; in HandleCommCountEvent) is rarely used. It holds the name of the synced event, so you know what synced event fired the function, as in the following example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local function func(str)&lt;br /&gt;
    if str == &amp;quot;abcd&amp;quot; then&lt;br /&gt;
        -- do something&lt;br /&gt;
    elseif str == &amp;quot;efgh&amp;quot;&lt;br /&gt;
        -- do another thing&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
gadgetHandler:AddSyncAction(&amp;quot;abcd&amp;quot;, func)&lt;br /&gt;
gadgetHandler:AddSyncAction(&amp;quot;efgh&amp;quot;, func)&lt;br /&gt;
&lt;br /&gt;
SendToUnsynced(&amp;quot;abcd&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Using globals (96.0 and previous) ==&lt;br /&gt;
When making a gadget you will sometimes want to combine synced and unsynced code.&lt;br /&gt;
&lt;br /&gt;
For example if you do some things with units, that code will need to be synced.&lt;br /&gt;
&lt;br /&gt;
The UnitDestroyed, UnitFinished etc. callins can only be called in synced code. Using them inside unsynced code is not going to work.&lt;br /&gt;
&lt;br /&gt;
If you want to draw on the screen (for example to mark units) then the drawing will have to happen in unsynced code.&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates how to change the value inside the synced block of code and read the value in the unsynced block of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if (gadgetHandler:IsSyncedCode()) then&lt;br /&gt;
   --SYNCED CODE&lt;br /&gt;
   local number = 10               -- declaring local variable &#039;number&#039;&lt;br /&gt;
   function gadget:SomeSyncedCallin(...)&lt;br /&gt;
      number=number+1              -- increment variable&#039;s value by one&lt;br /&gt;
      _G.number=number             -- save the new value into a global variable&lt;br /&gt;
   end&lt;br /&gt;
else&lt;br /&gt;
   --UNSYNCED CODE&lt;br /&gt;
   function gadget:SomeUnsyncedCallin(...)&lt;br /&gt;
      Spring.Echo(SYNCED.number)   -- print the global variable&#039;s value on screen&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 97.0+ ==&lt;br /&gt;
As of 97.0 unsynced gets most of the [[Lua:Callins|callins]] available to synced (excepting those which control synced actions e.g. AllowUnitCreation etc) which means that forwarding data from synced to unsynced is now not always required. Additionally in 97.0 there were changes to the behaviour of the &amp;lt;code&amp;gt;SYNCED&amp;lt;/code&amp;gt; table described above.&lt;br /&gt;
&lt;br /&gt;
Change 1: &amp;lt;code&amp;gt;SYNCED&amp;lt;/code&amp;gt; does a copy on access now and so is slow:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Bad:    &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;for i=1,100 do ... SYNCED.foo[i] ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Good:   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local foo = SYNCED.foo; for i=1,100 do ... foo[i] ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 2: &amp;lt;code&amp;gt;SYNCED.&amp;lt;/code&amp;gt; can&#039;t be localized in global scope anymore:&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Bad:    &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local foo = SYNCED.foo;    function gadget:DrawWorld() ... foo ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Good:   &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function gadget:DrawWorld() local foo = SYNCED.foo; ... foo ... end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Here is a (older) description by quantum:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[LCC]quantum[0K] every time there  is a new target, i send &amp;quot;addTarget&amp;quot; and its number to unsynced&lt;br /&gt;
[LCC]quantum[0K] when a target is removed from the list, i send &amp;quot;removeTarget&amp;quot; and its number&lt;br /&gt;
[LCC]quantum[0K] this wierd stuff:&lt;br /&gt;
[LCC]quantum[0K]   _G.laserEventArgs = eventArgs&lt;br /&gt;
[LCC]quantum[0K]   SendToUnsynced(&amp;quot;LaserEvent&amp;quot;)&lt;br /&gt;
[LCC]quantum[0K]   _G.laserEventArgs = nil&lt;br /&gt;
[LCC]quantum[0K] puts the eventArgs table somewhere were unsynced can find it&lt;br /&gt;
[LCC]quantum[0K] sends a signal to unsynced called &amp;quot;LaserEvent&amp;quot;&lt;br /&gt;
[LCC]quantum[0K] and removes the table&lt;br /&gt;
[LCC]quantum[0K] on the unsynced side, _G.laserEventArgs becomes SYNCED.laserEventArgs&lt;br /&gt;
[LCC]quantum[0K] this copies it to another table, ready for reuse:   for k, v in spairs(SYNCED.laserEventArgs) do&lt;br /&gt;
[LCC]quantum[0K]     eventArgs[k] = v&lt;br /&gt;
[LCC]quantum[0K]   end&lt;br /&gt;
[LCC]quantum[0K] also, this: gadgetHandler:AddSyncAction(&amp;quot;LaserEvent&amp;quot;, HandleLaserEvent)&lt;br /&gt;
[LCC]quantum[0K] means that i want the HandleLaserEvent function to be called every time i do SendToUnsynced(&amp;quot;LaserEvent&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://pastebin.com/hMHv3Lrf&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Sidedata.lua&amp;diff=16811</id>
		<title>Sidedata.lua</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Sidedata.lua&amp;diff=16811"/>
		<updated>2021-11-02T00:07:31Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Typo fixed - sitedata.lua =&amp;gt; sidedata.lua&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Location==&lt;br /&gt;
&amp;lt;code&amp;gt;sidedata.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 the playable factions/races/sides in a game. (ie ARM &amp;amp; CORE, Terran, Protoss, USA, Bananas,...)&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/SideParser.cpp}}&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
Each faction can have two properties:&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; (displayed in lobby)&amp;lt;br&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;startUnit&amp;lt;/code&amp;gt; (must be read by [http://springrts.com/phpbb/viewtopic.php?f=67&amp;amp;t=21883&amp;amp;p=417021 a gadget to actually spawn the start unit])&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These values are available to lua via &amp;lt;code&amp;gt;Spring.GetSideData&amp;lt;/code&amp;gt; (See [[Lua_SyncedRead#Sides.2FFactions|Lua_SyncedRead]]):&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;local sideName, startUnit = Spring.GetSideData(sideID)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
===Single Faction===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;local sideData = {&lt;br /&gt;
  {&lt;br /&gt;
    name = &#039;AwesomeDudes&#039;,&lt;br /&gt;
    startunit = &#039;awesomedudebase&#039;,&lt;br /&gt;
  },&lt;br /&gt;
}&lt;br /&gt;
return sideData&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
===Multiple Factions===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;local sideData = {&lt;br /&gt;
  {&lt;br /&gt;
    name = &#039;NKG&#039;,&lt;br /&gt;
    startunit = &#039;bflagship2&#039;,&lt;br /&gt;
  },&lt;br /&gt;
  {&lt;br /&gt;
    name = &#039;Drone&#039;,&lt;br /&gt;
    startunit = &#039;kdroneengineer&#039;,&lt;br /&gt;
  },&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
return sideData&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Faction Icons==&lt;br /&gt;
Faction icons are not defined in this file but just read from the &amp;lt;code&amp;gt;Sidepics/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(NB: Some widgets, such as advanced playerlist, may complain about missing faction icon if they are not present)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Can be .bmp and maybe other formats.&lt;br /&gt;
Filename is same as Faction name ie for above examples:&lt;br /&gt;
&amp;lt;code&amp;gt;AwesomeDudes.bmp NKG.bmp Drone.bmp&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:gamedata]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8611</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=8611"/>
		<updated>2021-10-29T04:55:25Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Forget it, that was the lua entry.&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}}&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8610</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=8610"/>
		<updated>2021-10-29T04:54:20Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added dlHoverFactor (it&amp;#039;s in the source code)&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}}&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 = dlHoverFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = values &amp;lt; 0 means it can land, values &amp;gt;= 0 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 = 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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8608</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=8608"/>
		<updated>2021-09-18T17:17:39Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Spring.UnitHarvestStorageFull callin is still not fully implemented, up to 105.0. Removing UnitHarvestStorageFull callin reference&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}}&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 amount of the energy resource the unit generates which is dependant on the map wind. Works only for structures.}}&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedRead&amp;diff=12066</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=12066"/>
		<updated>2021-01-25T03:05:55Z</updated>

		<summary type="html">&lt;p&gt;Maddox: rewriting it&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;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;velw returns the velocity length in one frame. Multiply by 30 (game frames/s) to get an equivalent to unitDef.speed&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedRead&amp;diff=12065</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=12065"/>
		<updated>2021-01-25T03:02:56Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Spring.GetUnityVelocity.velw clarification&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;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;velw returns the velocity length in seconds. Divide by 30 (game frames/s) to get an equivalent to the unitDefs speed&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9128</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9128"/>
		<updated>2020-02-16T15:36:27Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Fixed NOTA header line&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are a number of games made for the Spring Engine. Some of the more popular ones are listed below, sorted by their terms of use. &amp;lt;!--(/license schemes?)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can download games automatically, using your lobby (see [[Read_Me_First|Read Me First]]). Some games also offer a stand-alone installer.&lt;br /&gt;
&lt;br /&gt;
=Open Source=&lt;br /&gt;
&#039;&#039;These games are all free to download and play and may be open to modifications, however, be sure to read the licenses before doing so.&#039;&#039;&lt;br /&gt;
{|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://zero-k.info/ Zero-K]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://github.com/ZeroK-RTS/Zero-K/blob/f24c14f31bcd1040e7dce66336ec39fce63b7de9/sounds/music/license.txt CC-BY-NC-ND for music], [https://github.com/ZeroK-RTS/Zero-K/blob/079af01d8781e9785d21e41057d0d67f0c571b12/legal.txt GPL/PD for code and all other assets])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Zero-k_image.jpg|300px|link=https://zero-k.info/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Zero-K is a fast, competitive game with a focus on a streamlined economy and advanced interface that takes the focus off tedious tasks and back on the action. A huge roster of interesting, unique units and a variety of unit abilities provides tremendous tactical and strategic depth to the game. (This game is available via [https://zerok.itch.io/zero-k Itch.io] and [https://store.steampowered.com/app/334920/ZeroK/ Steam].)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://github.com/spring1944/spring1944/wiki Spring: 1944]&amp;lt;/h2&amp;gt;([https://github.com/spring1944/spring1944/blob/1e36bbf93f42018bb9f52af8c3dc3e9ffa9fbeff/docs/License.txt CC-BY-NC])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:S44_tigers.jpg|300px|link=http://spring1944.net/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Spring:1944 is a WWII themed game with eight fully functional armies (US, Germany, USSR, Britain, Japan, Italy, Hungary, Sweden), period-accurate units and strengths. Realism comes second only to creating a game that is fun and accessible to play. ([https://spring1944.github.io/ homepage], [https://youtu.be/bg5k4b8Zgsk youtube 1], [https://youtu.be/76jFZvpvwoA youtube 2], [https://springrts.com/phpbb/viewforum.php?f=45 subforum])&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[https://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;([https://github.com/EvolutionRTS/Evolution-RTS/blob/f8a5df79b384f28fa8705f58df2cd2b580f0c982/license.txt CC-BY-SA])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Evoimg.jpg|300px|link=https://www.evolutionrts.info]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A new war is brewing. A violent conflict, between the Six Colonies, each one convinced that it was in the right, each one sure of its own ability to defeat its enemies. But they need Generals. They need soldiers. They need you. (This game is available via [https://forboding-angel.itch.io/evolution-rts Itch.io] and [https://store.steampowered.com/app/291150/Evolution_RTS/ Steam].)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;([[Kernel_Panic#License:|FOSS]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Kernel_Panic_3.4.jpg|300px|link=Kernel Panic]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A game based around combat &#039;&#039;&#039;inside&#039;&#039;&#039; a computer, with 3 unique sides: the System, the Hacker and the Network waging war in a matrix of DOOM! No resource economy exists in KP, with the only constraints being time and space.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://springfiles.com/spring/games/edge-1 On The Edge]&amp;lt;/h2&amp;gt;  (GPL, [https://github.com/PepeAmpere/On-The-Edge/blob/master/README.md CC-BY-NC-SA], [https://github.com/PepeAmpere/On-The-Edge/blob/master/wiki/credits.md etc])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:start3.jpg|300px|link=https://springfiles.com/spring/games/edge-1]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | First Spring MOBA with unique pre-game hero setup. Under heavy development. ([http://springrts.com/phpbb/viewtopic.php?f=55&amp;amp;t=31476 On The Edge forum thread])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[http://www.metalfactions.pt Metal Factions]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://www.metalfactions.pt/about.html#license CC-BY-ND, with GPL/PD code])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Mf_spring_wiki.jpg|300px|link=http://www.metalfactions.pt]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | An evolving game that started as a TA mod and currently features four factions: AVEN, GEAR, CLAW and SPHERE. Commanders can morph to fit into different play styles and be easily revived. Economy scaling is more strictly tied to map control. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://springrts.com/phpbb/viewtopic.php?f=54&amp;amp;t=23988#p447937 The Cursed]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://springrts.com/phpbb/viewtopic.php?f=54&amp;amp;t=23988&amp;amp;p=566530&amp;amp;hilit=license#p566530 CC-BY-NC-SA])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:cursed_logo.jpg|300px|link=http://www.indiedb.com/games/the-cursed]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | The game is about bones, undead, demons, space marines and magic settled in a futuristic environment. It is a fresh   mixture of gameplay elements from many popular RTS games like Starcraft and C&amp;amp;C. ([https://www.indiedb.com/games/the-cursed homepage], [https://youtu.be/EiBh8l200oo youtube 1], [https://youtu.be/oah7Xt0CgVY youtube 2], [https://springrts.com/phpbb/viewforum.php?f=54 subforum])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://drive.google.com/file/d/0Bx_Nvv6rzVvgLXJkckpYaDhaOVU/view Journeywar] &amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://github.com/PicassoCT/Journeywar/blob/97aa399693cd04097367eb5c587eeb590723b700/LICENSE GPLv3])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:JwLogo.jpg|300px|link=https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1180#p578989]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |  Journeywar is the final battle between Combine and Exobiotics. Join the fight and rediscover the HL- Universe from a new, strategic perspective. ([https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1220#p588002 dev blog], [https://springrts.com/phpbb/viewforum.php?f=69 subforum])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Proprietary=&lt;br /&gt;
&#039;&#039;These games may or may not be free to play. Modifying their content (i.e. the art assets) is not allowed without the game authors explicit permission, although the code is GPL and some games include large GPL-friendly content collections.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://www.moddb.com/games/conflict-terra/tutorials/how-to-start-a-game-of-conflict-terra Conflict Terra]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:CT_Hojos.png|300px|link=http://www.moddb.com/games/conflict-terra]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A unique game with heavy emphasis on mobility and featuring Spring&#039;s first major &amp;quot;collect and drop-off&amp;quot; economy, Conflict Terra boasts a distinctive art style.  Play as one of two factions in an ever-changing battlefield as you struggle to come out on top. ([http://www.moddb.com/games/conflict-terra homepage], [https://github.com/oksnoop2/conflictterra/commit/0e72529194e1ff363c986a43ce3af77d0cf720f7 currently proprietary], [https://github.com/oksnoop2/conflictterra/blob/e4a974c697f425c6ed00f83b1864d64c366da2f1/games/CT/License.txt last known public domain release], [https://springrts.com/phpbb/viewforum.php?f=63 subforum])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=46 Star Wars: Imperial Winter] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Imperial Winter assault.jpg|300px|link=https://springrts.com/phpbb/viewforum.php?f=46]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A Star Wars themed game set in the troubled post-Return of the Jedi era.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://github.com/SpringMCLegacy/SpringMCLegacy/wiki Spring Mech Commander Legacy Project] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Spring_Mech_Commander_Legacy_Project.jpg|300px|link=https://github.com/SpringMCLegacy/SpringMCLegacy/wiki]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A cool RTS based in the Battletech Universe.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=TA-derived=&lt;br /&gt;
&#039;&#039;At least parts of these games are derived from data of the  Total Annihilation game (copyright Atari). As such, their distribution is potentially in breach of copyright laws and therefore not officially endorsed by the Spring RTS team.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h2&amp;gt; [https://balancedannihilation.com Balanced Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:BAScreenShot.jpg|300px|link=https://balancedannihilation.com]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Balanced Annihilation (BA) is a mature game and new versions feature only minor balance tweaks.&lt;br /&gt;
&lt;br /&gt;
BA gameplay develops in stages of progressively heavier units with a growing economy. Many strategies are viable in BA, including focusing on map control, aggression, defense, air power, sea power, or mobility.&lt;br /&gt;
([https://balancedannihilation.com homepage], [https://youtu.be/qeZYghUPU-s youtube], [https://springrts.com/phpbb/viewforum.php?f=44 subforum])&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h2&amp;gt;[https://springrts.com/phpbb/viewforum.php?f=55 NOTA]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:notAgame02.jpg|300px|link=http://nota.machys.net/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Not Original Total Annihilation is a rethink of the Total Annihilation universe with a focus on strategic, base oriented gameplay. With its revised unit scale, huge battles erupt engaging hundreds of units and scores of unit types. NOTA&#039;s completely rethought air and sea gameplay forces participation in all elements and places the tide of conflict in your hands. (This game is available via [http://nota.machys.net/downloads its own lobby].)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [http://fluidplay.co/taprime TA Prime] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Taprime site.png|300px|link=http://fluidplay.co/taprime]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |Highly polished prequel to Total Annihilation, with a full-blown tech tree, unit abilities and a strong rock-paper-scissors countering system similar to C&amp;amp;C games.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=91 Tech Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Tech_Annihilation.png|300px|link=https://springrts.com/phpbb/viewforum.php?f=91]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |This Game is bigger, greater and more epic! Tech your Commander from a tiny Commander to a Galactic Commander! (currently no homepage)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [[XTA]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Screen508_s.jpg|300px|link=XTA]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Originally developed as a Total Annihilation game by the Swedish Yankspankers, XTA is the Original Public Game released with first versions of Spring. Development of this game by the SYs has stopped a while ago, but it is still played and actively developed by the community.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Installing Games in Spring=&lt;br /&gt;
Quite a few of the games listed above come with standalone installers, which makes things easy. Check their website to find out! Otherwise a lobby such as [[SpringLobby]] will download everything for you when you join a game room.&lt;br /&gt;
&lt;br /&gt;
Games can also be downloaded manually as .sdz/.sd7 files, for example &#039;&#039;BA750&#039;&#039;&#039;&#039;&#039;.sd7&#039;&#039;&#039; or &#039;&#039;XTA&#039;&#039;&#039;&#039;&#039;.sdz&#039;&#039;&#039;, and placed into &#039;&#039;...\My Documents\My Games\Spring\Games\&#039;&#039; or &#039;&#039;...\Spring\games\&#039;&#039; folder (&#039;&#039;~/.spring/games/&#039;&#039; on Linux/Unix/Mac). Read the advice on [[Read_Me_First|this page]] if your lobby does not find your games.&lt;br /&gt;
You may install multiple games in the same engine installation. The same goes for [[Maps]]. Place them into a folder called maps in  the same folder where the games folder is.&lt;br /&gt;
&lt;br /&gt;
Still not enough Games? There are [[Getting_Spring_Content_and_Links|some more]], not listed here or make your [[Game_and_Unit_development|own Game]]!&lt;br /&gt;
&lt;br /&gt;
[[Category: Games]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9127</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9127"/>
		<updated>2020-02-16T15:34:26Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added TA Prime to the games list, ordered alphabetically&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are a number of games made for the Spring Engine. Some of the more popular ones are listed below, sorted by their terms of use. &amp;lt;!--(/license schemes?)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can download games automatically, using your lobby (see [[Read_Me_First|Read Me First]]). Some games also offer a stand-alone installer.&lt;br /&gt;
&lt;br /&gt;
=Open Source=&lt;br /&gt;
&#039;&#039;These games are all free to download and play and may be open to modifications, however, be sure to read the licenses before doing so.&#039;&#039;&lt;br /&gt;
{|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://zero-k.info/ Zero-K]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://github.com/ZeroK-RTS/Zero-K/blob/f24c14f31bcd1040e7dce66336ec39fce63b7de9/sounds/music/license.txt CC-BY-NC-ND for music], [https://github.com/ZeroK-RTS/Zero-K/blob/079af01d8781e9785d21e41057d0d67f0c571b12/legal.txt GPL/PD for code and all other assets])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Zero-k_image.jpg|300px|link=https://zero-k.info/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Zero-K is a fast, competitive game with a focus on a streamlined economy and advanced interface that takes the focus off tedious tasks and back on the action. A huge roster of interesting, unique units and a variety of unit abilities provides tremendous tactical and strategic depth to the game. (This game is available via [https://zerok.itch.io/zero-k Itch.io] and [https://store.steampowered.com/app/334920/ZeroK/ Steam].)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://github.com/spring1944/spring1944/wiki Spring: 1944]&amp;lt;/h2&amp;gt;([https://github.com/spring1944/spring1944/blob/1e36bbf93f42018bb9f52af8c3dc3e9ffa9fbeff/docs/License.txt CC-BY-NC])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:S44_tigers.jpg|300px|link=http://spring1944.net/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Spring:1944 is a WWII themed game with eight fully functional armies (US, Germany, USSR, Britain, Japan, Italy, Hungary, Sweden), period-accurate units and strengths. Realism comes second only to creating a game that is fun and accessible to play. ([https://spring1944.github.io/ homepage], [https://youtu.be/bg5k4b8Zgsk youtube 1], [https://youtu.be/76jFZvpvwoA youtube 2], [https://springrts.com/phpbb/viewforum.php?f=45 subforum])&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[https://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;([https://github.com/EvolutionRTS/Evolution-RTS/blob/f8a5df79b384f28fa8705f58df2cd2b580f0c982/license.txt CC-BY-SA])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Evoimg.jpg|300px|link=https://www.evolutionrts.info]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A new war is brewing. A violent conflict, between the Six Colonies, each one convinced that it was in the right, each one sure of its own ability to defeat its enemies. But they need Generals. They need soldiers. They need you. (This game is available via [https://forboding-angel.itch.io/evolution-rts Itch.io] and [https://store.steampowered.com/app/291150/Evolution_RTS/ Steam].)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;([[Kernel_Panic#License:|FOSS]])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Kernel_Panic_3.4.jpg|300px|link=Kernel Panic]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A game based around combat &#039;&#039;&#039;inside&#039;&#039;&#039; a computer, with 3 unique sides: the System, the Hacker and the Network waging war in a matrix of DOOM! No resource economy exists in KP, with the only constraints being time and space.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://springfiles.com/spring/games/edge-1 On The Edge]&amp;lt;/h2&amp;gt;  (GPL, [https://github.com/PepeAmpere/On-The-Edge/blob/master/README.md CC-BY-NC-SA], [https://github.com/PepeAmpere/On-The-Edge/blob/master/wiki/credits.md etc])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:start3.jpg|300px|link=https://springfiles.com/spring/games/edge-1]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | First Spring MOBA with unique pre-game hero setup. Under heavy development. ([http://springrts.com/phpbb/viewtopic.php?f=55&amp;amp;t=31476 On The Edge forum thread])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[http://www.metalfactions.pt Metal Factions]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://www.metalfactions.pt/about.html#license CC-BY-ND, with GPL/PD code])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Mf_spring_wiki.jpg|300px|link=http://www.metalfactions.pt]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | An evolving game that started as a TA mod and currently features four factions: AVEN, GEAR, CLAW and SPHERE. Commanders can morph to fit into different play styles and be easily revived. Economy scaling is more strictly tied to map control. &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://springrts.com/phpbb/viewtopic.php?f=54&amp;amp;t=23988#p447937 The Cursed]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://springrts.com/phpbb/viewtopic.php?f=54&amp;amp;t=23988&amp;amp;p=566530&amp;amp;hilit=license#p566530 CC-BY-NC-SA])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:cursed_logo.jpg|300px|link=http://www.indiedb.com/games/the-cursed]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | The game is about bones, undead, demons, space marines and magic settled in a futuristic environment. It is a fresh   mixture of gameplay elements from many popular RTS games like Starcraft and C&amp;amp;C. ([https://www.indiedb.com/games/the-cursed homepage], [https://youtu.be/EiBh8l200oo youtube 1], [https://youtu.be/oah7Xt0CgVY youtube 2], [https://springrts.com/phpbb/viewforum.php?f=54 subforum])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://drive.google.com/file/d/0Bx_Nvv6rzVvgLXJkckpYaDhaOVU/view Journeywar] &amp;lt;/h2&amp;gt;&lt;br /&gt;
([https://github.com/PicassoCT/Journeywar/blob/97aa399693cd04097367eb5c587eeb590723b700/LICENSE GPLv3])&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:JwLogo.jpg|300px|link=https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1180#p578989]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |  Journeywar is the final battle between Combine and Exobiotics. Join the fight and rediscover the HL- Universe from a new, strategic perspective. ([https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1220#p588002 dev blog], [https://springrts.com/phpbb/viewforum.php?f=69 subforum])&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Proprietary=&lt;br /&gt;
&#039;&#039;These games may or may not be free to play. Modifying their content (i.e. the art assets) is not allowed without the game authors explicit permission, although the code is GPL and some games include large GPL-friendly content collections.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt;[https://www.moddb.com/games/conflict-terra/tutorials/how-to-start-a-game-of-conflict-terra Conflict Terra]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:CT_Hojos.png|300px|link=http://www.moddb.com/games/conflict-terra]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A unique game with heavy emphasis on mobility and featuring Spring&#039;s first major &amp;quot;collect and drop-off&amp;quot; economy, Conflict Terra boasts a distinctive art style.  Play as one of two factions in an ever-changing battlefield as you struggle to come out on top. ([http://www.moddb.com/games/conflict-terra homepage], [https://github.com/oksnoop2/conflictterra/commit/0e72529194e1ff363c986a43ce3af77d0cf720f7 currently proprietary], [https://github.com/oksnoop2/conflictterra/blob/e4a974c697f425c6ed00f83b1864d64c366da2f1/games/CT/License.txt last known public domain release], [https://springrts.com/phpbb/viewforum.php?f=63 subforum])&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=46 Star Wars: Imperial Winter] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Imperial Winter assault.jpg|300px|link=https://springrts.com/phpbb/viewforum.php?f=46]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A Star Wars themed game set in the troubled post-Return of the Jedi era.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;h2&amp;gt; [https://github.com/SpringMCLegacy/SpringMCLegacy/wiki Spring Mech Commander Legacy Project] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Spring_Mech_Commander_Legacy_Project.jpg|300px|link=https://github.com/SpringMCLegacy/SpringMCLegacy/wiki]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | A cool RTS based in the Battletech Universe.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=TA-derived=&lt;br /&gt;
&#039;&#039;At least parts of these games are derived from data of the  Total Annihilation game (copyright Atari). As such, their distribution is potentially in breach of copyright laws and therefore not officially endorsed by the Spring RTS team.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h2&amp;gt; [https://balancedannihilation.com Balanced Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:BAScreenShot.jpg|300px|link=https://balancedannihilation.com]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Balanced Annihilation (BA) is a mature game and new versions feature only minor balance tweaks.&lt;br /&gt;
&lt;br /&gt;
BA gameplay develops in stages of progressively heavier units with a growing economy. Many strategies are viable in BA, including focusing on map control, aggression, defense, air power, sea power, or mobility.&lt;br /&gt;
([https://balancedannihilation.com homepage], [https://youtu.be/qeZYghUPU-s youtube], [https://springrts.com/phpbb/viewforum.php?f=44 subforum])&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;h2&amp;gt;[https://springrts.com/phpbb/viewforum.php?f=55 NOTA]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:notAgame02.jpg|300px|link=http://nota.machys.net/]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Not Original Total Annihilation is a rethink of the Total Annihilation universe with a focus on strategic, base oriented gameplay. With its revised unit scale, huge battles erupt engaging hundreds of units and scores of unit types. NOTA&#039;s completely rethought air and sea gameplay forces participation in all elements and places the tide of conflict in your hands. (This game is available via [http://nota.machys.net/downloads its own lobby].)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [http://fluidplay.co/taprime TA Prime] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Taprime site.png|300px|link=http://fluidplay.co/taprime]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |Highly polished prequel to Total Annihilation, with a full-blown tech tree, unit abilities and a strong rock-paper-scissors countering system similar to C&amp;amp;C games.&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=91 Tech Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Tech_Annihilation.png|300px|link=https://springrts.com/phpbb/viewforum.php?f=91]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |This Game is bigger, greater and more epic! Tech your Commander from a tiny Commander to a Galactic Commander! (currently no homepage)&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  &amp;lt;h2&amp;gt; [[XTA]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Image:Screen508_s.jpg|300px|link=XTA]]&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; | Originally developed as a Total Annihilation game by the Swedish Yankspankers, XTA is the Original Public Game released with first versions of Spring. Development of this game by the SYs has stopped a while ago, but it is still played and actively developed by the community.&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Installing Games in Spring=&lt;br /&gt;
Quite a few of the games listed above come with standalone installers, which makes things easy. Check their website to find out! Otherwise a lobby such as [[SpringLobby]] will download everything for you when you join a game room.&lt;br /&gt;
&lt;br /&gt;
Games can also be downloaded manually as .sdz/.sd7 files, for example &#039;&#039;BA750&#039;&#039;&#039;&#039;&#039;.sd7&#039;&#039;&#039; or &#039;&#039;XTA&#039;&#039;&#039;&#039;&#039;.sdz&#039;&#039;&#039;, and placed into &#039;&#039;...\My Documents\My Games\Spring\Games\&#039;&#039; or &#039;&#039;...\Spring\games\&#039;&#039; folder (&#039;&#039;~/.spring/games/&#039;&#039; on Linux/Unix/Mac). Read the advice on [[Read_Me_First|this page]] if your lobby does not find your games.&lt;br /&gt;
You may install multiple games in the same engine installation. The same goes for [[Maps]]. Place them into a folder called maps in  the same folder where the games folder is.&lt;br /&gt;
&lt;br /&gt;
Still not enough Games? There are [[Getting_Spring_Content_and_Links|some more]], not listed here or make your [[Game_and_Unit_development|own Game]]!&lt;br /&gt;
&lt;br /&gt;
[[Category: Games]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=File:Taprime_site.png&amp;diff=22122</id>
		<title>File:Taprime site.png</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=File:Taprime_site.png&amp;diff=22122"/>
		<updated>2020-02-16T15:33:04Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11812</id>
		<title>Lua SyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11812"/>
		<updated>2019-10-23T22:22:08Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added clarification about Spring.SpawnExplosion not applying the assigned WeaponDef&amp;#039;s damage&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 End =&lt;br /&gt;
&#039;&#039;&#039;Spring.KillTeam&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare a team to be dead ( no further orders can be assigned to such teams&#039;s units ), Gaia team cannot be killed.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GameOver&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( {number allyTeamID1, number allyTeamID2, ...} ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare game over, a list of winning allyteams can be passed, if undecided ( like when dropped from the host ) it should be empty ( no winner ), in the case of a draw with multiple winners, all should be listed&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RulesParams =&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;string values are new since 95.0. Attention: Numeric paramValues in quotes will be converted to number.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;possible keys for the losAccess table are:&lt;br /&gt;
    `private` : only readable by the ally (default)&lt;br /&gt;
    `allied`  : readable by ally + ingame allied&lt;br /&gt;
    `inlos`   : readable if the unit is in LOS&lt;br /&gt;
    `inradar` : readable if the unit is in AirLOS&lt;br /&gt;
    `public`  : readable by all&lt;br /&gt;
   note: if one condition is fulfilled all beneath it are too (e.g. if an unit is in LOS it&amp;lt;br/&amp;gt;     can read params with `inradar=true` even if the param has `inlos=false`)&lt;br /&gt;
   note2: all GameRulesParam are public, TeamRulesParams can just be `private`,`allied`&amp;lt;br/&amp;gt;     and/or `public`&lt;br /&gt;
   note3: You can read RulesParams from &#039;&#039;&#039;any&#039;&#039;&#039; Lua enviroments! With those losAccess&amp;lt;br/&amp;gt;     policies you can limit their access.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRulesParam&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;new since 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number featureID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGameRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UseTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, &lt;br /&gt;
    string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;,number amount |&lt;br /&gt;
    { metal = number amount, energy = number amount}&lt;br /&gt;
  ) -&amp;gt; nil | boolean hadEnough&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string res, number amount ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are:&lt;br /&gt;
    &amp;quot;m&amp;quot;  = metal&lt;br /&gt;
    &amp;quot;e&amp;quot;  = energy&lt;br /&gt;
    &amp;quot;ms&amp;quot;  = metal storage&lt;br /&gt;
    &amp;quot;es&amp;quot;  = energy storage&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamShareLevel&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareTeamResource&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;0.82 and later&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number teamID_src, number teamID_recv, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Teams =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAlly&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( number firstAllyTeamID, number secondAllyTeamID, boolean ally ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
Changes the value of the (one-sided) alliance between: firstAllyTeamID -&amp;gt; secondAllyTeamID&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignPlayerToTeam&#039;&#039;&#039; {{new|98.0}}  {{Sourcelinkhash|7ed9a7e34814c60e5ae16281520cccc4daf3c367}}&lt;br /&gt;
  ( number playerID, number teamID)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGlobalLos&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number allyTeamID, bool globallos )&lt;br /&gt;
&lt;br /&gt;
= Unit Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: offmap positions are clamped! (you still can use MoveCtrl todo so)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    (number facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
    number teamID&lt;br /&gt;
    [, boolean build = false] &lt;br /&gt;
    [, boolean flattenGround = true]&lt;br /&gt;
    [, number unitID]&lt;br /&gt;
    [, number builderID]) -&amp;gt; number unitID | nil (meaning unit was not created)&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
  if build is true the unit is created in &amp;quot;being built&amp;quot; state, with buildProgress = 0&lt;br /&gt;
  unitID and builderID are {{new|92.0}}, the former allowing to spawn a unit with&lt;br /&gt;
  a specific ID.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID&lt;br /&gt;
    [, boolean selfd = false]&lt;br /&gt;
    [, boolean reclaimed = false]&lt;br /&gt;
    [, number attackerID ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
 selfd := makes the unit act like it self-destructed&lt;br /&gt;
 reclaimed := don&#039;t show any DeathSequences, don&#039;t leave a wreckage.&lt;br /&gt;
   NOTE this does _not_ give back the resources to the team!&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    numer newTeamID&lt;br /&gt;
    [, boolean given = true ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;if given=false, the unit is captured&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCosts&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, { &lt;br /&gt;
     [ buildTime  = number amount ],&lt;br /&gt;
     [ metalCost  = number amount ],&lt;br /&gt;
     [ energyCost = number amount ]&lt;br /&gt;
   } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;tooltip&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number health |&lt;br /&gt;
    { [ health   = number health ],&lt;br /&gt;
      [ capture  = number capture ],&lt;br /&gt;
      [ paralyze = number paralyze ],&lt;br /&gt;
      [ build    = number build ] }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxHealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitDamage&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number damage&lt;br /&gt;
    [, number paralyze = 0 [, number attackerID = -1 [, number weaponID = -1&lt;br /&gt;
      [, number impulse_x [, number impulse_y [, number impulse_z ]]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;the number in the paralyze parameter equals to paralyzetime in the WeaponDef&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStockpile&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number stockpile [, number buildPercent ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitExperience&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number experience ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFuel&#039;&#039;&#039; {{removed|101.0}}&lt;br /&gt;
  ( number unitID, number fuel ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCrashing&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean crashing ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLineage&#039;&#039;&#039; {{removed|83.0}}&lt;br /&gt;
  ( number unitID, number teamID [, boolean isRoot] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNeutral&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean neutral ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTarget&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;userTarget &amp;amp; success new in version 95.0, setting nil target new in 99.0, weaponNum new in 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number enemyUnitID | number x, number y, number z, | nil,&lt;br /&gt;
    [ boolean dgun = false [, boolean userTarget = false [, number weaponNum = -1 ]]] ) -&amp;gt;  success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxRange&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxRange ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;crushable new in version 85.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, boolean blocking [, boolean collide [, boolean crushable]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number unitID,&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.SetUnitMetalExtraction&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;quot;depth&amp;quot; corresponds to metal extraction rate (value range similar to &amp;quot;extractsMetal&amp;quot; unitDef)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, number depth [,number range] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBuildSpeed&#039;&#039;&#039;&lt;br /&gt;
  ( number builderID,&lt;br /&gt;
    number buildSpeed, [ number repairSpeed [, number reclaimSpeed&lt;br /&gt;
  [,number resurrectSpeed [, number captureSpeed [, number terraformSpeed ]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNanoPieces&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number builderID, table pieces ) -&amp;gt; nil&lt;br /&gt;
This saves a lot of engine calls, by replacing:&lt;br /&gt;
function script.QueryNanoPiece() return currentpiece end&lt;br /&gt;
Use it!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitAttach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number transporterID, number passengerID, number pieceNum ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetachFromAir&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLoadingTransport&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID, number transportID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Disables collisions between the two units to allow colvol intersection during the approach.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceParent&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number AlteredPiece, number ParentPiece ) -&amp;gt; nil&lt;br /&gt;
Changes the pieces hierarchy of a unit, by attaching a piece to a new parent.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceMatrix&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number pieceNum, table matrix )&lt;br /&gt;
&lt;br /&gt;
Sets the local (i.e. parent-relative) matrix of the given piece if any of the first three elements are non-zero, and also blocks all script animations from modifying it until {0, 0, 0} is passed (matrix should be an array of 16 floats, but is not otherwise sanity-checked).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitArmored&#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, boolean armored [, number armorMultiple] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number weaponID = -1] [, boolean enabled] [, number power] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFlanking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;mode&amp;quot;, number mode ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;moveFactor&amp;quot;, number factor) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;minDamage&amp;quot;, number minDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;mazDamage&amp;quot;, number maxDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;dir&amp;quot;, number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponNum, table states ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the states table:&lt;br /&gt;
    {&lt;br /&gt;
      [&amp;quot;reloadState&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;reloadFrame&amp;quot;     = number value,] (synonym for reloadState!)&lt;br /&gt;
      [&amp;quot;reloadTime&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;accuracy&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;sprayAngle&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;range&amp;quot;           = number value,] (*)&lt;br /&gt;
      [&amp;quot;projectileSpeed&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;burst&amp;quot;           = number value,]&lt;br /&gt;
      [&amp;quot;burstRate&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;projectiles&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;salvoLeft&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;nextSalvo&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;aimReady&amp;quot;        = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
    }&lt;br /&gt;
  (*) if you change the range of a weapon with dynamic damage&lt;br /&gt;
  make sure you use SetUnitWeaponDamages to change dynDamageRange as well.&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;enum COLVOL_TYPES {&lt;br /&gt;
      COLVOL_TYPE_DISABLED = -1,&lt;br /&gt;
      COLVOL_TYPE_ELLIPSOID = 0,&lt;br /&gt;
      COLVOL_TYPE_CYLINDER,&lt;br /&gt;
      COLVOL_TYPE_BOX,&lt;br /&gt;
      COLVOL_TYPE_SPHERE,&lt;br /&gt;
      COLVOL_NUM_TYPES       // number of non-disabled collision volume types&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_TESTS {&lt;br /&gt;
      COLVOL_TEST_DISC = 0,&lt;br /&gt;
      COLVOL_TEST_CONT = 1,&lt;br /&gt;
      COLVOL_NUM_TESTS = 2   // number of tests&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_AXES {&lt;br /&gt;
      COLVOL_AXIS_X   = 0,&lt;br /&gt;
      COLVOL_AXIS_Y   = 1,&lt;br /&gt;
      COLVOL_AXIS_Z   = 2,&lt;br /&gt;
      COLVOL_NUM_AXES = 3    // number of collision volume axes&lt;br /&gt;
    };&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
As of 101.0 this is 1-based piece index argument (was 0-based).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTravel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number travel [, number travelPeriod] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMoveGoal&#039;&#039;&#039;   &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used by default commands to get in build-,attackrange etc.&amp;lt;/span&amp;gt;&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz &lt;br /&gt;
  [, number goalRadius [, number moveSpeed [, bool moveRaw ]]] )&lt;br /&gt;
{{new|98.0}} &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;moveRaw: [http://springrts.com/mantis/view.php?id=4412 allow unit to dumbly move to a coordinate without calculating path.]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLandGoal&#039;&#039;&#039;   {{new|101.0}}&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz [, number goalRadius ] ) -&amp;gt; nil&lt;br /&gt;
Used in conjunction with {{name|Spring.UnitAttach}} et al to re-implement old airbase &amp;amp; fuel system in lua.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearUnitGoal&#039;&#039;&#039; {{new|102.0}}&lt;br /&gt;
  (number unitID) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPhysics&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;drag new in version 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number posx, number posy, number posz,&lt;br /&gt;
    number velx, number vely, number velz,&lt;br /&gt;
    number rotx, number roty, number rotz,&lt;br /&gt;
    number dragx, number dragy, number dragz,&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number z [, boolean alwaysAboveSea] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDirection&#039;&#039;&#039; {{new|90.0}}&lt;br /&gt;
  ( number unitID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number velx, number vely, number velz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRotation&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number rotx, number roty, number rotz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitImpulse&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number y, number z [, decayRate ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitSeismicPing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pingSize ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveBuildingDecal&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
mpx, mpy, mpz: new middle position of unit&lt;br /&gt;
&lt;br /&gt;
apx, apy, apz: new position that enemies aim at on this unit&lt;br /&gt;
&lt;br /&gt;
relative: are the new coordinates relative to world or unit coordinates?&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponHoldFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit LOS ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCloak&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    boolean cloaked | number scriptCloak,&lt;br /&gt;
    [ number decloakDistance | boolean decloakAbs ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  If the 2nd argument is a number, the value works like this:&lt;br /&gt;
   1:=normal cloak&lt;br /&gt;
   2:=for free cloak (cost no E)&lt;br /&gt;
   3:=for free + no decloaking (except the unit is stunned)&lt;br /&gt;
   4&amp;gt;=ultimative cloak (no ecost, no decloaking, no stunned decloak)&lt;br /&gt;
&lt;br /&gt;
  The decloak distance is only changed if the 3th argument is a number or a boolean.&lt;br /&gt;
   If the boolean is false it takes the default decloak distance for that unitdef,&lt;br /&gt;
   if the boolean is true it takes the absolute value of it.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSonarStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean sonarStealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean stealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean alwaysVisible ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosMask&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;the 3th argument is either the bit-and combination of the following numbers:&lt;br /&gt;
  LOS_INLOS     = 1&lt;br /&gt;
  LOS_INRADAR   = 2&lt;br /&gt;
  LOS_PREVLOS   = 4&lt;br /&gt;
  LOS_CONTRADAR = 8&lt;br /&gt;
&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;or a table of the following form:&lt;br /&gt;
  losTypes = {&lt;br /&gt;
    [los = boolean,]&lt;br /&gt;
    [radar = boolean,]&lt;br /&gt;
    [prevLos = boolean,]&lt;br /&gt;
    [contRadar = boolean,]&lt;br /&gt;
  }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;see above for more info on the arguments&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSensorRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string type, number radius ) -&amp;gt; nil | number newRadius&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;type can be:&lt;br /&gt;
  &amp;quot;los&amp;quot;,&amp;quot;airLos&amp;quot;,&amp;quot;radar&amp;quot;,&amp;quot;sonar&amp;quot;,&amp;quot;seismic&amp;quot;,&amp;quot;radarJammer&amp;quot;,&amp;quot;sonarJammer&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetRadarErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number allyTeamID, number allyteamErrorSize &lt;br /&gt;
  [, number baseErrorSize [, number baseErrorMult ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number unitID, 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]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Resourcing ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitResourcing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    string res, number amount |&lt;br /&gt;
    { res = number amount, ... }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are: &amp;quot;[u|c][u|m][m|e]&amp;quot;&lt;br /&gt;
       unconditional | conditional&lt;br /&gt;
                 use | make&lt;br /&gt;
               metal | energy&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UseUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil | boolean okay&lt;br /&gt;
  ( number unitID, { [&amp;quot;m&amp;quot; | &amp;quot;metal&amp;quot; | &amp;quot;e&amp;quot; | &amp;quot;energy&amp;quot;] = amount, ... } ) -&amp;gt; nil | boolean okay&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHarvestStorage&#039;&#039;&#039; {{new|97.0}}&lt;br /&gt;
  ( number unitid, number metal )&lt;br /&gt;
&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;
= Feature Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateFeature&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number featureDefID, &lt;br /&gt;
    number x, number y, number z&lt;br /&gt;
    [, number heading &lt;br /&gt;
    [, number AllyTeamID &lt;br /&gt;
    [, number featureID ]]] ) -&amp;gt; number featureID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number teamID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feature Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number health) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResources&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number featureID, number metal, number energy [, number reclaimTime [, number reclaimLeft ]] )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureReclaim&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number reclaimLeft) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResurrect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number unitDefID | string unitDefName [, number facing | string &amp;quot;facing&amp;quot; [, number progress ]] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{new|104.0}} Second param can now be a number id instead of a string name, this also allows cancelling ressurection by passing {{value|-1}}. The level of progress can now be set via the additional 4th param.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z [, boolean snapToGround]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRotation&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureVelocity&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePhysics&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
(like their feature counterparts at [[Lua_SyncedCtrl#Unit_Control]])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMoveCtrl&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID [, boolean enable [, number* args]]) to control feature movement&lt;br /&gt;
   the number* arguments are parsed as follows and all optional&lt;br /&gt;
   if enable is true:&lt;br /&gt;
     [, velVector(x,y,z) -- initial velocity for feature&lt;br /&gt;
     [, accVector(x,y,z) -- acceleration added every frame&lt;br /&gt;
     ]]&lt;br /&gt;
   if enable is false:&lt;br /&gt;
     [, velocityMask(x,y,z) -- dimensions in which velocity is allowed to build when not using MoveCtrl&lt;br /&gt;
     [,  impulseMask(x,y,z) -- dimensions in which impulse is allowed to apply when not using MoveCtrl&lt;br /&gt;
     [, movementMask(x,y,z) -- dimensions in which feature is allowed to move when not using MoveCtrl&lt;br /&gt;
     ]]]&lt;br /&gt;
&lt;br /&gt;
As of spring 103.0 it is necessary to unlock feature movement on x,z axis before changing feature physics. For example use &amp;quot;Spring.SetFeatureMoveCtrl(featureID,false,1,1,1,1,1,1,1,1,1)&amp;quot; to unlock all movement prior to making SetFeatureVelocity calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitCollisionVolumeData for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePieceCollisionVolumeData&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitMidAndAimPos for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039;&lt;br /&gt;
  (number featureID, boolean blocking, boolean collidable) --&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number featureID,&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;
= Lua to COB =&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScript&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScriptCB&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;broken in 0.78.2.1; will be removed with the introduction of Lua as COB replacement&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number CallbackData, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBScriptID&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string funcName ) -&amp;gt; nil | number funcID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Note: Don&#039;t use Spring.[Get|Set]UnitCOBValue in LUS just because you are familar with it since bos/cob, use the mighty LuaSpringAPI instead!&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCOBValue&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID [, boolean splitData=false], number COBValue&lt;br /&gt;
    [, number param1 [,number param2 [, number param3 [, number param4 ] ] ] ] )&lt;br /&gt;
  -&amp;gt; number result | number result1, number result2&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCOBValue&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number COBValue, number param1 [,number param2] ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Give Order =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options can also be a bitmask; e.g. 0 instead of an empty table (can avoid performance hit on table creation)&amp;lt;br&amp;gt;&lt;br /&gt;
see [[Lua CMDs]] for relevant constants&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [unitID] = dontCare, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = unitID, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},    &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
=Ground=&lt;br /&gt;
== Grass ==&lt;br /&gt;
&#039;&#039;&#039;Spring.AddGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Heightmap ==&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note that x &amp;amp; z coords are in worldspace (Game.mapSizeX/Z), still the heightmap resolution is [[Lua_ConstGame|Game.squareSize]].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(heightmap[x][z] += height;)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMapFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Example code:&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Spring.SetHeightMapFunc(function()&lt;br /&gt;
	for z=0,Game.mapSizeZ, Game.squareSize do&lt;br /&gt;
		for x=0,Game.mapSizeX, Game.squareSize do&lt;br /&gt;
			Spring.SetHeightMap( x, z, 200 + 20 * math.cos((x + z) / 90) )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.AddHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;the terraform argument is a scaling factor:&lt;br /&gt;
so if 0 nothing will be changed (the terraform starts) and if it is 1 the terraform will be finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMeshFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&#039;&#039;&#039;Spring.AddSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&lt;br /&gt;
== TerrainTypes ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTerrainType&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z, int newType ) -&amp;gt; nil | int oldType&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTerrainTypeData&#039;&#039;&#039;&lt;br /&gt;
  ( int typeIndex&lt;br /&gt;
  [, number speedTanks = nil ]&lt;br /&gt;
  [, number speedKBOTs = nil ]&lt;br /&gt;
  [, number speedHovers = nil ]&lt;br /&gt;
  [, number speedShips = nil ] ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSquareBuildingMask&#039;&#039;&#039; {{new|103.0}}&lt;br /&gt;
  ( number x, number z, int mask ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
See also {{xtaglink|Gamedev:UnitDefs|buildingMask}} unitdef tag.&lt;br /&gt;
&lt;br /&gt;
== MetalAmount ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMetalAmount&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number x, number z, number metalAmount)&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;x &amp;amp; z coords are in worldspace/16&amp;lt;br&amp;gt;metalAmount must be between 0 and 255*maxMetal (with maxMetal from the .smd or mapinfo.lua)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Command Descriptions =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-size:120%; font-weight:600&amp;quot;&amp;gt;Doesn&#039;t work in unsynced code!&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.EditUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number cmdDescID, table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  structure of cmdArray:&lt;br /&gt;
  {&lt;br /&gt;
    [ id          = int ],&lt;br /&gt;
    [ type        = int ],&lt;br /&gt;
    [ name        = string ],&lt;br /&gt;
    [ action      = string ],&lt;br /&gt;
    [ tooltip     = string ],&lt;br /&gt;
    [ texture     = string ],&lt;br /&gt;
    [ cursor      = string ],&lt;br /&gt;
    [ queueing    = boolean ],&lt;br /&gt;
    [ hidden      = boolean ],&lt;br /&gt;
    [ disabled    = boolean ],&lt;br /&gt;
    [ showUnique  = boolean ],&lt;br /&gt;
    [ onlyTexture = boolean ],&lt;br /&gt;
    [ params      = { string = string, ... } ]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{var|queueing}} is {{new|101.0}} and allows custom commands to be non-queueing (handy for state toggles).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.InsertUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] , table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetNoPause&#039;&#039;&#039;&lt;br /&gt;
  ( boolean noPause ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitToFeature&#039;&#039;&#039;&lt;br /&gt;
  ( boolean tofeature ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
an ugly global switch that can be used to block units turning into features when they finish being built (like *A DT&#039;s do, which have the isFeature tag)&lt;br /&gt;
[http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;p=481521 thread]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetExperienceGrade&#039;&#039;&#039;&lt;br /&gt;
  ( number expGrade [, number ExpPowerScale [, number ExpHealthScale [, number ExpReloadScale ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  expGrade defines how often UnitExperience() will be called,&lt;br /&gt;
  Prior to 104.0 it is based on the following equation:&lt;br /&gt;
     (int) [exp/(exp+1)] / expGrade&lt;br /&gt;
  Post 104.0 it is the raw change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnExplosion&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    table explosionParams&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of explosionParams are:&lt;br /&gt;
    weaponDef = number,&lt;br /&gt;
    owner = number,&lt;br /&gt;
    hitUnit = number,&lt;br /&gt;
    hitFeature = number,&lt;br /&gt;
    craterAreaOfEffect = number,&lt;br /&gt;
    damageAreaOfEffect = number,&lt;br /&gt;
    edgeEffectiveness = number,&lt;br /&gt;
    explosionSpeed = number,&lt;br /&gt;
    gfxMod = number,&lt;br /&gt;
    impactOnly = boolean,&lt;br /&gt;
    ignoreOwner = boolean,&lt;br /&gt;
    damageGround = boolean,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Please note the explosion defaults to 1 damage regardless of what it&#039;s defined in the weaponDef.&lt;br /&gt;
The weapondefID is only used for visuals and for passing into callins like UnitDamaged&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnCEG&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;cegname&amp;quot; | number cegID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
  ) -&amp;gt; nil | boolean success, cegID&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;cegID new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnSFX&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number sfxID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
    [, boolean absolute ]&lt;br /&gt;
  ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
Equal to the [[Animation-LuaCallouts#Effects|UnitScript versions of EmitSFX]], but takes position and direction arguments (in either unit- or piece-space) instead of a piece index.&lt;br /&gt;
&lt;br /&gt;
= Projectiles =&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnProjectile&#039;&#039;&#039;&lt;br /&gt;
  ( number weaponDefID, table projectileParams ) -&amp;gt; nil | number projectileID&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of projectileParams are:&lt;br /&gt;
    pos = {number x, number y, number z},&lt;br /&gt;
    end = {number x, number y, number z},&lt;br /&gt;
    speed = {number x, number y, number z},&lt;br /&gt;
    spread = {number x, number y, number z},&lt;br /&gt;
    error = {number x, number y, number z},&lt;br /&gt;
    owner = number,&lt;br /&gt;
    team = number,&lt;br /&gt;
    ttl = number,&lt;br /&gt;
    gravity = number,&lt;br /&gt;
    tracking = number,&lt;br /&gt;
    maxRange = number,&lt;br /&gt;
    startAlpha = number,&lt;br /&gt;
    endAlpha = number,&lt;br /&gt;
    model = string,&lt;br /&gt;
    cegTag = string,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DeleteProjectile&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
Silently removes projectiles (no explosion).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileTarget&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Pre 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID, string targetTypeStr ] | [ number posX, number posY, number posZ ] ) &lt;br /&gt;
    -&amp;gt; nil | boolean validTarget&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Post 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID [, number targetType]]  |  [number posX, number posY, number posZ]) &lt;br /&gt;
    --&amp;gt; nil | boolean validTarget&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;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIgnoreTrackingError&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID, bool ignore ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIsIntercepted&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileMoveControl&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;(disables engine movecontrol, so lua can fully control the physics)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectilePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCollision&#039;&#039;&#039;&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileGravity&#039;&#039;&#039; &lt;br /&gt;
  ( number projID [, number grav = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinAngle&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number spinAngle = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinSpeed&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number speed = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinVec&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCEG&#039;&#039;&#039;&lt;br /&gt;
  ( number projID, string ceg_name ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetPieceProjectileParams&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
  (number projectileID,&lt;br /&gt;
  [ number explosionFlags, [ number spinAngle, [ number spinSpeed,&lt;br /&gt;
  [ number spinVector.x, [ number spinVector.y, [ number spinVector.z ]]]]]]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileAlwaysVisible&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
    (number projectileID, boolean alwaysVisible) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11811</id>
		<title>Lua SyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11811"/>
		<updated>2019-10-23T20:28:47Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added clarification about the &amp;#039;paralyze&amp;#039; parameter in Spring.AddUnitDamage&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 End =&lt;br /&gt;
&#039;&#039;&#039;Spring.KillTeam&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare a team to be dead ( no further orders can be assigned to such teams&#039;s units ), Gaia team cannot be killed.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GameOver&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( {number allyTeamID1, number allyTeamID2, ...} ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare game over, a list of winning allyteams can be passed, if undecided ( like when dropped from the host ) it should be empty ( no winner ), in the case of a draw with multiple winners, all should be listed&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RulesParams =&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;string values are new since 95.0. Attention: Numeric paramValues in quotes will be converted to number.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;possible keys for the losAccess table are:&lt;br /&gt;
    `private` : only readable by the ally (default)&lt;br /&gt;
    `allied`  : readable by ally + ingame allied&lt;br /&gt;
    `inlos`   : readable if the unit is in LOS&lt;br /&gt;
    `inradar` : readable if the unit is in AirLOS&lt;br /&gt;
    `public`  : readable by all&lt;br /&gt;
   note: if one condition is fulfilled all beneath it are too (e.g. if an unit is in LOS it&amp;lt;br/&amp;gt;     can read params with `inradar=true` even if the param has `inlos=false`)&lt;br /&gt;
   note2: all GameRulesParam are public, TeamRulesParams can just be `private`,`allied`&amp;lt;br/&amp;gt;     and/or `public`&lt;br /&gt;
   note3: You can read RulesParams from &#039;&#039;&#039;any&#039;&#039;&#039; Lua enviroments! With those losAccess&amp;lt;br/&amp;gt;     policies you can limit their access.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRulesParam&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;new since 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number featureID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGameRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UseTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, &lt;br /&gt;
    string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;,number amount |&lt;br /&gt;
    { metal = number amount, energy = number amount}&lt;br /&gt;
  ) -&amp;gt; nil | boolean hadEnough&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string res, number amount ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are:&lt;br /&gt;
    &amp;quot;m&amp;quot;  = metal&lt;br /&gt;
    &amp;quot;e&amp;quot;  = energy&lt;br /&gt;
    &amp;quot;ms&amp;quot;  = metal storage&lt;br /&gt;
    &amp;quot;es&amp;quot;  = energy storage&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamShareLevel&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareTeamResource&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;0.82 and later&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number teamID_src, number teamID_recv, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Teams =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAlly&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( number firstAllyTeamID, number secondAllyTeamID, boolean ally ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
Changes the value of the (one-sided) alliance between: firstAllyTeamID -&amp;gt; secondAllyTeamID&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignPlayerToTeam&#039;&#039;&#039; {{new|98.0}}  {{Sourcelinkhash|7ed9a7e34814c60e5ae16281520cccc4daf3c367}}&lt;br /&gt;
  ( number playerID, number teamID)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGlobalLos&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number allyTeamID, bool globallos )&lt;br /&gt;
&lt;br /&gt;
= Unit Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: offmap positions are clamped! (you still can use MoveCtrl todo so)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    (number facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
    number teamID&lt;br /&gt;
    [, boolean build = false] &lt;br /&gt;
    [, boolean flattenGround = true]&lt;br /&gt;
    [, number unitID]&lt;br /&gt;
    [, number builderID]) -&amp;gt; number unitID | nil (meaning unit was not created)&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
  if build is true the unit is created in &amp;quot;being built&amp;quot; state, with buildProgress = 0&lt;br /&gt;
  unitID and builderID are {{new|92.0}}, the former allowing to spawn a unit with&lt;br /&gt;
  a specific ID.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID&lt;br /&gt;
    [, boolean selfd = false]&lt;br /&gt;
    [, boolean reclaimed = false]&lt;br /&gt;
    [, number attackerID ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
 selfd := makes the unit act like it self-destructed&lt;br /&gt;
 reclaimed := don&#039;t show any DeathSequences, don&#039;t leave a wreckage.&lt;br /&gt;
   NOTE this does _not_ give back the resources to the team!&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    numer newTeamID&lt;br /&gt;
    [, boolean given = true ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;if given=false, the unit is captured&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCosts&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, { &lt;br /&gt;
     [ buildTime  = number amount ],&lt;br /&gt;
     [ metalCost  = number amount ],&lt;br /&gt;
     [ energyCost = number amount ]&lt;br /&gt;
   } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;tooltip&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number health |&lt;br /&gt;
    { [ health   = number health ],&lt;br /&gt;
      [ capture  = number capture ],&lt;br /&gt;
      [ paralyze = number paralyze ],&lt;br /&gt;
      [ build    = number build ] }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxHealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitDamage&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number damage&lt;br /&gt;
    [, number paralyze = 0 [, number attackerID = -1 [, number weaponID = -1&lt;br /&gt;
      [, number impulse_x [, number impulse_y [, number impulse_z ]]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;the number in the paralyze parameter equals to paralyzetime in the WeaponDef&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStockpile&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number stockpile [, number buildPercent ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitExperience&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number experience ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFuel&#039;&#039;&#039; {{removed|101.0}}&lt;br /&gt;
  ( number unitID, number fuel ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCrashing&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean crashing ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLineage&#039;&#039;&#039; {{removed|83.0}}&lt;br /&gt;
  ( number unitID, number teamID [, boolean isRoot] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNeutral&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean neutral ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTarget&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;userTarget &amp;amp; success new in version 95.0, setting nil target new in 99.0, weaponNum new in 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number enemyUnitID | number x, number y, number z, | nil,&lt;br /&gt;
    [ boolean dgun = false [, boolean userTarget = false [, number weaponNum = -1 ]]] ) -&amp;gt;  success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxRange&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxRange ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;crushable new in version 85.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, boolean blocking [, boolean collide [, boolean crushable]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number unitID,&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.SetUnitMetalExtraction&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;quot;depth&amp;quot; corresponds to metal extraction rate (value range similar to &amp;quot;extractsMetal&amp;quot; unitDef)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, number depth [,number range] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBuildSpeed&#039;&#039;&#039;&lt;br /&gt;
  ( number builderID,&lt;br /&gt;
    number buildSpeed, [ number repairSpeed [, number reclaimSpeed&lt;br /&gt;
  [,number resurrectSpeed [, number captureSpeed [, number terraformSpeed ]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNanoPieces&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number builderID, table pieces ) -&amp;gt; nil&lt;br /&gt;
This saves a lot of engine calls, by replacing:&lt;br /&gt;
function script.QueryNanoPiece() return currentpiece end&lt;br /&gt;
Use it!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitAttach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number transporterID, number passengerID, number pieceNum ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetachFromAir&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLoadingTransport&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID, number transportID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Disables collisions between the two units to allow colvol intersection during the approach.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceParent&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number AlteredPiece, number ParentPiece ) -&amp;gt; nil&lt;br /&gt;
Changes the pieces hierarchy of a unit, by attaching a piece to a new parent.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceMatrix&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number pieceNum, table matrix )&lt;br /&gt;
&lt;br /&gt;
Sets the local (i.e. parent-relative) matrix of the given piece if any of the first three elements are non-zero, and also blocks all script animations from modifying it until {0, 0, 0} is passed (matrix should be an array of 16 floats, but is not otherwise sanity-checked).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitArmored&#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, boolean armored [, number armorMultiple] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number weaponID = -1] [, boolean enabled] [, number power] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFlanking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;mode&amp;quot;, number mode ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;moveFactor&amp;quot;, number factor) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;minDamage&amp;quot;, number minDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;mazDamage&amp;quot;, number maxDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;dir&amp;quot;, number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponNum, table states ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the states table:&lt;br /&gt;
    {&lt;br /&gt;
      [&amp;quot;reloadState&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;reloadFrame&amp;quot;     = number value,] (synonym for reloadState!)&lt;br /&gt;
      [&amp;quot;reloadTime&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;accuracy&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;sprayAngle&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;range&amp;quot;           = number value,] (*)&lt;br /&gt;
      [&amp;quot;projectileSpeed&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;burst&amp;quot;           = number value,]&lt;br /&gt;
      [&amp;quot;burstRate&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;projectiles&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;salvoLeft&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;nextSalvo&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;aimReady&amp;quot;        = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
    }&lt;br /&gt;
  (*) if you change the range of a weapon with dynamic damage&lt;br /&gt;
  make sure you use SetUnitWeaponDamages to change dynDamageRange as well.&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;enum COLVOL_TYPES {&lt;br /&gt;
      COLVOL_TYPE_DISABLED = -1,&lt;br /&gt;
      COLVOL_TYPE_ELLIPSOID = 0,&lt;br /&gt;
      COLVOL_TYPE_CYLINDER,&lt;br /&gt;
      COLVOL_TYPE_BOX,&lt;br /&gt;
      COLVOL_TYPE_SPHERE,&lt;br /&gt;
      COLVOL_NUM_TYPES       // number of non-disabled collision volume types&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_TESTS {&lt;br /&gt;
      COLVOL_TEST_DISC = 0,&lt;br /&gt;
      COLVOL_TEST_CONT = 1,&lt;br /&gt;
      COLVOL_NUM_TESTS = 2   // number of tests&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_AXES {&lt;br /&gt;
      COLVOL_AXIS_X   = 0,&lt;br /&gt;
      COLVOL_AXIS_Y   = 1,&lt;br /&gt;
      COLVOL_AXIS_Z   = 2,&lt;br /&gt;
      COLVOL_NUM_AXES = 3    // number of collision volume axes&lt;br /&gt;
    };&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
As of 101.0 this is 1-based piece index argument (was 0-based).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTravel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number travel [, number travelPeriod] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMoveGoal&#039;&#039;&#039;   &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used by default commands to get in build-,attackrange etc.&amp;lt;/span&amp;gt;&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz &lt;br /&gt;
  [, number goalRadius [, number moveSpeed [, bool moveRaw ]]] )&lt;br /&gt;
{{new|98.0}} &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;moveRaw: [http://springrts.com/mantis/view.php?id=4412 allow unit to dumbly move to a coordinate without calculating path.]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLandGoal&#039;&#039;&#039;   {{new|101.0}}&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz [, number goalRadius ] ) -&amp;gt; nil&lt;br /&gt;
Used in conjunction with {{name|Spring.UnitAttach}} et al to re-implement old airbase &amp;amp; fuel system in lua.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearUnitGoal&#039;&#039;&#039; {{new|102.0}}&lt;br /&gt;
  (number unitID) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPhysics&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;drag new in version 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number posx, number posy, number posz,&lt;br /&gt;
    number velx, number vely, number velz,&lt;br /&gt;
    number rotx, number roty, number rotz,&lt;br /&gt;
    number dragx, number dragy, number dragz,&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number z [, boolean alwaysAboveSea] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDirection&#039;&#039;&#039; {{new|90.0}}&lt;br /&gt;
  ( number unitID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number velx, number vely, number velz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRotation&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number rotx, number roty, number rotz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitImpulse&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number y, number z [, decayRate ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitSeismicPing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pingSize ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveBuildingDecal&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
mpx, mpy, mpz: new middle position of unit&lt;br /&gt;
&lt;br /&gt;
apx, apy, apz: new position that enemies aim at on this unit&lt;br /&gt;
&lt;br /&gt;
relative: are the new coordinates relative to world or unit coordinates?&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponHoldFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit LOS ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCloak&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    boolean cloaked | number scriptCloak,&lt;br /&gt;
    [ number decloakDistance | boolean decloakAbs ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  If the 2nd argument is a number, the value works like this:&lt;br /&gt;
   1:=normal cloak&lt;br /&gt;
   2:=for free cloak (cost no E)&lt;br /&gt;
   3:=for free + no decloaking (except the unit is stunned)&lt;br /&gt;
   4&amp;gt;=ultimative cloak (no ecost, no decloaking, no stunned decloak)&lt;br /&gt;
&lt;br /&gt;
  The decloak distance is only changed if the 3th argument is a number or a boolean.&lt;br /&gt;
   If the boolean is false it takes the default decloak distance for that unitdef,&lt;br /&gt;
   if the boolean is true it takes the absolute value of it.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSonarStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean sonarStealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean stealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean alwaysVisible ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosMask&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;the 3th argument is either the bit-and combination of the following numbers:&lt;br /&gt;
  LOS_INLOS     = 1&lt;br /&gt;
  LOS_INRADAR   = 2&lt;br /&gt;
  LOS_PREVLOS   = 4&lt;br /&gt;
  LOS_CONTRADAR = 8&lt;br /&gt;
&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;or a table of the following form:&lt;br /&gt;
  losTypes = {&lt;br /&gt;
    [los = boolean,]&lt;br /&gt;
    [radar = boolean,]&lt;br /&gt;
    [prevLos = boolean,]&lt;br /&gt;
    [contRadar = boolean,]&lt;br /&gt;
  }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;see above for more info on the arguments&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSensorRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string type, number radius ) -&amp;gt; nil | number newRadius&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;type can be:&lt;br /&gt;
  &amp;quot;los&amp;quot;,&amp;quot;airLos&amp;quot;,&amp;quot;radar&amp;quot;,&amp;quot;sonar&amp;quot;,&amp;quot;seismic&amp;quot;,&amp;quot;radarJammer&amp;quot;,&amp;quot;sonarJammer&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetRadarErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number allyTeamID, number allyteamErrorSize &lt;br /&gt;
  [, number baseErrorSize [, number baseErrorMult ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number unitID, 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]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Resourcing ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitResourcing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    string res, number amount |&lt;br /&gt;
    { res = number amount, ... }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are: &amp;quot;[u|c][u|m][m|e]&amp;quot;&lt;br /&gt;
       unconditional | conditional&lt;br /&gt;
                 use | make&lt;br /&gt;
               metal | energy&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UseUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil | boolean okay&lt;br /&gt;
  ( number unitID, { [&amp;quot;m&amp;quot; | &amp;quot;metal&amp;quot; | &amp;quot;e&amp;quot; | &amp;quot;energy&amp;quot;] = amount, ... } ) -&amp;gt; nil | boolean okay&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHarvestStorage&#039;&#039;&#039; {{new|97.0}}&lt;br /&gt;
  ( number unitid, number metal )&lt;br /&gt;
&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;
= Feature Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateFeature&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number featureDefID, &lt;br /&gt;
    number x, number y, number z&lt;br /&gt;
    [, number heading &lt;br /&gt;
    [, number AllyTeamID &lt;br /&gt;
    [, number featureID ]]] ) -&amp;gt; number featureID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number teamID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feature Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number health) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResources&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number featureID, number metal, number energy [, number reclaimTime [, number reclaimLeft ]] )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureReclaim&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number reclaimLeft) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResurrect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number unitDefID | string unitDefName [, number facing | string &amp;quot;facing&amp;quot; [, number progress ]] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{new|104.0}} Second param can now be a number id instead of a string name, this also allows cancelling ressurection by passing {{value|-1}}. The level of progress can now be set via the additional 4th param.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z [, boolean snapToGround]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRotation&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureVelocity&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePhysics&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
(like their feature counterparts at [[Lua_SyncedCtrl#Unit_Control]])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMoveCtrl&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID [, boolean enable [, number* args]]) to control feature movement&lt;br /&gt;
   the number* arguments are parsed as follows and all optional&lt;br /&gt;
   if enable is true:&lt;br /&gt;
     [, velVector(x,y,z) -- initial velocity for feature&lt;br /&gt;
     [, accVector(x,y,z) -- acceleration added every frame&lt;br /&gt;
     ]]&lt;br /&gt;
   if enable is false:&lt;br /&gt;
     [, velocityMask(x,y,z) -- dimensions in which velocity is allowed to build when not using MoveCtrl&lt;br /&gt;
     [,  impulseMask(x,y,z) -- dimensions in which impulse is allowed to apply when not using MoveCtrl&lt;br /&gt;
     [, movementMask(x,y,z) -- dimensions in which feature is allowed to move when not using MoveCtrl&lt;br /&gt;
     ]]]&lt;br /&gt;
&lt;br /&gt;
As of spring 103.0 it is necessary to unlock feature movement on x,z axis before changing feature physics. For example use &amp;quot;Spring.SetFeatureMoveCtrl(featureID,false,1,1,1,1,1,1,1,1,1)&amp;quot; to unlock all movement prior to making SetFeatureVelocity calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitCollisionVolumeData for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePieceCollisionVolumeData&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitMidAndAimPos for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039;&lt;br /&gt;
  (number featureID, boolean blocking, boolean collidable) --&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number featureID,&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;
= Lua to COB =&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScript&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScriptCB&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;broken in 0.78.2.1; will be removed with the introduction of Lua as COB replacement&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number CallbackData, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBScriptID&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string funcName ) -&amp;gt; nil | number funcID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Note: Don&#039;t use Spring.[Get|Set]UnitCOBValue in LUS just because you are familar with it since bos/cob, use the mighty LuaSpringAPI instead!&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCOBValue&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID [, boolean splitData=false], number COBValue&lt;br /&gt;
    [, number param1 [,number param2 [, number param3 [, number param4 ] ] ] ] )&lt;br /&gt;
  -&amp;gt; number result | number result1, number result2&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCOBValue&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number COBValue, number param1 [,number param2] ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Give Order =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options can also be a bitmask; e.g. 0 instead of an empty table (can avoid performance hit on table creation)&amp;lt;br&amp;gt;&lt;br /&gt;
see [[Lua CMDs]] for relevant constants&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [unitID] = dontCare, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = unitID, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},    &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
=Ground=&lt;br /&gt;
== Grass ==&lt;br /&gt;
&#039;&#039;&#039;Spring.AddGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Heightmap ==&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note that x &amp;amp; z coords are in worldspace (Game.mapSizeX/Z), still the heightmap resolution is [[Lua_ConstGame|Game.squareSize]].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(heightmap[x][z] += height;)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMapFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Example code:&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Spring.SetHeightMapFunc(function()&lt;br /&gt;
	for z=0,Game.mapSizeZ, Game.squareSize do&lt;br /&gt;
		for x=0,Game.mapSizeX, Game.squareSize do&lt;br /&gt;
			Spring.SetHeightMap( x, z, 200 + 20 * math.cos((x + z) / 90) )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.AddHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;the terraform argument is a scaling factor:&lt;br /&gt;
so if 0 nothing will be changed (the terraform starts) and if it is 1 the terraform will be finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMeshFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&#039;&#039;&#039;Spring.AddSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&lt;br /&gt;
== TerrainTypes ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTerrainType&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z, int newType ) -&amp;gt; nil | int oldType&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTerrainTypeData&#039;&#039;&#039;&lt;br /&gt;
  ( int typeIndex&lt;br /&gt;
  [, number speedTanks = nil ]&lt;br /&gt;
  [, number speedKBOTs = nil ]&lt;br /&gt;
  [, number speedHovers = nil ]&lt;br /&gt;
  [, number speedShips = nil ] ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSquareBuildingMask&#039;&#039;&#039; {{new|103.0}}&lt;br /&gt;
  ( number x, number z, int mask ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
See also {{xtaglink|Gamedev:UnitDefs|buildingMask}} unitdef tag.&lt;br /&gt;
&lt;br /&gt;
== MetalAmount ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMetalAmount&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number x, number z, number metalAmount)&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;x &amp;amp; z coords are in worldspace/16&amp;lt;br&amp;gt;metalAmount must be between 0 and 255*maxMetal (with maxMetal from the .smd or mapinfo.lua)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Command Descriptions =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-size:120%; font-weight:600&amp;quot;&amp;gt;Doesn&#039;t work in unsynced code!&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.EditUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number cmdDescID, table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  structure of cmdArray:&lt;br /&gt;
  {&lt;br /&gt;
    [ id          = int ],&lt;br /&gt;
    [ type        = int ],&lt;br /&gt;
    [ name        = string ],&lt;br /&gt;
    [ action      = string ],&lt;br /&gt;
    [ tooltip     = string ],&lt;br /&gt;
    [ texture     = string ],&lt;br /&gt;
    [ cursor      = string ],&lt;br /&gt;
    [ queueing    = boolean ],&lt;br /&gt;
    [ hidden      = boolean ],&lt;br /&gt;
    [ disabled    = boolean ],&lt;br /&gt;
    [ showUnique  = boolean ],&lt;br /&gt;
    [ onlyTexture = boolean ],&lt;br /&gt;
    [ params      = { string = string, ... } ]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{var|queueing}} is {{new|101.0}} and allows custom commands to be non-queueing (handy for state toggles).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.InsertUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] , table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetNoPause&#039;&#039;&#039;&lt;br /&gt;
  ( boolean noPause ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitToFeature&#039;&#039;&#039;&lt;br /&gt;
  ( boolean tofeature ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
an ugly global switch that can be used to block units turning into features when they finish being built (like *A DT&#039;s do, which have the isFeature tag)&lt;br /&gt;
[http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;p=481521 thread]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetExperienceGrade&#039;&#039;&#039;&lt;br /&gt;
  ( number expGrade [, number ExpPowerScale [, number ExpHealthScale [, number ExpReloadScale ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  expGrade defines how often UnitExperience() will be called,&lt;br /&gt;
  Prior to 104.0 it is based on the following equation:&lt;br /&gt;
     (int) [exp/(exp+1)] / expGrade&lt;br /&gt;
  Post 104.0 it is the raw change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnExplosion&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    table explosionParams&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of explosionParams are:&lt;br /&gt;
    weaponDef = number,&lt;br /&gt;
    owner = number,&lt;br /&gt;
    hitUnit = number,&lt;br /&gt;
    hitFeature = number,&lt;br /&gt;
    craterAreaOfEffect = number,&lt;br /&gt;
    damageAreaOfEffect = number,&lt;br /&gt;
    edgeEffectiveness = number,&lt;br /&gt;
    explosionSpeed = number,&lt;br /&gt;
    gfxMod = number,&lt;br /&gt;
    impactOnly = boolean,&lt;br /&gt;
    ignoreOwner = boolean,&lt;br /&gt;
    damageGround = boolean,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnCEG&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;cegname&amp;quot; | number cegID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
  ) -&amp;gt; nil | boolean success, cegID&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;cegID new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnSFX&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number sfxID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
    [, boolean absolute ]&lt;br /&gt;
  ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
Equal to the [[Animation-LuaCallouts#Effects|UnitScript versions of EmitSFX]], but takes position and direction arguments (in either unit- or piece-space) instead of a piece index.&lt;br /&gt;
&lt;br /&gt;
= Projectiles =&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnProjectile&#039;&#039;&#039;&lt;br /&gt;
  ( number weaponDefID, table projectileParams ) -&amp;gt; nil | number projectileID&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of projectileParams are:&lt;br /&gt;
    pos = {number x, number y, number z},&lt;br /&gt;
    end = {number x, number y, number z},&lt;br /&gt;
    speed = {number x, number y, number z},&lt;br /&gt;
    spread = {number x, number y, number z},&lt;br /&gt;
    error = {number x, number y, number z},&lt;br /&gt;
    owner = number,&lt;br /&gt;
    team = number,&lt;br /&gt;
    ttl = number,&lt;br /&gt;
    gravity = number,&lt;br /&gt;
    tracking = number,&lt;br /&gt;
    maxRange = number,&lt;br /&gt;
    startAlpha = number,&lt;br /&gt;
    endAlpha = number,&lt;br /&gt;
    model = string,&lt;br /&gt;
    cegTag = string,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DeleteProjectile&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
Silently removes projectiles (no explosion).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileTarget&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Pre 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID, string targetTypeStr ] | [ number posX, number posY, number posZ ] ) &lt;br /&gt;
    -&amp;gt; nil | boolean validTarget&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Post 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID [, number targetType]]  |  [number posX, number posY, number posZ]) &lt;br /&gt;
    --&amp;gt; nil | boolean validTarget&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;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIgnoreTrackingError&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID, bool ignore ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIsIntercepted&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileMoveControl&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;(disables engine movecontrol, so lua can fully control the physics)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectilePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCollision&#039;&#039;&#039;&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileGravity&#039;&#039;&#039; &lt;br /&gt;
  ( number projID [, number grav = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinAngle&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number spinAngle = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinSpeed&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number speed = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinVec&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCEG&#039;&#039;&#039;&lt;br /&gt;
  ( number projID, string ceg_name ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetPieceProjectileParams&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
  (number projectileID,&lt;br /&gt;
  [ number explosionFlags, [ number spinAngle, [ number spinSpeed,&lt;br /&gt;
  [ number spinVector.x, [ number spinVector.y, [ number spinVector.z ]]]]]]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileAlwaysVisible&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
    (number projectileID, boolean alwaysVisible) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10802</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10802"/>
		<updated>2019-05-10T03:00:08Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added a more in-depth description of Update vs GameFrame, as per Sprung &amp;amp; Gajop&amp;#039;s description on Discord&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = &amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;[ Unsynced only ]&#039;&#039;&#039;&amp;lt;/span&amp;gt; Called for every drawn frame. The parameter is the time since the last update. Perform calculations in here and only perform drawing in Draw* callins (listed below). On the synced portion of gadgets, use GameFrame() for per-frame computations. Please note that when  the engine is not under heavy load you will typically get more than one Update callin for each GameFrame. Update is called even while the engine is paused, there is no such event in synced. }}&lt;br /&gt;
&lt;br /&gt;
=== Draw* Functions ===&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10801</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10801"/>
		<updated>2019-05-10T02:43:21Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;&#039;&#039;&#039;Attention:&#039;&#039;&#039;&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame. The parameter is the time since the last update. Perform calculations in here and only drawing in Draw* callins.}}&lt;br /&gt;
&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10800</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10800"/>
		<updated>2019-05-10T02:42:02Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Alerting about unsynced-only callins&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
This page is future looking to unified widget/gadget (aka &amp;quot;addon&amp;quot;) handler, which may yet be some way off, c.f. the [https://github.com/spring/spring/blob/ebb704e008f6ea645947d07be1cfcc272af0428f/doc/changelog.txt#L71 changelog].&lt;br /&gt;
&lt;br /&gt;
Related Sourcecode :&lt;br /&gt;
[https://github.com/spring/spring/blob/d9b3927a528a876b9ab4042771e82b050267572a/rts/Lua/LuaHandle.cpp https://github.com/spring/spring/rts/Lua/LuaHandle.cpp]&lt;br /&gt;
&lt;br /&gt;
For now, to use these addons in a widget, replace addon with widget and, for a gadget, replace addon with gadget. For example,&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)&lt;br /&gt;
        ...  &lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some functions may differ between (synced) gadget and widgets; those are in the [[#Synced_-_Unsynced_Shared]] section. Essentially the reason is that all information should be available to synced (game logic controlling) gadgets, but restricted to unsynced gadget/widget (e.g. information about an enemy unit only detected via radar and not yet in LOS). In such cases the full (synced) param list is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: maroon;&amp;quot;&amp;gt;Attention:&amp;lt;/span&amp;gt; some callins will only work on the unsynced portion of the gadget. Due to the type-unsafe nature of lua parsing, those callins not firing up might be hard to trace. This document will be continuously updated to properly alert about those situations.&lt;br /&gt;
&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|info = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|info = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|args = type, id&lt;br /&gt;
|return = {{type|number}} cmdID&lt;br /&gt;
|info = Used to set the default command when a unit is selected. First parameter is the type of the object pointed at (either &amp;quot;unit or &amp;quot;feature&amp;quot;) and the second is its {{var|unitID}} or {{var|featureID}} respectively. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|args = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = {{type|bool}} removeCmd&lt;br /&gt;
|info = Called when a command is issued. Returning {{value|true}} deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandsChanged&lt;br /&gt;
|args = None&lt;br /&gt;
|return = ?&lt;br /&gt;
|info = Called when the command descriptions changed, e.g. when selecting or deselecting a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|args = ttType, data1, data2, data3&lt;br /&gt;
|return = {{type|string}} newTooltip&lt;br /&gt;
|info = The parameters can be {{value|&amp;quot;unit&amp;quot;}}, {{var|unitID}}; {{value|&amp;quot;feature&amp;quot;}}, {{var|featureID}}; {{value|&amp;quot;ground&amp;quot;}}, {{var|posX}}, {{var|posY}}, {{var|posZ}} or {{value|&amp;quot;selection&amp;quot;}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|args = serverFrameNum&lt;br /&gt;
|info = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|args =  state, ready, playerStates&lt;br /&gt;
|return = {{type|bool}} success, {{type|bool}} newReady&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|args = msg, priority&lt;br /&gt;
|info = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|args = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|args = ...&lt;br /&gt;
|info = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|args = message, replaceLastLine&lt;br /&gt;
|info = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|args = groupID&lt;br /&gt;
|info = Called when a unit is added to or removed from a control group. Currently implemented for widgets only.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|args = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|bool}} isAbove&lt;br /&gt;
|info = Called every Update. Must return {{value|true}} for {{name|Mouse*}} events and {{name|GetToolTip}} to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|args = x, y&lt;br /&gt;
|return = {{type|string}} tooltip&lt;br /&gt;
|info = Called when {{name|IsAbove}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|args = key, mods, isRepeat&lt;br /&gt;
|return = {{type|bool}} becomeOwner&lt;br /&gt;
|info = Called repeatedly when a key is pressed down. If you want an action to occur only once check for {{var|1=isRepeat == {{value|false}}}}. The {{var|mods}} parameter is a {{type|table}}, with keys {{value|&amp;quot;alt&amp;quot;}}, {{value|&amp;quot;ctrl&amp;quot;}}, {{value|&amp;quot;meta&amp;quot;}} and {{value|&amp;quot;shift&amp;quot;}} each having a boolean value. Return {{value|true}} if you don&#039;t want other callins or the engine to also receive this keypress. A list of key codes can be seen at the [https://wiki.libsdl.org/SDLKeycodeLookup SDL wiki].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|args = key&lt;br /&gt;
|return = {{type|bool}}&lt;br /&gt;
|info = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TextInput&lt;br /&gt;
|args = utf8char&lt;br /&gt;
|info = Called whenever a key press results in text input. Introduced in 97.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = {{type|bool}} becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is pressed. The {{var|button}} parameter supports up to 7 buttons. Must return {{value|true}} for {{name|MouseRelease}} and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|args = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|info = Called when a mouse button is released. Please note that in order to have Spring call {{name|MouseRelease}}, you need to have a {{name|MousePress}} call-in in the same addon that returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|args = up, value&lt;br /&gt;
|info = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|args = x, y, dx, dy, button&lt;br /&gt;
|info = Called when the mouse is moved. The {{var|dx}} and {{var|dy}} parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|args = playerID&lt;br /&gt;
|info = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|args = playerID, reason&lt;br /&gt;
|info = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Downloads ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadStarted&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download is started via [[Lua_VFS#Archives|VFS.DownloadArchive]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFinished&lt;br /&gt;
|args = id&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download finishes successfully.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadFailed&lt;br /&gt;
|args = id, errorID&lt;br /&gt;
|info = Called when a [[Pr-downloader]] download fails to complete.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DownloadProgress&lt;br /&gt;
|args = id, downloaded, total&lt;br /&gt;
|info = Called incrementally during a [[Pr-downloader]] download.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|args = viewSizeX, viewSizeY&lt;br /&gt;
|info = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|args = dt&lt;br /&gt;
|info = Called for every draw frame. The parameter is the time since the last update. Perform calculations in here and only drawing in Draw* callins.}}&lt;br /&gt;
&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|info = Doesn&#039;t render to screen! Use this callin to update textures, shaders, etc. Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreParticles&lt;br /&gt;
|info = ??? {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|info = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|info = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreForward&lt;br /&gt;
|info = Runs at the start of the forward pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPreDeferred&lt;br /&gt;
|info = Runs at the start of the deferred pass when a custom map shader has been assigned via [[Lua_UnsyncedCtrl#Map|{{name|Spring.SetMapShader}}]] (convenient for setting uniforms).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGroundPostDeferred&lt;br /&gt;
|info = This runs at the end of its respective deferred pass and allows proper frame compositing (with ground flashes/decals/foliage/etc, which are drawn between it and [[#API:DrawWorldPreUnit|{{name|DrawWorldPreUnit}}]]) via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnitsPostDeferred&lt;br /&gt;
|info = Runs at the end of the unit deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeaturesPostDeferred&lt;br /&gt;
|info = Runs at the end of the feature deferred pass to inform Lua code it should make use of the {{value|$model_gbuffer_*}} textures before another pass overwrites them (and to allow proper blending with e.g. cloaked objects which are drawn between these events and [[#API:DrawWorld|{{name|DrawWorld}}]] via [[Lua_OpenGL_Api#Textures|{{name|gl.CopyToTexture}}]]). N.B. The *PostDeferred events are only sent (and only have a real purpose) if forward drawing is disabled.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = ??? Also available to LuaMenu.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = Where {{var|vsx}}, {{var|vsy}} are screen coordinates.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenPost&lt;br /&gt;
|args = vsx, vsy&lt;br /&gt;
|info = {{new|104.0}} Similar to {{name|DrawScreenEffects}}, this can be used to alter the contents of a frame after it has been completely rendered (i.e. World, MiniMap, Menu, UI).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|info = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimapBackground&lt;br /&gt;
|args = sx, sy&lt;br /&gt;
|info = Where {{var|sx}}, {{var|sy}} are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls {{var|drawMode}} can be one of the following, {{var|1=notDrawing = {{value|0}}}}, {{var|1=normalDraw = {{value|1}}}}, {{var|1=shadowDraw = {{value|2}}}}, {{var|1=reflectionDraw = {{value|3}}}}, {{var|1=refractionDraw = {{value|4}}}}, and finally {{var|1=gameDeferredDraw = {{value|5}}}} which was added in 102.0.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|args = unitID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|args = unitID, weaponID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|args = projectileID, drawMode&lt;br /&gt;
|return = {{type|bool}} suppressEngineDraw&lt;br /&gt;
|info = For custom rendering of weapon (&amp;amp; other) projectiles.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unsynced Menu Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDraw&lt;br /&gt;
|return = {{type|bool}} allowDraw&lt;br /&gt;
|info = Enables Draw{Genesis,Screen,ScreenPost} callins if {{value|true}} is returned, otherwise they are called once every 30 seconds. Only active when a game isn&#039;t running.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateMenu&lt;br /&gt;
|info = Called whenever LuaMenu is on with no game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ActivateGame&lt;br /&gt;
|info = Called whenever LuaMenu is on with a game loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GotChatMsg&lt;br /&gt;
|args = msg, player&lt;br /&gt;
|info = Called when a player issues a UI command e.g. types {{var|/foo}} or {{var|/luarules foo}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|args = gameID&lt;br /&gt;
|info = Called once to deliver the {{var|gameID}}. As of 101.0+ the string is encoded in hex.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|info = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|args = winningAllyTeams&lt;br /&gt;
|info = The parameter is a {{type|table}} list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|args = frame&lt;br /&gt;
|info = Called for every game simulation frame (30 per second). Starts at frame {{value|0}} in 101.0+ and {{value|1}} in previous versions.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|info = Called before the 0 gameframe. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|info = Called upon the start of the game. From 104.0 onwards, will not be called when a saved game is loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|args = teamID&lt;br /&gt;
|info = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|info = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|info = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitReverseBuilt&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a living unit becomes a nanoframe again.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|args = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called after {{name|UnitTaken}} and in that moment unit is assigned to the &#039;&#039;&#039;newTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|info = Called when a unit is transferred between teams. This is called before {{name|UnitGiven}} and in that moment unit is still assigned to the &#039;&#039;&#039;oldTeam&#039;&#039;&#039;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is damaged (after {{name|UnitPreDamaged}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RenderUnitDestroyed&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called just before a unit is invalid, after it finishes its death animation. {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitStunned&lt;br /&gt;
|args =  unitID, unitDefID, unitTeam, stunned&lt;br /&gt;
|info = Called when a unit changes its stun status. {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|args = colliderID, collideeID&lt;br /&gt;
|info = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called after when a unit accepts a command, after {{name|AllowCommand}} returns {{value|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOpts, cmdTag&lt;br /&gt;
|info = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|info = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|info = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]]. Should be called more reliably with small values of experience grade in 104.0+.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|args = unitID, unitDefID, unitTeam&lt;br /&gt;
|info = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|info = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|args = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|info = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|args = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|info = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|args =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|info = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|args = featureID, allyTeamID&lt;br /&gt;
|info = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|args = ???&lt;br /&gt;
|info = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|args = proID, proOwnerID, weaponDefID&lt;br /&gt;
|info = Called when the projectile is created. Note that {{var|weaponDefID}} is missing if the projectile is spawned as part of a burst, but [[Lua_SyncedRead#Projectiles|Spring.GetProjectileDefID]] and [[Lua_SyncedRead#Projectiles|Spring.GetProjectileName]] still work in callin scope using {{var|proID}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|args = proID&lt;br /&gt;
|info = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = {{type|bool}} used, {{type|bool}} finished&lt;br /&gt;
|info = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns {{var|used}} as {{value|true}} the command is dropped, if an addon returns {{value|true}}, {{value|true}} the command is removed because it&#039;s done, with {{value|true}}, {{value|false}} it&#039;s kept in the queue and {{name|CommandFallback}} gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when the command is given, before the unit&#039;s queue is altered. The return value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|args = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|args = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = {{type|bool}} allow&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;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|args = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|args = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|args = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|args = teamID, res, level&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|args = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|args = playerID, teamID, readyState, clampedX, clampedY, clampedZ, rawX, rawY, rawZ&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = {{var|clamped{X,Y,Z}}} are the coordinates clamped into start-boxes, {{var|raw}} is where player tried to place their marker. The {{var|readyState}} can be any one of &lt;br /&gt;
* {{value|0}} - player picked a position, &lt;br /&gt;
* {{value|1}} - player clicked ready, &lt;br /&gt;
* {{value|2}} - player pressed ready OR  the game was force-started (player did not click ready, but is now forcibly readied) or &lt;br /&gt;
* {{value|3}} - the player failed to load. &lt;br /&gt;
* {{new|95.0}} the default &#039;failed to choose&#039; start-position is the north-west point of their startbox, or (0,0,0) if they do not have a startbox. &lt;br /&gt;
NB: The order of the parameters changed with the addition of {{var|teamID}} in 104.0. Previouly it was:&lt;br /&gt;
{{var|clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = {{type|bool}} allow&lt;br /&gt;
|info = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|args = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = {{type|bool}} allowCheck, {{type|bool}} ignoreCheck&lt;br /&gt;
|info = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag. The {{var|ignoreCheck}} return value was added in 99.0 to allow ignoring the callin i.e. running normal engine check for this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|args = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = {{type|bool}} allowed, {{type|number}} newPriority&lt;br /&gt;
|info = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value is the new priority for this target (if you don&#039;t want to change it, return {{var|defPriority}}). Lower priority targets are targeted first.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|args = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = {{type|bool}} allowed&lt;br /&gt;
|info = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for {{var|weaponDefIDs}} registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowBuilderHoldFire&lt;br /&gt;
|args = unitID, unitDefID, action&lt;br /&gt;
|return = {{type|bool}} actionAllowed&lt;br /&gt;
|info = {{new|98.0}} {{Sourcelinkhash|5a82d750b89e72024bb0bb62cf05ea257737e0ac}}   Called when a construction unit wants to &amp;quot;use his nano beams&amp;quot;.&amp;lt;br&amp;gt;{{var|action}} is one of following:&lt;br /&gt;
* {{value|-1}} Build&lt;br /&gt;
* {{value|CMD.REPAIR}} Repair&lt;br /&gt;
* {{value|CMD.RECLAIM}} Reclaim&lt;br /&gt;
* {{value|CMD.RESTORE}} Restore&lt;br /&gt;
* {{value|CMD.RESURRECT}} Resurrect&lt;br /&gt;
* {{value|CMD.CAPTURE}} Capture&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|args = weaponDefID, px, py, pz, AttackerID, ProjectileID&lt;br /&gt;
|return = {{type|bool}} noGfx&lt;br /&gt;
|info = Called when an explosion occurs. If it returns {{value|true}} then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = {{type|bool}} stop&lt;br /&gt;
|info = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is {{value|true}} the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = {{type|bool}} moveCtrlComplete&lt;br /&gt;
|info = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than {{value|1}} (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled ({{value|false}}) or return to engine controlled movement ({{value|true}}).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|args = msg, playerID&lt;br /&gt;
|info = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|args = zip&lt;br /&gt;
|info = Called after {{name|GamePreload}} and before {{name|GameStart}}. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
For the following callins, in addition to being a regular weapon, {{var|weaponDefID}} may be one of the following:&lt;br /&gt;
* {{value|-1}} - debris collision, also default of [[Lua_SyncedCtrl#Unit_Control|Spring.AddUnitDamage]]&lt;br /&gt;
* {{value|-2}} - ground collision&lt;br /&gt;
* {{value|-3}} - object collision&lt;br /&gt;
* {{value|-4}} - fire damage&lt;br /&gt;
* {{value|-5}} - water damage&lt;br /&gt;
* {{value|-6}} - kill damage&lt;br /&gt;
* {{value|-7}} - crush damage&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|args = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|I recommend looking up the CallIns in Sourcecode, because the Lua-Documentation, generated from the lua handle of them is seriously flawed and not regenerated.&lt;br /&gt;
|Lua-Handler documented from version&lt;br /&gt;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynced.h#L106&lt;br /&gt;
|Actual CallIn: &lt;br /&gt;
|args = proID, shieldCarrier, boolBounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID, startX, startY, startZ, hitX, hitY, hitZ&lt;br /&gt;
|return = {{type|bool}} handleCollision&lt;br /&gt;
|info = Called before any engine shield-vs-projectile logic executes. If the return value is {{value|true}} the gadget handles the collision event and the engine does not remove the projectile. If the weapon is a hitscan type ([[Gamedev:WeaponDefs#Tag:weaponType|BeamLaser]] or [[Gamedev:WeaponDefs#Tag:weaponType|LightningCanon]]) then {{var|proID}} is {{value|nil}} and {{var|beamEmitterWeaponNum}} and {{var|beamEmitterUnitID}} are populated instead. The start and hit position arguments are provided from 104.0 onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|args = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = {{type|number}} newDamage, {{type|number}} impulseMult&lt;br /&gt;
|info = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_CMDs&amp;diff=11176</id>
		<title>Lua CMDs</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_CMDs&amp;diff=11176"/>
		<updated>2019-04-05T05:59:38Z</updated>

		<summary type="html">&lt;p&gt;Maddox: adding command amount req param to getunitcommands&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;
== Options ==&lt;br /&gt;
&amp;lt;b id=CMD.OPT_ALT&amp;gt;CMD.OPT_ALT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_CTRL&amp;gt;CMD.OPT_CTRL&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_SHIFT&amp;gt;CMD.OPT_SHIFT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_RIGHT&amp;gt;CMD.OPT_RIGHT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_INTERNAL&amp;gt;CMD.OPT_INTERNAL&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_META&amp;gt;CMD.OPT_META&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Waitcodes ==&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_TIME&amp;gt;CMD.WAITCODE_TIME&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_DEATH&amp;gt;CMD.WAITCODE_DEATH&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_SQUAD&amp;gt;CMD.WAITCODE_SQUAD&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_GATHER&amp;gt;CMD.WAITCODE_GATHER&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Insert/Remove Commands ==&lt;br /&gt;
To get the commandqueue use the following lua-call&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;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;First, said &amp;quot;tags&amp;quot; aka &amp;quot;id&amp;quot; are unique command identifiers, so each command that gets inserted into a unit&#039;s command &lt;br /&gt;
queue gets its unique &amp;quot;tag&amp;quot; number. (It is used to &#039;&#039;sync&#039;&#039; command queue operations, also it makes things much easier.)&lt;br /&gt;
Editors Note: I fucking hate it when open source devs use the word easy. It is a clear indicator that someone spends a whole day finding out about a well hidden simple concept. Well at least we are on this journey together :)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To look at those &amp;quot;tags&amp;quot; you can do the following:&lt;br /&gt;
   local cmdQueue = Spring.GetUnitCommands(unitID, 100);&lt;br /&gt;
   if (#cmdQueue&amp;gt;0) then &lt;br /&gt;
      local cmdTag = cmdQueue[1].tag&lt;br /&gt;
      Spring.Echo(cmdTag)&lt;br /&gt;
      ..&lt;br /&gt;
   end&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.INSERT&amp;gt;CMD.INSERT&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  options.ALT     -&amp;gt; treat param0 as a position instead of a tag &lt;br /&gt;
  options.CONTROL -&amp;gt; use the build queue for factories &lt;br /&gt;
  params[0] = command tag or position (negative numbers to reference&lt;br /&gt;
  the back of the queue and 0 the first)&lt;br /&gt;
  params[1] = insertCmd id &lt;br /&gt;
  params[2] = insertCmd options (shift,alt,right click,etc.)&lt;br /&gt;
  params[3 ... N+2] = insertCmd params[0 ... N-1]&lt;br /&gt;
&lt;br /&gt;
  Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    Spring.GiveOrderToUnit(unitID,&lt;br /&gt;
      CMD.INSERT,&lt;br /&gt;
      {-1,CMD.ATTACK,&#039;&#039;CMD.OPT_SHIFT&#039;&#039;,&#039;&#039;unitID2&#039;&#039;},&lt;br /&gt;
      {&amp;quot;alt&amp;quot;}&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Command structure dissection:&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;What to do with the command - in our case insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.INSERT&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Place in the queue to insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;-1&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Type of command to insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.ATTACK&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Additional Information:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	If the unit is working down a shift queue, add it seemless into it&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.OPT_SHIFT&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;TargetID or Position:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;unitID2&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;The &#039;-1&#039; is the queue position and not a tag:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;{&amp;quot;alt&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  if you insert cmd in pos 2 for example the rest of commands starting&lt;br /&gt;
  from 2 will be pushed back. &lt;br /&gt;
  Ilustration: {cmdA, cmdB, cmdC, cmdD} =&amp;gt; {cmdA, cmdB, NewCmd, cmdC, cmdD}&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note: If you didn&#039;t already notice, the command params and&lt;br /&gt;
        the command options are twisted in the array (compared to GiveOrder)!&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note2: The command options in the array/table is a number value!&lt;br /&gt;
         You have to use CMD.OPT_* in this case.&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note3: The inserted command doesn&#039;t go through allowcommand callins, only CMD.INSERT does.&lt;br /&gt;
  &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.REMOVE&amp;gt;CMD.REMOVE&amp;lt;/b&amp;gt;&lt;br /&gt;
  options.ALT     -&amp;gt; use the parameters as commandIDs &lt;br /&gt;
  options.CONTROL -&amp;gt; use the build queue for factories &lt;br /&gt;
  params[0 ... N-1] = tags or commandIDs to remove&lt;br /&gt;
&lt;br /&gt;
No clues what the above mean translated, but here is a working example of how to delete a buildorder from a factory:  &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   &lt;br /&gt;
 local facCmds = Spring.GetFactoryCommands(factoryID)&lt;br /&gt;
 &lt;br /&gt;
 if facCmds then -- nil check&lt;br /&gt;
	local cmd = facCmds[1]&lt;br /&gt;
	Spring.GiveOrderToUnit(factoryID, CMD.REMOVE, {i,cmd.tag}, {&amp;quot;ctrl&amp;quot;})&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note, the CMD[] table is bidirectional. That means: CMD[CMD.STOP] := &amp;quot;CMD_STOP&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.STOP&amp;gt;CMD.STOP&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.WAIT&amp;gt;CMD.WAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.TIMEWAIT&amp;gt;CMD.TIMEWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.DEATHWAIT&amp;gt;CMD.DEATHWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_RECTANGLE|CMDTYPE.ICON_UNIT_OR_RECTANGLE]]&lt;br /&gt;
&amp;lt;b id=CMD.SQUADWAIT&amp;gt;CMD.SQUADWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.GATHERWAIT&amp;gt;CMD.GATHERWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.MOVE&amp;gt;CMD.MOVE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.PATROL&amp;gt;CMD.PATROL&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.FIGHT&amp;gt;CMD.FIGHT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.ATTACK&amp;gt;CMD.ATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_MAP|CMDTYPE.ICON_UNIT_OR_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.AREA_ATTACK&amp;gt;CMD.AREA_ATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.GUARD&amp;gt;CMD.GUARD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]&lt;br /&gt;
&amp;lt;b id=CMD.AISELECT&amp;gt;CMD.AISELECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.COMBO_BOX|CMDTYPE.COMBO_BOX]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPSELECT&amp;gt;CMD.GROUPSELECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPADD&amp;gt;CMD.GROUPADD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPCLEAR&amp;gt;CMD.GROUPCLEAR&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.REPAIR&amp;gt;CMD.REPAIR&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.FIRE_STATE&amp;gt;CMD.FIRE_STATE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.MOVE_STATE&amp;gt;CMD.MOVE_STATE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.SELFD&amp;gt;CMD.SELFD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.LOAD_UNITS&amp;gt;CMD.LOAD_UNITS&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.LOAD_ONTO&amp;gt;CMD.LOAD_ONTO&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]&lt;br /&gt;
&amp;lt;b id=CMD.UNLOAD_UNITS&amp;gt;CMD.UNLOAD_UNITS&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.UNLOAD_UNIT&amp;gt;CMD.UNLOAD_UNIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.ONOFF&amp;gt;CMD.ONOFF&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.RECLAIM&amp;gt;CMD.RECLAIM&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.CLOAK&amp;gt;CMD.CLOAK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.STOCKPILE&amp;gt;CMD.STOCKPILE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.DGUN&amp;gt;CMD.DGUN&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.RESTORE&amp;gt;CMD.RESTORE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.REPEAT&amp;gt;CMD.REPEAT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.TRAJECTORY&amp;gt;CMD.TRAJECTORY&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.RESURRECT&amp;gt;CMD.RESURRECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.CAPTURE&amp;gt;CMD.CAPTURE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.AUTOREPAIRLEVEL&amp;gt;CMD.AUTOREPAIRLEVEL&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.LOOPBACKATTACK&amp;gt;CMD.LOOPBACKATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.IDLEMODE&amp;gt;CMD.IDLEMODE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.SET_WANTED_MAX_SPEED&amp;gt;CMD.SET_WANTED_MAX_SPEED&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.SETBASE&amp;gt;CMD.SETBASE&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.INTERNAL&amp;gt;CMD.INTERNAL&amp;lt;/b&amp;gt;&lt;br /&gt;
  used in different ways&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;A negative number means build command&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The number is -unitDefID of the unittype that this command orders to be built.&lt;br /&gt;
   This means that build orders have no convenient CMD._____ string.&lt;br /&gt;
      The command id for build orders must always be a &amp;quot;minus&amp;quot; sign &amp;lt;i&amp;gt;appended to an integer value&amp;lt;/i&amp;gt;.&lt;br /&gt;
   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Spring.GiveOrderToUnit(unitID, &amp;lt;b&amp;gt;-(unitDefID)&amp;lt;/b&amp;gt;, {x,y,z(,facing)}, {&amp;quot;shift&amp;quot;})&amp;lt;/font&amp;gt;&lt;br /&gt;
      alternatively:&lt;br /&gt;
   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Spring.GiveOrderToUnit(unitID, &amp;lt;b&amp;gt;-UnitDefNames[&amp;quot;unitname&amp;quot;].id&amp;lt;/b&amp;gt;, {x,y,z(,facing)}, {&amp;quot;shift&amp;quot;})&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&#039;facing&#039;&amp;lt;/b&amp;gt; is an optional integer parameter that controls unit&#039;s facing when placed.&lt;br /&gt;
      The values of (x,y,z) must &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt; be number values (like the number &amp;quot;0&amp;quot;), or the build order will break.&lt;br /&gt;
&lt;br /&gt;
== CommandTypes ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := &amp;quot;CMDTYPE_ICON&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON&amp;gt;CMDTYPE.ICON&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 0 parameters in return&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_MODE&amp;gt;CMDTYPE.ICON_MODE&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number selected mode)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_MAP&amp;gt;CMDTYPE.ICON_MAP&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_AREA&amp;gt;CMDTYPE.ICON_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT&amp;gt;CMDTYPE.ICON_UNIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameters in return (unitid)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_MAP&amp;gt;CMDTYPE.ICON_UNIT_OR_MAP&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameters in return (unitid) or 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_FRONT&amp;gt;CMDTYPE.ICON_FRONT&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 or 6 parameters in return (middle and right side of front if a front was defined)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.COMBO_BOX&amp;gt;CMDTYPE.COMBO_BOX&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number selected option)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_AREA&amp;gt;CMDTYPE.ICON_UNIT_OR_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_FEATURE_OR_AREA&amp;gt;CMDTYPE.ICON_UNIT_FEATURE_OR_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid or [[Lua_ConstGame#Engine|Game.maxUnits]]+featureid)&lt;br /&gt;
      or 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_BUILDING&amp;gt;CMDTYPE.ICON_BUILDING&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_RECTANGLE&amp;gt;CMDTYPE.ICON_UNIT_OR_RECTANGLE&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid)&lt;br /&gt;
      or 3 parameters in return (mappos)&lt;br /&gt;
      or 6 parameters in return (startpos+endpos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.NUMBER&amp;gt;CMDTYPE.NUMBER&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMDTYPE.CUSTOM&amp;gt;CMDTYPE.CUSTOM&amp;lt;/b&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&amp;lt;b id=CMDTYPE.NEXT&amp;gt;CMDTYPE.NEXT&amp;lt;/b&amp;gt; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;next command page&amp;lt;/font&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&amp;lt;b id=CMDTYPE.PREV&amp;gt;CMDTYPE.PREV&amp;lt;/b&amp;gt; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;previous command page&amp;lt;/font&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&lt;br /&gt;
== CmdIDs ==&lt;br /&gt;
Below is a table of all CMD table entries and their IDs:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Command||ID&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_NONE||-1&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_NONE||-1&lt;br /&gt;
|-&lt;br /&gt;
|STOP||0&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_HOLDPOS||0&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_HOLDFIRE||0&lt;br /&gt;
|-&lt;br /&gt;
|INSERT||1&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_MANEUVER||1&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_RETURNFIRE||1&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_TIME||1&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_DEATH||2&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_ROAM||2&lt;br /&gt;
|-&lt;br /&gt;
|REMOVE||2&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_FIREATWILL||2&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_FIREATNEUTRAL||3&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_SQUAD||3&lt;br /&gt;
|-&lt;br /&gt;
|OPT_META||4&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_GATHER||4&lt;br /&gt;
|-&lt;br /&gt;
|WAIT||5&lt;br /&gt;
|-&lt;br /&gt;
|TIMEWAIT||6&lt;br /&gt;
|-&lt;br /&gt;
|DEATHWAIT||7&lt;br /&gt;
|-&lt;br /&gt;
|OPT_INTERNAL||8&lt;br /&gt;
|-&lt;br /&gt;
|SQUADWAIT||8&lt;br /&gt;
|-&lt;br /&gt;
|GATHERWAIT||9&lt;br /&gt;
|-&lt;br /&gt;
|MOVE||10&lt;br /&gt;
|-&lt;br /&gt;
|PATROL||15&lt;br /&gt;
|-&lt;br /&gt;
|FIGHT||16&lt;br /&gt;
|-&lt;br /&gt;
|OPT_RIGHT||16&lt;br /&gt;
|-&lt;br /&gt;
|LOOPBACKATTACK||20&lt;br /&gt;
|-&lt;br /&gt;
|ATTACK||20&lt;br /&gt;
|-&lt;br /&gt;
|AREA_ATTACK||21&lt;br /&gt;
|-&lt;br /&gt;
|GUARD||25&lt;br /&gt;
|-&lt;br /&gt;
|AISELECT||30&lt;br /&gt;
|-&lt;br /&gt;
|OPT_SHIFT||32&lt;br /&gt;
|-&lt;br /&gt;
|GROUPSELECT||35&lt;br /&gt;
|-&lt;br /&gt;
|GROUPADD||36&lt;br /&gt;
|-&lt;br /&gt;
|GROUPCLEAR||37&lt;br /&gt;
|-&lt;br /&gt;
|REPAIR||40&lt;br /&gt;
|-&lt;br /&gt;
|FIRE_STATE||45&lt;br /&gt;
|-&lt;br /&gt;
|MOVE_STATE||50&lt;br /&gt;
|-&lt;br /&gt;
|SETBASE||55&lt;br /&gt;
|-&lt;br /&gt;
|INTERNAL||60&lt;br /&gt;
|-&lt;br /&gt;
|OPT_CTRL||64&lt;br /&gt;
|-&lt;br /&gt;
|SELFD||65&lt;br /&gt;
|-&lt;br /&gt;
|SET_WANTED_MAX_SPEED||70&lt;br /&gt;
|-&lt;br /&gt;
|LOAD_UNITS||75&lt;br /&gt;
|-&lt;br /&gt;
|LOAD_ONTO||76&lt;br /&gt;
|-&lt;br /&gt;
|UNLOAD_UNITS||80&lt;br /&gt;
|-&lt;br /&gt;
|UNLOAD_UNIT||81&lt;br /&gt;
|-&lt;br /&gt;
|ONOFF||85&lt;br /&gt;
|-&lt;br /&gt;
|RECLAIM||90&lt;br /&gt;
|-&lt;br /&gt;
|CLOAK||95&lt;br /&gt;
|-&lt;br /&gt;
|STOCKPILE||100&lt;br /&gt;
|-&lt;br /&gt;
|MANUALFIRE||105&lt;br /&gt;
|-&lt;br /&gt;
|DGUN||105&lt;br /&gt;
|-&lt;br /&gt;
|RESTORE||110&lt;br /&gt;
|-&lt;br /&gt;
|REPEAT||115&lt;br /&gt;
|-&lt;br /&gt;
|TRAJECTORY||120&lt;br /&gt;
|-&lt;br /&gt;
|RESURRECT||125&lt;br /&gt;
|-&lt;br /&gt;
|OPT_ALT||128&lt;br /&gt;
|-&lt;br /&gt;
|CAPTURE||130&lt;br /&gt;
|-&lt;br /&gt;
|AUTOREPAIRLEVEL||135&lt;br /&gt;
|-&lt;br /&gt;
|IDLEMODE||145&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=3DModels:AssimpMetadata&amp;diff=284</id>
		<title>3DModels:AssimpMetadata</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=3DModels:AssimpMetadata&amp;diff=284"/>
		<updated>2019-03-27T19:07:57Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added specific assimp metadata wiki entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Assimp mesh Meta Reference =&lt;br /&gt;
You may add additional, Spring-specific information to .dae, .lwo and other assimp-supported files in this extra lua file. It&#039;s usually named after the models extension and placed at the /objects folder, next to it. For instance, for testobject.dae you&#039;d use testobject.dae.lua.&lt;br /&gt;
&lt;br /&gt;
Variables are organised as such:&lt;br /&gt;
{{tag|name=VariableName|type=type|range=[valid range]|special=Required|default=value&lt;br /&gt;
|description=Description}}&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The engine source code which reads this file is viewable here:&lt;br /&gt;
&lt;br /&gt;
* {{sourcelink|file=rts/Rendering/Models/AssParser.cpp}}&lt;br /&gt;
&lt;br /&gt;
= General Formatting =&lt;br /&gt;
check [http://www.lua.org/docs.html Lua Documentation].&lt;br /&gt;
&lt;br /&gt;
=Data Types=&lt;br /&gt;
{{DataTypes}}&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
* the script MUST return exactly one model-table (which may be named arbitrarily)&lt;br /&gt;
* the tree must reference ONLY object names defined in the assimp file&lt;br /&gt;
* a piece-table key may NOT be &amp;quot;name&amp;quot; or &amp;quot;offset&amp;quot; (these are reserved keywords)&lt;br /&gt;
= Sections =&lt;br /&gt;
== modelfilename.lua ==&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;model = {&lt;br /&gt;
    pieces = {&lt;br /&gt;
       ...&lt;br /&gt;
    },&lt;br /&gt;
    radius = 0,&lt;br /&gt;
    midpos = { 0, 0, 0 },&lt;br /&gt;
    tex1 = &amp;quot;&amp;quot;,&lt;br /&gt;
    --tex2 = &amp;quot;&amp;quot;,&lt;br /&gt;
    numpieces = 1,&lt;br /&gt;
&lt;br /&gt;
    globalvertexoffset = true,&lt;br /&gt;
    localpieceoffset = true,&lt;br /&gt;
}&lt;br /&gt;
return model&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== meshname =====&lt;br /&gt;
name of your mesh...&lt;br /&gt;
&lt;br /&gt;
{{tag|name=midpos|type=float3|special=Required&lt;br /&gt;
|description=the local of the median point of the mesh from the origin}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=radius|type=float|special=Required&lt;br /&gt;
|description=from the midpos the radius of the mesh, used for occlusion culling}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=tex1|type=string&lt;br /&gt;
|description=filename of the texture image to use for diffuse and teamcolor}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=tex2|type=string&lt;br /&gt;
|description=filename of the texture image to use for ambient, specular and transparency}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=globalvertexoffsets|type=bool&lt;br /&gt;
|description=whether the vertex coordinates are relative to the global origin, or the local origin}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=localpieceoffsets|type=bool&lt;br /&gt;
|description=whether the piece offsets are relative to the global origin, or the parent offset}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=nodenamesfromids|type=bool|default=false&lt;br /&gt;
|description=uses names as unique object identifiers, instead of node ids. Useful for non-Blender .dae files. New in 104 maintenance 1153-gfb53422}}&lt;br /&gt;
&lt;br /&gt;
== pieces ==&lt;br /&gt;
Specifies the hierarchy of objects&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;model = {&lt;br /&gt;
    pieces = {&lt;br /&gt;
        piecename = {&lt;br /&gt;
            offset = {0.0, 0.0, 0.0},&lt;br /&gt;
            anotherpiecename = {&lt;br /&gt;
                offset = {0.0, 0.0, 0.0},&lt;br /&gt;
                ...&lt;br /&gt;
            },&lt;br /&gt;
            ...&lt;br /&gt;
        },&lt;br /&gt;
    },&lt;br /&gt;
    ...&lt;br /&gt;
}&lt;br /&gt;
return model&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{tag|name=name|type=string|special=Required&lt;br /&gt;
|description=each piece name needs to correspond to an object in the mesh file. For an .obj file it would be the &amp;quot;o&amp;quot; tag}}&lt;br /&gt;
&lt;br /&gt;
{{tag|name=offset|type=float3&lt;br /&gt;
|description=the offset of the piece vertices either in parent or world space}}&lt;br /&gt;
&lt;br /&gt;
[[Category:3D Models]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Assimp&amp;diff=2184</id>
		<title>Assimp</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Assimp&amp;diff=2184"/>
		<updated>2019-03-27T16:18:55Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Adding assimp-metadata link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Game_and_Unit_development|Game Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Assimp=&lt;br /&gt;
Open Asset Import Library (short name: Assimp) is used in Spring for loading a number of common and well supported model formats (.3ds, .dae, .lwo, .blend - currently .obj is parsed by a different code path).&lt;br /&gt;
&lt;br /&gt;
What Spring supports in its Assimp renderer:&lt;br /&gt;
* extended metafile (&amp;lt;code&amp;gt;%modelfilename%.lua&amp;lt;/code&amp;gt; next to the modefile)&lt;br /&gt;
* still uses tex1 &amp;amp; tex2 texture system of S3O (same shader as S3O)&lt;br /&gt;
* 2nd texcoord&lt;br /&gt;
* loading of the texture filepaths from the model (don&#039;t have to be in &amp;lt;code&amp;gt;unittextures/&amp;lt;/code&amp;gt;)&lt;br /&gt;
* when texture filepaths aren&#039;t included in the model, it searches for &amp;lt;code&amp;gt;%modelfilename%.*&amp;lt;/code&amp;gt; &amp;amp; &amp;lt;code&amp;gt;%modelfilename%2.*&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;unittextures/&amp;lt;/code&amp;gt;&lt;br /&gt;
* special modelpieces `SpringHeight` &amp;amp; `SpringRadius` {{removed|101.0}}&lt;br /&gt;
* {{new|102.0}} auto-normalize normals and tangents for all AssImp-loaded models&lt;br /&gt;
* {{new|95.0}} allow modellers to work around {{mantis|3552}} (differing axes conventions between software) by recognizing a number of new piece-table keys as follows&lt;br /&gt;
&lt;br /&gt;
For the root piece: {{removed|104.0}}&lt;br /&gt;
* &amp;quot;xaxis&amp;quot; = float3, &amp;quot;yaxis&amp;quot; = float3, &amp;quot;zaxis&amp;quot; = float3 (determine global orientation of model)&lt;br /&gt;
For all pieces: {{removed|104.0}}&lt;br /&gt;
* &amp;quot;rotAxisSigns&amp;quot; = float3 (determines direction of script-applied rotations around each axis)&lt;br /&gt;
* &amp;quot;rotAxisMap&amp;quot; = number (currently can only be 0=XYZ or 3=XZY, determines coordinate conversion)&lt;br /&gt;
&lt;br /&gt;
=Assimp Textures=&lt;br /&gt;
See [[3DModels:Textures#Textures_-_Assimp_Model_Formats_.28DAE.2CMDL.2CMD3_and_others_except_OBJ.29 |3DModels:Textures (Assimp Section)]]&lt;br /&gt;
&lt;br /&gt;
=Standard Workflow=&lt;br /&gt;
The following Workflow is provided for a standard 3D Modeling package using the Z = forward, Y = upwards convention, like Maya, Modo or Lightwave. You can also use Blender to export models for ASSIMP, as covered in the next section.&lt;br /&gt;
&lt;br /&gt;
* [[3DModels:AssimpWorkflow]]&lt;br /&gt;
* [[3DModels:AssimpMetadata]]&lt;br /&gt;
&lt;br /&gt;
=Blender Workflow Tutorial=&lt;br /&gt;
This is a stub containing a simple outline of a Blender workflow.&lt;br /&gt;
&lt;br /&gt;
# Open an existing Blender model or import a different format through the File menu (File &amp;gt; Import).&lt;br /&gt;
# In the 3D view, drag out the secret panel from the right.  [[File:3-12-2013 5-02-21 PM.pngâ€Žâ€Ž|secret panel]]&lt;br /&gt;
# In that panel, select Display &amp;gt; Shading &amp;gt; GLSL. [[File:3-12-2013 5-02-04 PM.pngâ€Žâ€Ž|display settings]]&lt;br /&gt;
# Make sure you have a lamp in your scene while in this mode or your model will be dark.&lt;br /&gt;
# Applying texture: &lt;br /&gt;
## In the UV/Image editor, click the image icon (Tooltip: Browse Image to be linked) to select your texture. If it&#039;s not there, click on Image &amp;gt; Open Image to browse for it.&lt;br /&gt;
## In the 3D View, select (right-click) your object and hit Tab to enter Mesh Mode.&lt;br /&gt;
## Hit A to select all your faces.&lt;br /&gt;
## In the 3D View, hit A to select all the faces there and select your image with the image icon. Assuming there&#039;s a UVMap, you should see your texture.&lt;br /&gt;
## If you don&#039;t see any faces you&#039;ll need to add the UVMap to a new texture:&lt;br /&gt;
### In the Properties view click on Textures (checkerboard icon).&lt;br /&gt;
### Click on Add New Texture (plus icon).&lt;br /&gt;
### Select Type = Image or Movie.&lt;br /&gt;
### Under Image, click on the image icon and choose your image file.&lt;br /&gt;
### Under Mapping, select Coordinates = UV.&lt;br /&gt;
### Under Influence &amp;gt; Diffuse, check Color and make sure it&#039;s 1.00.&lt;br /&gt;
## To add a normalmap:&lt;br /&gt;
### Repeat steps 5.5.1 to 5.5.5.&lt;br /&gt;
### Under Image Sampling, check Normal Map.&lt;br /&gt;
### Under Influence &amp;gt; Geometry, check Normal. Make sure it.s 1.00.&lt;br /&gt;
## You&#039;ll need to do this for each piece.&lt;br /&gt;
# Piece hierarchy:&lt;br /&gt;
## Select piece A, hold shift and select piece B. Hit Ctrl+P and it will make piece A a child of piece B.&lt;br /&gt;
## &amp;lt;strike&amp;gt;Make sure all the pieces are descending from one single piece.&amp;lt;/strike&amp;gt; This is no longer necessary but is still good practice. Spring will now place all your pieces into one root piece for you, regardless.&lt;br /&gt;
# Setting piece origins:&lt;br /&gt;
## Select a piece.&lt;br /&gt;
## Place the 3D cursor where you want the origin to be (left-click).&lt;br /&gt;
## Click on Object &amp;gt; Transform &amp;gt; Origin to 3D Cursor.&lt;br /&gt;
## You can now rotate your pieces:&lt;br /&gt;
### Click on the dropdown &amp;quot;Pivot Center for Rotation/Scaling&amp;quot; and select Individual Origins.&lt;br /&gt;
### Rotate.&lt;br /&gt;
## Do this for all your pieces.&lt;br /&gt;
# Preparing for Spring (this may or may not apply depending on how assimp handles your model.):&lt;br /&gt;
## Ensure that the scales for each object in your scene are uniform (that is, x, y, and z scales are equal to each other). A quick way to ensure that is select all (a) and apply scale (ctrl+a -&amp;gt; scale).&lt;br /&gt;
# Save your model.&lt;br /&gt;
# Select all the pieces of your model, ignore the lamp.&lt;br /&gt;
# Click on File &amp;gt; Export &amp;gt; Collada.&lt;br /&gt;
# Check &amp;quot;Export Only Selected&amp;quot; and export.&lt;br /&gt;
# The dae file will be used as your object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:3D Models]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16138</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16138"/>
		<updated>2019-01-27T04:17:38Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  Perl comes installed in Ubuntu, but you&#039;ll probably need [https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.28.1.tar.gz a more recent version]. After downloading it at the root, enter the following commands:&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  tar -xzf perl-5.10.1.tar.gz&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  cd perl-5.10.1&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  ./Configure -des -Dprefix=/usr/local&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make test&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo make install&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  export PATH=$PATH:/usr/local/bin/perl&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To check if perl is installed, at your ssh connection prompt enter: &#039;&#039;&#039;perl -v&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install Swig in Ubuntu or other debian-based Linux distros, enter: &#039;&#039;&#039;apt install swig&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install g++, the C++ compiler: &lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get update&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get install g++&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &#039;&#039;&#039;perl spadsInstaller.pl&#039;&#039;&#039; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  In hostingPresets you&#039;ll probably want to edit &#039;&#039;&#039;battleName&#039;&#039;&#039; to what will be shown in Spring Lobby&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then you can run SPADS as follows:&lt;br /&gt;
&#039;&#039;&#039;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&#039;&#039;&#039; (for instance: &#039;&#039;&#039;perl spads.pl etc/spads.conf&#039;&#039;&#039;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 SPADS subforum]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16137</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16137"/>
		<updated>2019-01-27T01:19:58Z</updated>

		<summary type="html">&lt;p&gt;Maddox: /* = */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  Perl comes installed in Ubuntu, but you&#039;ll probably need [https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.28.1.tar.gz a more recent version]. After downloading it at the root, enter the following commands:&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  tar -xzf perl-5.10.1.tar.gz&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  cd perl-5.10.1&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  ./Configure -des -Dprefix=/usr/local&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make test&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo make install&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  export PATH=$PATH:/usr/local/bin/perl&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To check if perl is installed, at your ssh connection prompt enter: &#039;&#039;&#039;perl -v&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install Swig in Ubuntu or other debian-based Linux distros, enter: &#039;&#039;&#039;apt install swig&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install g++, the C++ compiler: &lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get update&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get install g++&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &#039;&#039;&#039;perl spadsInstaller.pl&#039;&#039;&#039; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 SPADS subforum]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16136</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16136"/>
		<updated>2019-01-27T01:17:34Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  Perl comes installed in Ubuntu, but you&#039;ll probably need [https://cpan.metacpan.org/authors/id/S/SH/SHAY/perl-5.28.1.tar.gz a more recent version]. After downloading it at the root, enter the following commands:&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  tar -xzf perl-5.10.1.tar.gz&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  cd perl-5.10.1&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  ./Configure -des -Dprefix=/usr/local&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  make test&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo make install&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  export PATH=$PATH:/usr/local/bin/perl&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To check if perl is installed, at your ssh connection prompt enter: &#039;&#039;&#039;perl -v&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install Swig in Ubuntu or other debian-based Linux distros, enter: &#039;&#039;&#039;apt install swig&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install g++, the C++ compiler: &lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get update&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get install g++&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 SPADS subforum]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16135</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16135"/>
		<updated>2019-01-26T19:24:30Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added details on Swig and G++ installation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  Perl comes installed in Ubuntu&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To check if perl is installed, at your ssh connection prompt enter: &#039;&#039;&#039;perl -v&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install Swig in Ubuntu or other debian-based Linux distros, enter: &#039;&#039;&#039;apt install swig&#039;&#039;&#039;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;•  To install g++, the C++ compiler: &lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get update&amp;lt;/ol&amp;gt;&lt;br /&gt;
    &amp;lt;ol&amp;gt;•  sudo apt-get install g++&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 SPADS subforum]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16134</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16134"/>
		<updated>2019-01-26T16:40:22Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Adding install guide from the package&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 SPADS subforum]&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16133</id>
		<title>SPADS:Installation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS:Installation&amp;diff=16133"/>
		<updated>2019-01-26T16:38:35Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Created page with &amp;quot;To install SPADS on &amp;#039;&amp;#039;&amp;#039;Linux/UNIX&amp;#039;&amp;#039;&amp;#039;, you have to: =============================================== &amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To install SPADS on &#039;&#039;&#039;Linux/UNIX&#039;&#039;&#039;, you have to:&lt;br /&gt;
===============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Ensure Perl, swig and g++ are installed and available in your PATH (all standard Perl core modules must be available, on some systems such as RedHat/Fedora/CentOS this requires installing a metapackage usually named &amp;quot;perl-core&amp;quot;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;Windows&#039;&#039;&#039;, you have to:&lt;br /&gt;
=============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Install ActivePerl Windows (x86) (available here: http://www.activestate.com/activeperl/downloads) or Strawberry Perl (32bit) (available here: http://strawberryperl.com)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Ensure your Perl bin directory is in your PATH environement variable&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Open a Command shell, go in the directory where you extracted SPADS installation files, and run &amp;quot;perl spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;perl spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;perl spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To install SPADS on &#039;&#039;&#039;macOS&#039;&#039;&#039;, you have to:&lt;br /&gt;
============================================&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt; Ensure Perl, swig and g++ are installed and available in your PATH&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; Install Spring server (check the locations of the unitsyc library, &amp;quot;spring-dedicated&amp;quot; and &amp;quot;Spring data directory&amp;quot;, they will be asked during SPADS installation)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install at least one mod in Spring data directory&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Run &amp;quot;./spadsInstaller.pl&amp;quot; (SPADS will be installed in current directory)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Check your configuration files, in particular &amp;quot;spads.conf&amp;quot;, &amp;quot;hostingPresets.conf&amp;quot; and &amp;quot;battlePresets.conf&amp;quot;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can run SPADS as follows:&lt;br /&gt;
&amp;quot;./spads.pl &amp;lt;spadsConfPath&amp;gt;&amp;quot; (for instance: &amp;quot;./spads.pl etc/spads.conf&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If you have any problem, you can contact the SPADS creator, &#039;&#039;bibim&#039;&#039;, directly in SpringLobby or in the [https://springrts.com/phpbb/viewforum.php?f=88 forum thread]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS&amp;diff=16127</id>
		<title>SPADS</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=SPADS&amp;diff=16127"/>
		<updated>2019-01-26T16:30:47Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added &amp;#039;installation&amp;#039; section to /* Support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span style=&amp;quot;font-weight:bold; font-size:large;&amp;quot;&amp;gt;SPADS links&amp;lt;/span&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Support ==&lt;br /&gt;
*[[SPADS:Installation|Installation]]&lt;br /&gt;
*[https://springrts.com/phpbb/viewforum.php?f=88 Discussion in Spring forums]&lt;br /&gt;
*[http://github.com/Yaribz/SPADS/issues Issue tracker]&lt;br /&gt;
&lt;br /&gt;
== Reference documents ==&lt;br /&gt;
*[http://planetspads.free.fr/spads/doc/spadsDoc.html Commands and settings reference guide]&lt;br /&gt;
*[http://planetspads.free.fr/spads/conf/templates/ Configuration templates]&lt;br /&gt;
*[http://springrts.com/wiki/SPADS_official_plugins_list Official plugins list]&lt;br /&gt;
== Memos ==&lt;br /&gt;
*[http://springrts.com/wiki/SPADS_update_procedure_for_new_Spring_version SPADS update procedure for new Spring version]&lt;br /&gt;
*[http://planetspads.free.fr/spads/repository/UPDATE SPADS manual update procedure for new major SPADS version]&lt;br /&gt;
*[http://springrts.com/wiki/SPADS_plugin_install_notes Plugin installation notes]&lt;br /&gt;
*[http://springrts.com/wiki/SPADS_PerlUnitSync_module_generation_for_Windows PerlUnitSync module generation for Windows]&lt;br /&gt;
== Development ==&lt;br /&gt;
*[https://github.com/Yaribz/SPADS Source code]&lt;br /&gt;
*[http://planetspads.free.fr/spads/repository/CHANGELOG Detailed changelog]&lt;br /&gt;
*[http://planetspads.free.fr/spads/doc/spadsPluginApiDoc.html Plugin API documentation]&lt;br /&gt;
*[http://springrts.com/wiki/SPADS_plugin_development Plugin development tutorials]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
[[Category:Autohosts]]&lt;br /&gt;
[[Category:SPADS]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11048</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11048"/>
		<updated>2018-12-11T05:15:12Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &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;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Synced only.&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit started being built (it&#039;s in wireframe mode)&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;No commands in this unit&#039;s queue. Beware, might be fired while &#039;guarding&#039;.&amp;lt;/font&amp;gt;&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, shieldEmitterWeaponNum, shieldCarrierUnitID, boolBounceProjectile, beamEmitterWaponNumber, beamCarrierUnitID, startx, starty, startz, hitx, hity, hitz&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11047</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11047"/>
		<updated>2018-12-11T05:11:44Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &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;
&amp;lt;font color=#dd9944&amp;gt;Gadget only.&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit started being built (it&#039;s in wireframe mode)&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;No commands in this unit&#039;s queue. Beware, might be fired while &#039;guarding&#039;.&amp;lt;/font&amp;gt;&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, shieldEmitterWeaponNum, shieldCarrierUnitID, boolBounceProjectile, beamEmitterWaponNumber, beamCarrierUnitID, startx, starty, startz, hitx, hity, hitz&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11810</id>
		<title>Lua SyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11810"/>
		<updated>2018-12-09T00:24:11Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &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 End =&lt;br /&gt;
&#039;&#039;&#039;Spring.KillTeam&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare a team to be dead ( no further orders can be assigned to such teams&#039;s units ), Gaia team cannot be killed.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GameOver&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( {number allyTeamID1, number allyTeamID2, ...} ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Will declare game over, a list of winning allyteams can be passed, if undecided ( like when dropped from the host ) it should be empty ( no winner ), in the case of a draw with multiple winners, all should be listed&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RulesParams =&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;string values are new since 95.0. Attention: Numeric paramValues in quotes will be converted to number.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;possible keys for the losAccess table are:&lt;br /&gt;
    `private` : only readable by the ally (default)&lt;br /&gt;
    `allied`  : readable by ally + ingame allied&lt;br /&gt;
    `inlos`   : readable if the unit is in LOS&lt;br /&gt;
    `inradar` : readable if the unit is in AirLOS&lt;br /&gt;
    `public`  : readable by all&lt;br /&gt;
   note: if one condition is fulfilled all beneath it are too (e.g. if an unit is in LOS it&amp;lt;br/&amp;gt;     can read params with `inradar=true` even if the param has `inlos=false`)&lt;br /&gt;
   note2: all GameRulesParam are public, TeamRulesParams can just be `private`,`allied`&amp;lt;br/&amp;gt;     and/or `public`&lt;br /&gt;
   note3: You can read RulesParams from &#039;&#039;&#039;any&#039;&#039;&#039; Lua enviroments! With those losAccess&amp;lt;br/&amp;gt;     policies you can limit their access.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRulesParam&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;new since 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number featureID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGameRulesParam&#039;&#039;&#039;&lt;br /&gt;
  ( string paramName, number|string paramValue [, table &amp;lt;span class=note&amp;gt;losAccess&amp;lt;/span&amp;gt;] ) -&amp;gt; nil&lt;br /&gt;
   &amp;lt;span class=note&amp;gt;see above for further documentation of losAccess&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UseTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, &lt;br /&gt;
    string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;,number amount |&lt;br /&gt;
    { metal = number amount, energy = number amount}&lt;br /&gt;
  ) -&amp;gt; nil | boolean hadEnough&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string res, number amount ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are:&lt;br /&gt;
    &amp;quot;m&amp;quot;  = metal&lt;br /&gt;
    &amp;quot;e&amp;quot;  = energy&lt;br /&gt;
    &amp;quot;ms&amp;quot;  = metal storage&lt;br /&gt;
    &amp;quot;es&amp;quot;  = energy storage&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamShareLevel&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareTeamResource&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;0.82 and later&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number teamID_src, number teamID_recv, string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Teams =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAlly&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( number firstAllyTeamID, number secondAllyTeamID, boolean ally ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
Changes the value of the (one-sided) alliance between: firstAllyTeamID -&amp;gt; secondAllyTeamID&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignPlayerToTeam&#039;&#039;&#039; {{new|98.0}}  {{Sourcelinkhash|7ed9a7e34814c60e5ae16281520cccc4daf3c367}}&lt;br /&gt;
  ( number playerID, number teamID)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetGlobalLos&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number allyTeamID, bool globallos )&lt;br /&gt;
&lt;br /&gt;
= Unit Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: offmap positions are clamped! (you still can use MoveCtrl todo so)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    (number facing | string &amp;quot;facing&amp;quot;),&lt;br /&gt;
    number teamID&lt;br /&gt;
    [, boolean build = false] &lt;br /&gt;
    [, boolean flattenGround = true]&lt;br /&gt;
    [, number unitID]&lt;br /&gt;
    [, number builderID]) -&amp;gt; number unitID | nil (meaning unit was not created)&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
  if build is true the unit is created in &amp;quot;being built&amp;quot; state, with buildProgress = 0&lt;br /&gt;
  unitID and builderID are {{new|92.0}}, the former allowing to spawn a unit with&lt;br /&gt;
  a specific ID.&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID&lt;br /&gt;
    [, boolean selfd = false]&lt;br /&gt;
    [, boolean reclaimed = false]&lt;br /&gt;
    [, number attackerID ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
 selfd := makes the unit act like it self-destructed&lt;br /&gt;
 reclaimed := don&#039;t show any DeathSequences, don&#039;t leave a wreckage.&lt;br /&gt;
   NOTE this does _not_ give back the resources to the team!&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    numer newTeamID&lt;br /&gt;
    [, boolean given = true ] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;if given=false, the unit is captured&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCosts&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, { &lt;br /&gt;
     [ buildTime  = number amount ],&lt;br /&gt;
     [ metalCost  = number amount ],&lt;br /&gt;
     [ energyCost = number amount ]&lt;br /&gt;
   } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;tooltip&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number health |&lt;br /&gt;
    { [ health   = number health ],&lt;br /&gt;
      [ capture  = number capture ],&lt;br /&gt;
      [ paralyze = number paralyze ],&lt;br /&gt;
      [ build    = number build ] }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxHealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitDamage&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number damage&lt;br /&gt;
    [, number paralyze = 0 [, number attackerID = -1 [, number weaponID = -1&lt;br /&gt;
      [, number impulse_x [, number impulse_y [, number impulse_z ]]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStockpile&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number stockpile [, number buildPercent ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitExperience&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number experience ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFuel&#039;&#039;&#039; {{removed|101.0}}&lt;br /&gt;
  ( number unitID, number fuel ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCrashing&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean crashing ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLineage&#039;&#039;&#039; {{removed|83.0}}&lt;br /&gt;
  ( number unitID, number teamID [, boolean isRoot] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNeutral&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean neutral ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTarget&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;userTarget &amp;amp; success new in version 95.0, setting nil target new in 99.0, weaponNum new in 102.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number enemyUnitID | number x, number y, number z, | nil,&lt;br /&gt;
    [ boolean dgun = false [, boolean userTarget = false [, number weaponNum = -1 ]]] ) -&amp;gt;  success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMaxRange&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number maxRange ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;crushable new in version 85.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, boolean blocking [, boolean collide [, boolean crushable]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number unitID,&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.SetUnitMetalExtraction&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;quot;depth&amp;quot; corresponds to metal extraction rate (value range similar to &amp;quot;extractsMetal&amp;quot; unitDef)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID, number depth [,number range] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBuildSpeed&#039;&#039;&#039;&lt;br /&gt;
  ( number builderID,&lt;br /&gt;
    number buildSpeed, [ number repairSpeed [, number reclaimSpeed&lt;br /&gt;
  [,number resurrectSpeed [, number captureSpeed [, number terraformSpeed ]] ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNanoPieces&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number builderID, table pieces ) -&amp;gt; nil&lt;br /&gt;
This saves a lot of engine calls, by replacing:&lt;br /&gt;
function script.QueryNanoPiece() return currentpiece end&lt;br /&gt;
Use it!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitAttach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number transporterID, number passengerID, number pieceNum ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetach&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitDetachFromAir&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLoadingTransport&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number passengerID, number transportID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Disables collisions between the two units to allow colvol intersection during the approach.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceParent&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number AlteredPiece, number ParentPiece ) -&amp;gt; nil&lt;br /&gt;
Changes the pieces hierarchy of a unit, by attaching a piece to a new parent.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceMatrix&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number pieceNum, table matrix )&lt;br /&gt;
&lt;br /&gt;
Sets the local (i.e. parent-relative) matrix of the given piece if any of the first three elements are non-zero, and also blocks all script animations from modifying it until {0, 0, 0} is passed (matrix should be an array of 16 floats, but is not otherwise sanity-checked).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitArmored&#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, boolean armored [, number armorMultiple] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number weaponID = -1] [, boolean enabled] [, number power] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitFlanking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;mode&amp;quot;, number mode ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;moveFactor&amp;quot;, number factor) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;minDamage&amp;quot;, number minDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;mazDamage&amp;quot;, number maxDamage ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, string &amp;quot;dir&amp;quot;, number x, number y, number z) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponNum, table states ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the states table:&lt;br /&gt;
    {&lt;br /&gt;
      [&amp;quot;reloadState&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;reloadFrame&amp;quot;     = number value,] (synonym for reloadState!)&lt;br /&gt;
      [&amp;quot;reloadTime&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;accuracy&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;sprayAngle&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;range&amp;quot;           = number value,] (*)&lt;br /&gt;
      [&amp;quot;projectileSpeed&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;burst&amp;quot;           = number value,]&lt;br /&gt;
      [&amp;quot;burstRate&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;projectiles&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;salvoLeft&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;nextSalvo&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;aimReady&amp;quot;        = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
    }&lt;br /&gt;
  (*) if you change the range of a weapon with dynamic damage&lt;br /&gt;
  make sure you use SetUnitWeaponDamages to change dynDamageRange as well.&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitWeaponDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum | &amp;quot;selfDestruct&amp;quot; | &amp;quot;explode&amp;quot;, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;enum COLVOL_TYPES {&lt;br /&gt;
      COLVOL_TYPE_DISABLED = -1,&lt;br /&gt;
      COLVOL_TYPE_ELLIPSOID = 0,&lt;br /&gt;
      COLVOL_TYPE_CYLINDER,&lt;br /&gt;
      COLVOL_TYPE_BOX,&lt;br /&gt;
      COLVOL_TYPE_SPHERE,&lt;br /&gt;
      COLVOL_NUM_TYPES       // number of non-disabled collision volume types&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_TESTS {&lt;br /&gt;
      COLVOL_TEST_DISC = 0,&lt;br /&gt;
      COLVOL_TEST_CONT = 1,&lt;br /&gt;
      COLVOL_NUM_TESTS = 2   // number of tests&lt;br /&gt;
    };&lt;br /&gt;
    enum COLVOL_AXES {&lt;br /&gt;
      COLVOL_AXIS_X   = 0,&lt;br /&gt;
      COLVOL_AXIS_Y   = 1,&lt;br /&gt;
      COLVOL_AXIS_Z   = 2,&lt;br /&gt;
      COLVOL_NUM_AXES = 3    // number of collision volume axes&lt;br /&gt;
    };&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPieceCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
As of 101.0 this is 1-based piece index argument (was 0-based).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitTravel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number travel [, number travelPeriod] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMoveGoal&#039;&#039;&#039;   &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;used by default commands to get in build-,attackrange etc.&amp;lt;/span&amp;gt;&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz &lt;br /&gt;
  [, number goalRadius [, number moveSpeed [, bool moveRaw ]]] )&lt;br /&gt;
{{new|98.0}} &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;moveRaw: [http://springrts.com/mantis/view.php?id=4412 allow unit to dumbly move to a coordinate without calculating path.]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLandGoal&#039;&#039;&#039;   {{new|101.0}}&lt;br /&gt;
  (number unitID, number goalx, number goaly, number goalz [, number goalRadius ] ) -&amp;gt; nil&lt;br /&gt;
Used in conjunction with {{name|Spring.UnitAttach}} et al to re-implement old airbase &amp;amp; fuel system in lua.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearUnitGoal&#039;&#039;&#039; {{new|102.0}}&lt;br /&gt;
  (number unitID) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPhysics&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;drag new in version 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number posx, number posy, number posz,&lt;br /&gt;
    number velx, number vely, number velz,&lt;br /&gt;
    number rotx, number roty, number rotz,&lt;br /&gt;
    number dragx, number dragy, number dragz,&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number z [, boolean alwaysAboveSea] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDirection&#039;&#039;&#039; {{new|90.0}}&lt;br /&gt;
  ( number unitID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number velx, number vely, number velz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRotation&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number rotx, number roty, number rotz ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitImpulse&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number x, number y, number z [, decayRate ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitSeismicPing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number pingSize ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveBuildingDecal&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
mpx, mpy, mpz: new middle position of unit&lt;br /&gt;
&lt;br /&gt;
apx, apy, apz: new position that enemies aim at on this unit&lt;br /&gt;
&lt;br /&gt;
relative: are the new coordinates relative to world or unit coordinates?&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitWeaponHoldFire&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number weaponID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit LOS ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCloak&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    boolean cloaked | number scriptCloak,&lt;br /&gt;
    [ number decloakDistance | boolean decloakAbs ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  If the 2nd argument is a number, the value works like this:&lt;br /&gt;
   1:=normal cloak&lt;br /&gt;
   2:=for free cloak (cost no E)&lt;br /&gt;
   3:=for free + no decloaking (except the unit is stunned)&lt;br /&gt;
   4&amp;gt;=ultimative cloak (no ecost, no decloaking, no stunned decloak)&lt;br /&gt;
&lt;br /&gt;
  The decloak distance is only changed if the 3th argument is a number or a boolean.&lt;br /&gt;
   If the boolean is false it takes the default decloak distance for that unitdef,&lt;br /&gt;
   if the boolean is true it takes the absolute value of it.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSonarStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean sonarStealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitStealth&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean stealth ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean alwaysVisible ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosMask&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;the 3th argument is either the bit-and combination of the following numbers:&lt;br /&gt;
  LOS_INLOS     = 1&lt;br /&gt;
  LOS_INRADAR   = 2&lt;br /&gt;
  LOS_PREVLOS   = 4&lt;br /&gt;
  LOS_CONTRADAR = 8&lt;br /&gt;
&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;or a table of the following form:&lt;br /&gt;
  losTypes = {&lt;br /&gt;
    [los = boolean,]&lt;br /&gt;
    [radar = boolean,]&lt;br /&gt;
    [prevLos = boolean,]&lt;br /&gt;
    [contRadar = boolean,]&lt;br /&gt;
  }&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLosState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number allyTeam, number los | table losTypes ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;see above for more info on the arguments&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitSensorRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string type, number radius ) -&amp;gt; nil | number newRadius&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;type can be:&lt;br /&gt;
  &amp;quot;los&amp;quot;,&amp;quot;airLos&amp;quot;,&amp;quot;radar&amp;quot;,&amp;quot;sonar&amp;quot;,&amp;quot;seismic&amp;quot;,&amp;quot;radarJammer&amp;quot;,&amp;quot;sonarJammer&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetRadarErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number allyTeamID, number allyteamErrorSize &lt;br /&gt;
  [, number baseErrorSize [, number baseErrorMult ]]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPosErrorParams&#039;&#039;&#039; {{new|95.0}}&lt;br /&gt;
  (number unitID, 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]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Resourcing ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitResourcing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    string res, number amount |&lt;br /&gt;
    { res = number amount, ... }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for res are: &amp;quot;[u|c][u|m][m|e]&amp;quot;&lt;br /&gt;
       unconditional | conditional&lt;br /&gt;
                 use | make&lt;br /&gt;
               metal | energy&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UseUnitResource&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil | boolean okay&lt;br /&gt;
  ( number unitID, { [&amp;quot;m&amp;quot; | &amp;quot;metal&amp;quot; | &amp;quot;e&amp;quot; | &amp;quot;energy&amp;quot;] = amount, ... } ) -&amp;gt; nil | boolean okay&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitHarvestStorage&#039;&#039;&#039; {{new|97.0}}&lt;br /&gt;
  ( number unitid, number metal )&lt;br /&gt;
&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;
= Feature Handling =&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateFeature&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;defName&amp;quot; | number featureDefID, &lt;br /&gt;
    number x, number y, number z&lt;br /&gt;
    [, number heading &lt;br /&gt;
    [, number AllyTeamID &lt;br /&gt;
    [, number featureID ]]] ) -&amp;gt; number featureID&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DestroyFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TransferFeature&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number teamID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Feature Control ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureHealth&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number health) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResources&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number featureID, number metal, number energy [, number reclaimTime [, number reclaimLeft ]] )&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureReclaim&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number reclaimLeft) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureResurrect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number unitDefID | string unitDefName [, number facing | string &amp;quot;facing&amp;quot; [, number progress ]] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  possible values for facing are:&lt;br /&gt;
    &amp;quot;south&amp;quot; | &amp;quot;s&amp;quot; | 0&lt;br /&gt;
    &amp;quot;east&amp;quot;  | &amp;quot;e&amp;quot; | 1&lt;br /&gt;
    &amp;quot;north&amp;quot; | &amp;quot;n&amp;quot; | 2&lt;br /&gt;
    &amp;quot;west&amp;quot;  | &amp;quot;w&amp;quot; | 3&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{new|104.0}} Second param can now be a number id instead of a string name, this also allows cancelling ressurection by passing {{value|-1}}. The level of progress can now be set via the additional 4th param.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z [, boolean snapToGround]) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRotation&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureVelocity&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePhysics&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
&lt;br /&gt;
(like their feature counterparts at [[Lua_SyncedCtrl#Unit_Control]])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMoveCtrl&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID [, boolean enable [, number* args]]) to control feature movement&lt;br /&gt;
   the number* arguments are parsed as follows and all optional&lt;br /&gt;
   if enable is true:&lt;br /&gt;
     [, velVector(x,y,z) -- initial velocity for feature&lt;br /&gt;
     [, accVector(x,y,z) -- acceleration added every frame&lt;br /&gt;
     ]]&lt;br /&gt;
   if enable is false:&lt;br /&gt;
     [, velocityMask(x,y,z) -- dimensions in which velocity is allowed to build when not using MoveCtrl&lt;br /&gt;
     [,  impulseMask(x,y,z) -- dimensions in which impulse is allowed to apply when not using MoveCtrl&lt;br /&gt;
     [, movementMask(x,y,z) -- dimensions in which feature is allowed to move when not using MoveCtrl&lt;br /&gt;
     ]]]&lt;br /&gt;
&lt;br /&gt;
As of spring 103.0 it is necessary to unlock feature movement on x,z axis before changing feature physics. For example use &amp;quot;Spring.SetFeatureMoveCtrl(featureID,false,1,1,1,1,1,1,1,1,1)&amp;quot; to unlock all movement prior to making SetFeatureVelocity calls.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureAlwaysVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureCollisionVolumeData&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetX,&lt;br /&gt;
    number vType, number tType, number Axis&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitCollisionVolumeData for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeaturePieceCollisionVolumeData&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number pieceIndex, boolean enable, &lt;br /&gt;
    number scaleX, number scaleY, number scaleZ,&lt;br /&gt;
    number offsetX, number offsetY, number offsetZ&lt;br /&gt;
    [, number volumeType [, number primaryAxis]]&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMidAndAimPos&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, &lt;br /&gt;
    number mpx, number mpy, number mpz, &lt;br /&gt;
    number apx, number apy, number apz, &lt;br /&gt;
    [, boolean relative] ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;check Spring.SetUnitMidAndAimPos for further explanation of the arguments&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureRadiusAndHeight&#039;&#039;&#039; {{new|89.0}}&lt;br /&gt;
  ( number unitID, number radius, number height ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureMass&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureID, number mass ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039;&lt;br /&gt;
  (number featureID, boolean blocking, boolean collidable) --&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureBlocking&#039;&#039;&#039; {{new|95.0}} changed parameters:&lt;br /&gt;
  number featureID,&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;
= Lua to COB =&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScript&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.CallCOBScriptCB&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;broken in 0.78.2.1; will be removed with the introduction of Lua as COB replacement&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number funcID | string funcName, number retArgs, COBArg1, COBArg2, ... )&lt;br /&gt;
    -&amp;gt; nil | number returnValue, number CallbackData, number retArg1, number retArg2, ...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCOBScriptID&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string funcName ) -&amp;gt; nil | number funcID&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;&amp;lt;b&amp;gt;Note: Don&#039;t use Spring.[Get|Set]UnitCOBValue in LUS just because you are familar with it since bos/cob, use the mighty LuaSpringAPI instead!&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCOBValue&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID [, boolean splitData=false], number COBValue&lt;br /&gt;
    [, number param1 [,number param2 [, number param3 [, number param4 ] ] ] ] )&lt;br /&gt;
  -&amp;gt; number result | number result1, number result2&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitCOBValue&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number COBValue, number param1 [,number param2] ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;you find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt; also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Give Order =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options can also be a bitmask; e.g. 0 instead of an empty table (can avoid performance hit on table creation)&amp;lt;br&amp;gt;&lt;br /&gt;
see [[Lua CMDs]] for relevant constants&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [unitID] = dontCare, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = unitID, etc... },&lt;br /&gt;
    number cmdID,&lt;br /&gt;
    params = {number, etc...},&lt;br /&gt;
    options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},     &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&lt;br /&gt;
      { number cmdID,&lt;br /&gt;
        {number, etc...},    &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;params&amp;lt;/font&amp;gt;&lt;br /&gt;
        {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options&amp;lt;/font&amp;gt;&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
=Ground=&lt;br /&gt;
== Grass ==&lt;br /&gt;
&#039;&#039;&#039;Spring.AddGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveGrass&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Heightmap ==&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note that x &amp;amp; z coords are in worldspace (Game.mapSizeX/Z), still the heightmap resolution is [[Lua_ConstGame|Game.squareSize]].&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;(heightmap[x][z] += height;)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertHeightMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMapFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Example code:&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
Spring.SetHeightMapFunc(function()&lt;br /&gt;
	for z=0,Game.mapSizeZ, Game.squareSize do&lt;br /&gt;
		for x=0,Game.mapSizeX, Game.squareSize do&lt;br /&gt;
			Spring.SetHeightMap( x, z, 200 + 20 * math.cos((x + z) / 90) )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.AddHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetHeightMap&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;the terraform argument is a scaling factor:&lt;br /&gt;
so if 0 nothing will be changed (the terraform starts) and if it is 1 the terraform will be finished.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.LevelSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AdjustSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number height ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.RevertSmoothMesh&#039;&#039;&#039;&lt;br /&gt;
  ( number x1, number z1 [, number x2, number z2], number origFactor ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMeshFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&#039;&#039;&#039;Spring.AddSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt; &lt;br /&gt;
  ( number x, number z, number height ) -&amp;gt; nil | number newHeight&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSmoothMesh&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;can only be called in SetSmoothMeshFunc()&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&lt;br /&gt;
== TerrainTypes ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTerrainType&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z, int newType ) -&amp;gt; nil | int oldType&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTerrainTypeData&#039;&#039;&#039;&lt;br /&gt;
  ( int typeIndex&lt;br /&gt;
  [, number speedTanks = nil ]&lt;br /&gt;
  [, number speedKBOTs = nil ]&lt;br /&gt;
  [, number speedHovers = nil ]&lt;br /&gt;
  [, number speedShips = nil ] ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSquareBuildingMask&#039;&#039;&#039; {{new|103.0}}&lt;br /&gt;
  ( number x, number z, int mask ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
See also {{xtaglink|Gamedev:UnitDefs|buildingMask}} unitdef tag.&lt;br /&gt;
&lt;br /&gt;
== MetalAmount ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMetalAmount&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number x, number z, number metalAmount)&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;x &amp;amp; z coords are in worldspace/16&amp;lt;br&amp;gt;metalAmount must be between 0 and 255*maxMetal (with maxMetal from the .smd or mapinfo.lua)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Command Descriptions =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-size:120%; font-weight:600&amp;quot;&amp;gt;Doesn&#039;t work in unsynced code!&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.EditUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, number cmdDescID, table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  structure of cmdArray:&lt;br /&gt;
  {&lt;br /&gt;
    [ id          = int ],&lt;br /&gt;
    [ type        = int ],&lt;br /&gt;
    [ name        = string ],&lt;br /&gt;
    [ action      = string ],&lt;br /&gt;
    [ tooltip     = string ],&lt;br /&gt;
    [ texture     = string ],&lt;br /&gt;
    [ cursor      = string ],&lt;br /&gt;
    [ queueing    = boolean ],&lt;br /&gt;
    [ hidden      = boolean ],&lt;br /&gt;
    [ disabled    = boolean ],&lt;br /&gt;
    [ showUnique  = boolean ],&lt;br /&gt;
    [ onlyTexture = boolean ],&lt;br /&gt;
    [ params      = { string = string, ... } ]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
{{var|queueing}} is {{new|101.0}} and allows custom commands to be non-queueing (handy for state toggles).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.InsertUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] , table cmdArray ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.RemoveUnitCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number cmdDescID ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetNoPause&#039;&#039;&#039;&lt;br /&gt;
  ( boolean noPause ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitToFeature&#039;&#039;&#039;&lt;br /&gt;
  ( boolean tofeature ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
an ugly global switch that can be used to block units turning into features when they finish being built (like *A DT&#039;s do, which have the isFeature tag)&lt;br /&gt;
[http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;p=481521 thread]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetExperienceGrade&#039;&#039;&#039;&lt;br /&gt;
  ( number expGrade [, number ExpPowerScale [, number ExpHealthScale [, number ExpReloadScale ]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  expGrade defines how often UnitExperience() will be called,&lt;br /&gt;
  Prior to 104.0 it is based on the following equation:&lt;br /&gt;
     (int) [exp/(exp+1)] / expGrade&lt;br /&gt;
  Post 104.0 it is the raw change.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnExplosion&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    table explosionParams&lt;br /&gt;
  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of explosionParams are:&lt;br /&gt;
    weaponDef = number,&lt;br /&gt;
    owner = number,&lt;br /&gt;
    hitUnit = number,&lt;br /&gt;
    hitFeature = number,&lt;br /&gt;
    craterAreaOfEffect = number,&lt;br /&gt;
    damageAreaOfEffect = number,&lt;br /&gt;
    edgeEffectiveness = number,&lt;br /&gt;
    explosionSpeed = number,&lt;br /&gt;
    gfxMod = number,&lt;br /&gt;
    impactOnly = boolean,&lt;br /&gt;
    ignoreOwner = boolean,&lt;br /&gt;
    damageGround = boolean,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnCEG&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;cegname&amp;quot; | number cegID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
  ) -&amp;gt; nil | boolean success, cegID&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;cegID new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnSFX&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( number unitID, number sfxID,&lt;br /&gt;
    number posX = 0, number posY = 0, number posZ = 0,&lt;br /&gt;
    number dirX = 0, number dirY = 0, number dirZ = 0,&lt;br /&gt;
    number radius = 0, number damage = 0&lt;br /&gt;
    [, boolean absolute ]&lt;br /&gt;
  ) -&amp;gt; nil | boolean success&lt;br /&gt;
&lt;br /&gt;
Equal to the [[Animation-LuaCallouts#Effects|UnitScript versions of EmitSFX]], but takes position and direction arguments (in either unit- or piece-space) instead of a piece index.&lt;br /&gt;
&lt;br /&gt;
= Projectiles =&lt;br /&gt;
&#039;&#039;&#039;Spring.SpawnProjectile&#039;&#039;&#039;&lt;br /&gt;
  ( number weaponDefID, table projectileParams ) -&amp;gt; nil | number projectileID&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;possible keys of projectileParams are:&lt;br /&gt;
    pos = {number x, number y, number z},&lt;br /&gt;
    end = {number x, number y, number z},&lt;br /&gt;
    speed = {number x, number y, number z},&lt;br /&gt;
    spread = {number x, number y, number z},&lt;br /&gt;
    error = {number x, number y, number z},&lt;br /&gt;
    owner = number,&lt;br /&gt;
    team = number,&lt;br /&gt;
    ttl = number,&lt;br /&gt;
    gravity = number,&lt;br /&gt;
    tracking = number,&lt;br /&gt;
    maxRange = number,&lt;br /&gt;
    startAlpha = number,&lt;br /&gt;
    endAlpha = number,&lt;br /&gt;
    model = string,&lt;br /&gt;
    cegTag = string,&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DeleteProjectile&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
Silently removes projectiles (no explosion).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileTarget&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Pre 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID, string targetTypeStr ] | [ number posX, number posY, number posZ ] ) &lt;br /&gt;
    -&amp;gt; nil | boolean validTarget&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class = &amp;quot;warning&amp;quot;&amp;gt;Post 95.0:&amp;lt;/span&amp;gt;  ( number projectileID, &lt;br /&gt;
    [ number targetID [, number targetType]]  |  [number posX, number posY, number posZ]) &lt;br /&gt;
    --&amp;gt; nil | boolean validTarget&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;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIgnoreTrackingError&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number projID, bool ignore ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileIsIntercepted&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileMoveControl&#039;&#039;&#039; &amp;lt;span class=note&amp;gt;(disables engine movecontrol, so lua can fully control the physics)&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number projID, boolean enable ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectilePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileVelocity&#039;&#039;&#039;&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0 ]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCollision&#039;&#039;&#039;&lt;br /&gt;
  ( number projID ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileGravity&#039;&#039;&#039; &lt;br /&gt;
  ( number projID [, number grav = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinAngle&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number spinAngle = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinSpeed&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number speed = 0] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileSpinVec&#039;&#039;&#039; {{new|95.0}} Deprecated&lt;br /&gt;
  ( number projID [, number x = 0 [, number y = 0 [, number z = 0]]] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileCEG&#039;&#039;&#039;&lt;br /&gt;
  ( number projID, string ceg_name ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetPieceProjectileParams&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
  (number projectileID,&lt;br /&gt;
  [ number explosionFlags, [ number spinAngle, [ number spinSpeed,&lt;br /&gt;
  [ number spinVector.x, [ number spinVector.y, [ number spinVector.z ]]]]]]) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileAlwaysVisible&#039;&#039;&#039; {{new|95.0}} &lt;br /&gt;
    (number projectileID, boolean alwaysVisible) --&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetProjectileDamages&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitID, number weaponNum, table damages ) -&amp;gt; nil&lt;br /&gt;
  ( number unitID, number weaponNum, string key, number value ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;format of the damages table:&lt;br /&gt;
   {&lt;br /&gt;
      [&amp;quot;paralyzeDamageTime&amp;quot; = number value,]  &lt;br /&gt;
      [&amp;quot;impulseFactor&amp;quot;      = number value,]&lt;br /&gt;
      [&amp;quot;impulseBoost&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;craterMult&amp;quot;         = number value,]&lt;br /&gt;
      [&amp;quot;craterBoost&amp;quot;        = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageExp&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageMin&amp;quot;       = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageRange&amp;quot;     = number value,]&lt;br /&gt;
      [&amp;quot;dynDamageInverted&amp;quot;  = number value,] (&amp;lt;&amp;gt;0.0f := true)&lt;br /&gt;
      [&amp;quot;craterAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;damageAreaOfEffect&amp;quot; = number value,]&lt;br /&gt;
      [&amp;quot;edgeEffectiveness&amp;quot;  = number value,]&lt;br /&gt;
      [&amp;quot;explosionSpeed&amp;quot;     = number value,]&lt;br /&gt;
      [number armorType     = number value,] (changes the damage against this armor type)&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8603</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=8603"/>
		<updated>2018-12-04T03:02:40Z</updated>

		<summary type="html">&lt;p&gt;Maddox: * Minor style fix @ Flares section&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}}&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:Callins#API:UnitHarvestStorageFull|UnitHarvestStorageFull callin]] and [[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 amount of the energy resource the unit generates which is dependant on the map wind. Works only for structures.}}&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11046</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11046"/>
		<updated>2018-11-28T01:31:10Z</updated>

		<summary type="html">&lt;p&gt;Maddox: * Styling fixes&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit started being built (it&#039;s in wireframe mode)&amp;lt;/font&amp;gt;&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;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;No commands in this unit&#039;s queue. Beware, might be fired while &#039;guarding&#039;.&amp;lt;/font&amp;gt;&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, shieldEmitterWeaponNum, shieldCarrierUnitID, boolBounceProjectile, beamEmitterWaponNumber, beamCarrierUnitID, startx, starty, startz, hitx, hity, hitz&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11045</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11045"/>
		<updated>2018-11-28T01:30:13Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Added some details to unitcreated and unitidle&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;
&amp;lt;font color=#dd9944&amp;gt;Unit started being built (it&#039;s in wireframe mode)&amp;lt;/font&amp;gt;&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;
&amp;lt;font color=#dd9944&amp;gt;No commands in this unit&#039;s queue. Beware, might be fired while &#039;guarding&#039;.&amp;lt;/font&amp;gt;&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, shieldEmitterWeaponNum, shieldCarrierUnitID, boolBounceProjectile, beamEmitterWaponNumber, beamCarrierUnitID, startx, starty, startz, hitx, hity, hitz&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_CMDs&amp;diff=11175</id>
		<title>Lua CMDs</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_CMDs&amp;diff=11175"/>
		<updated>2018-11-07T09:34:00Z</updated>

		<summary type="html">&lt;p&gt;Maddox: /* IDs =&amp;gt; CmdIDs (to ease search from Google) */&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;
== Options ==&lt;br /&gt;
&amp;lt;b id=CMD.OPT_ALT&amp;gt;CMD.OPT_ALT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_CTRL&amp;gt;CMD.OPT_CTRL&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_SHIFT&amp;gt;CMD.OPT_SHIFT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_RIGHT&amp;gt;CMD.OPT_RIGHT&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_INTERNAL&amp;gt;CMD.OPT_INTERNAL&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.OPT_META&amp;gt;CMD.OPT_META&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Waitcodes ==&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_TIME&amp;gt;CMD.WAITCODE_TIME&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_DEATH&amp;gt;CMD.WAITCODE_DEATH&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_SQUAD&amp;gt;CMD.WAITCODE_SQUAD&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.WAITCODE_GATHER&amp;gt;CMD.WAITCODE_GATHER&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Insert/Remove Commands ==&lt;br /&gt;
To get the commandqueue use the following lua-call&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;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=note&amp;gt;First, said &amp;quot;tags&amp;quot; aka &amp;quot;id&amp;quot; are unique command identifiers, so each command that gets inserted into a unit&#039;s command &lt;br /&gt;
queue gets its unique &amp;quot;tag&amp;quot; number. (It is used to &#039;&#039;sync&#039;&#039; command queue operations, also it makes things much easier.)&lt;br /&gt;
Editors Note: I fucking hate it when open source devs use the word easy. It is a clear indicator that someone spends a whole day finding out about a well hidden simple concept. Well at least we are on this journey together :)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To look at those &amp;quot;tags&amp;quot; you can do the following:&lt;br /&gt;
   local cmdQueue = Spring.GetUnitCommands(unitID);&lt;br /&gt;
   if (#cmdQueue&amp;gt;0) then &lt;br /&gt;
      local cmdTag = cmdQueue[1].tag&lt;br /&gt;
      Spring.Echo(cmdTag)&lt;br /&gt;
      ..&lt;br /&gt;
   end&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.INSERT&amp;gt;CMD.INSERT&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  options.ALT     -&amp;gt; treat param0 as a position instead of a tag &lt;br /&gt;
  options.CONTROL -&amp;gt; use the build queue for factories &lt;br /&gt;
  params[0] = command tag or position (negative numbers to reference&lt;br /&gt;
  the back of the queue and 0 the first)&lt;br /&gt;
  params[1] = insertCmd id &lt;br /&gt;
  params[2] = insertCmd options (shift,alt,right click,etc.)&lt;br /&gt;
  params[3 ... N+2] = insertCmd params[0 ... N-1]&lt;br /&gt;
&lt;br /&gt;
  Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
    Spring.GiveOrderToUnit(unitID,&lt;br /&gt;
      CMD.INSERT,&lt;br /&gt;
      {-1,CMD.ATTACK,&#039;&#039;CMD.OPT_SHIFT&#039;&#039;,&#039;&#039;unitID2&#039;&#039;},&lt;br /&gt;
      {&amp;quot;alt&amp;quot;}&lt;br /&gt;
    );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	Command structure dissection:&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;What to do with the command - in our case insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.INSERT&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Place in the queue to insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;-1&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Type of command to insert:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.ATTACK&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;Additional Information:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
	If the unit is working down a shift queue, add it seemless into it&lt;br /&gt;
&lt;br /&gt;
		&#039;CMD.OPT_SHIFT&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;TargetID or Position:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;unitID2&#039;&lt;br /&gt;
&lt;br /&gt;
	&#039;&#039;&#039;The &#039;-1&#039; is the queue position and not a tag:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
		&#039;{&amp;quot;alt&amp;quot;}&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  if you insert cmd in pos 2 for example the rest of commands starting&lt;br /&gt;
  from 2 will be pushed back. &lt;br /&gt;
  Ilustration: {cmdA, cmdB, cmdC, cmdD} =&amp;gt; {cmdA, cmdB, NewCmd, cmdC, cmdD}&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note: If you didn&#039;t already notice, the command params and&lt;br /&gt;
        the command options are twisted in the array (compared to GiveOrder)!&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note2: The command options in the array/table is a number value!&lt;br /&gt;
         You have to use CMD.OPT_* in this case.&lt;br /&gt;
  &amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
  Note3: The inserted command doesn&#039;t go through allowcommand callins, only CMD.INSERT does.&lt;br /&gt;
  &amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;b id=CMD.REMOVE&amp;gt;CMD.REMOVE&amp;lt;/b&amp;gt;&lt;br /&gt;
  options.ALT     -&amp;gt; use the parameters as commandIDs &lt;br /&gt;
  options.CONTROL -&amp;gt; use the build queue for factories &lt;br /&gt;
  params[0 ... N-1] = tags or commandIDs to remove&lt;br /&gt;
&lt;br /&gt;
No clues what the above mean translated, but here is a working example of how to delete a buildorder from a factory:  &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;   &lt;br /&gt;
 local facCmds = Spring.GetFactoryCommands(factoryID)&lt;br /&gt;
 &lt;br /&gt;
 if facCmds then -- nil check&lt;br /&gt;
	local cmd = facCmds[1]&lt;br /&gt;
	Spring.GiveOrderToUnit(factoryID, CMD.REMOVE, {i,cmd.tag}, {&amp;quot;ctrl&amp;quot;})&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Commands ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note, the CMD[] table is bidirectional. That means: CMD[CMD.STOP] := &amp;quot;CMD_STOP&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.STOP&amp;gt;CMD.STOP&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.WAIT&amp;gt;CMD.WAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.TIMEWAIT&amp;gt;CMD.TIMEWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.DEATHWAIT&amp;gt;CMD.DEATHWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_RECTANGLE|CMDTYPE.ICON_UNIT_OR_RECTANGLE]]&lt;br /&gt;
&amp;lt;b id=CMD.SQUADWAIT&amp;gt;CMD.SQUADWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.GATHERWAIT&amp;gt;CMD.GATHERWAIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.MOVE&amp;gt;CMD.MOVE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.PATROL&amp;gt;CMD.PATROL&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.FIGHT&amp;gt;CMD.FIGHT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.ATTACK&amp;gt;CMD.ATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_MAP|CMDTYPE.ICON_UNIT_OR_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.AREA_ATTACK&amp;gt;CMD.AREA_ATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.GUARD&amp;gt;CMD.GUARD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]&lt;br /&gt;
&amp;lt;b id=CMD.AISELECT&amp;gt;CMD.AISELECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.COMBO_BOX|CMDTYPE.COMBO_BOX]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPSELECT&amp;gt;CMD.GROUPSELECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPADD&amp;gt;CMD.GROUPADD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.GROUPCLEAR&amp;gt;CMD.GROUPCLEAR&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.REPAIR&amp;gt;CMD.REPAIR&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.FIRE_STATE&amp;gt;CMD.FIRE_STATE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.MOVE_STATE&amp;gt;CMD.MOVE_STATE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.SELFD&amp;gt;CMD.SELFD&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.LOAD_UNITS&amp;gt;CMD.LOAD_UNITS&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.LOAD_ONTO&amp;gt;CMD.LOAD_ONTO&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT|CMDTYPE.ICON_UNIT]]&lt;br /&gt;
&amp;lt;b id=CMD.UNLOAD_UNITS&amp;gt;CMD.UNLOAD_UNITS&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.UNLOAD_UNIT&amp;gt;CMD.UNLOAD_UNIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.ONOFF&amp;gt;CMD.ONOFF&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.RECLAIM&amp;gt;CMD.RECLAIM&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.CLOAK&amp;gt;CMD.CLOAK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.STOCKPILE&amp;gt;CMD.STOCKPILE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON|CMDTYPE.ICON]]&lt;br /&gt;
&amp;lt;b id=CMD.DGUN&amp;gt;CMD.DGUN&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MAP|CMDTYPE.ICON_MAP]]&lt;br /&gt;
&amp;lt;b id=CMD.RESTORE&amp;gt;CMD.RESTORE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_AREA|CMDTYPE.ICON_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.REPEAT&amp;gt;CMD.REPEAT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.TRAJECTORY&amp;gt;CMD.TRAJECTORY&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.RESURRECT&amp;gt;CMD.RESURRECT&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_FEATURE_OR_AREA|CMDTYPE.ICON_UNIT_FEATURE_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.CAPTURE&amp;gt;CMD.CAPTURE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_UNIT_OR_AREA|CMDTYPE.ICON_UNIT_OR_AREA]]&lt;br /&gt;
&amp;lt;b id=CMD.AUTOREPAIRLEVEL&amp;gt;CMD.AUTOREPAIRLEVEL&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.LOOPBACKATTACK&amp;gt;CMD.LOOPBACKATTACK&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.IDLEMODE&amp;gt;CMD.IDLEMODE&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.ICON_MODE|CMDTYPE.ICON_MODE]]&lt;br /&gt;
&amp;lt;b id=CMD.SET_WANTED_MAX_SPEED&amp;gt;CMD.SET_WANTED_MAX_SPEED&amp;lt;/b&amp;gt;&lt;br /&gt;
  type [[Lua_CMDs#CMDTYPE.NUMBER|CMDTYPE.NUMBER]]&lt;br /&gt;
&amp;lt;b id=CMD.SETBASE&amp;gt;CMD.SETBASE&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMD.INTERNAL&amp;gt;CMD.INTERNAL&amp;lt;/b&amp;gt;&lt;br /&gt;
  used in different ways&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;A negative number means build command&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The number is -unitDefID of the unittype that this command orders to be built.&lt;br /&gt;
   This means that build orders have no convenient CMD._____ string.&lt;br /&gt;
      The command id for build orders must always be a &amp;quot;minus&amp;quot; sign &amp;lt;i&amp;gt;appended to an integer value&amp;lt;/i&amp;gt;.&lt;br /&gt;
   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Spring.GiveOrderToUnit(unitID, &amp;lt;b&amp;gt;-(unitDefID)&amp;lt;/b&amp;gt;, {x,y,z(,facing)}, {&amp;quot;shift&amp;quot;})&amp;lt;/font&amp;gt;&lt;br /&gt;
      alternatively:&lt;br /&gt;
   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Spring.GiveOrderToUnit(unitID, &amp;lt;b&amp;gt;-UnitDefNames[&amp;quot;unitname&amp;quot;].id&amp;lt;/b&amp;gt;, {x,y,z(,facing)}, {&amp;quot;shift&amp;quot;})&amp;lt;/font&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&#039;facing&#039;&amp;lt;/b&amp;gt; is an optional integer parameter that controls unit&#039;s facing when placed.&lt;br /&gt;
      The values of (x,y,z) must &amp;lt;i&amp;gt;all&amp;lt;/i&amp;gt; be number values (like the number &amp;quot;0&amp;quot;), or the build order will break.&lt;br /&gt;
&lt;br /&gt;
== CommandTypes ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Note, the CMDTYPE[] table is bidirectional. That means: CMDTYPE[CMDTYPE.ICON] := &amp;quot;CMDTYPE_ICON&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON&amp;gt;CMDTYPE.ICON&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 0 parameters in return&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_MODE&amp;gt;CMDTYPE.ICON_MODE&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number selected mode)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_MAP&amp;gt;CMDTYPE.ICON_MAP&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_AREA&amp;gt;CMDTYPE.ICON_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT&amp;gt;CMDTYPE.ICON_UNIT&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameters in return (unitid)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_MAP&amp;gt;CMDTYPE.ICON_UNIT_OR_MAP&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameters in return (unitid) or 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_FRONT&amp;gt;CMDTYPE.ICON_FRONT&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 or 6 parameters in return (middle and right side of front if a front was defined)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.COMBO_BOX&amp;gt;CMDTYPE.COMBO_BOX&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number selected option)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_AREA&amp;gt;CMDTYPE.ICON_UNIT_OR_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid) or 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_FEATURE_OR_AREA&amp;gt;CMDTYPE.ICON_UNIT_FEATURE_OR_AREA&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid or [[Lua_ConstGame#Engine|Game.maxUnits]]+featureid)&lt;br /&gt;
      or 4 parameters in return (mappos+radius)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_BUILDING&amp;gt;CMDTYPE.ICON_BUILDING&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 3 parameters in return (mappos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.ICON_UNIT_OR_RECTANGLE&amp;gt;CMDTYPE.ICON_UNIT_OR_RECTANGLE&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (unitid)&lt;br /&gt;
      or 3 parameters in return (mappos)&lt;br /&gt;
      or 6 parameters in return (startpos+endpos)&lt;br /&gt;
&amp;lt;b id=CMDTYPE.NUMBER&amp;gt;CMDTYPE.NUMBER&amp;lt;/b&amp;gt;&lt;br /&gt;
  expect 1 parameter in return (number)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b id=CMDTYPE.CUSTOM&amp;gt;CMDTYPE.CUSTOM&amp;lt;/b&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&amp;lt;b id=CMDTYPE.NEXT&amp;gt;CMDTYPE.NEXT&amp;lt;/b&amp;gt; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;next command page&amp;lt;/font&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&amp;lt;b id=CMDTYPE.PREV&amp;gt;CMDTYPE.PREV&amp;lt;/b&amp;gt; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;previous command page&amp;lt;/font&amp;gt;&lt;br /&gt;
  used with CMD_INTERNAL&lt;br /&gt;
&lt;br /&gt;
== CmdIDs ==&lt;br /&gt;
Below is a table of all CMD table entries and their IDs:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Command||ID&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_NONE||-1&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_NONE||-1&lt;br /&gt;
|-&lt;br /&gt;
|STOP||0&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_HOLDPOS||0&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_HOLDFIRE||0&lt;br /&gt;
|-&lt;br /&gt;
|INSERT||1&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_MANEUVER||1&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_RETURNFIRE||1&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_TIME||1&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_DEATH||2&lt;br /&gt;
|-&lt;br /&gt;
|MOVESTATE_ROAM||2&lt;br /&gt;
|-&lt;br /&gt;
|REMOVE||2&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_FIREATWILL||2&lt;br /&gt;
|-&lt;br /&gt;
|FIRESTATE_FIREATNEUTRAL||3&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_SQUAD||3&lt;br /&gt;
|-&lt;br /&gt;
|OPT_META||4&lt;br /&gt;
|-&lt;br /&gt;
|WAITCODE_GATHER||4&lt;br /&gt;
|-&lt;br /&gt;
|WAIT||5&lt;br /&gt;
|-&lt;br /&gt;
|TIMEWAIT||6&lt;br /&gt;
|-&lt;br /&gt;
|DEATHWAIT||7&lt;br /&gt;
|-&lt;br /&gt;
|OPT_INTERNAL||8&lt;br /&gt;
|-&lt;br /&gt;
|SQUADWAIT||8&lt;br /&gt;
|-&lt;br /&gt;
|GATHERWAIT||9&lt;br /&gt;
|-&lt;br /&gt;
|MOVE||10&lt;br /&gt;
|-&lt;br /&gt;
|PATROL||15&lt;br /&gt;
|-&lt;br /&gt;
|FIGHT||16&lt;br /&gt;
|-&lt;br /&gt;
|OPT_RIGHT||16&lt;br /&gt;
|-&lt;br /&gt;
|LOOPBACKATTACK||20&lt;br /&gt;
|-&lt;br /&gt;
|ATTACK||20&lt;br /&gt;
|-&lt;br /&gt;
|AREA_ATTACK||21&lt;br /&gt;
|-&lt;br /&gt;
|GUARD||25&lt;br /&gt;
|-&lt;br /&gt;
|AISELECT||30&lt;br /&gt;
|-&lt;br /&gt;
|OPT_SHIFT||32&lt;br /&gt;
|-&lt;br /&gt;
|GROUPSELECT||35&lt;br /&gt;
|-&lt;br /&gt;
|GROUPADD||36&lt;br /&gt;
|-&lt;br /&gt;
|GROUPCLEAR||37&lt;br /&gt;
|-&lt;br /&gt;
|REPAIR||40&lt;br /&gt;
|-&lt;br /&gt;
|FIRE_STATE||45&lt;br /&gt;
|-&lt;br /&gt;
|MOVE_STATE||50&lt;br /&gt;
|-&lt;br /&gt;
|SETBASE||55&lt;br /&gt;
|-&lt;br /&gt;
|INTERNAL||60&lt;br /&gt;
|-&lt;br /&gt;
|OPT_CTRL||64&lt;br /&gt;
|-&lt;br /&gt;
|SELFD||65&lt;br /&gt;
|-&lt;br /&gt;
|SET_WANTED_MAX_SPEED||70&lt;br /&gt;
|-&lt;br /&gt;
|LOAD_UNITS||75&lt;br /&gt;
|-&lt;br /&gt;
|LOAD_ONTO||76&lt;br /&gt;
|-&lt;br /&gt;
|UNLOAD_UNITS||80&lt;br /&gt;
|-&lt;br /&gt;
|UNLOAD_UNIT||81&lt;br /&gt;
|-&lt;br /&gt;
|ONOFF||85&lt;br /&gt;
|-&lt;br /&gt;
|RECLAIM||90&lt;br /&gt;
|-&lt;br /&gt;
|CLOAK||95&lt;br /&gt;
|-&lt;br /&gt;
|STOCKPILE||100&lt;br /&gt;
|-&lt;br /&gt;
|MANUALFIRE||105&lt;br /&gt;
|-&lt;br /&gt;
|DGUN||105&lt;br /&gt;
|-&lt;br /&gt;
|RESTORE||110&lt;br /&gt;
|-&lt;br /&gt;
|REPEAT||115&lt;br /&gt;
|-&lt;br /&gt;
|TRAJECTORY||120&lt;br /&gt;
|-&lt;br /&gt;
|RESURRECT||125&lt;br /&gt;
|-&lt;br /&gt;
|OPT_ALT||128&lt;br /&gt;
|-&lt;br /&gt;
|CAPTURE||130&lt;br /&gt;
|-&lt;br /&gt;
|AUTOREPAIRLEVEL||135&lt;br /&gt;
|-&lt;br /&gt;
|IDLEMODE||145&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8817</id>
		<title>Gamedev:WeaponDefs</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8817"/>
		<updated>2018-10-25T04:38:17Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Updated targetmoveerror description with https://springrts.com/phpbb/viewtopic.php?t=2234&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;
WeaponDef files are .lua files stored in the &amp;lt;code&amp;gt;Weapons/&amp;lt;/code&amp;gt; directory of a Spring Game. Alternatively they can be integrated into [[Gamedev:UnitDefs|UnitDefs]].&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
WeaponDef files have one purpose; to define the properties of weapons. They are the main description file for what attributes your weapon should have and how it should behave. Since version 100.0, Spring will record a warning whenever it finds an unknown tag.&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/Weapons/WeaponDef.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 WeaponDef table the internal &amp;lt;code&amp;gt;weaponName&amp;lt;/code&amp;gt; desired for the weapon.&lt;br /&gt;
&lt;br /&gt;
===Common===&lt;br /&gt;
The following tags are common to all or at least a majority of &#039;&#039;&#039;WeaponTypes&#039;&#039;&#039;, depending on the tag.&lt;br /&gt;
&lt;br /&gt;
====General====&lt;br /&gt;
{{tag&lt;br /&gt;
|name = weaponType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;Cannon&amp;quot;&lt;br /&gt;
|description = Spring has 14 &#039;&#039;&#039;WeaponTypes&#039;&#039;&#039; which provide game developers with basic behaviours which they can customise to an extent with the &#039;&#039;&#039;WeaponDef&#039;&#039;&#039; tags. Some tags are specific to certain &#039;&#039;&#039;WeaponTypes&#039;&#039;&#039; and not implemented for others, [https://docs.google.com/spreadsheet/ccc?key=0Am5BbZxm93S9dEZXc1Q4dXR4TFRYTFM4NlR4OFJFdWc#gid=0 this two-way table] indicates which tags work for which types.}} The possible values are:&lt;br /&gt;
* [[#AircraftBomb|AircraftBomb]]&lt;br /&gt;
* [[#BeamLaser|BeamLaser]]&lt;br /&gt;
* [[#Cannon|Cannon]]&lt;br /&gt;
* [[#DGun|Dgun]]&lt;br /&gt;
* [[#EmgCannon|EmgCannon]]&lt;br /&gt;
* [[#Flame|Flame]]&lt;br /&gt;
* [[#LaserCannon|LaserCannon]]&lt;br /&gt;
* [[#LightningCannon|LightningCanon]]&lt;br /&gt;
* [[#Melee|Melee]]&lt;br /&gt;
* [[#MissileLauncher|MissileLauncher]]&lt;br /&gt;
* [[#Rifle|Rifle]]&lt;br /&gt;
* [[#Shield (WeaponType)|Shield]]&lt;br /&gt;
* [[#StarburstLauncher|StarburstLauncher]]&lt;br /&gt;
* [[#TorpedoLauncher|TorpedoLauncher]]&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = name&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;Weapon&amp;quot;&lt;br /&gt;
|description = The descriptive name of the weapon as listed in FPS mode.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = turret&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the unit aim within an arc (up-to and including full 360Â° turret traverse) or always aim along the owner&#039;s heading?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = noSelfDamage&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the weapon&#039;s explosion damage the unit which fires it? Useful for preventing bombers with high-yield weapons destroying themselves.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = impactOnly&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the weapon only deal damage through direct hits and not &#039;splash&#039; damage through {{taglink|areaOfEffect}}?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = noExplode&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the weapon explode on impact with a target or continue through? Note that these weapons will do damage every single frame they are inside the [[Gamedev:CollisionVolumes|collision volume]] of an object, underground or under water, massively multiplying their damage.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = burnblow&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = selfExplode&lt;br /&gt;
|description = Does the weapon explode when it reaches its maximum range or continue on its path? The name is an [[OTAism]].}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = range&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 10.0&lt;br /&gt;
|description = The maximum range in [[elmo]]s that the weapon can fire at.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = weaponVelocity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The velocity in [[elmo]]s per second of the weapon projectile. Since 99.0 &amp;lt;code&amp;gt;maxVelocity&amp;lt;/code&amp;gt; is a synonym.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = reloadTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = The time in seconds between shots fired.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = metalPerShot&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Metal used per shot. If the specified amount is not available, the weapon cannot be fired. Can also be used to specify how much a {{taglink|stockpile}} weapon will cost to build.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = energyPerShot&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Energy used per shot. If the specified amount is not available, the weapon cannot be fired. Can also be used to specify how much a {{taglink|stockpile}} weapon will cost to build.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = myGravity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Overrides the map gravity for ballistic weapons. The default of &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; disables the tag in favour of map gravity.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireStarter&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The percentage chance (&amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;100.0&amp;lt;/code&amp;gt;) of the weapon setting fire to static map features on impact.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cameraShake&lt;br /&gt;
|type = float&lt;br /&gt;
|default = damage (0.0 for paralyzers)&lt;br /&gt;
|description = Passed to the [[LuaCallinReturn#Game_Events:|ShockFront() callin]] as the first argument. Intended as a means to make the camera shake if in range of detonation.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = stockpile&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does each round of the weapon have to be built and stockpiled by the player? Will only correctly function for the first of each stockpiled weapons a unit has.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = stockpileTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = reloadTime&lt;br /&gt;
|description = The time in seconds taken to stockpile one round of the weapon.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = interceptedByShieldType&lt;br /&gt;
|type = int&lt;br /&gt;
|default = Depends on {{taglink|weaponType}}&lt;br /&gt;
|description = [http://en.wikipedia.org/wiki/Mask_(computing) Bitmask] representing the types of shields that can intercept this weapon. Each digit of binary that is set to one means that a shield with the corresponding digit in its {{taglink|interceptType}} will intercept this weapon. A value of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; means that no shields will intercept the weapon. The defaults are as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - [[#DGun]]&lt;br /&gt;
* &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - [[#Cannon]] and [[#EmgCannon]]&lt;br /&gt;
* &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - [[#LaserCannon]] and [[#BeamLaser]]&lt;br /&gt;
* &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; - [[#MissileLauncher]] and [[#StarburstLauncher]]&lt;br /&gt;
* &amp;lt;code&amp;gt;8&amp;lt;/code&amp;gt; - [[#AircraftBomb]]&lt;br /&gt;
* &amp;lt;code&amp;gt;16&amp;lt;/code&amp;gt; - [[#Flame]]&lt;br /&gt;
* &amp;lt;code&amp;gt;32&amp;lt;/code&amp;gt; - [[#TorpedoLauncher]]&lt;br /&gt;
* &amp;lt;code&amp;gt;64&amp;lt;/code&amp;gt; - [[#LightningCannon]]&lt;br /&gt;
* &amp;lt;code&amp;gt;128&amp;lt;/code&amp;gt; - [[#Rifle]]&lt;br /&gt;
* &amp;lt;code&amp;gt;256&amp;lt;/code&amp;gt; - [[#Melee]]&lt;br /&gt;
(See [[Shield Interception Tag Use]]).}}&lt;br /&gt;
&lt;br /&gt;
====Collision &amp;amp; Avoidance====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = avoidGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Should the weapon avoid firing if terrain blocks the line of fire?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = avoidFriendly&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Should the weapon avoid firing if a friendly unit is in the line of fire?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = avoidFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Should the weapon avoid firing if a static map feature is in the line of fire?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = avoidNeutral&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Should the weapon avoid firing if a neutral unit is in the line of fire?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideEnemy&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = noEnemyCollide&lt;br /&gt;
|description = Does the weapon projectile collide with enemy units or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideFriendly&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = noFriendlyCollide&lt;br /&gt;
|description = Does the weapon projectile collide with friendly units or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideFirebase&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = noFirebaseCollide&lt;br /&gt;
|description = Does the weapon projectile collide with friendly firebase units the owner is loaded onto, or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = noFeatureCollide&lt;br /&gt;
|description = Does the weapon projectile collide with static map features or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideNeutral&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = noNeutralCollide&lt;br /&gt;
|description = Does the weapon projectile collide with neutral units or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collideGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|lua = noGroundCollide&lt;br /&gt;
|description = Does the weapon projectile collide with terrain or pass through?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = collisionSize&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.05 (0.5 for [[#Flame]] and [[#LaserCannon]], 10.0 for [[#Dgun]])&lt;br /&gt;
|description = Modifies visual size of EMG and Flame projectiles, and physical size &#039;&#039;&#039;only&#039;&#039;&#039; for hitscan interceptor weapons (e.g. antinuke lasers). [[https://github.com/spring/spring/blob/3034e5f5a8f5b9fb4624a97f7a85cb5c90457725/rts/Sim/Projectiles/WeaponProjectiles/WeaponProjectile.cpp#L250 1]][[https://github.com/spring/spring/blob/master/rts/Sim/Misc/CollisionHandler.cpp#L33 2]]}}&lt;br /&gt;
&lt;br /&gt;
====Targeting &amp;amp; Accuracy====&lt;br /&gt;
{{tag&lt;br /&gt;
|name = commandFire&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Determines if the weapon will automatically fire on enemy units in range or only when manually ordered to attack.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = canAttackGround&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Determines if the weapon can be force-fired on ground positions or only fire on targeted units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = waterWeapon&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Determines if the weapon can pass through water and target underwater units.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireSubmersed&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = waterWeapon&lt;br /&gt;
|description = Determines if the weapon can fire whilst underwater.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = targetBorder&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0 (1.0 for [[#Melee]])&lt;br /&gt;
|description = Controls whether the weapon aims for the centre or the edge of its target&#039;s [[Gamedev:CollisionVolumes|collision volume]]. Clamped between &amp;lt;code&amp;gt;-1.0&amp;lt;/code&amp;gt; - target the far border, and &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; - target the near border.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cylinderTargeting&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0 (1.0 for [[#Melee]])&lt;br /&gt;
|description = Controls whether the weapon range is calculated in a sphere or a cylinder. The height of the cylinder is determined by the value of this tag multiplied by the {{taglink|range}}. Clamped between &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;128.0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = tolerance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 3000.0 (+/- ~18 degrees)&lt;br /&gt;
|description = The amount (in [[Gamedev:UnitsOfMeasurement#Angular|cau]]) to which the weapon&#039;s &amp;quot;real&amp;quot; aim can be off while the weapon will still be able to fire accurately at the target. For {{taglink|turret|false}} or {{taglink|fixedLauncher|true}} weapons this determines in what arc the unit will fire.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fireTolerance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 32768.0 (+/- 180 degrees)&lt;br /&gt;
|special = {{new|99.0}}&lt;br /&gt;
|description =  Final check to prevent weapons from shooting sideways. If a weapon is about to fire but the difference between its old aim and requested aim is greater than this angle (in [[Gamedev:UnitsOfMeasurement#Angular|cau]]) then it will not fire.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = allowNonBlockingAim&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|special = {{new|99.0}}&lt;br /&gt;
|description = When enabled it makes [[Animation-LuaCallins#Weapons|AimWeapon()]] script calls non-blocking (still the {{taglink|fireTolerance}} tag might prevent the weapon firing). This is very useful for fast units that need to re-target often.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = targetMoveError&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The degree to which a weapon&#039;s aiming will fail to keep up with its target&#039;s movement. It adds a fraction of the target&#039;s speed (per second) as a random error to the targetting. So if the target moves 50 units per second and the targetmoveerror is 0.5 a random error of 25 will be added to the target position. If set very low or not set at all, a weapon will lead its target and almost always hit.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = leadLimit&lt;br /&gt;
|type = float&lt;br /&gt;
|default = -1.0&lt;br /&gt;
|description = Limits the maximum distance a unit will lead a target. The default of &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; allows an infinite distance.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = leadBonus&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Controls how experience boosts the weapon&#039;s target leading. Is multiplied with the unit&#039;s experience and added to the {{taglink|leadLimit}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = predictBoost&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0 (0.5 for {{taglink|burnblow|true}} weapons)&lt;br /&gt;
|description = Controls how well the weapon predicts unit speeds. Works in a similar way to  {{taglink|targetMoveError}} except that it is 1-dimensional. This tag spreads the shots in a line based on the direction of the target whereas {{taglink|targetMoveError}} spreads the shots all around based on the movement.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = heightMod&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.2 (0.8 for [[#Cannon]], 1.0 for [[#BeamLaser]] and [[#LightningCannon]])&lt;br /&gt;
|description = Changes the spherical weapon range into an ellipsoid. Values above &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; mean the weapon cannot target as high as it can far, values below &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; mean it can target higher than it can far. For example &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; would allow the weapon to target twice as high as far.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = proximityPriority&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = Acts as a multiplier for the distance to the target in the priority calculation. Note that negative values make weapons prefer distant targets.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = accuracy&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How accurate the weapon is. Lower values are more accurate. Accuracy is relative to the distance to the target; for instance, if the target is very close, even a very high value will probably still hit. If a target is very far away, even a very low value will likely cause the weapon to miss.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = movingAccuracy&lt;br /&gt;
|type = float&lt;br /&gt;
|default = accuracy&lt;br /&gt;
|description = A weapon&#039;s {{taglink|accuracy}} whilst the owning unit is moving.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sprayAngle&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How wide the the angle of a burst from a [[#Bursts|burst weapon]] can be. Very similar to {{taglink|accuracy}}, except that this tag affects each projectile in a burst, whilst the former does not.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = ownerExpAccWeight&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0 (See description)&lt;br /&gt;
|description = A multiplier to {{taglink|accuracy}} and {{taglink|sprayAngle}} that reduces inaccuracy as a units experience increases. Defaults are as follows:&lt;br /&gt;
* &amp;lt;code&amp;gt;0.9&amp;lt;/code&amp;gt; - [[#Cannon]], [[#Rifle]]&lt;br /&gt;
* &amp;lt;code&amp;gt;0.7&amp;lt;/code&amp;gt; - [[#LaserCannon]], [[#BeamLaser]], [[#StarburstLauncher]]&lt;br /&gt;
* &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; - [[#MissileLauncher]], [[#LightningCannon]], [[#EmgCannon]], [[#DGun]]&lt;br /&gt;
* &amp;lt;code&amp;gt;0.2&amp;lt;/code&amp;gt; - [[#Flame]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = targetable&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|special = {{new|92.0}} Previously only for [[#StarburstLauncher]]&lt;br /&gt;
|description = [http://en.wikipedia.org/wiki/Mask_(computing) Bitmask] representing the types of weapon that can intercept this weapon. Each digit of binary that is set to one means that a weapon with the corresponding digit in its {{taglink|interceptor}} tag will intercept this weapon. Instant-hitting weapons such as [[#BeamLaser]], [[#LightningCannon]] and [[#Rifle]] cannot be targeted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = interceptor&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|special = {{new|92.0}} Previously only for [[#StarburstLauncher]]&lt;br /&gt;
|description = [http://en.wikipedia.org/wiki/Mask_(computing) Bitmask] representing the types of weapons that this weapon can intercept. Each digit of binary that is set to one means that a weapon with the corresponding digit in its {{taglink|targetable}} tag will be intercepted by this weapon.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = interceptSolo&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = {{new|92.0}} &lt;br /&gt;
|description = If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; no other interceptors may target the same projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = coverage&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|special = {{new|92.0}} Previously only for [[#StarburstLauncher]]&lt;br /&gt;
|description = The radius in [[elmo]]s within which an {{taglink|interceptor}} weapon will fire on {{taglink|targetable}} weapons.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Bouncing====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = waterBounce&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the weapon bounce on water impacts?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = groundBounce&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the weapon bounce on ground impacts?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = bounceSlip&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = The decimal-percentage amount of horizontal velocity a projectile keeps when it bounces.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = bounceRebound&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = The decimal-percentage amount of vertical velocity a projectile keeps when it bounces.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = numBounce&lt;br /&gt;
|type = int&lt;br /&gt;
|default = -1&lt;br /&gt;
|description = The number of times the weapon will bounce on impact before exploding. The default value of &amp;lt;code&amp;gt;-1&amp;lt;/code&amp;gt; allows infinite bounces (at least until velocity reaches 0).}}&lt;br /&gt;
&lt;br /&gt;
====Area Of Effect, Impulse &amp;amp; Cratering====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = areaOfEffect&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 8.0 * 0.5&lt;br /&gt;
|lua = damageAreaOfEffect&lt;br /&gt;
|description = The &#039;&#039;diameter&#039;&#039; in [[elmo]]s in which the weapons explosion will cause damage.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = craterAreaOfEffect&lt;br /&gt;
|type = float&lt;br /&gt;
|default = areaOfEffect * 0.5&lt;br /&gt;
|description = The &#039;&#039;radius&#039;&#039; in [[elmo]]s in which the weapons explosion will cause terrain cratering. Behaviour changed slightly in 98.0 as previously craters were 1.5x {{taglink|craterAreaOfEffect}} whilst decals were 1.0x, they are now both the same size.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = edgeEffectiveness&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Determines what percent of a weapon&#039;s maximum damage value will be applied to units within the weapon&#039;s {{taglink|areaOfEffect}}. Falls off from the epicentre according to the formula &amp;lt;code&amp;gt;damageApplied = damage * [(areaOfEffect - distToUnit) / (areaOfEffect - (distToUnit * edgeEffectiveness))]&amp;lt;/code&amp;gt;, a graph of the function for various values is available [[Media:EdgeEffectiveness.png|here]].}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = explosionSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = See description&lt;br /&gt;
|description = The speed at which the weapon&#039;s explosion propagates from the epicentre. The default is calculated by this complex formula: &amp;lt;code&amp;gt;defExpSpeed = {8.0 + [max(30.0, default_damage / 20.0) * 2.5]} / {9.0f + [sqrt(max(30.0, default_damage / 20.0f)) * 0.7]} * 0.5&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = impulseFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = A multiplier to the impulse given to units within the explosion {{taglink|areaOfEffect}}, which is otherwise equal to the damage dealt after {{taglink|edgeEffectiveness}} is taken into account. For [[#Melee]] weapons this is instead multiplied by the owning unit&#039;s mass (See [[Gamedev:UnitDefs#Tag:mass|Gamedev:UnitDefs]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = impulseBoost&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = A constant amount added to the weapon&#039;s impulse, regardless of distance from the epicentre or the damage potential of the explosion, prior to the application of {{taglink|impulseFactor}}}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = craterMult&lt;br /&gt;
|type = float&lt;br /&gt;
|default = impulseFactor&lt;br /&gt;
|description = A multiplier to depth of terrain crater the weapon&#039;s explosion will create, which is otherwise based on the damage potential.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = craterBoost&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = A constant amount, added to the weapon&#039;s cratering depth before the application of {{taglink|craterMult}}.}}&lt;br /&gt;
&lt;br /&gt;
====Bursts====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = burst&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|lua = salvoSize&lt;br /&gt;
|description = How many shots to fire per burst.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = burstRate&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.1&lt;br /&gt;
|lua = salvoDelay&lt;br /&gt;
|description = The time in seconds between shots in a burst. Note that {{taglink|reloadTime}} starts to count down from the &#039;&#039;first&#039;&#039; round fired, not the last so if &amp;lt;code&amp;gt;reloadTime &amp;lt; burst * burstRate&amp;lt;/code&amp;gt; the weapon will fire continuously.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = projectiles&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1&lt;br /&gt;
|description = How many projectiles released per shot (shotgun style). e.g. a weapon with {{taglink|burst|5}}, {{taglink|burstRate|0.5}} and {{taglink|projectiles|2}} will shoot 5 lots of 2 for 10 projectiles total, with gaps of 0.5 seconds, before waiting for {{taglink|reloadTime}}. Best used in conjunction with {{taglink|sprayAngle}} or changing the firing piece using [[Animation-LuaCallins#Weapons|ShotX]] as otherwise they&#039;ll all be clumped in one shot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Paralyzing====&lt;br /&gt;
{{tag&lt;br /&gt;
|name = paralyzer&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the weapon a paralyzer? If &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the weapon only stuns enemy units and does not cause damage in the form of lost hit-points.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = paralyzeTime&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 10&lt;br /&gt;
|lua = damages.paralyzeDamageTime&lt;br /&gt;
|description = Determines the maximum length of time in seconds that the target will be paralyzed. The timer is restarted every time the target is hit by the weapon. Cannot be less than &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Dynamic Damage====&lt;br /&gt;
The following set of tags allow for a weapon&#039;s damage potential to vary with the distance to its target.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = dynDamageExp&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Exponent of the range-dependent damage formula, the default of &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; disables dynamic damage, &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; means linear scaling, &amp;lt;code&amp;gt;2.0&amp;lt;/code&amp;gt; quadratic and so on.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = dynDamageMin&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The minimum floor value that range-dependent damage can drop to.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = dynDamageRange&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = If set to non-zero values the weapon will use this value in the range-dependant damage formula instead of the actual {{taglink|range}}. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = dynDamageInverted&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; the damage curve is inverted i.e. the weapon does more damage at greater ranges as opposed to less.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Sounds====&lt;br /&gt;
{{tag&lt;br /&gt;
|name = soundTrigger&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false (true for [[#Melee]], [[#Rifle]] and non-beamBurst [[#BeamLaser]])&lt;br /&gt;
|description = Does the weapon play {{taglink|soundStart}} only once for each salvo (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;) or for every round in a burst (&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;)?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = soundStart&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of a &#039;&#039;&#039;SoundItem&#039;&#039;&#039; (See [[Sounds.lua]]) or filename of a sound to play when the weapon fires.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = soundHitDry&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of a &#039;&#039;&#039;SoundItem&#039;&#039;&#039; (See [[Sounds.lua]]) or filename of a sound to play when the weapon collides with solid ground. Note that a [[#BeamLaser]] will play this sound every frame of its lifetime.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = soundHitWet&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of a &#039;&#039;&#039;SoundItem&#039;&#039;&#039; (See [[Sounds.lua]]) or filename of a sound to play when the weapon collides with water. Note that a [[#BeamLaser]] will play this sound every frame of its lifetime.}}&lt;br /&gt;
&lt;br /&gt;
====Visuals====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = cegTag&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name, without prefixes, of a [[CEG]] to be emitted by the projectile each frame.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = intensity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.9 (0.2 for [[#Cannon]])&lt;br /&gt;
|description = Alpha transparency for non-3D model projectiles. Lower values are more opaque, but &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; will cause the projectile to disappear entirely.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = model&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The filename of a 3D model to use when rendering the projectile. Note that only the root piece of a projectile model is rendered. Currently only for [[#Cannon]], [[#LaserCannon]], [[#MissileLauncher]], [[#StarburstLauncher]] and [[#TorpedoLauncher]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = explosionScar&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the weapon&#039;s explosion leave a scar decal on the ground? For all types except [[#Melee]] and [[#Rifle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = alwaysVisible&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; the weapon is always rendered regardless of whether or not it is in LOS range of a player&#039;s units.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = rgbColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {1.0, 0.0, 0.0} (See Description)&lt;br /&gt;
|description = The primary colour for sprite rendering weapons. Additional defaults are as follows:&lt;br /&gt;
* [[#Cannon]] - &amp;lt;code&amp;gt;{1.0, 0.5, 0.0}&amp;lt;/code&amp;gt;&lt;br /&gt;
* [[#EmgCannon]] - &amp;lt;code&amp;gt;{0.9, 0.9, 0.2}&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = explosionGenerator&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The name of a [[CEG]], with &amp;lt;code&amp;gt;custom:&amp;lt;/code&amp;gt; prefix, to spawn as the weapon&#039;s explosion. Does not currently work for [[#Melee]] and [[#Rifle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = bounceExplosionGenerator&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = For weapons which can use {{taglink|groundBounce|true}}, the name of a [[CEG]], with &amp;lt;code&amp;gt;custom:&amp;lt;/code&amp;gt; prefix, to spawn when weapon the bounces.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = texture1&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The projectile texture for [[#AircraftBomb]], [[#Cannon]], [[#EmgCannon]], [[#Flame]]; beam texture for [[#LaserCannon]], [[#BeamLaser]], [[#LightningCannon]]; flare texture for [[#MissileLauncher]], [[#StarburstLauncher]] and dome texture for the [[#Shield]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = texture2&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = The end-of-beam texture for [[#LaserCannon]], [[#BeamLaser]] and {{taglink|smoketrail}} texture for [[#MissileLauncher]], [[#StarburstLauncher]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = texture3&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = Flare texture for [[#BeamLaser]], or muzzle texture if {{taglink|largeBeamLaser|true}}. Also used as the flame texture for [[#StarburstLauncher]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = texture4&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = Flare texture for [[#BeamLaser]] with {{taglink|largeBeamLaser|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===AircraftBomb===&lt;br /&gt;
Drops a ballistic projectile at the same movement vector as the unit itself. Intended only for aircraft. Visually drawn as a billboarded sprite as used by the [[#Cannon]], but more commonly used with a 3D model.&lt;br /&gt;
&lt;br /&gt;
There are no tags specific to this &#039;&#039;&#039;WeaponType&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====AircraftBomb Visuals====&lt;br /&gt;
&lt;br /&gt;
When not using a {{taglink|model}}, the AircraftBomb is the same as [[#Cannon Visuals]].&lt;br /&gt;
&lt;br /&gt;
===BeamLaser===&lt;br /&gt;
An instant-hit weapon which spawns a beam and does a portion of its total damage each frame. Cannot be [[Animation-LuaCallouts#Effects|script emitted]] if it has a {{taglink|beamTime}} longer than one frame. Visually drawn as a [http://en.wikipedia.org/wiki/Star_Trek Star Trek] Phaser-style laser weapon. The {{taglink|largeBeamLaser}} tag allows changing the visual effect of the laser, such as using a tileable, scrolling texture without changing the behaviour.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = minIntensity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The minimum percentage the weapon&#039;s damage can fall-off to over its range. Setting to &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; will disable fall off entirely. Unrelated to the visual-only {{taglink|intensity}} tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = beamTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|lua = beamtime (all lowercase!)&lt;br /&gt;
|description = How long in seconds to fire the laser before waiting for {{taglink|reloadTime}} to start. Damage is distributed over the duration of the {{taglink|beamTime}}, and the weapon will aim to hit the target when the beam is in the middle of its {{taglink|beamTime}} (i.e. using prediction).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = beamBurst&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|lua = beamburst (all lowercase!)&lt;br /&gt;
|description = Makes the laser fire a burst of beams that are all aimed towards the target (instead of aimed with the piece). A [[#BeamLaser]] can do its full damage with every shot if {{taglink|beamBurst}} is enabled. Disables {{taglink|beamTime}} in favour of the [[#Bursts|burst tags]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sweepFire&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Makes the laser continue firing while it aims for a new target, &#039;sweeping&#039; across the terrain. Reimplemented in 95.0, still has no script interaction so use with care. Respects {{taglink|reloadTime}} constraint but not much else.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====BeamLaser Visuals====&lt;br /&gt;
&lt;br /&gt;
See also {{taglink|thickness}} and {{taglink|coreThickness}}.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = beamTTL&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The time in frames for which the laser beam remains visible.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = beamDecay&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = How fast the beam fades out. Each frame the {{taglink|intensity}} is multiplied by this value.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = laserFlareSize&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 15.0&lt;br /&gt;
|description = Determines the size of the firing flare.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = largeBeamLaser&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Changes the visual effect allowing tiling and scrolling of the texture and a pulsating firing flare.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = tileLength&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 200.0&lt;br /&gt;
|description = Defines the length before the texture used is repeated (tiled). Only if {{taglink|largeBeamLaser|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = scrollSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 5.0&lt;br /&gt;
|description = Controls how fast the texture scrolls. Only if {{taglink|largeBeamLaser|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = pulseSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = Controls how fast the pulsating effect at the start of the beam is. Only if {{taglink|largeBeamLaser|true}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Cannon===&lt;br /&gt;
The default &#039;&#039;&#039;WeaponType&#039;&#039;&#039;. Fires a ballistic projectile, for the best result (without under/overshooting) the {{taglink|weaponVelocity}} should be set so as to give an elevation of 45Â° when firing at the maximum {{taglink|range}}. Substituting the angle into the [http://en.wikipedia.org/wiki/Trajectory#Range_and_height trajectory equation] and rearranging, we get: &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;weaponVelocity = âˆš(range * g)&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt; &lt;br /&gt;
where &amp;lt;code&amp;gt;g&amp;lt;/code&amp;gt; is the map gravity, usually around &amp;lt;code&amp;gt;120&amp;lt;/code&amp;gt; for most Spring maps (You can use the {{taglink|myGravity}} tag if you want to be exact). Visually drawn as a billboarded sprite or 3D model. &lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = highTrajectory&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 2&lt;br /&gt;
|description = Can this weapon be fired in a high trajectory (&amp;gt;45Â° angle). 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; - enables a high/low toggle button on the unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = heightBoostFactor&lt;br /&gt;
|type = float&lt;br /&gt;
|default = -1.0&lt;br /&gt;
|description = Controls the boost given to {{taglink|range}} by high terrain. Values &amp;gt; &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; result in increased range, &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; means the cannon has fixed range regardless of height difference to target. Any value &amp;lt; &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; (i.e. the default value) result in an automatically calculated value based on {{taglink|range}} and theoretical maximum range.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====Cannon Visuals====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = size&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 2.0 + min(default_damage * 0.0025, {{taglink|areaOfEffect}} * 0.1)&lt;br /&gt;
|description = The drawing radius of the billboarded sprite. Also for [[#AircraftBomb Visuals]], [[#EmgCannon Visuals]] (default: &amp;lt;code&amp;gt;3.0&amp;lt;/code&amp;gt;) and [[#Flame Visuals]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = colorMap&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = A set of RGB colours to transition between over the projectile&#039;s lifetime. Can be given as a string of RGB digits or an image filename (See [[CColorMap]]). Also for [[#Flame Visuals]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sizeDecay&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How quickly each particle of the Cannon shot decays in size.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = alphaDecay&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.0&lt;br /&gt;
|description = How quickly each particle of the Cannon shot fades out.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = separation&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The distance between each particle of the Cannon shot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = noGap&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|description = Switch between the distance between particles being proportional to the size of the two particles (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;) or proportional to the size of the first particle (&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 = stages&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 5&lt;br /&gt;
|description = The number of particles in each Cannon shot.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===DGun===&lt;br /&gt;
Fires a line-of-sight or ballistic projectile (selected via the {{taglink|gravityAffected}} tag). Visually represented by a fireball effect that cannot be customised, however it can be replaced by a 3D model. The name and visual effect are [[OTAism]]s.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = gravityAffected&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the fireball projectile lose height due to map gravity?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===EmgCannon===&lt;br /&gt;
A line-of-sight weapon. Visually drawn as a billboarded sprite very similar to that of the [[#Cannon]], however not as customisable, or a 3D model. The name is another [[OTAism]].&lt;br /&gt;
&lt;br /&gt;
There are no tags specific to this &#039;&#039;&#039;WeaponType&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Flame===&lt;br /&gt;
A line-of-sight weapon intended for use as a flamethrower or similar. Visually drawn as a stream of textured particles, the colour of which can be controlled very precisely using the {{taglink|colorMap}} tag (see [[CColorMap]]).&lt;br /&gt;
&lt;br /&gt;
====Flame Visuals====&lt;br /&gt;
See also {{taglink|colorMap}}.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = sizeGrowth&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.5&lt;br /&gt;
|description = How much the draw radius of the flame projectile increases each frame.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flameGFXTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 1.2&lt;br /&gt;
|description = Makes the flamethrower projectile stay alive as a visual-only effect (i.e. does not deal any damage) after it has reached maximum {{taglink|range}}. It is a percentage multiplier, e.g. &amp;lt;code&amp;gt;1.2&amp;lt;/code&amp;gt; makes the projectile stay alive until it reaches 20% beyond {{taglink|range}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===LaserCannon===&lt;br /&gt;
A particularly versatile line-of-sight weapon. Visually drawn like a [http://en.wikipedia.org/wiki/Star_Wars Star Wars] Blaster-style laser weapon, or a 3D model.&lt;br /&gt;
&lt;br /&gt;
====LaserCannon Visuals====&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = duration&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.05&lt;br /&gt;
|description = Multiplied against {{taglink|weaponVelocity}} to determine the visual length of the beam projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = hardStop&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the laser projectile stop dead or fade out?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fallOffRate&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.5&lt;br /&gt;
|description = Rate at which the beam fades out after it goes past its maximum {{taglink|range}} if {{taglink|hardStop|false}}. A value of &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; is never fade out, &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; is finish fading out exactly at maximum {{taglink|range}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = lodDistance&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 1000&lt;br /&gt;
|description = Minimum camera distance at which the default LaserCannon projectile is simplified to a single rectangle.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = thickness&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 2.0&lt;br /&gt;
|description = The thickness (width) of the LaserCannon projectile. Also for [[#BeamLaser Visuals]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = coreThickness&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 2.0&lt;br /&gt;
|description = The thickness (width) of the LaserCannon projectile&#039;s core. Also for [[#BeamLaser Visuals]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = rgbColor2&lt;br /&gt;
|type = float&lt;br /&gt;
|default = {1.0, 1.0, 1.0}&lt;br /&gt;
|description = The colour of the LaserCannon projectile&#039;s core. Also for [[#BeamLaser Visuals]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===LightningCannon===&lt;br /&gt;
An instant-hit weapon similar to the [[#BeamLaser]], but which does all its damage at once. Visually drawn like [http://en.wikipedia.org/wiki/Star_Wars Star Wars] &#039;Force Lightning&#039; or [http://en.wikipedia.org/wiki/Command_%26_Conquer:_Red_Alert CnC: Red Alert] [http://en.wikipedia.org/wiki/Tesla_coil Tesla Coil] weapons, the effect is not very customisable.&lt;br /&gt;
&lt;br /&gt;
There are no tags specific to this &#039;&#039;&#039;WeaponType&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Melee===&lt;br /&gt;
A weapon that always damages the target, no ifs or buts; unsurprisingly intended for use as a close quarters [http://en.wikipedia.org/wiki/Melee#Use_in_gaming &#039;melee&#039;] weapon. It does not fire a projectile and does not care about the line of fire.&lt;br /&gt;
&lt;br /&gt;
There are no tags specific to this &#039;&#039;&#039;WeaponType&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===MissileLauncher===&lt;br /&gt;
A versatile weapon which can optionally track targets and accelerate from a low initial velocity.  It can also use {{taglink|trajectoryHeight}} to have the shot arc similar to a ballistic  projectile. Visually represented by a 3D model, with an optional {{taglink|smokeTrail}}.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = startVelocity&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The initial velocity of the weapon projectile. Also for [[#StarburstLauncher]] and [[#TorpedoLauncher]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = weaponAcceleration&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The initial acceleration of the weapon projectile. Also for [[#StarburstLauncher]] and [[#TorpedoLauncher]]. Note that if it is &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; the weapon can never increase from its {{taglink|startVelocity}} and will not reach its maximum {{taglink|weaponVelocity}}. Since 99.0 &amp;lt;code&amp;gt;acceleration&amp;lt;/code&amp;gt; is a synonym.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = tracks&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the weapon projectile track a moving target? Also for [[#StarburstLauncher]] and [[#TorpedoLauncher]].}}&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 = The rate (in [[Elmo#Angular|cau]]) at which {{taglink|tracks|true}} weapons turn towards their target. This is relative to a projectile&#039;s current velocity; a weapon with a higher velocity will need a higher value in order to be able to hit targets that turn suddenly.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = flightTime&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The time in seconds before a missile projectile&#039;s fuel runs out; it ceases to obey {{taglink|tracks}}, loses velocity and falls to the ground. Also for [[#StarburstLauncher]]. Large values may cause over/undershoot problems. As of 104.0 also applies to [[#EmgCannon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = fixedLauncher&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Makes the projectile spawn with the orientation of the shooting piece instead of their normal orientation. Also for [[#StarburstLauncher]] and [[#TorpedoLauncher]]. Weapons may not correctly obey [[#Collision &amp;amp; Avoidance|avoidance settings]] when using this tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = wobble&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Adds a random vector to the direction of travel every 16 frames, multiplied by the value of the tag. The effect is reduced as the firing unit gains experience. As this missiles direction is changed, wobbling swarm of missiles will diverge.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = dance&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Adds a random vector to the position of a missile projectile every 8 frames, multiplied by the value of the tag. As the projectile is not rotated, a dancing swarm of missiles will remain relatively coherent.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = trajectoryHeight&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Determines the height of the arc the missile will reach as it moves towards its target. A value of &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt; will result in a flat trajectory, &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt; will launch at 45&amp;amp;deg;. Can be any value &amp;gt;= &amp;lt;code&amp;gt;0.0&amp;lt;/code&amp;gt;; extreme values may require the {{taglink|tracks}} tag to be able to hit a target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
====MissileLauncher Visuals====&lt;br /&gt;
A note about the missile exhaust flare: the size of the flare is determined by the model radius. The emit position of the flare is at (0,0,-radius) so the model may need careful adjustment to get the flare looking right.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = smokeTrail&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the missile projectile emit a smoke trail as it travels? Also for [[#StarburstLauncher]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Rifle===&lt;br /&gt;
An instant hit weapon which does all its damage at once. Visually represented by a hardcoded tracer, firing and hitting effects. Rarely used.&lt;br /&gt;
&lt;br /&gt;
There are no tags specific to this &#039;&#039;&#039;WeaponType&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Shield (WeaponType)===&lt;br /&gt;
As the name suggests, not a weapon but a defensive shield. Can absorb or deflect ({{taglink|repulsor|true}}) projectiles. Individual weapons can be set to be intercepted or not by the shield using a [http://en.wikipedia.org/wiki/Mask_(computing) bitmask] (see [[Shield Interception Tag Use]]). Visually represented as a translucent sphere, with control over colour and texture; by default the shield is invisible ({{taglink|visible|false}}).&lt;br /&gt;
&lt;br /&gt;
See the [[#shield]] sub-table section for other tags specific to this type.&lt;br /&gt;
&lt;br /&gt;
===StarburstLauncher===&lt;br /&gt;
Fires a projectile that rises vertically for {{taglink|weaponTimer}} seconds, then turns towards its target. It can optionally track targets and accelerate from a low initial velocity. Before spring 92.0 was the only weapon that can be {{taglink|targetable}} and act as an {{taglink|interceptor}}. Visually represented by a 3D model, with an optional {{taglink|smokeTrail}}.&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = weaponTimer&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The time in seconds during which the missile ascends vertically before turning towards its target.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===TorpedoLauncher===&lt;br /&gt;
Fires a projectile that will behave ballistically out of water and like a missile in water. Usually used with {{taglink|waterWeapon|true}} so they can fire underwater and target underwater units. An aircraft carrying a [[#TorpedoLauncher]] is a special case, the weapon turns into an [[#AircraftBomb]] projectile that will spawn a torpedo projectile on impact with water. Visually represented by a pointed black cuboid, usually the default object is replaced by a 3D model. &lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = subMissile&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Can the torpedo leave the water and target units and positions on land?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===NoWeapon===&lt;br /&gt;
Not actually a &#039;&#039;&#039;WeaponType&#039;&#039;&#039;, but an individual weapon requested by Spring to &#039;fill in the gaps&#039; if a unit claims to have a weapon which isn&#039;t actually defined. There needs to be only one of these weapons and it is created by setting {{taglink|weaponName|&amp;quot;NOWEAPON&amp;quot;}} rather than by the {{taglink|weaponType}} tag.&lt;br /&gt;
&lt;br /&gt;
==Sub Tables==&lt;br /&gt;
&lt;br /&gt;
===damage===&lt;br /&gt;
The damage subtable lists how many hit points the weapon depletes against each armor class (See [[Armordefs.lua]]). It is a key-value map of armor class names and damage values. The special &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; entry is as the name suggests the default damage applied to any unit which does not belong to a listed armor class, or to shields.&lt;br /&gt;
&lt;br /&gt;
For example a weapon which deals 100 damage by default but only 50 to units in the &#039;tank&#039; armor class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;damage = {&lt;br /&gt;
    default = 100,&lt;br /&gt;
    tank = 50,&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===shield===&lt;br /&gt;
The preferred way to create a shield or repulser is to use the shield subtable rather than the old shield tags. &lt;br /&gt;
&lt;br /&gt;
The following tags are repulser specific:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = repulser&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Does the shield [http://dictionary.reference.com/browse/repulse?s=t repulse] (deflect) projectiles or absorb them? Btw its [http://springrts.com/mantis/view.php?id=4206 not repulsOr, but repulsEr]!}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = force&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The force applied by the repulser to the weapon - higher values will deflect weapons away at higher velocities.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = maxSpeed&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The maximum speed the repulser will impart to deflected projectiles.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = visibleRepulse&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the (hard-coded) repulse effect rendered or not?}}&lt;br /&gt;
&lt;br /&gt;
The following tags are general behaviour for all shields:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = interceptType&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = [http://en.wikipedia.org/wiki/Mask_(computing) Bitmask] representing the types of weapons that this shield can intercept. Each digit of binary that is set to one means that a weapon with the corresponding digit in its {{taglink|interceptedByShieldType}} will be intercepted by this shield (See [[Shield Interception Tag Use]]).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = armorType&lt;br /&gt;
|type = string&lt;br /&gt;
|default = &amp;quot;&amp;quot;&lt;br /&gt;
|description = Specifies the armorclass of the shield; you can input either an [[Armordefs.lua|armorclass]] name OR a unitdef {{xtaglink|Gamedev:UnitDefs|name}} to share that unit&#039;s armorclass.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = smart&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Determines whether or not projectiles fired by allied units can pass through the shield (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;) or are intercepted as enemy weapons are (&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;).}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = exterior&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Determines whether or not projectiles fired within the shield&#039;s radius can pass through the shield (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;) or are intercepted (&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;).}}&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;
|description = The amount of the energy resource consumed by the shield to absorb or repulse weapons, continually drained by a repulser as long as the projectile is in range.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = radius&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The radius of the circular area the shield covers.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = power&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = Essentially the maximum allowed hit-points of the shield - reduced by the &amp;lt;code&amp;gt;damage&amp;lt;/code&amp;gt; of a weapon upon impact.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = startingPower&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How many hit-points the shield starts with - otherwise the shield must regenerate from &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; until it reaches maximum {{taglink|power}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = powerRegen&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How many hit-points the shield regenerates each second.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = powerRegenEnergy&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = How much energy resource is consumed to regenerate each hit-point.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = rechargeDelay&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.0&lt;br /&gt;
|description = The delay in seconds before a shield begins to regenerate after it is hit.}}&lt;br /&gt;
&lt;br /&gt;
The following tags control the visual aspects of the shield:&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = visible&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = false&lt;br /&gt;
|description = Is the shield visible or not?}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = visibleHitFrames&lt;br /&gt;
|type = int&lt;br /&gt;
|default = 0&lt;br /&gt;
|description = The number of frames a shield becomes visible for when hit.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = badColor&lt;br /&gt;
|type = float[4]&lt;br /&gt;
|default = {1.0, 0.5, 0.5, 1.0} (Red)&lt;br /&gt;
|description = The RGBA colour the shield transitions to as its hit-points are reduced towards &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = goodColor&lt;br /&gt;
|type = float[4]&lt;br /&gt;
|default = {0.5, 0.5, 1.0, 1.0} (Blue)&lt;br /&gt;
|description = The RGBA colour the shield transitions to as its hit-points are regenerated towards its maximum {{taglink|power}}.}}&lt;br /&gt;
&lt;br /&gt;
{{tag&lt;br /&gt;
|name = alpha&lt;br /&gt;
|type = float&lt;br /&gt;
|default = 0.2&lt;br /&gt;
|description = The alpha transparency of the shield whilst it is visible.}}&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 WeaponDef allows the game designer to give their weapons 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;
Some games may have most WeaponDefs integrated into their [[Gamedev:UnitDefs#Examples|UnitDefs]].&lt;br /&gt;
&lt;br /&gt;
S44 and MC:L implement an [http://en.wikipedia.org/wiki/Object-oriented_programming OOP] paradigm with [http://en.wikipedia.org/wiki/Inheritance_(computer_science) inheritance].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{ExampleRepoLinks&lt;br /&gt;
|path = weapons/&lt;br /&gt;
|entity = WeaponDefs&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Game Dev]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8602</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=8602"/>
		<updated>2018-10-10T04:45:11Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &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}}&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:Callins#API:UnitHarvestStorageFull|UnitHarvestStorageFull callin]] and [[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 amount of the energy resource the unit generates which is dependant on the map wind. Works only for structures.}}&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]].&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8601</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=8601"/>
		<updated>2018-10-10T04:01:28Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Improved frontToSpeed and SpeedToFront descriptions&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}}&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:Callins#API:UnitHarvestStorageFull|UnitHarvestStorageFull callin]] and [[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 amount of the energy resource the unit generates which is dependant on the map wind. Works only for structures.}}&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.&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]].&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]]).}}&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>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16769</id>
		<title>Shaders:IvandPBRShader</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16769"/>
		<updated>2018-09-27T17:55:36Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Ivand&#039;s PBR shader&#039;s install instructions&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
What you will need:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
# Latest maintenance engine. Grab it here: https://springrts.com/dl/buildbot/default/maintenance/&lt;br /&gt;
# Custom unit shader gadget. Every mod has a bit different code, check if your game has it, if not copy from somewhere else. ZK variant: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/LuaRules/Gadgets/api_custom_unit_shaders.lua&lt;br /&gt;
# PBR shader: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/Shaders/pbr.lua&lt;br /&gt;
# PBR meta-material definitions: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/10_pbr.lua&lt;br /&gt;
# model definition with PBR extension: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/Objects3d/unit.dae.lua (replace &amp;quot;unit&amp;quot; by your actual unit model&#039;s name)&lt;br /&gt;
# unitDef file (ZK style, you might prefer your own): https://github.com/lhog/Zero-K/blob/pbrCUS_v1/units/unit.lua&lt;br /&gt;
# model and textures (not on github, provide your own). Make sure texture filenames and channel mappings are specified correctly in unit.dae.lua&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If this all sounds too complicated from the first sight, you can just clone this demo branch: &amp;quot;git clone -b pbrCUS_v1 https://github.com/lhog/Zero-K.git&amp;quot;. It&#039;s all in there except for textures and .dae file&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Texture Preparation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
For efficient file size usage, your different maps must be disposed in separate channels of up to three images. All images and channels are optional and will reset to a default value or appearance if missing. Follows a proposal for this channel layout, yet bear in mind this can be rearranged in the model.ext.lua config file. Upspring has a built-in menu option to assemble images from separate channels in any desired configuration.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*Texture1: Diffuse/Color (r, g, b) + Teamcolor (a)&lt;br /&gt;
*Texture2: Occlusion (r) + Roughness (g) + Metallic (b) + Emissive (a)&lt;br /&gt;
*Texture3: Normal (r, g, b) + Clipping (a)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
PS.: Clipping is currently unsupported in this shader.&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16768</id>
		<title>Shaders:IvandPBRShader</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16768"/>
		<updated>2018-09-27T17:53:12Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Ivand&#039;s PBR shader&#039;s install instructions&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
What you will need:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
# Latest maintenance engine. Grab it here: https://springrts.com/dl/buildbot/default/maintenance/&lt;br /&gt;
# Custom unit shader gadget. Every mod has a bit different code, check if your game has it, if not copy from somewhere else. ZK variant: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/LuaRules/Gadgets/api_custom_unit_shaders.lua&lt;br /&gt;
# PBR shader: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/Shaders/pbr.lua&lt;br /&gt;
# PBR meta-material definitions: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/10_pbr.lua&lt;br /&gt;
# model definition with PBR extension: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/Objects3d/unit.dae.lua (replace &amp;quot;unit&amp;quot; by your actual unit model&#039;s name)&lt;br /&gt;
# unitDef file (ZK style, you might prefer your own): https://github.com/lhog/Zero-K/blob/pbrCUS_v1/units/unit.lua&lt;br /&gt;
# model and textures (not on github, provide your own). Make sure texture filenames and channel mappings are specified correctly in unit.dae.lua&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If this all sounds too complicated from the first sight, you can just clone this demo branch: &amp;quot;git clone -b pbrCUS_v1 https://github.com/lhog/Zero-K.git&amp;quot;. It&#039;s all in there except for textures and .dae file&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Texture Preparation&#039;&#039;&#039;&lt;br /&gt;
For efficient file size usage, your different maps must be disposed in separate channels of up to three images. All images and channels are optional and will reset to a default value or appearance if missing.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*Texture1: Diffuse/Color (r, g, b) + Teamcolor (a)&lt;br /&gt;
*Texture2: Occlusion (r) + Roughness (g) + Metallic (b) + Emissive (a)&lt;br /&gt;
*Texture3: Normal (r, g, b) + Clipping (a)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
PS.: Clipping is currently unsupported in this shader.&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16767</id>
		<title>Shaders:IvandPBRShader</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:IvandPBRShader&amp;diff=16767"/>
		<updated>2018-09-27T17:52:58Z</updated>

		<summary type="html">&lt;p&gt;Maddox: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Ivand&amp;#039;s PBR shader&amp;#039;s install instructions&amp;#039;&amp;#039;&amp;#039; &amp;lt;br /&amp;gt; What you will need: &amp;lt;br /&amp;gt; # Latest maintenance engine. Grab it here: https://springrts.com/dl/buildbot/default/maintena...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Ivand&#039;s PBR shader&#039;s install instructions&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
What you will need:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
# Latest maintenance engine. Grab it here: https://springrts.com/dl/buildbot/default/maintenance/&lt;br /&gt;
# Custom unit shader gadget. Every mod has a bit different code, check if your game has it, if not copy from somewhere else. ZK variant: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/LuaRules/Gadgets/api_custom_unit_shaders.lua&lt;br /&gt;
# PBR shader: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/Shaders/pbr.lua&lt;br /&gt;
# PBR meta-material definitions: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/ModelMaterials/10_pbr.lua&lt;br /&gt;
# model definition with PBR extension: https://github.com/lhog/Zero-K/blob/pbrCUS_v1/Objects3d/unit.dae.lua (replace &amp;quot;unit&amp;quot; by your actual unit model&#039;s name)&lt;br /&gt;
# unitDef file (ZK style, you might prefer your own): https://github.com/lhog/Zero-K/blob/pbrCUS_v1/units/unit.lua&lt;br /&gt;
# model and textures (not on github, provide your own). Make sure texture filenames and channel mappings are specified correctly in unit.dae.lua&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
If this all sounds too complicated from the first sight, you can just clone this demo branch: &amp;quot;git clone -b pbrCUS_v1 https://github.com/lhog/Zero-K.git&amp;quot;. It&#039;s all in there except for textures and .dae file&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Texture Preparation&#039;&#039;&#039;&lt;br /&gt;
For efficient file size usage, your different maps must be disposed in separate channels of up to three images. All images and channels are optional and will reset to a default value or appearance if missing.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*Texture1: Diffuse/Color (r, g, b) + Teamcolor (a)&lt;br /&gt;
*Texture2: Occlusion (r) + Roughness (g) + Metallic (b) + Emissive (a)&lt;br /&gt;
*Texture3: Normal (r, g, b) + Clipping (a)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
PS.: Clipping is currently unsupported in this shader.&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:PBRShaders&amp;diff=16773</id>
		<title>Shaders:PBRShaders</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Shaders:PBRShaders&amp;diff=16773"/>
		<updated>2018-09-27T17:49:18Z</updated>

		<summary type="html">&lt;p&gt;Maddox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PBR stands for Physically Based Render, it&#039;s a technique for 3D surface shading that tries to replicate the physical properties of light when hitting a given surface. More info: https://en.wikipedia.org/wiki/Physically_based_rendering&lt;br /&gt;
&lt;br /&gt;
One of the main advantages of PBR - besides looking extremely good for minimal effort by the artists - is how streamlined the process of generating the textures becomes. Regardless of if you created the textures \in an image editing program or in a dedicated texturing app like Substance Painter, you know that &amp;quot;what you see is what you get&amp;quot; - ie. the final look of the model in the target gaming engine will be the same as what you&#039;re seeing in your authoring software.&lt;br /&gt;
&lt;br /&gt;
SanguinarioJoe (from Spring 1944) &amp;amp; Ivand (from ZeroK) have developed powerful PBR shaders for the Spring engine. Follows the related links:&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://github.com/sanguinariojoe/spring1944-materialstest/commit/9696a1dcc42790a627ea27660d67ebf27348ca05 SanguinarioJoe&#039;s PBR Shader]&lt;br /&gt;
*[[Shaders:IvandPBRShader]]&lt;/div&gt;</summary>
		<author><name>Maddox</name></author>
	</entry>
</feed>