<?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=Picassoct</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=Picassoct"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Picassoct"/>
	<updated>2026-11-08T20:28:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:PublicRepos&amp;diff=8362</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=8362"/>
		<updated>2022-03-13T20:44:31Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Known Repos */&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/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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:PublicRepos&amp;diff=8361</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=8361"/>
		<updated>2022-03-13T20:44:04Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Known Repos */&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]&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/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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Rapid_Tags&amp;diff=15652</id>
		<title>Rapid Tags</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Rapid_Tags&amp;diff=15652"/>
		<updated>2022-03-13T20:32:50Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Most of these tags are automaticly updated from [[Gamedev:PublicRepos]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot; Width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Tag !! Name&lt;br /&gt;
|-&lt;br /&gt;
| ba-tronic:latest || Balanced Annihilation Tronic&lt;br /&gt;
|-&lt;br /&gt;
| ba:stable || Balanced Annihilation&lt;br /&gt;
|-&lt;br /&gt;
| ba:test || Balanced Annihilation&lt;br /&gt;
|-&lt;br /&gt;
| bac:stable || BA Chicken Defense&lt;br /&gt;
|-&lt;br /&gt;
| bac:test || BA Chicken Defense&lt;br /&gt;
|-&lt;br /&gt;
| bar:test || Balanced Annihilation Reloaded&lt;br /&gt;
|-&lt;br /&gt;
| brickcraft:epenis || BrickCraft epenis&lt;br /&gt;
|-&lt;br /&gt;
| brickcraft:latest || BrickCraft &lt;br /&gt;
|-&lt;br /&gt;
| btl:latest || BattleTech: Legacy&lt;br /&gt;
|-&lt;br /&gt;
| ct:stable || Conflict Terra&lt;br /&gt;
|-&lt;br /&gt;
| ct:test || Conflict Terra&lt;br /&gt;
|-&lt;br /&gt;
| ea:latest || Eternal Annihilation&lt;br /&gt;
|-&lt;br /&gt;
| evo:stable || Evolution RTS&lt;br /&gt;
|-&lt;br /&gt;
| evo:test || Evolution RTS&lt;br /&gt;
|-&lt;br /&gt;
| ft:test || Frontier&lt;br /&gt;
|-&lt;br /&gt;
| jw:test || Journeywar&lt;br /&gt;
|-&lt;br /&gt;
| kp:latest || Kernel Panic&lt;br /&gt;
|-&lt;br /&gt;
| micromodules:latest || Micro Modules&lt;br /&gt;
|-&lt;br /&gt;
| mosaic:stable || MOSAIC&lt;br /&gt;
|-&lt;br /&gt;
| mw:latest || Micronwars&lt;br /&gt;
|-&lt;br /&gt;
| nota:latest || NOTA&lt;br /&gt;
|-&lt;br /&gt;
| nota:stable || NOTA&lt;br /&gt;
|-&lt;br /&gt;
| operationx:latest || Special BA&lt;br /&gt;
|-&lt;br /&gt;
| pa:latest || Progressive Annihilation&lt;br /&gt;
|-&lt;br /&gt;
| ra:latest || Research Annihilation Concept&lt;br /&gt;
|-&lt;br /&gt;
| s44-deployment:test || Spring: 1944&lt;br /&gt;
|-&lt;br /&gt;
| s44:latest || Spring: 1944&lt;br /&gt;
|-&lt;br /&gt;
| s44:stable || Spring: 1944&lt;br /&gt;
|-&lt;br /&gt;
| sa:latest || Supreme Annihilation&lt;br /&gt;
|-&lt;br /&gt;
| spring-features:stable || Spring Features&lt;br /&gt;
|-&lt;br /&gt;
| specialba:latest || Special BA&lt;br /&gt;
|-&lt;br /&gt;
| springtanks:latest || Spring Tanks&lt;br /&gt;
|-&lt;br /&gt;
| staticfriction:stable || Static Friction&lt;br /&gt;
|-&lt;br /&gt;
| staticfriction:testing || Static Friction&lt;br /&gt;
|-&lt;br /&gt;
| ta_factions:latest || TA : Factions&lt;br /&gt;
|-&lt;br /&gt;
| tc:stable || The Cursed&lt;br /&gt;
|-&lt;br /&gt;
| tc:test || The Cursed&lt;br /&gt;
|-&lt;br /&gt;
| void:latest || Void&lt;br /&gt;
|-&lt;br /&gt;
| xta:fixed || XTA&lt;br /&gt;
|-&lt;br /&gt;
| xta:latest || XTA&lt;br /&gt;
|-&lt;br /&gt;
| xta:test || XTA&lt;br /&gt;
|-&lt;br /&gt;
| xtar:latest || XTAR&lt;br /&gt;
|-&lt;br /&gt;
| zk:stable || Zero-K&lt;br /&gt;
|-&lt;br /&gt;
| zk:test || Zero-K&lt;br /&gt;
|-&lt;br /&gt;
| zkc:latest || Zero-K&lt;br /&gt;
|-&lt;br /&gt;
| zkdota:stable || Zero-K DOTA&lt;br /&gt;
|-&lt;br /&gt;
| zkdota:test || Zero-K DOTA&lt;br /&gt;
|-&lt;br /&gt;
| zkr:alpha || Zero-K Raid&lt;br /&gt;
|-&lt;br /&gt;
| zkr:latest || Zero-K Raid&lt;br /&gt;
|-&lt;br /&gt;
| zkr:test || Zero-K Raid&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Download Systems]]&lt;br /&gt;
[[Category:Game Dev]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11817</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=11817"/>
		<updated>2022-02-11T11:30:23Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Unit Control */ https://github.com/spring/spring/blob/a8cf33ad1d2ac775e6008cd04baa7e859d1f23ec/rts/Lua/LuaSyncedCtrl.cpp#L530&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = KillTeam&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}}&lt;br /&gt;
|info = {{new|83.0}}&amp;lt;br&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.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|arg1 = {{type|number}} allyTeamID1&lt;br /&gt;
|arg2 = {{type|number}} allyTeamID2&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}}&lt;br /&gt;
|info = {{new|83.0}}&amp;lt;br&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.&lt;br /&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;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitRulesParam&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} paramName&lt;br /&gt;
|arg3 = {{type|number{{pipe}}string}} paramValue {{bracket}} &lt;br /&gt;
|arg4 = {{type|table}} losAccess {{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}}&lt;br /&gt;
|info = &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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureRulesParam&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|string}} paramName&lt;br /&gt;
|arg3 = {{type|number{{pipe}}string}} paramValue {{bracket}} &lt;br /&gt;
|arg4 = {{type|table}} losAccess {{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}}&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;New since 102.0.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;See above for further documentation of losAccess.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetTeamRulesParam&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} paramName&lt;br /&gt;
|arg3 = {{type|number{{pipe}}string}} paramValue {{bracket}} &lt;br /&gt;
|arg4 = {{type|table}} losAccess {{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}}&lt;br /&gt;
|info = See above for further documentation of losAccess.&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 = SetGameRulesParam&lt;br /&gt;
|arg1 = {{type|string}} paramName&lt;br /&gt;
|arg2 = {{type|number{{pipe}}string}} paramValue {{bracket}} &lt;br /&gt;
|arg3 = {{type|table}} losAccess {{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}}&lt;br /&gt;
|info = See above for further documentation of losAccess.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Resources =&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = AddTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount&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}}&lt;br /&gt;
|info = Adds metal or energy resources to the specified team.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = UseTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount {{pipe}} { metal = {{type|number}} amount, energy = {{type|number}} amount }&lt;br /&gt;
|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}} hadEnough&lt;br /&gt;
|info = Consumes metal and/or energy resources of the specified team.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} res&lt;br /&gt;
|arg3 = {{type|number}} amount&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}}&lt;br /&gt;
|info = Possible values for res are:&amp;lt;br&amp;gt;&amp;quot;m&amp;quot;  = metal&amp;lt;br&amp;gt;&amp;quot;e&amp;quot;  = energy&amp;lt;br&amp;gt;&amp;quot;ms&amp;quot;  = metal storage&amp;lt;br&amp;gt;&amp;quot;es&amp;quot;  = energy storage&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetTeamShareLevel&lt;br /&gt;
|arg1 = {{type|number}} teamID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount&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}}&lt;br /&gt;
|info = Changes the resource amount for a team beyond which resources aren&#039;t stored but transferred to other allied teams if possible.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = ShareTeamResource&lt;br /&gt;
|arg1 = {{type|number}} teamID_src&lt;br /&gt;
|arg2 = {{type|number}} teamID_recv&lt;br /&gt;
|arg3 = {{type|string}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;energy&amp;quot;&lt;br /&gt;
|arg4 = {{type|number}} amount&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}}&lt;br /&gt;
|info = Transfers resources between two teams.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Teams =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetAlly&lt;br /&gt;
|arg1 = {{type|number}} firstAllyTeamID&lt;br /&gt;
|arg2 = {{type|number}} secondAllyTeamID&lt;br /&gt;
|arg3 = {{type|bool}} ally&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}}&lt;br /&gt;
|info = {{new|98.0}}&amp;lt;br&amp;gt;Changes the value of the (one-sided) alliance between: firstAllyTeamID -&amp;gt; secondAllyTeamID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = AssignPlayerToTeam&lt;br /&gt;
|arg1 = {{type|number}} playerID&lt;br /&gt;
|arg2 = {{type|number}} teamID&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}}&lt;br /&gt;
|info = {{new|98.0}}&amp;lt;br&amp;gt;Assigns a player to a team.&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 = SetGlobalLos&lt;br /&gt;
|arg1 = {{type|number}} allyTeamID&lt;br /&gt;
|arg2 = {{type|bool}} globallos &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}}&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;gt;Changes access to global line of sight for a team and its allies.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Unit Handling =&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = CreateUnit&lt;br /&gt;
|arg1 = {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} {{type|number }} unitDefID&lt;br /&gt;
|arg2 = {{type|number}} x&lt;br /&gt;
|arg3 = {{type|number}} y&lt;br /&gt;
|arg4 = {{type|number}} z&lt;br /&gt;
|arg5 = {{type|string}} &amp;quot;facing&amp;quot; {{pipe}} {{type|number }} facing &lt;br /&gt;
|arg6 = {{type|number}} teamID {{bracket}}&lt;br /&gt;
|arg7 = {{type|bool}} build = false {{bracket}} &lt;br /&gt;
|arg8 = {{type|bool}} flattenGround = true {{bracket}} &lt;br /&gt;
|arg9 = {{type|number}} builderID {{rbracket}}{{rbracket}}{{rbracket}} &lt;br /&gt;
|return = {{type|number}} unitID {{pipe}} {{type|nil}} (meaning unit was not created)&lt;br /&gt;
|info = Offmap positions are clamped! Use MoveCtrl to move to such positions.&amp;lt;br&amp;gt;Possible values for facing are:&amp;lt;br&amp;gt;&amp;quot;south&amp;quot; {{pipe}} &amp;quot;s&amp;quot; {{pipe}} 0&amp;lt;br&amp;gt;&amp;quot;east&amp;quot;  {{pipe}} &amp;quot;e&amp;quot; {{pipe}} 1&amp;lt;br&amp;gt;&amp;quot;north&amp;quot; {{pipe}} &amp;quot;n&amp;quot; {{pipe}} 2&amp;lt;br&amp;gt;&amp;quot;west&amp;quot;  {{pipe}} &amp;quot;w&amp;quot; {{pipe}} 3&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;If build is true, the unit is created in &amp;quot;being built&amp;quot; state with buildProgress = 0&amp;lt;br&amp;gt;unitID and builderID are {{new|92.0}}, the former allowing to spawn a unit with a specific ID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = DestroyUnit&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}} &lt;br /&gt;
|arg2 = {{type|bool}} selfd = false {{bracket}} &lt;br /&gt;
|arg3 = {{type|bool}} reclaimed = false {{bracket}} &lt;br /&gt;
|arg4 = {{type|number}} attackerID {{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}}&lt;br /&gt;
|info = selfd := Makes the unit act like it self-destructed.&amp;lt;br&amp;gt;reclaimed := Don&#039;t show any DeathSequences, don&#039;t leave a wreckage. This does not give back the resources to the team!&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 = TransferUnit&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} newTeamID {{bracket}} &lt;br /&gt;
|arg3 = {{type|bool}} given = true {{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}}&lt;br /&gt;
|info = If given=false, the unit is captured.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unit Control ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitCosts&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = { {{bracket}} buildTime = {{type|number}} amount {{rbracket}}&lt;br /&gt;
|arg3 = {{bracket}} metalCost = {{type|number}} amount  {{rbracket}}&lt;br /&gt;
|arg4 = {{bracket}} energyCost = {{type|number}} amount {{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}}&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 = SetUnitTooltip&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;tooltip&amp;quot;&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}}&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 = SetUnitHealth&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|number}} health {{pipe}} { {{bracket}} health = {{type|number}} health {{rbracket}}&lt;br /&gt;
|arg3 = {{bracket}} capture  = {{type|number}} capture  {{rbracket}}&lt;br /&gt;
|arg4 = {{bracket}} paralyze = {{type|number}} paralyze {{rbracket}}&lt;br /&gt;
|arg5 = {{bracket}} build    = {{type|number}} build {{rbracket}} }&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetUnitMaxHealth&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|number}} maxHealth &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}}&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 = AddUnitDamage&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|number}} damage {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} paralyze = 0 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} attackerID = -1 {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} weaponID = -1 {{bracket}}&lt;br /&gt;
|arg6 = {{type|number}} impulse_x {{bracket}}&lt;br /&gt;
|arg7 = {{type|number}} impulse_y {{bracket}}&lt;br /&gt;
|arg8 = {{type|number}} impulse_z {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = The number in the paralyze parameter equals to the paralyzetime in the WeaponDef.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitStockpile&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} stockpile {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} buildPercent {{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}}&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 = SetUnitExperience&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} experience &lt;br /&gt;
|arg3 = {{type|number}} buildPercent&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}}&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 = SetUnitFuel&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} fuel &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}}&lt;br /&gt;
|info = {{removed|101.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 = SetUnitCrashing&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} crashing &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}} success&lt;br /&gt;
|info = {{new|83.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitLineage&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} teamID {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} isRoot {{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}}&lt;br /&gt;
|info = {{removed|83.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitNeutral&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} neutral&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}}&lt;br /&gt;
|info = {{removed|83.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitTarget&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} x {{pipe}} {{type|nil}} &lt;br /&gt;
|arg3 = {{type|number}} y &lt;br /&gt;
|arg4 = {{type|number}} z {{bracket}}&lt;br /&gt;
|arg5 = {{type|bool}} dgun = false {{bracket}}&lt;br /&gt;
|arg6 = {{type|bool}} userTarget = false {{bracket}}&lt;br /&gt;
|arg7 = {{type|number}} weaponNum = -1 {{rbracket}}{{rbracket}}{{rbracket}}&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;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitTarget&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} enemyUnitID {{pipe}} {{type|nil}} {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} dgun = false {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} userTarget = false {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} weaponNum = -1 {{rbracket}}{{rbracket}}{{rbracket}}&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 = Defines a unit&#039;s target. Nil as 2nd argument drops the unit&#039;s current target.&amp;lt;br&amp;gt;&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 version 99.0, weaponNum new in version 102.0.&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitMaxRange&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} maxRange&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}}&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 = SetUnitMass&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} mass &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitBlocking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} isblocking&lt;br /&gt;
|arg3 = {{type|bool}} isSolidObjectCollidable&lt;br /&gt;
|arg4 = {{type|bool}} isProjectileCollidable&lt;br /&gt;
|arg5 = {{type|bool}} isRaySegmentCollidable&lt;br /&gt;
|arg6 = {{type|bool}} crushable&lt;br /&gt;
|arg7 = {{type|bool}} blockEnemyPushing&lt;br /&gt;
|arg8 = {{type|bool}} blockHeightChanges&lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = {{new|95.0}}&amp;lt;br&amp;gt;Changed parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitMetalExtraction&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} depth {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} range {{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}}&lt;br /&gt;
|info = Parameter &amp;quot;depth&amp;quot; corresponds to metal extraction rate. Range value is similar to &amp;quot;extractsMetal&amp;quot; in unitDefs.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitBuildSpeed&lt;br /&gt;
|arg1 = {{type|number}} builderID&lt;br /&gt;
|arg2 = {{type|number}} buildSpeed {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} repairSpeed {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} reclaimSpeed{{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} resurrectSpeed {{bracket}}&lt;br /&gt;
|arg6 = {{type|number}} captureSpeed {{bracket}}&lt;br /&gt;
|arg7 = {{type|number}} terraformSpeed {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetUnitNanoPieces&lt;br /&gt;
|arg1 = {{type|number}} builderID&lt;br /&gt;
|arg2 = {{type|table}} pieces&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}}&lt;br /&gt;
|info = {{new|92.0}}&amp;lt;br&amp;gt;This saves a lot of engine calls, by replacing: function script.QueryNanoPiece() return currentpiece end&amp;lt;br&amp;gt;Use it!&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 = UnitAttach&lt;br /&gt;
|arg1 = {{type|number}} transporterID&lt;br /&gt;
|arg2 = {{type|number}} passengerID&lt;br /&gt;
|arg3 = {{type|number}} pieceNum &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = UnitDetach&lt;br /&gt;
|arg1 = {{type|number}} passengerID &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = UnitDetachFromAir&lt;br /&gt;
|arg1 = {{type|number}} passengerID &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitLoadingTransport&lt;br /&gt;
|arg1 = {{type|number}} passengerID &lt;br /&gt;
|arg2 = {{type|number}} transportID &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}}&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;gt;Disables collisions between the two units to allow colvol intersection during the approach.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPieceParent&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} AlteredPiece&lt;br /&gt;
|arg3 = {{type|number}} ParentPiece &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}}&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;gt;Changes the pieces hierarchy of a unit by attaching a piece to a new parent.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPieceMatrix&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} pieceNum&lt;br /&gt;
|arg3 = {{type|table }} matrix &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}}&lt;br /&gt;
|info = {{new|104.0}}&amp;lt;br&amp;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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitArmored&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} armored {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} armorMultiple {{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}}&lt;br /&gt;
|info = &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;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitShieldState&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} weaponID = -1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} enabled {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} power {{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}}&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 = SetUnitFlanking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;mode&amp;quot;&lt;br /&gt;
|arg3 = {{type|number }} mode &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitFlanking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;moveFactor&amp;quot;&lt;br /&gt;
|arg3 = {{type|number }} factor&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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitFlanking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;minDamage&amp;quot;&lt;br /&gt;
|arg3 = {{type|number }} minDamage &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitFlanking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;maxDamage&amp;quot;&lt;br /&gt;
|arg3 = {{type|number }} maxDamage &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitFlanking&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} &amp;quot;dir&amp;quot;&lt;br /&gt;
|arg3 = {{type|number }} x&lt;br /&gt;
|arg4 = {{type|number }} y&lt;br /&gt;
|arg5 = {{type|number }} z&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetUnitWeaponState&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum&lt;br /&gt;
|arg3 = {{type|table }} states &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitWeaponState&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum&lt;br /&gt;
|arg3 = {{type|string }} key&lt;br /&gt;
|arg4 = {{type|number}} value&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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitWeaponDamages&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum {{pipe}} {{type|string}} &amp;quot;selfDestruct&amp;quot; {{pipe}} {{type|string}} &amp;quot;explode&amp;quot;&lt;br /&gt;
|arg3 = {{type|table}} damages &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitWeaponDamages&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum {{pipe}} {{type|string}} &amp;quot;selfDestruct&amp;quot; {{pipe}} {{type|string}} &amp;quot;explode&amp;quot;&lt;br /&gt;
|arg3 = {{type|string}} key&lt;br /&gt;
|arg4 = {{type|number}} value&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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitCollisionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ&lt;br /&gt;
|arg3 = {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ&lt;br /&gt;
|arg4 = {{type|number}} vType&lt;br /&gt;
|arg5 = {{type|number}} tType&lt;br /&gt;
|arg6 = {{type|number}} Axis&lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPieceCollisionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} pieceIndex&lt;br /&gt;
|arg3 = {{type|bool}} enable&lt;br /&gt;
|arg4 = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ&lt;br /&gt;
|arg5 = {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ {{bracket}}&lt;br /&gt;
|arg6 = {{type|number}} volumeType {{bracket}}&lt;br /&gt;
|arg7 = {{type|number}} primaryAxis {{rbracket}}{{rbracket}}&lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = As of 101.0 this is 1-based piece index argument (was 0-based).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitTravel&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} travel {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} travelPeriod {{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}}&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 = SetUnitMoveGoal&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} goalX, {{type|number}} goalY, {{type|number}} goalZ {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} goalRadius {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} moveSpeed {{bracket}}&lt;br /&gt;
|arg5 = {{type|bool}} moveRaw {{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = &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;&amp;lt;br&amp;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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitLandGoal&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} goalX, {{type|number}} goalY, {{type|number}} goalZ {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} goalRadius {{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}}&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = ClearUnitGoal&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}}&lt;br /&gt;
|info = {{new|102.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 = SetUnitPhysics&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} posX, {{type|number}} posY, {{type|number}} posZ&lt;br /&gt;
|arg3 = {{type|number}} velX, {{type|number}} velY, {{type|number}} velZ&lt;br /&gt;
|arg4 = {{type|number}} rotX, {{type|number}} rotY, {{type|number}} rotZ&lt;br /&gt;
|arg5 = {{type|number}} dragX, {{type|number}} dragY, {{type|number}} dragZ&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = &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;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPosition&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} x&lt;br /&gt;
|arg3 = {{type|number}} z {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} alwaysAboveSea {{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}}&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 = SetUnitDirection&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} x&lt;br /&gt;
|arg3 = {{type|number}} y&lt;br /&gt;
|arg4 = {{type|number}} z&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}}&lt;br /&gt;
|info = {{new|90.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitVelocity&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} velX&lt;br /&gt;
|arg3 = {{type|number}} velY&lt;br /&gt;
|arg4 = {{type|number}} velZ&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}}&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 = SetUnitRotation&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} yaw&lt;br /&gt;
|arg3 = {{type|number}} pitch&lt;br /&gt;
|arg4 = {{type|number}} roll&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}}&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 = AddUnitImpulse&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} x&lt;br /&gt;
|arg3 = {{type|number}} y&lt;br /&gt;
|arg4 = {{type|number}} z {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} decayRate {{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = AddUnitSeismicPing&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} pingSize &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}}&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 = RemoveBuildingDecal&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}}&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 = SetUnitMidAndAimPos&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} mpX, {{type|number}} mpY, {{type|number}} mpZ&lt;br /&gt;
|arg3 = {{type|number}} apX, {{type|number}} apY, {{type|number}} apZ {{bracket}}&lt;br /&gt;
|arg4 = {{type|bool}} relative {{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|bool}} success&lt;br /&gt;
|info = {{new|89.0}}&amp;lt;br&amp;gt;mpx, mpy, mpz: New middle position of unit&amp;lt;br&amp;gt;apx, apy, apz: New position that enemies aim at on this unit&amp;lt;br&amp;gt;relative: Are the new coordinates relative to world or unit coordinates?&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitRadiusAndHeight&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} radius&lt;br /&gt;
|arg3 = {{type|number}} height&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 = {{new|89.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = UnitWeaponFire&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponID &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}}&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 = UnitWeaponHoldFire&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponID &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unit LOS ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitCloak&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} cloaked {{pipe}} {{type|number}} scriptCloak {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} decloakAbs {{pipe}} {{type|number}} decloakDistance {{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}}&lt;br /&gt;
|info = If the 2nd argument is a number, the value works like this:&amp;lt;br&amp;gt;1:=normal cloak&amp;lt;br&amp;gt;2:=for free cloak (cost no E)&amp;lt;br&amp;gt;3:=for free + no decloaking (except the unit is stunned)&amp;lt;br&amp;gt;4:=ultimative cloak (no ecost, no decloaking, no stunned decloak)&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The decloak distance is only changed:&amp;lt;br&amp;gt;- if the 3th argument is a number or a boolean.&amp;lt;br&amp;gt;- if the boolean is false it takes the default decloak distance for that unitdef,&amp;lt;br&amp;gt;- if the boolean is true it takes the absolute value of it.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitSonarStealth&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} sonarStealth &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}}&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 = SetUnitStealth&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} stealth &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}}&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 = SetUnitAlwaysVisible&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|bool}} alwaysVisible &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}}&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 = SetUnitLosMask&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} allyTeam&lt;br /&gt;
|arg3 = {{type|number}} los  {{pipe}} {{type|table }} losTypes &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}}&lt;br /&gt;
|info = The 3rd argument is either the bit-and combination of the following numbers:&amp;lt;br&amp;gt;LOS_INLOS     = 1&amp;lt;br&amp;gt;LOS_INRADAR   = 2&amp;lt;br&amp;gt;LOS_PREVLOS   = 4&amp;lt;br&amp;gt;LOS_CONTRADAR = 8&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;or a table of the following form:&amp;lt;br&amp;gt;losTypes = {&amp;lt;br&amp;gt;[los = boolean,]&amp;lt;br&amp;gt;[radar = boolean,]&amp;lt;br&amp;gt;[prevLos = boolean,]&amp;lt;br&amp;gt;[contRadar = boolean]&amp;lt;br&amp;gt;}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitLosState&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} allyTeam&lt;br /&gt;
|arg3 = {{type|number}} los  {{pipe}} {{type|table }} losTypes &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}}&lt;br /&gt;
|info = See above for more info on the arguments.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitSensorRadius&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string }} type&lt;br /&gt;
|arg3 = {{type|number}} radius&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}} newRadius&lt;br /&gt;
|info = Type can be:&amp;lt;br&amp;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;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetRadarErrorParams&lt;br /&gt;
|arg1 = {{type|number}} allyTeamID&lt;br /&gt;
|arg2 = {{type|number }} allyteamErrorSize {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} baseErrorSize {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} baseErrorMult {{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}}&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPosErrorParams&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} posErrorVector.x, {{type|number}} posErrorVector.y, {{type|number}} posErrorVector.z,&lt;br /&gt;
|arg3 = {{type|number}} posErrorDelta.x, {{type|number}} number posErrorDelta.y, {{type|number}} posErrorDelta.z {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} nextPosErrorUpdate {{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}}&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Unit Resourcing ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitResourcing&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string }} res&lt;br /&gt;
|arg3 = {{type|number}} amount&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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitResourcing&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = { res = {{type|number}} amount, ... }&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}}&lt;br /&gt;
|info =  Possible values for res are: &amp;quot;[u{{pipe}}c][u{{pipe}}m][m{{pipe}}e]&amp;quot;&amp;lt;br&amp;gt;unconditional {{pipe}} conditional&amp;lt;br&amp;gt;use {{pipe}} make&amp;lt;br&amp;gt;metal {{pipe}} energy&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = AddUnitResource&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string }} &amp;quot;m&amp;quot; {{pipe}} &amp;quot;e&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount &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}}&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 = UseUnitResource&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string }} &amp;quot;m&amp;quot; {{pipe}} &amp;quot;e&amp;quot;&lt;br /&gt;
|arg3 = {{type|number}} amount &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}} okay&lt;br /&gt;
|info =  &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = UseUnitResource&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = { {{bracket}} &amp;quot;m&amp;quot; {{pipe}} &amp;quot;metal&amp;quot; {{pipe}} &amp;quot;e&amp;quot; {{pipe}} &amp;quot;energy&amp;quot; {{rbracket}} = amount, ... }&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}} okay&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 = SetUnitHarvestStorage&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} metal&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}}&lt;br /&gt;
|info =  {{new|97.0}}&amp;lt;br&amp;gt;See also {{xtaglink|Gamedev:UnitDefs|harvestStorage}} UnitDef tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Feature Handling =&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = CreateFeature&lt;br /&gt;
|arg1 = {{type|string}} &amp;quot;defName&amp;quot; {{pipe}} {{type|number}} featureDefID&lt;br /&gt;
|arg2 = {{type|number}} x, {{type|number}} y, {{type|number}} z {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} heading {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} AllyTeamID {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} featureID {{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{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 = DestroyFeature&lt;br /&gt;
|arg1 = {{type|number}} featureDefID&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}}&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 = TransferFeature&lt;br /&gt;
|arg1 = {{type|number}} featureDefID&lt;br /&gt;
|arg2 = {{type|number}} teamID &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}}&lt;br /&gt;
|info =  &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Feature Control ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureHealth&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} health&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}}&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 = SetFeatureResources&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} metal&lt;br /&gt;
|arg3 = {{type|number}} energy {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} reclaimTime {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} reclaimLeft {{rbracket}}{rbracket}}&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetFeatureReclaim&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} reclaimLeft&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}}&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 = SetFeatureResurrect&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} unitDefID {{pipe}} {{type|string}} unitDefName {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} facing {{pipe}} {{type|string}} &amp;quot;facing&amp;quot; {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} progress {{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}}&lt;br /&gt;
|info = {{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.&amp;lt;br&amp;gt;Possible values for facing are:&amp;lt;br&amp;gt;&amp;quot;south&amp;quot; {{pipe}} &amp;quot;s&amp;quot; {{pipe}} 0&amp;lt;br&amp;gt;&amp;quot;east&amp;quot;  {{pipe}} &amp;quot;e&amp;quot; {{pipe}} 1&amp;lt;br&amp;gt;&amp;quot;north&amp;quot; {{pipe}} &amp;quot;n&amp;quot; {{pipe}} 2&amp;lt;br&amp;gt;&amp;quot;west&amp;quot;  {{pipe}} &amp;quot;w&amp;quot; {{pipe}} 3&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeaturePosition&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} x, {{type|number}} y, {{type|number}} z {{bracket}}&lt;br /&gt;
|arg3 = {{type|bool}} snapToGround {{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}}&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 = SetFeatureDirection&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} dirX, {{type|number}} dirY, {{type|number}} dirZ&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}}&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 = SetFeatureRotation&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} rotX, {{type|number}} rotY, {{type|number}} rotZ&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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureVelocity&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} velX, {{type|number}} velY, {{type|number}} velZ&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}}&lt;br /&gt;
|info = {{New|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitPhysics&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} posX, {{type|number}} posY, {{type|number}} posZ&lt;br /&gt;
|arg3 = {{type|number}} velX, {{type|number}} velY, {{type|number}} velZ&lt;br /&gt;
|arg4 = {{type|number}} rotX, {{type|number}} rotY, {{type|number}} rotZ&lt;br /&gt;
|arg5 = {{type|number}} dragX, {{type|number}} dragY, {{type|number}} dragZ&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = {{New|95.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 = SetFeatureMoveCtrl&lt;br /&gt;
|arg1 = {{type|number}} featureID {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} enable {{bracket}}&lt;br /&gt;
|arg3 = {{type|number*}} args {{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}}&lt;br /&gt;
|info = Use this callout to control feature movement. The number* arguments are parsed as follows and all optional:&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;If enable is true:&amp;lt;br&amp;gt;{{bracket}}, velVector(x,y,z) -- initial velocity for feature&amp;lt;br&amp;gt;{{bracket}}, accVector(x,y,z) -- acceleration added every frame{{rbracket}}{{rbracket}}&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;If enable is false:&amp;lt;br&amp;gt;{{bracket}}, velocityMask(x,y,z) -- dimensions in which velocity is allowed to build when not using MoveCtrl&amp;lt;br&amp;gt;{{bracket}},  impulseMask(x,y,z) -- dimensions in which impulse is allowed to apply when not using MoveCtrl&amp;lt;br&amp;gt;{{bracket}}, movementMask(x,y,z) -- dimensions in which feature is allowed to move when not using MoveCtrl{{rbracket}}{{rbracket}}{{rbracket}}&amp;lt;br&amp;gt;&amp;lt;br&amp;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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureNoSelect&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|bool}} noSelect &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}}&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 = SetFeatureAlwaysVisible&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|bool}} enable&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}}&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 = SetFeatureCollisionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ&lt;br /&gt;
|arg3 = {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ&lt;br /&gt;
|arg4 = {{type|number}} vType&lt;br /&gt;
|arg5 = {{type|number}} tType&lt;br /&gt;
|arg6 = {{type|number}} Axis&lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = Check Spring.SetUnitCollisionVolumeData for further explanation of the arguments.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeaturePieceCollisionVolumeData&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} pieceIndex&lt;br /&gt;
|arg3 = {{type|bool}} enable&lt;br /&gt;
|arg4 = {{type|number}} scaleX, {{type|number}} scaleY, {{type|number}} scaleZ&lt;br /&gt;
|arg5 = {{type|number}} offsetX, {{type|number}} offsetY, {{type|number}} offsetZ&lt;br /&gt;
|arg6 = {{type|number}} Axis&lt;br /&gt;
|arg7 = {{type|number}} volumeType {{bracket}}&lt;br /&gt;
|arg8 = {{type|number}} primaryAxis {{rbracket}}&lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = {{new|101.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 = SetFeatureMidAndAimPos&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} mpX, {{type|number}} mpY, {{type|number}} mpZ&lt;br /&gt;
|arg3 = {{type|number}} apX, {{type|number}} apY, {{type|number}} apZ {{bracket}} &lt;br /&gt;
|arg4 = {{type|bool}} relative&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 = {{new|89.0}}&amp;lt;br&amp;gt;Check Spring.SetUnitMidAndAimPos for further explanation of the arguments.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureRadiusAndHeight&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} radius&lt;br /&gt;
|arg3 = {{type|number}} height&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 = {{new|89.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureMass&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|number}} mass&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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetFeatureBlocking&lt;br /&gt;
|arg1 = {{type|number}} featureID&lt;br /&gt;
|arg2 = {{type|boolean}} isBlocking&lt;br /&gt;
|arg3 = {{type|boolean}} isSolidObjectCollidable&lt;br /&gt;
|arg4 = {{type|boolean}} isProjectileCollidable&lt;br /&gt;
|arg5 = {{type|boolean}} isRaySegmentCollidable&lt;br /&gt;
|arg6 = {{type|boolean}} crushable&lt;br /&gt;
|arg7 = {{type|boolean}} blockEnemyPushing&lt;br /&gt;
|arg8 = {{type|boolean}} blockHeightChanges&lt;br /&gt;
|arg9 =&lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = {{new|95.0}}&amp;lt;br&amp;gt; Changed parameters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Lua to COB =&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = CallCOBScript&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} funcID {{pipe}} {{type|string}} funcName&lt;br /&gt;
|arg3 = {{type|number}} retArgs&lt;br /&gt;
|arg4 = COBArg1&lt;br /&gt;
|arg5 = COBArg2&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}} returnValue, {{type|number}} retArg1, {{type|number}} retArg2, ...&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 = GetCOBScriptID&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|string}} funcName&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}} funcID&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 = GetUnitCOBValue&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|bool}} splitData=false {{rbracket}}&lt;br /&gt;
|arg3 = {{type|number}} COBValue {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} param1 {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} param2 {{bracket}}&lt;br /&gt;
|arg6 = {{type|number}} param3 {{bracket}}&lt;br /&gt;
|arg7 =  {{type|number}} param4 {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|number}} result {{pipe}} {{type|number}} result1, {{type|number}} result2&lt;br /&gt;
|info = Note: Don&#039;t use Spring.{{bracket}}Get{{pipe}}Set{{rbracket}}UnitCOBValue in LUS just because you are familar with it since bos/cob, use the LuaSpringAPI instead!&amp;lt;br&amp;gt;You can find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]. Also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetUnitCOBValue&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|number}} COBValue&lt;br /&gt;
|arg3 = {{type|number}} param1 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} param2 {{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}}&lt;br /&gt;
|info = Note: Don&#039;t use Spring.{{bracket}}Get{{pipe}}Set{{rbracket}}UnitCOBValue in LUS just because you are familar with it since bos/cob, use the LuaSpringAPI instead!&amp;lt;br&amp;gt;You can find the possible values for `COBValue` in [[Lua_ConstCOB#Get.2FSet|Lua_ConstCOB]]. Also see [[Animation-CobConstants#Custom_Variables|Custom_Variables]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Give Order =&lt;br /&gt;
&lt;br /&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;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = GiveOrderToUnit&lt;br /&gt;
|arg1 = {{type|number}} unitID &lt;br /&gt;
|arg2 = {{type|number}} cmdID&lt;br /&gt;
|arg3 = params = { number, etc...}&lt;br /&gt;
|arg4 = options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}&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}}&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 = GiveOrderToUnitMap&lt;br /&gt;
|arg1 = unitMap = { {{bracket}}unitID{{rbracket}} = example, etc... }&lt;br /&gt;
|arg2 = {{type|number}} cmdID&lt;br /&gt;
|arg3 = params = { number, etc...}&lt;br /&gt;
|arg4 = options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}&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}}&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 = GiveOrderToUnitArray&lt;br /&gt;
|arg1 = unitArray = { {{bracket}}1{{rbracket}} = unitID, etc... }&lt;br /&gt;
|arg2 = {{type|number}} cmdID&lt;br /&gt;
|arg3 = params = { number, etc...}&lt;br /&gt;
|arg4 = options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;}&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}}&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 = GiveOrderArrayToUnitMap&lt;br /&gt;
|arg1 = unitMap = { {{bracket}}{{type|number}} unitID{{rbracket}} = example, etc... }&lt;br /&gt;
|arg2 = orderArray = { { {{type|number}} cmdID, params = { number, etc...}, options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} } }&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}}&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 = GiveOrderArrayToUnitArray&lt;br /&gt;
|arg1 = unitArray = { {{bracket}}1{{rbracket}} = {{type|number}} unitID, etc... }&lt;br /&gt;
|arg2 = orderArray = { { {{type|number}} cmdID, params = { number, etc...}, options = {&amp;quot;alt&amp;quot;, &amp;quot;ctrl&amp;quot;, &amp;quot;shift&amp;quot;, &amp;quot;right&amp;quot;} } }&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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Ground=&lt;br /&gt;
== Grass ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = AddGrass&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&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}}&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 = RemoveGrass&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&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;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = LevelHeightMap&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} height&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = AdjustHeightMap&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} height&lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = (heightmap[x][z] += height;)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = RevertHeightMap&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} origFactor &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetHeightMapFunc&lt;br /&gt;
|arg1 = lua_function {{bracket}}&lt;br /&gt;
|arg2 = arg1 {{bracket}}&lt;br /&gt;
|arg3 = arg2 {{bracket}}&lt;br /&gt;
|arg4 = ... {{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|number}} absTotalHeightMapAmountChanged&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
Example code:&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)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = AddHeightMap&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} height&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}} newHeight&lt;br /&gt;
|info = Can only be called in SetHeightMapFunc()&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetHeightMap&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} height {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} terraform = 1 {{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|number}} absHeightDiff&lt;br /&gt;
|info = Can only be called in SetHeightMapFunc(). The terraform argument is a scaling factor:&amp;lt;br&amp;gt;&lt;br /&gt;
If =0 nothing will be changed (the terraform starts) and if =1 the terraform will be finished.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = LevelSmoothMesh&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} height &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = AdjustSmoothMesh&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} height &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = RevertSmoothMesh&lt;br /&gt;
|arg1 = {{type|number}} x1&lt;br /&gt;
|arg2 = {{type|number}} z1 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} x2 &lt;br /&gt;
|arg4 = {{type|number}} z2 {{rbracket}}&lt;br /&gt;
|arg5 = {{type|number}} origFactor &lt;br /&gt;
|arg6 = &lt;br /&gt;
|arg7 = &lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&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 = SetSmoothMeshFunc&lt;br /&gt;
|arg1 = lua_function {{bracket}}&lt;br /&gt;
|arg2 = arg1 {{bracket}}&lt;br /&gt;
|arg3 = arg2 {{bracket}}&lt;br /&gt;
|arg4 = ... {{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|number}} absTotalHeightMapAmountChanged&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 = AddSmoothMesh&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} height&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}} newHeight&lt;br /&gt;
|info = Can only be called in SetSmoothMeshFunc().&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetSmoothMesh&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} height {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} terraform = 1 {{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|number}} absHeightDiff&lt;br /&gt;
|info = Can only be called in SetSmoothMeshFunc().&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== TerrainTypes ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetMapSquareTerrainType&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} newType&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}} oldType&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 = SetTerrainTypeData&lt;br /&gt;
|arg1 = {{type|number}} typeIndex {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} speedTanks = nil {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} speedKBOts = nil {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} speedHovers = nil {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} speedShips = nil {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&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}} true&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 = SetSquareBuildingMask&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} mask &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}}&lt;br /&gt;
|info = {{new|103.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also {{xtaglink|Gamedev:UnitDefs|buildingMask}} unitdef tag.&lt;br /&gt;
&lt;br /&gt;
== MetalAmount ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetMetalAmount&lt;br /&gt;
|arg1 = {{type|number}} x&lt;br /&gt;
|arg2 = {{type|number}} z&lt;br /&gt;
|arg3 = {{type|number}} metalAmount&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}}&lt;br /&gt;
|info = {{new|83.0}}&amp;lt;br&amp;gt;x &amp;amp; z coords are in worldspace/16. metalAmount must be between 0 and 255*maxMetal (with maxMetal from the .smd or mapinfo.lua).&lt;br /&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;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = EditUnitCmdDesc&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} cmdDescID&lt;br /&gt;
|arg3 = {{type|table}} cmdArray &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&amp;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;
  }&amp;lt;/pre&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = InsertUnitCmdDesc&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} cmdDescID {{rbracket}}&lt;br /&gt;
|arg3 = {{type|table}} cmdArray &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}}&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 = RemoveUnitCmdDesc&lt;br /&gt;
|arg1 = {{type|number}} unitID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} cmdDescID {{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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetNoPause&lt;br /&gt;
|arg1 = {{type|bool}} noPause &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}}&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 = SetUnitToFeature&lt;br /&gt;
|arg1 = {{type|bool}} tofeature &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}}&lt;br /&gt;
|info = 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) [http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;p=481521 thread]&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 = SetExperienceGrade&lt;br /&gt;
|arg1 = {{type|number}} expGrade {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} ExpPowerScale {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} ExpHealthScale {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} ExpReloadScale {{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}}&lt;br /&gt;
|info = expGrade defines how often UnitExperience() will be called.&amp;lt;br&amp;gt;Prior to 104.0 it is based on the following equation:&amp;lt;br&amp;gt;(int) {{bracket}}exp/(exp+1){{rbracket}} / expGrade&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Post 104.0 it is the raw change.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SpawnExplosion&lt;br /&gt;
|arg1 = {{type|number}} posX = 0, {{type|number}} posY = 0, {{type|number}} posZ = 0&lt;br /&gt;
|arg2 = {{type|number}} dirX = 0, {{type|number}} dirY = 0, {{type|number}} dirZ = 0&lt;br /&gt;
|arg3 = {{type|table}} explosionParams&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}}&lt;br /&gt;
|info = {{new|104.0}}&lt;br /&gt;
}}&lt;br /&gt;
  &amp;lt;pre&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;
&lt;br /&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;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SpawnCEG&lt;br /&gt;
|arg1 = {{type|string}} &amp;quot;cegname&amp;quot; | {{type|number}} cegID&lt;br /&gt;
|arg2 = {{type|number}} posX = 0, {{type|number}} posY = 0, {{type|number}} posZ = 0&lt;br /&gt;
|arg3 = {{type|number}} dirX = 0, {{type|number}} dirY = 0, {{type|number}} dirZ = 0&lt;br /&gt;
|arg4 = {{type|number}} radius = 0&lt;br /&gt;
|arg5 = {{type|number}} damage = 0&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}} success, {{type|number}} cegID&lt;br /&gt;
|info = cegID new in 95.0.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SpawnSFX&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} sfxID&lt;br /&gt;
|arg3 = {{type|number}} posX = 0, {{type|number}} posY = 0, {{type|number}} posZ = 0&lt;br /&gt;
|arg4 = {{type|number}} dirX = 0, {{type|number}} dirY = 0, {{type|number}} dirZ = 0&lt;br /&gt;
|arg5 = {{type|number}} radius = 0&lt;br /&gt;
|arg6 = {{type|number}} damage = 0 {{bracket}}&lt;br /&gt;
|arg7 = {{type|bool}} absolute {{rbracket}}&lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}} {{pipe}} {{type|bool}} success&lt;br /&gt;
|info = {{new|104.0}}&lt;br /&gt;
}}&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;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SpawnProjectile&lt;br /&gt;
|arg1 = {{type|number}} weaponDefID&lt;br /&gt;
|arg2 = {{type|table}} projectileParams &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}} projectileID&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
  &amp;lt;pre&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = DeleteProjectile&lt;br /&gt;
|arg1 = {{type|number}} projectileID&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}}&lt;br /&gt;
|info = {{new|101.0}}&amp;lt;br&amp;gt;Silently removes projectiles (no explosion).&lt;br /&gt;
}}&lt;br /&gt;
&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;&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileTarget&lt;br /&gt;
|arg1 = {{type|number}} projectileID &lt;br /&gt;
|arg2 = {{bracket}} {{type|number}} targetID, {{type|string}} targetTypeStr {{rbracket}} {{pipe}} {{bracket}} {{type|number}} posX = 0, {{type|number}} posY = 0, {{type|number}} posZ = 0 {{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}} validTarget&lt;br /&gt;
|info = &lt;br /&gt;
}}&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;&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileTarget&lt;br /&gt;
|arg1 = {{type|number}} projectileID &lt;br /&gt;
|arg2 = {{bracket}} {{type|number}} targetID, {{type|number}} targetType {{rbracket}} {{pipe}} {{bracket}} {{type|number}} posX = 0, {{type|number}} posY = 0, {{type|number}} posZ = 0 {{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}} validTarget&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
  &amp;lt;pre&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&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileIgnoreTrackingError&lt;br /&gt;
|arg1 = {{type|number}} projectileID &lt;br /&gt;
|arg2 = {{type|bool}} ignore &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileIsIntercepted&lt;br /&gt;
|arg1 = {{type|number}} projectileID &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}}&lt;br /&gt;
|info = {{new|99.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileMoveControl&lt;br /&gt;
|arg1 = {{type|number}} projectileID &lt;br /&gt;
|arg2 = {{type|bool}} enable&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}}&lt;br /&gt;
|info = Disables engine movecontrol, so lua can fully control the physics.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectilePosition&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} posX = 0 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} posY = 0 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} posZ = 0 {{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}}&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 = SetProjectileVelocity&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} velX = 0 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} velY = 0 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} velZ = 0 {{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}}&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 = SetProjectileCollision&lt;br /&gt;
|arg1 = {{type|number}} projectileID&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}}&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 = SetProjectileGravity&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} grav = 0 {{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}}&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 = SetProjectileSpinAngle&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} spinAngle = 0 {{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}}&lt;br /&gt;
|info = {{removed|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileSpinSpeed&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} speed = 0 {{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}}&lt;br /&gt;
|info = {{removed|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileSpinVec&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} spinX = 0 {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} spinY = 0 {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} spinZ = 0 {{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}}&lt;br /&gt;
|info = {{removed|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileCEG&lt;br /&gt;
|arg1 = {{type|number}} projectileID&lt;br /&gt;
|arg2 = {{type|string}} ceg_name &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}}&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 = SetPieceProjectileParams&lt;br /&gt;
|arg1 = {{type|number}} projectileID {{bracket}}&lt;br /&gt;
|arg2 = {{type|number}} explosionFlags {{bracket}}&lt;br /&gt;
|arg3 = {{type|number}} spinAngle {{bracket}}&lt;br /&gt;
|arg4 = {{type|number}} spinSpeed {{bracket}}&lt;br /&gt;
|arg5 = {{type|number}} spinVector.x {{bracket}}&lt;br /&gt;
|arg6 = {{type|number}} spinVector.y {{bracket}}&lt;br /&gt;
|arg7 = {{type|number}} spinVector.z {{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}{{rbracket}}&lt;br /&gt;
|arg8 = &lt;br /&gt;
|arg9 = &lt;br /&gt;
|return = {{type|nil}}&lt;br /&gt;
|info = {{new|95.0}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileAlwaysVisible&lt;br /&gt;
|arg1 = {{type|number}} projectileID&lt;br /&gt;
|arg2 = {{type|bool}} alwaysVisible&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}}&lt;br /&gt;
|info = {{new|95.0}} &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileDamages&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum&lt;br /&gt;
|arg3 = {{type|table}} damages &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}}&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
{{LuaCallout&lt;br /&gt;
|prefix = Spring.&lt;br /&gt;
|name = SetProjectileDamages&lt;br /&gt;
|arg1 = {{type|number}} unitID&lt;br /&gt;
|arg2 = {{type|number}} weaponNum&lt;br /&gt;
|arg3 = {{type|string}} key&lt;br /&gt;
|arg4 = {{type|number}} value &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}}&lt;br /&gt;
|info = {{new|101.0}}&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;pre&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;
    }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11124</id>
		<title>Lua Beginners FAQ</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Beginners_FAQ&amp;diff=11124"/>
		<updated>2021-12-12T09:36:00Z</updated>

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

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

		<summary type="html">&lt;p&gt;Picassoct: /* Screen Trace */ Does not need a third z argument, but can have a optional argument index (optArgIdx)https://github.com/spring/spring/blob/a8cf33ad1d2ac775e6008cd04baa7e859d1f23ec/rts/Lua/LuaUnsyncedRead.cpp#L1547&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 = 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}} 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGame&amp;diff=11239</id>
		<title>Lua ConstGame</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_ConstGame&amp;diff=11239"/>
		<updated>2021-10-17T19:09:08Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Engine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Engine =&lt;br /&gt;
&lt;br /&gt;
Word of advice. Do not modify tables provided by the engine - like Game. Many of them are internally implemented as engine calls.  &lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.version&lt;br /&gt;
|info = {{removed|104.0}} Now in [[Lua_ConstEngine]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.buildFlags&lt;br /&gt;
|info = {{removed|104.0}} Now in [[Lua_ConstEngine]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.gameID&lt;br /&gt;
|info = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Replaced in 89.0 with GameID(string gameID) synced callin&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.maxUnits&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.maxTeams&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.maxPlayers&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.squareSize&lt;br /&gt;
|info = &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Divide Game.mapSizeX or Game.mapSizeZ by this to get engine&#039;s &amp;quot;mapDims&amp;quot; coordinates&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.gameSpeed&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Host =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.gameMode&lt;br /&gt;
|info = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Removed from version 83.x&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.startPosType&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.commEnds&lt;br /&gt;
|info = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Removed from version 83.x&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.limitDGun&lt;br /&gt;
|info = &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Removed from version 83.x&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.ghostedBuildings&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Checksums =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.mapChecksum&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modChecksum&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Map =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.mapDamage&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.mapName&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.mapDescription&lt;br /&gt;
|info = = {{type|string}} &#039;&#039;&#039;Game.mapHumanName&#039;&#039;&#039;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.mapHardness&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.mapX&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.mapY&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.mapSizeX&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;  in worldspace/opengl coords. Divide by Game.squareSize to get engine&#039;s &amp;quot;mapDims&amp;quot; coordinates&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.mapSizeZ&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;  in worldspace/opengl coords. Divide by Game.squareSize to get engine&#039;s &amp;quot;mapDims&amp;quot; coordinates&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.gravity&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.tidal&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.windMin&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.windMax&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.extractorRadius&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterDamage&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = table&lt;br /&gt;
|name = Game.envDamageTypes&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Containing {def}IDs of environmental-damage sources {{new|104.0}}.&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Mod =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.gameName&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.gameShortName&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.gameVersion&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.gameMutator&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.gameDesc&lt;br /&gt;
|info = {{new|95.0}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modName&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;deprecated (it is in contrast to gameName appended with gameVersion!)&amp;lt;/span&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modShortName&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;deprecated&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modVersion&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;deprecated&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modMutator&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;deprecated&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.modDesc&lt;br /&gt;
|info = &amp;lt;span class=warning&amp;gt;deprecated&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.allowTeamColors&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.requireSonarUnderWater&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.transportAir&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.transportShip&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.transportHover&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.transportGround&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.fireAtKilled&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.fireAtCrashing&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Constructor =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.constructionDecay&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.reclaimAllowEnemies&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.reclaimAllowAllies&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.constructionDecayTime&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.constructionDecaySpeed&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.multiReclaim&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.reclaimMethod&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.reclaimUnitMethod&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.reclaimUnitEnergyCostFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.reclaimUnitEfficiency&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.reclaimFeatureEnergyCostFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.repairEnergyCostFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.resurrectEnergyCostFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.captureEnergyCostFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Categories =&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = table&lt;br /&gt;
|name = Game.springCategories&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  example: {&lt;br /&gt;
    [&amp;quot;vtol&amp;quot;]         = 0,  [&amp;quot;special&amp;quot;]      = 1,  [&amp;quot;noweapon&amp;quot;]     = 2,&lt;br /&gt;
    [&amp;quot;notair&amp;quot;]       = 3,  [&amp;quot;notsub&amp;quot;]       = 4,  [&amp;quot;all&amp;quot;]          = 5,&lt;br /&gt;
    [&amp;quot;weapon&amp;quot;]       = 6,  [&amp;quot;notship&amp;quot;]      = 7,  [&amp;quot;notland&amp;quot;]      = 8,&lt;br /&gt;
    [&amp;quot;mobile&amp;quot;]       = 9,  [&amp;quot;kbot&amp;quot;]         = 10, [&amp;quot;antigator&amp;quot;]    = 11,&lt;br /&gt;
    [&amp;quot;tank&amp;quot;]         = 12, [&amp;quot;plant&amp;quot;]        = 13, [&amp;quot;ship&amp;quot;]         = 14,&lt;br /&gt;
    [&amp;quot;antiemg&amp;quot;]      = 15, [&amp;quot;antilaser&amp;quot;]    = 16, [&amp;quot;antiflame&amp;quot;]    = 17,&lt;br /&gt;
    [&amp;quot;underwater&amp;quot;]   = 18, [&amp;quot;hover&amp;quot;]        = 19, [&amp;quot;phib&amp;quot;]         = 20,&lt;br /&gt;
    [&amp;quot;constr&amp;quot;]       = 21, [&amp;quot;strategic&amp;quot;]    = 22, [&amp;quot;commander&amp;quot;]    = 23,&lt;br /&gt;
    [&amp;quot;paral&amp;quot;]        = 24, [&amp;quot;jam&amp;quot;]          = 25, [&amp;quot;mine&amp;quot;]         = 26,&lt;br /&gt;
    [&amp;quot;kamikaze&amp;quot;]     = 27, [&amp;quot;minelayer&amp;quot;]    = 28, [&amp;quot;notstructure&amp;quot;] = 29,&lt;br /&gt;
    [&amp;quot;air&amp;quot;]          = 30&lt;br /&gt;
  }&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = table&lt;br /&gt;
|name = Game.armorTypes&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(bidirectional)&amp;lt;/font&amp;gt;&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&lt;br /&gt;
  example: {&lt;br /&gt;
    [1]  = amphibious,   [2] = anniddm,     [3] = antibomber,&lt;br /&gt;
    [4]  = antifighter,  [5] = antiraider,  [6] = atl,&lt;br /&gt;
    [7]  = blackhydra,   [8] = bombers,     [9] = commanders,&lt;br /&gt;
    [10] = crawlingbombs, ...&lt;br /&gt;
&lt;br /&gt;
    [&amp;quot;amphibious&amp;quot;]   = 1, [&amp;quot;anniddm&amp;quot;]    = 2, [&amp;quot;antibomber&amp;quot;] = 3&lt;br /&gt;
    [&amp;quot;antifighter&amp;quot;]  = 4, [&amp;quot;antiraider&amp;quot;] = 5, [&amp;quot;atl&amp;quot;]        = 6&lt;br /&gt;
    [&amp;quot;blackhydra&amp;quot;]   = 7, [&amp;quot;bombers&amp;quot;]    = 8, [&amp;quot;commanders&amp;quot;] = 9&lt;br /&gt;
    [&amp;quot;crawlingbombs&amp;quot;]= 10, ...&lt;br /&gt;
  }&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Water Visuals =&lt;br /&gt;
{{removed|104.0}} - No longer constant as are now runtime mutable (Use gl.GetWaterRendering(name) instead).&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.waterVoid&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = bool&lt;br /&gt;
|name = Game.waterPlane&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.waterTexture&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.waterFoamTexture&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = string&lt;br /&gt;
|name = Game.waterNormalTexture&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterRepeatX&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterRepeatY&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterSurfaceAlpha&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterSpecularFactor&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterFresnelMin&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterFresnelMax&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = number&lt;br /&gt;
|name = Game.waterFresnelPower&lt;br /&gt;
|info =&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = table&lt;br /&gt;
|name = Game.waterCausticTextures&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;= {&amp;quot;tex1&amp;quot;,&amp;quot;tex2&amp;quot;,..}&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterAbsorb&lt;br /&gt;
|info = &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;= { number r, number g, number b}&amp;lt;/font&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterBaseColor&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterMinColor&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterSurfaceColor&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterSpecularColor&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.waterPlaneColor&lt;br /&gt;
|info = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.fogColor&lt;br /&gt;
|info = {{removed|101.0}} (Use gl.GetAtmosphere(&amp;quot;fogColor&amp;quot;) instead)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.groundAmbientColor&lt;br /&gt;
|info = {{removed|101.0}} (Use gl.GetSun(&amp;quot;ambient&amp;quot;) instead)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.groundSpecularColor&lt;br /&gt;
|info = {{removed|101.0}} (Use gl.GetSun(&amp;quot;specular&amp;quot;) instead)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{LuaConstant&lt;br /&gt;
|type = color&lt;br /&gt;
|name = Game.groundSunColor&lt;br /&gt;
|info = {{removed|101.0}} (Use gl.GetSun(&amp;quot;diffuse&amp;quot;) instead)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8607</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=8607"/>
		<updated>2021-07-09T08:12:59Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: Undo revision 31609 by Picassoct (talk)&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:UnitDefs&amp;diff=8606</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=8606"/>
		<updated>2021-07-09T08:09:07Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Advanced Air Tags */&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 &amp;gt;= 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11056</id>
		<title>LuaLifecycle</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11056"/>
		<updated>2020-11-08T20:09:00Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* On-Load */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is work in Progress: Its goal is to collect and present all that missing information in the other articles, that lead to look ups in the source code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring takes your game either as a folder with the ending .sdd or as a zipped file distributed- either traditionally or via rapid, in a series of small files, stored in the rapid (/home/picasso/.spring/rapid/repos.springrts.com) folder in your spring installation. &lt;br /&gt;
Spring will compute a hash over those files and folders. If they are altered in name, value or existence, spring will not sync these games up. You will not go to war today.&lt;br /&gt;
You can sync a .sdd folder with zipped games, by adding a springignore.txt which is similar to a .gitignore.&lt;br /&gt;
&lt;br /&gt;
You can not add external widgets to a sdd folder and make it work. (TODO Validate)&lt;br /&gt;
&lt;br /&gt;
The nature of this hash, enforces something else. With all content static, you can not store any values &amp;quot;inside&amp;quot; your game.&lt;br /&gt;
You can store values as config values within the spring installation. You can load textfiles from external folders reachable to spring.&lt;br /&gt;
But you cant change what makes the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring will load your game and then present the loaded files within the game-code as reachable via the VFS (Virtual File System).&lt;br /&gt;
Some files can be altered and reloaded for development purposes. This includes the synced lua (/luarules reload) - which is equivalent to starting a new game, synced script wise.&lt;br /&gt;
UI-Files can be altered and reloaded, and already existing files at the start can be re-used. (/luaui reload). You can not add new widgets to the folder.&lt;br /&gt;
Depending on wether the game allows userWidgets (ModOptions), all already existing widgets in the external /LuaUI/GAMENAME/folder will be reloaded.&lt;br /&gt;
In this folder, settings for the User-LuaUI can be stored persistently.&lt;br /&gt;
&lt;br /&gt;
During engine development some mistakes were made, regarding naming during load.&lt;br /&gt;
Meaning, a map can have the same lua-rules and luaui folder, to implement map specific content and this content is loaded into the same namespace,&lt;br /&gt;
as regular widgets (/luaui) and and gadgets (/luarules).&lt;br /&gt;
This can lead to naming collisions and not working widgets / synced game parts, depending on the map.&lt;br /&gt;
The usual way to avoid this, is to rename your luaui and luarules (TODO Check) folder and assume that all gadgets /widgets loaded into the default folder are Map based or other external widgets.&lt;br /&gt;
&lt;br /&gt;
For a example of such a architectural separation look at &lt;br /&gt;
&lt;br /&gt;
https://github.com/beyond-all-reason/Beyond-All-Reason/tree/master/luaui&lt;br /&gt;
&lt;br /&gt;
other games have a exclude map lua function, that refuses to load non-game lua.&lt;br /&gt;
&lt;br /&gt;
== On-LuaIntro ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaUI load ==&lt;br /&gt;
&lt;br /&gt;
Depending on how the widgets are loaded and what framework they use, subtle different lua-sntax rules may apply. &lt;br /&gt;
This means that lua functions in those widgets will have to be declared to be used in parsing order.&lt;br /&gt;
&lt;br /&gt;
== On-LuaRules/Synced load ==&lt;br /&gt;
&lt;br /&gt;
== On-Victory ==&lt;br /&gt;
&lt;br /&gt;
== On-GameEnd ==&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11055</id>
		<title>LuaLifecycle</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11055"/>
		<updated>2020-11-08T20:06:47Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* On-LuaUI load */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is work in Progress: Its goal is to collect and present all that missing information in the other articles, that lead to look ups in the source code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring takes your game either as a folder with the ending .sdd or as a zipped file distributed- either traditionally or via rapid, in a series of small files, stored in the rapid (/home/picasso/.spring/rapid/repos.springrts.com) folder in your spring installation. &lt;br /&gt;
Spring will compute a hash over those files and folders. If they are altered in name, value or existence, spring will not sync these games up. You will not go to war today.&lt;br /&gt;
You can sync a .sdd folder with zipped games, by adding a springignore.txt which is similar to a .gitignore.&lt;br /&gt;
&lt;br /&gt;
You can not add external widgets to a sdd folder and make it work. (TODO Validate)&lt;br /&gt;
&lt;br /&gt;
The nature of this hash, enforces something else. With all content static, you can not store any values &amp;quot;inside&amp;quot; your game.&lt;br /&gt;
You can store values as config values within the spring installation. You can load textfiles from external folders reachable to spring.&lt;br /&gt;
But you cant change what makes the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring will load your game and then present the loaded files within the game-code as reachable via the VFS (Virtual File System).&lt;br /&gt;
Some files can be altered and reloaded for development purposes. This includes the synced lua (/luarules reload) - which is equivalent to starting a new game, synced script wise.&lt;br /&gt;
UI-Files can be altered and reloaded, and already existing files at the start can be re-used. (/luaui reload). You can not add new widgets to the folder.&lt;br /&gt;
&lt;br /&gt;
During engine development some mistakes were made, regarding naming during load.&lt;br /&gt;
Meaning, a map can have the same lua-rules and luaui folder, to implement map specific content and this content is loaded into the same namespace,&lt;br /&gt;
as regular widgets (/luaui) and and gadgets (/luarules).&lt;br /&gt;
This can lead to naming collisions and not working widgets / synced game parts, depending on the map.&lt;br /&gt;
The usual way to avoid this, is to rename your luaui and luarules (TODO Check) folder and assume that all gadgets /widgets loaded into the default folder are Map based or other external widgets.&lt;br /&gt;
&lt;br /&gt;
For a example of such a architectural separation look at &lt;br /&gt;
&lt;br /&gt;
https://github.com/beyond-all-reason/Beyond-All-Reason/tree/master/luaui&lt;br /&gt;
&lt;br /&gt;
other games have a exclude map lua function, that refuses to load non-game lua.&lt;br /&gt;
&lt;br /&gt;
== On-LuaIntro ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaUI load ==&lt;br /&gt;
&lt;br /&gt;
Depending on how the widgets are loaded and what framework they use, subtle different lua-sntax rules may apply. &lt;br /&gt;
This means that lua functions in those widgets will have to be declared to be used in parsing order.&lt;br /&gt;
&lt;br /&gt;
== On-LuaRules/Synced load ==&lt;br /&gt;
&lt;br /&gt;
== On-Victory ==&lt;br /&gt;
&lt;br /&gt;
== On-GameEnd ==&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11054</id>
		<title>LuaLifecycle</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11054"/>
		<updated>2020-11-01T21:36:52Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* On-LuaUI load */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is work in Progress: Its goal is to collect and present all that missing information in the other articles, that lead to look ups in the source code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring takes your game either as a folder with the ending .sdd or as a zipped file distributed- either traditionally or via rapid, in a series of small files, stored in the rapid (/home/picasso/.spring/rapid/repos.springrts.com) folder in your spring installation. &lt;br /&gt;
Spring will compute a hash over those files and folders. If they are altered in name, value or existence, spring will not sync these games up. You will not go to war today.&lt;br /&gt;
You can sync a .sdd folder with zipped games, by adding a springignore.txt which is similar to a .gitignore.&lt;br /&gt;
&lt;br /&gt;
You can not add external widgets to a sdd folder and make it work. (TODO Validate)&lt;br /&gt;
&lt;br /&gt;
The nature of this hash, enforces something else. With all content static, you can not store any values &amp;quot;inside&amp;quot; your game.&lt;br /&gt;
You can store values as config values within the spring installation. You can load textfiles from external folders reachable to spring.&lt;br /&gt;
But you cant change what makes the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring will load your game and then present the loaded files within the game-code as reachable via the VFS (Virtual File System).&lt;br /&gt;
Some files can be altered and reloaded for development purposes. This includes the synced lua (/luarules reload) - which is equivalent to starting a new game, synced script wise.&lt;br /&gt;
UI-Files can be altered and reloaded, and already existing files at the start can be re-used. (/luaui reload). You can not add new widgets to the folder.&lt;br /&gt;
&lt;br /&gt;
During engine development some mistakes were made, regarding naming during load.&lt;br /&gt;
Meaning, a map can have the same lua-rules and luaui folder, to implement map specific content and this content is loaded into the same namespace,&lt;br /&gt;
as regular widgets (/luaui) and and gadgets (/luarules).&lt;br /&gt;
This can lead to naming collisions and not working widgets / synced game parts, depending on the map.&lt;br /&gt;
The usual way to avoid this, is to rename your luaui and luarules (TODO Check) folder and assume that all gadgets /widgets loaded into the default folder are Map based or other external widgets.&lt;br /&gt;
&lt;br /&gt;
For a example of such a architectural separation look at &lt;br /&gt;
&lt;br /&gt;
https://github.com/beyond-all-reason/Beyond-All-Reason/tree/master/luaui&lt;br /&gt;
&lt;br /&gt;
other games have a exclude map lua function, that refuses to load non-game lua.&lt;br /&gt;
&lt;br /&gt;
== On-LuaIntro ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaUI load ==&lt;br /&gt;
&lt;br /&gt;
Depending on how the widgets are loaded and what framework they use, subtle different lua-sntax rules may apply. This means that lua functions in those widgets will have to be declared to be used in parsing order.&lt;br /&gt;
&lt;br /&gt;
== On-LuaRules/Synced load ==&lt;br /&gt;
&lt;br /&gt;
== On-Victory ==&lt;br /&gt;
&lt;br /&gt;
== On-GameEnd ==&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11053</id>
		<title>LuaLifecycle</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11053"/>
		<updated>2020-11-01T21:34:51Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* On-Load */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is work in Progress: Its goal is to collect and present all that missing information in the other articles, that lead to look ups in the source code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring takes your game either as a folder with the ending .sdd or as a zipped file distributed- either traditionally or via rapid, in a series of small files, stored in the rapid (/home/picasso/.spring/rapid/repos.springrts.com) folder in your spring installation. &lt;br /&gt;
Spring will compute a hash over those files and folders. If they are altered in name, value or existence, spring will not sync these games up. You will not go to war today.&lt;br /&gt;
You can sync a .sdd folder with zipped games, by adding a springignore.txt which is similar to a .gitignore.&lt;br /&gt;
&lt;br /&gt;
You can not add external widgets to a sdd folder and make it work. (TODO Validate)&lt;br /&gt;
&lt;br /&gt;
The nature of this hash, enforces something else. With all content static, you can not store any values &amp;quot;inside&amp;quot; your game.&lt;br /&gt;
You can store values as config values within the spring installation. You can load textfiles from external folders reachable to spring.&lt;br /&gt;
But you cant change what makes the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring will load your game and then present the loaded files within the game-code as reachable via the VFS (Virtual File System).&lt;br /&gt;
Some files can be altered and reloaded for development purposes. This includes the synced lua (/luarules reload) - which is equivalent to starting a new game, synced script wise.&lt;br /&gt;
UI-Files can be altered and reloaded, and already existing files at the start can be re-used. (/luaui reload). You can not add new widgets to the folder.&lt;br /&gt;
&lt;br /&gt;
During engine development some mistakes were made, regarding naming during load.&lt;br /&gt;
Meaning, a map can have the same lua-rules and luaui folder, to implement map specific content and this content is loaded into the same namespace,&lt;br /&gt;
as regular widgets (/luaui) and and gadgets (/luarules).&lt;br /&gt;
This can lead to naming collisions and not working widgets / synced game parts, depending on the map.&lt;br /&gt;
The usual way to avoid this, is to rename your luaui and luarules (TODO Check) folder and assume that all gadgets /widgets loaded into the default folder are Map based or other external widgets.&lt;br /&gt;
&lt;br /&gt;
For a example of such a architectural separation look at &lt;br /&gt;
&lt;br /&gt;
https://github.com/beyond-all-reason/Beyond-All-Reason/tree/master/luaui&lt;br /&gt;
&lt;br /&gt;
other games have a exclude map lua function, that refuses to load non-game lua.&lt;br /&gt;
&lt;br /&gt;
== On-LuaIntro ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaUI load ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaRules/Synced load ==&lt;br /&gt;
&lt;br /&gt;
== On-Victory ==&lt;br /&gt;
&lt;br /&gt;
== On-GameEnd ==&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11052</id>
		<title>LuaLifecycle</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaLifecycle&amp;diff=11052"/>
		<updated>2020-11-01T21:09:09Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: WIP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is work in Progress: Its goal is to collect and present all that missing information in the other articles, that lead to look ups in the source code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Pre-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring takes your game either as a folder with the ending .sdd or as a zipped file distributed- either traditionally or via rapid, in a series of small files, stored in the rapid (/home/picasso/.spring/rapid/repos.springrts.com) folder in your spring installation. &lt;br /&gt;
Spring will compute a hash over those files and folders. If they are altered in name, value or existence, spring will not sync these games up. You will not go to war today.&lt;br /&gt;
You can sync a .sdd folder with zipped games, by adding a springignore.txt which is similar to a .gitignore.&lt;br /&gt;
&lt;br /&gt;
You can not add external widgets to a sdd folder and make it work. (TODO Validate)&lt;br /&gt;
&lt;br /&gt;
The nature of this hash, enforces something else. With all content static, you can not store any values &amp;quot;inside&amp;quot; your game.&lt;br /&gt;
You can store values as config values within the spring installation. You can load textfiles from external folders reachable to spring.&lt;br /&gt;
But you cant change what makes the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-Load ==&lt;br /&gt;
&lt;br /&gt;
Spring will load your game and then present the loaded files within the game-code as reachable via the VFS (Virtual File System).&lt;br /&gt;
Some files can be altered and reloaded for development purposes. This includes the synced lua (/luarules reload) - which is equivalent to starting a new game, synced script wise.&lt;br /&gt;
UI-Files can be altered and reloaded, and already existing files at the start can be re-used. (/luaui reload). You can not add new widgets to the folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== On-LuaIntro ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaUI load ==&lt;br /&gt;
&lt;br /&gt;
== On-LuaRules/Synced load ==&lt;br /&gt;
&lt;br /&gt;
== On-Victory ==&lt;br /&gt;
&lt;br /&gt;
== On-GameEnd ==&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedRead&amp;diff=12415</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=12415"/>
		<updated>2020-08-04T19:03:35Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Screen Trace */&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;
&#039;&#039;&#039;Spring.IsReplay&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetReplayLength&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( ) -&amp;gt; nil | number (in seconds)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSpectatingState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean spectating, boolean fullView, boolean fullSelect&lt;br /&gt;
&lt;br /&gt;
== Game/Menu Name ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameName&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; string name&lt;br /&gt;
&lt;br /&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;
&#039;&#039;&#039;Spring.GetMenuName&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; string name&lt;br /&gt;
&lt;br /&gt;
== ModUI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetModUICtrl&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
== MyInfo ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyAllyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyPlayerID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&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;
&#039;&#039;&#039;Spring.GetLocalPlayerID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number playerID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLocalTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number teamID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLocalAllyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number allyID&lt;br /&gt;
&lt;br /&gt;
== Team/Player Info ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerRoster&#039;&#039;&#039;&lt;br /&gt;
  ( [number sortType] | [number sortType], [bool showPathingPlayers] ) -&amp;gt;&lt;br /&gt;
    nil | 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;
   if pingTime is == -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;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;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;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number r, number g, number b,  number a&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamOrigColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number r, number g, number b,  number a&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerTraffic&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID [, number packetID] ) -&amp;gt; number&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSoundStreamTime&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number playedTime, number totalTime&lt;br /&gt;
&lt;br /&gt;
== Camera ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraNames&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [camName] = number camNum, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { &amp;quot;name&amp;quot; = string, &amp;quot;mode&amp;quot; = number camIdx, state1 = number, state2 = number, ... }&lt;br /&gt;
&lt;br /&gt;
See [[Lua_camState]] for details about Spring.GetCameraState output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraPosition&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y, number z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraDirection&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number forward_x, number forward_y, number forward_z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraFOV&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number fov&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraVectors&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&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;
  }&lt;br /&gt;
&lt;br /&gt;
=== Inview ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleUnits&#039;&#039;&#039;&lt;br /&gt;
  ( [number teamID = -1 [, number radius = 30 [, boolean Icons = true ]]] )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleFeatures&#039;&#039;&#039;&lt;br /&gt;
  ( [number allyTeamID = -1 [, number radius = 30 [, boolean Icons = true [, boolean geos = true ]]]] )&lt;br /&gt;
    -&amp;gt; nil | featureTable = { [1] = number featureID, ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.IsAABBInView&#039;&#039;&#039;&lt;br /&gt;
  ( number minX, number minY, number minZ,&lt;br /&gt;
    number maxX, number maxY, number maxZ ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsSphereInView&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z [, number radius ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInView&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number radius [, boolean checkIcons] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Screen Trace ===&lt;br /&gt;
&#039;&#039;&#039;Spring.WorldToScreenCoords&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; number x, number y, number z&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TraceScreenRay&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( number mouseX, number mouseY [, boolean onlyCoords &lt;br /&gt;
  [, boolean useMinimap [, boolean includeSky [, boolean ignoreWater [, number D] ] ] ] ] )&lt;br /&gt;
    -&amp;gt; nil |&lt;br /&gt;
    string &amp;quot;unit&amp;quot;,    number unitID    |&lt;br /&gt;
    string &amp;quot;feature&amp;quot;, number featureID |&lt;br /&gt;
    string &amp;quot;ground&amp;quot;,  { [1] = number x, [2] = number y, [3] = number z }&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} Exended 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;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPixelDir&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
  ( number x, number y ) -&amp;gt; number dirx, number diry, number dirz&lt;br /&gt;
&lt;br /&gt;
=== Screen &amp;amp; Window Geometry ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetViewGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number viewSizeX, number viewSizeY, number viewPosX, number viewPosY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetWindowGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number winSizeX, number winSizeY, number winPosX, number winPosY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetScreenGeometry&#039;&#039;&#039; (is missing multiscreen support!)&lt;br /&gt;
  ( ) -&amp;gt; number screenSizeX, number screenSizeY, number ZERO, number ZERO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit ==&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitAllied&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitViewPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, boolean midPos = false ] ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTransformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, boolean invert = false] ) -&amp;gt; nil | number a11, number a12 ..., number a44    &amp;lt;span class=note&amp;gt;(4x4 matrix)&amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSelectionVolumeData&#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;
=== Selected Units ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnits&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [1] = unitID, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsSorted&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [number unitDefID] = { [1] = [number unitID], etc...}, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsCounts&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [number unitDefID] = number count, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsCount&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number count&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitSelected&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Unit Groups ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitGroup&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupList&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [number] = number unitCount,&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedGroup&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupAIName&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; string aiName&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupAIList&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
    [1] = string aiName, ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnits&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = number unitID, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsSorted&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [number unitDefID] = {number unitID, ...}, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsCounts&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [number unitDefID] = number count, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsCount&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | number count&lt;br /&gt;
&lt;br /&gt;
== Feature ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureSelectionVolumeData&#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;
== Projectiles ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleProjectiles&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   ([ number allyTeamID = -1&lt;br /&gt;
   [ , boolean addSyncedProjectiles = true&lt;br /&gt;
   [ , boolean addWeaponProjectiles = true&lt;br /&gt;
   [ , boolean addPieceProjectiles = true ]]]]&lt;br /&gt;
   ) --&amp;gt; nil | {[1] = projectileID, ...}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUICommands&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      command=string,&lt;br /&gt;
      description=string,&lt;br /&gt;
      synced=bool,&lt;br /&gt;
      cheat=bool,&lt;br /&gt;
    }, ...&lt;br /&gt;
  }&lt;br /&gt;
Returns a list of available [[UI commands]].&lt;br /&gt;
&lt;br /&gt;
=== GUI Settings ===&lt;br /&gt;
&#039;&#039;&#039;Spring.IsGUIHidden&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.HaveShadows&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.HaveAdvShading&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetWaterMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number mode, string &amp;quot;mode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&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;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMapDrawMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | &amp;quot;normal&amp;quot; | &amp;quot;height&amp;quot; | &amp;quot;metal&amp;quot; | &amp;quot;pathTraversability&amp;quot; | &amp;quot;los&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDrawSelectionInfo&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Returns whether &amp;amp;quot;Selected units&amp;amp;quot; text is displayed.&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
=== Unit &amp;amp; Feature GUI States ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLuaDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoMinimap&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureLuaDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureNoDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Minimap ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMiniMapGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number posX, number posY, number sizeX, number sizeY,&lt;br /&gt;
    boolean minimized, boolean maximized&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMiniMapDualScreen&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean false | string &amp;quot;left&amp;quot; | string &amp;quot;right&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.IsAboveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== (Build-)Menu ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCommand&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number index (, number cmd_id, number cmd_type, string cmd_name)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDefaultCommand&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number index (, number cmd_id, number cmd_type, string cmd_name)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCmdDescs&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&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;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number index ) -&amp;gt; nil | {&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;
&#039;&#039;&#039;Spring.GetCmdDescIndex&#039;&#039;&#039;&lt;br /&gt;
  ( number cmdID ) -&amp;gt; nil | number index&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActivePage&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number pageNum, number maxPages&lt;br /&gt;
&lt;br /&gt;
=== Build Facing ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetBuildSpacing&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
=== GatherMode &amp;amp; InvertQueueKey ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGatherMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetInvertQueueKey&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Mouse States ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseState&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( ) -&amp;gt; number X, number Y,&lt;br /&gt;
    boolean leftPressed, boolean middlePressed, boolean rightPressed,&lt;br /&gt;
    boolean offscreen&lt;br /&gt;
&lt;br /&gt;
X, Y are the screen coordinates, not world ones. This coordinate system starts in the lower left corner.&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Sixth return value offscreen&lt;br /&gt;
&lt;br /&gt;
For world coordinates see Spring.TraceScreenRay&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseCursor&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string name, number scale&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseStartPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number mouseButton ) -&amp;gt; nil | number pressedX, number pressedY,&lt;br /&gt;
    number camPosX, number camPosY, number camPosZ,&lt;br /&gt;
    number dirX, number dirY, number dirZ&lt;br /&gt;
&lt;br /&gt;
=== (Hot-)Keys ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyState&#039;&#039;&#039;&lt;br /&gt;
  ( number key ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetModKeyState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean alt, boolean ctrl, boolean meta, boolean shift&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPressedKeys&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
    [number code] = boolean,&lt;br /&gt;
    [string name] = boolean, {{new|99.0}}&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyCode&#039;&#039;&#039;&lt;br /&gt;
  ( string keysym ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeySymbol&#039;&#039;&#039;&lt;br /&gt;
  ( number key ) -&amp;gt; string &amp;quot;keysym1&amp;quot;, string &amp;quot;keysym2&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyBindings&#039;&#039;&#039;&lt;br /&gt;
  ( string keyset ) -&amp;gt; nil | {&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;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActionHotKeys&#039;&#039;&#039;&lt;br /&gt;
  ( string action ) -&amp;gt; nil | { [1] = string hotKey, ... }&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLastMessagePositions&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = { number X, number Y, number Z },&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConsoleBuffer&#039;&#039;&#039;&lt;br /&gt;
  ( [number maxLines] ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      text = string,&lt;br /&gt;
      priority = number&lt;br /&gt;
   }, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCurrentTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
=== LOS Colors ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLosViewColors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( ) -&amp;gt; always = {r,g,b}, LOS = {r,g,b}, radar = {r,g,b}, jam = {r,g,b}, radar2 = {r,g,b}  {{new|100}}&lt;br /&gt;
&lt;br /&gt;
== Config ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigParams&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;same information as &amp;lt;code&amp;gt;spring --list-config-vars&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; table {&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;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigInt&#039;&#039;&#039;&lt;br /&gt;
  ( string name [, number default ] ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigFloat&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name [, number default ] ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigString&#039;&#039;&#039;&lt;br /&gt;
  ( string name [, string default ] ) -&amp;gt; nil | string&lt;br /&gt;
&lt;br /&gt;
== FPS &amp;amp; GetDrawFrame ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFPS&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDrawFrame&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number low 16bit, number high 16bit&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVideoCapturingMode&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; boolean videoCaptureAllowed&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameSpeed&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; number userSpeedFactor, number speedFactor, boolean paused&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFrameTimeOffset&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLastUpdateSeconds&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetHasLag&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTimer&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; timer&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFrameTimer&#039;&#039;&#039; {{new|102.0}}&lt;br /&gt;
  ( ) -&amp;gt; timer&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Get a timer for the start of the frame, this should give better results for camera interpolations.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DiffTimers&#039;&#039;&#039;&lt;br /&gt;
  ( timer cur, timer ago, [boolean inMilliseconds]) -&amp;gt; number seconds&lt;br /&gt;
{{New|95.0}} optional third argument (boolean) to return dt in milliseconds&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMapSquareTexture&#039;&#039;&#039;&lt;br /&gt;
  (number texSqrX, number texSqrY, number texMipLvl, string luaTexName) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLogSections&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; table { &amp;quot;KeyBindings&amp;quot; = LOG.INFO, &amp;quot;Font&amp;quot; = LOG.INFO, &amp;quot;Sound&amp;quot; = LOG.WARNING, ... }&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetClipboard&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; string text&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedRead&amp;diff=12414</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=12414"/>
		<updated>2020-08-04T17:30:47Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Screen Trace */&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;
&#039;&#039;&#039;Spring.IsReplay&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetReplayLength&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( ) -&amp;gt; nil | number (in seconds)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSpectatingState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean spectating, boolean fullView, boolean fullSelect&lt;br /&gt;
&lt;br /&gt;
== Game/Menu Name ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameName&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; string name&lt;br /&gt;
&lt;br /&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;
&#039;&#039;&#039;Spring.GetMenuName&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; string name&lt;br /&gt;
&lt;br /&gt;
== ModUI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetModUICtrl&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
== MyInfo ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyAllyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMyPlayerID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&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;
&#039;&#039;&#039;Spring.GetLocalPlayerID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number playerID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLocalTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number teamID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLocalAllyTeamID&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number allyID&lt;br /&gt;
&lt;br /&gt;
== Team/Player Info ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerRoster&#039;&#039;&#039;&lt;br /&gt;
  ( [number sortType] | [number sortType], [bool showPathingPlayers] ) -&amp;gt;&lt;br /&gt;
    nil | 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;
   if pingTime is == -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;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;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;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number r, number g, number b,  number a&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTeamOrigColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID ) -&amp;gt; nil | number r, number g, number b,  number a&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPlayerTraffic&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID [, number packetID] ) -&amp;gt; number&lt;br /&gt;
&lt;br /&gt;
== Sound ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSoundStreamTime&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number playedTime, number totalTime&lt;br /&gt;
&lt;br /&gt;
== Camera ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraNames&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [camName] = number camNum, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { &amp;quot;name&amp;quot; = string, &amp;quot;mode&amp;quot; = number camIdx, state1 = number, state2 = number, ... }&lt;br /&gt;
&lt;br /&gt;
See [[Lua_camState]] for details about Spring.GetCameraState output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraPosition&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number x, number y, number z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraDirection&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number forward_x, number forward_y, number forward_z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraFOV&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number fov&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCameraVectors&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&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;
  }&lt;br /&gt;
&lt;br /&gt;
=== Inview ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleUnits&#039;&#039;&#039;&lt;br /&gt;
  ( [number teamID = -1 [, number radius = 30 [, boolean Icons = true ]]] )&lt;br /&gt;
    -&amp;gt; nil | unitTable = { [1] = number unitID, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleFeatures&#039;&#039;&#039;&lt;br /&gt;
  ( [number allyTeamID = -1 [, number radius = 30 [, boolean Icons = true [, boolean geos = true ]]]] )&lt;br /&gt;
    -&amp;gt; nil | featureTable = { [1] = number featureID, ... }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.IsAABBInView&#039;&#039;&#039;&lt;br /&gt;
  ( number minX, number minY, number minZ,&lt;br /&gt;
    number maxX, number maxY, number maxZ ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsSphereInView&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z [, number radius ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitInView&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitVisible&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number radius [, boolean checkIcons] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Screen Trace ===&lt;br /&gt;
&#039;&#039;&#039;Spring.WorldToScreenCoords&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; number x, number y, number z&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.TraceScreenRay&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( number mouseX, number mouseY [, boolean onlyCoords &lt;br /&gt;
  [, boolean useMinimap [, boolean includeSky [, boolean ignoreWater [, number D] ] ] ] ] )&lt;br /&gt;
    -&amp;gt; nil |&lt;br /&gt;
    string &amp;quot;unit&amp;quot;,    number unitID    |&lt;br /&gt;
    string &amp;quot;feature&amp;quot;, number featureID |&lt;br /&gt;
    string &amp;quot;ground&amp;quot;,  { [1] = number x, [2] = number y, [3] = number z }&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} Exended 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.&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;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPixelDir&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
  ( number x, number y ) -&amp;gt; number dirx, number diry, number dirz&lt;br /&gt;
&lt;br /&gt;
=== Screen &amp;amp; Window Geometry ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetViewGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number viewSizeX, number viewSizeY, number viewPosX, number viewPosY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetWindowGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number winSizeX, number winSizeY, number winPosX, number winPosY&lt;br /&gt;
&#039;&#039;&#039;Spring.GetScreenGeometry&#039;&#039;&#039; (is missing multiscreen support!)&lt;br /&gt;
  ( ) -&amp;gt; number screenSizeX, number screenSizeY, number ZERO, number ZERO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unit ==&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitAllied&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitViewPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, boolean midPos = false ] ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTransformMatrix&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, boolean invert = false] ) -&amp;gt; nil | number a11, number a12 ..., number a44    &amp;lt;span class=note&amp;gt;(4x4 matrix)&amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSelectionVolumeData&#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;
=== Selected Units ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnits&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [1] = unitID, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsSorted&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [number unitDefID] = { [1] = [number unitID], etc...}, ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsCounts&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; { [number unitDefID] = number count, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedUnitsCount&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number count&lt;br /&gt;
&#039;&#039;&#039;Spring.IsUnitSelected&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Unit Groups ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitGroup&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupList&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [number] = number unitCount,&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetSelectedGroup&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupAIName&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; string aiName&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupAIList&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
    [1] = string aiName, ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnits&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = number unitID, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsSorted&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [number unitDefID] = {number unitID, ...}, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsCounts&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | {&lt;br /&gt;
    [number unitDefID] = number count, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGroupUnitsCount&#039;&#039;&#039;&lt;br /&gt;
  ( number groupID ) -&amp;gt; nil | number count&lt;br /&gt;
&lt;br /&gt;
== Feature ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureSelectionVolumeData&#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;
== Projectiles ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVisibleProjectiles&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   ([ number allyTeamID = -1&lt;br /&gt;
   [ , boolean addSyncedProjectiles = true&lt;br /&gt;
   [ , boolean addWeaponProjectiles = true&lt;br /&gt;
   [ , boolean addPieceProjectiles = true ]]]]&lt;br /&gt;
   ) --&amp;gt; nil | {[1] = projectileID, ...}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUICommands&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      command=string,&lt;br /&gt;
      description=string,&lt;br /&gt;
      synced=bool,&lt;br /&gt;
      cheat=bool,&lt;br /&gt;
    }, ...&lt;br /&gt;
  }&lt;br /&gt;
Returns a list of available [[UI commands]].&lt;br /&gt;
&lt;br /&gt;
=== GUI Settings ===&lt;br /&gt;
&#039;&#039;&#039;Spring.IsGUIHidden&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.HaveShadows&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.HaveAdvShading&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetWaterMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number mode, string &amp;quot;mode&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&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;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMapDrawMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | &amp;quot;normal&amp;quot; | &amp;quot;height&amp;quot; | &amp;quot;metal&amp;quot; | &amp;quot;pathTraversability&amp;quot; | &amp;quot;los&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDrawSelectionInfo&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Returns whether &amp;amp;quot;Selected units&amp;amp;quot; text is displayed.&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
=== Unit &amp;amp; Feature GUI States ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLuaDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoMinimap&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureLuaDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFeatureNoDraw&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Minimap ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMiniMapGeometry&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number posX, number posY, number sizeX, number sizeY,&lt;br /&gt;
    boolean minimized, boolean maximized&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMiniMapDualScreen&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean false | string &amp;quot;left&amp;quot; | string &amp;quot;right&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.IsAboveMiniMap&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== (Build-)Menu ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCommand&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number index (, number cmd_id, number cmd_type, string cmd_name)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDefaultCommand&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number index (, number cmd_id, number cmd_type, string cmd_name)&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCmdDescs&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&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;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActiveCmdDesc&#039;&#039;&#039;&lt;br /&gt;
  ( number index ) -&amp;gt; nil | {&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;
&#039;&#039;&#039;Spring.GetCmdDescIndex&#039;&#039;&#039;&lt;br /&gt;
  ( number cmdID ) -&amp;gt; nil | number index&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActivePage&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number pageNum, number maxPages&lt;br /&gt;
&lt;br /&gt;
=== Build Facing ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetBuildSpacing&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
=== GatherMode &amp;amp; InvertQueueKey ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGatherMode&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetInvertQueueKey&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
=== Mouse States ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseState&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( ) -&amp;gt; number X, number Y,&lt;br /&gt;
    boolean leftPressed, boolean middlePressed, boolean rightPressed,&lt;br /&gt;
    boolean offscreen&lt;br /&gt;
&lt;br /&gt;
X, Y are the screen coordinates, not world ones. This coordinate system starts in the lower left corner.&lt;br /&gt;
&lt;br /&gt;
{{new|104.0}} Sixth return value offscreen&lt;br /&gt;
&lt;br /&gt;
For world coordinates see Spring.TraceScreenRay&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseCursor&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string name, number scale&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMouseStartPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number mouseButton ) -&amp;gt; nil | number pressedX, number pressedY,&lt;br /&gt;
    number camPosX, number camPosY, number camPosZ,&lt;br /&gt;
    number dirX, number dirY, number dirZ&lt;br /&gt;
&lt;br /&gt;
=== (Hot-)Keys ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyState&#039;&#039;&#039;&lt;br /&gt;
  ( number key ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetModKeyState&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean alt, boolean ctrl, boolean meta, boolean shift&lt;br /&gt;
&#039;&#039;&#039;Spring.GetPressedKeys&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; {&lt;br /&gt;
    [number code] = boolean,&lt;br /&gt;
    [string name] = boolean, {{new|99.0}}&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyCode&#039;&#039;&#039;&lt;br /&gt;
  ( string keysym ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeySymbol&#039;&#039;&#039;&lt;br /&gt;
  ( number key ) -&amp;gt; string &amp;quot;keysym1&amp;quot;, string &amp;quot;keysym2&amp;quot;&lt;br /&gt;
&#039;&#039;&#039;Spring.GetKeyBindings&#039;&#039;&#039;&lt;br /&gt;
  ( string keyset ) -&amp;gt; nil | {&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;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetActionHotKeys&#039;&#039;&#039;&lt;br /&gt;
  ( string action ) -&amp;gt; nil | { [1] = string hotKey, ... }&lt;br /&gt;
&lt;br /&gt;
=== Console ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLastMessagePositions&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = { number X, number Y, number Z },&lt;br /&gt;
    ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConsoleBuffer&#039;&#039;&#039;&lt;br /&gt;
  ( [number maxLines] ) -&amp;gt; nil | {&lt;br /&gt;
    [1] = {&lt;br /&gt;
      text = string,&lt;br /&gt;
      priority = number&lt;br /&gt;
   }, ...&lt;br /&gt;
  }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetCurrentTooltip&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
=== LOS Colors ===&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLosViewColors&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
  ( ) -&amp;gt; always = {r,g,b}, LOS = {r,g,b}, radar = {r,g,b}, jam = {r,g,b}, radar2 = {r,g,b}  {{new|100}}&lt;br /&gt;
&lt;br /&gt;
== Config ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigParams&#039;&#039;&#039; &amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;same information as &amp;lt;code&amp;gt;spring --list-config-vars&amp;lt;/code&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; table {&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;
  }&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigInt&#039;&#039;&#039;&lt;br /&gt;
  ( string name [, number default ] ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigFloat&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( string name [, number default ] ) -&amp;gt; nil | number&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigString&#039;&#039;&#039;&lt;br /&gt;
  ( string name [, string default ] ) -&amp;gt; nil | string&lt;br /&gt;
&lt;br /&gt;
== FPS &amp;amp; GetDrawFrame ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFPS&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetDrawFrame&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; number low 16bit, number high 16bit&lt;br /&gt;
&#039;&#039;&#039;Spring.GetVideoCapturingMode&#039;&#039;&#039; {{new|104.0}}&lt;br /&gt;
  ( ) -&amp;gt; boolean videoCaptureAllowed&lt;br /&gt;
&lt;br /&gt;
== Time ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetGameSpeed&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; number userSpeedFactor, number speedFactor, boolean paused&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFrameTimeOffset&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLastUpdateSeconds&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetHasLag&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.GetTimer&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; timer&lt;br /&gt;
&#039;&#039;&#039;Spring.GetFrameTimer&#039;&#039;&#039; {{new|102.0}}&lt;br /&gt;
  ( ) -&amp;gt; timer&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Get a timer for the start of the frame, this should give better results for camera interpolations.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.DiffTimers&#039;&#039;&#039;&lt;br /&gt;
  ( timer cur, timer ago, [boolean inMilliseconds]) -&amp;gt; number seconds&lt;br /&gt;
{{New|95.0}} optional third argument (boolean) to return dt in milliseconds&lt;br /&gt;
&lt;br /&gt;
== Rendering ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetMapSquareTexture&#039;&#039;&#039;&lt;br /&gt;
  (number texSqrX, number texSqrY, number texMipLvl, string luaTexName) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetLogSections&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; table { &amp;quot;KeyBindings&amp;quot; = LOG.INFO, &amp;quot;Font&amp;quot; = LOG.INFO, &amp;quot;Sound&amp;quot; = LOG.WARNING, ... }&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GetClipboard&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( ) -&amp;gt; string text&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_camState&amp;diff=12532</id>
		<title>Lua camState</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_camState&amp;diff=12532"/>
		<updated>2018-09-18T20:09:03Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* The raw info */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TL;DR ==&lt;br /&gt;
&#039;&#039;&#039;px&#039;&#039;&#039;, &#039;&#039;&#039;py&#039;&#039;&#039; and &#039;&#039;&#039;pz&#039;&#039;&#039; are camera position in world coords.&lt;br /&gt;
&lt;br /&gt;
=== Free camera ===&lt;br /&gt;
&#039;&#039;&#039;rx&#039;&#039;&#039; and &#039;&#039;&#039;ry&#039;&#039;&#039; are camera rotation in radians about the X and Y axes respectively, where an rx of 0 is horizontal and an ry of 0 is facing south, positive values running anticlockwise. &#039;&#039;&#039;rz&#039;&#039;&#039; currently (91.0) does nothing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dx&#039;&#039;&#039;, &#039;&#039;&#039;dy&#039;&#039;&#039; and &#039;&#039;&#039;dz&#039;&#039;&#039; have &#039;&#039;nothing&#039;&#039; to do with camera rotation.&lt;br /&gt;
&lt;br /&gt;
== The raw info ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I wanted to use Spring.SetCameraState( table camState, number camTime) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
The wiki said: camState has the same format as the output of Spring.GetCameraState().&lt;br /&gt;
&lt;br /&gt;
So I ran Spring.Echo(Spring.GetCameraState())&lt;br /&gt;
All I got was:&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
TABLE: &lt;br /&gt;
&lt;br /&gt;
So, I ran, for every kind of camera:&lt;br /&gt;
for index,value in pairs(Spring.GetCameraState()) do&lt;br /&gt;
	Spring.Echo(index,value)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
This is what I got:&lt;br /&gt;
&lt;br /&gt;
Switching to Overhead (TA) style camera&lt;br /&gt;
name : &amp;quot;ta&amp;quot;&lt;br /&gt;
mode : 1&lt;br /&gt;
px,py,pz : Position of the ground point in screen center (not camera position)&lt;br /&gt;
dx,dy,dz : Camera direction vector?&lt;br /&gt;
zscale: how tilted is the camera, from 10 (near horizontal) to 0.05 (near vertical). We have y/z = 1.0/zscale (with a -1 thrown in if flipped)&lt;br /&gt;
height : how much above the ground is the camera, cannot be negative -- &#039;&#039; it&#039;s absolute height of the camera, ie the camera positions y value, actually (so no difference if cam is above mountain or valley)~~~~&#039;&#039;&lt;br /&gt;
flipped : -1 for when south is down, 1 for when north is down&lt;br /&gt;
&lt;br /&gt;
exemple:&lt;br /&gt;
px, 2000&lt;br /&gt;
py, 70&lt;br /&gt;
pz, 1800&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, 0&lt;br /&gt;
name, ta&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 500&lt;br /&gt;
mode, 1&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Total War style camera&lt;br /&gt;
rz, 0&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
name, tw&lt;br /&gt;
ry, 3.1415927410126&lt;br /&gt;
px, 477.53298950195&lt;br /&gt;
py, 100&lt;br /&gt;
pz, 447.54751586914&lt;br /&gt;
mode, 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Rotatable overhead camera&lt;br /&gt;
name : &amp;quot;rot&amp;quot;&lt;br /&gt;
mode : 3&lt;br /&gt;
px,py,pz : Position of the ground point in screen center (not camera position) -- &#039;&#039; actually it seems to be the camera position to me (I set the height with py, not so sure about the others...) ~~~~&#039;&#039;&lt;br /&gt;
dx,dy,dz : Camera direction vector?&lt;br /&gt;
rx,ry,rz : Camera rotation?&lt;br /&gt;
oldHeight : how much above the ground is the camera, cannot be negative, cannot be changed (I guess it&#039;s just in for when switching to a view that requires it next)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
exemple:&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 600&lt;br /&gt;
pz, 441.25302124023&lt;br /&gt;
rz, 0&lt;br /&gt;
dx, -4.9136563262664e-008&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
name, rot&lt;br /&gt;
ry, 3.1415927410126&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
mode, 3&lt;br /&gt;
dz, -0.56205677986145&lt;br /&gt;
oldHeight, 500&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Free style camera&lt;br /&gt;
avx, 0&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
gravity, -500&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
autoTilt, 2.6179938316345&lt;br /&gt;
dx, -0.011240424588323&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
dz, -0.5619443655014&lt;br /&gt;
py, 964.28167724609&lt;br /&gt;
gndOffset, 16&lt;br /&gt;
gndLock, -1&lt;br /&gt;
goForward, -1&lt;br /&gt;
mode, 4&lt;br /&gt;
tiltSpeed, 2.6179938316345&lt;br /&gt;
velTime, 1.5&lt;br /&gt;
slide, 0.5&lt;br /&gt;
avz, 0&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
invertAlt, -1&lt;br /&gt;
rz, 0&lt;br /&gt;
ry, 3.1615927219391&lt;br /&gt;
avy, 0&lt;br /&gt;
scrollSpeed, 100&lt;br /&gt;
name, free&lt;br /&gt;
fov, 45&lt;br /&gt;
vz, 0&lt;br /&gt;
avelTime, 1&lt;br /&gt;
vx, 0&lt;br /&gt;
vy, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Smooth style camera&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 109.49719238281&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, -0.89428168535233&lt;br /&gt;
name, sm&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 500&lt;br /&gt;
mode, 5&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, -0.44714084267616&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Orbit style camera&lt;br /&gt;
tx, 522.32415771484&lt;br /&gt;
ty, 241.19664001465&lt;br /&gt;
name, OrbitController&lt;br /&gt;
tz, 644.45776367188&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 556.63806152344&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
mode, 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to FPS style camera&lt;br /&gt;
px, 1233.4810791016&lt;br /&gt;
py, 554.39453125&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
rz, 0&lt;br /&gt;
dx, -0.011240424588323&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
name, fps&lt;br /&gt;
ry, 3.1615927219391&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
mode, 0&lt;br /&gt;
dz, -0.5619443655014&lt;br /&gt;
oldHeight, 300&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Overhead (TA) style camera&lt;br /&gt;
px, 1324.8835449219&lt;br /&gt;
py, 254.39453125&lt;br /&gt;
pz, 871.56591796875&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, -0.89428168535233&lt;br /&gt;
name, ta&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 713.52716064453&lt;br /&gt;
mode, 1&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, -0.44714084267616&lt;br /&gt;
&lt;br /&gt;
Now someone go comment that.&lt;br /&gt;
&lt;br /&gt;
It appears that mod eis simply a number containing the same information as name, but while name is a string, mode is an integer between 0 and 6.&lt;br /&gt;
&lt;br /&gt;
I guess px,py,pz could be the postion, while dx,dy,dz could be the direction?&lt;br /&gt;
px,py,pz is the position.&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera/CameraController.cpp#L75&lt;br /&gt;
dx,dy,dz is the directional vector, this determinates where the camera points towards.&lt;br /&gt;
fov is the field of view.&lt;br /&gt;
&lt;br /&gt;
These values are part of the inherited base class, thus apply to all camera controllers.&lt;br /&gt;
rx,ry,rz - are part of a derived class and thus can not be found in all cameras.&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera.cpp#L383&lt;br /&gt;
It denotes the rotation of the camera, found in some camera controllers- theroretically these cameras could tilt and tumble around the viewing direction. In practice, setting the direction - always overrides the rotation.&lt;br /&gt;
&lt;br /&gt;
All the other values are also part of the derived classes. Found here:&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera/FreeController.cpp#L380&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But what is height? What is zscale? What is flipped? What is oldHeigh? What are rx,ry,rz? Why has orbit no dx,dy,dz but some tx,ty,tz? What about all the free style camera settings? If you know edit that page please!&lt;br /&gt;
&lt;br /&gt;
From testing, I found out flipped invert north/south depending on whether it&#039;s negative or positive.&lt;br /&gt;
&lt;br /&gt;
From testing, I found out zscale is how horizontal/vertical are some camera, 10 for almost horizontal TA overhead, 0.05 for almost vertical TA overhead.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;br /&gt;
&lt;br /&gt;
Camtime is optional, and currently not used&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_camState&amp;diff=12531</id>
		<title>Lua camState</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_camState&amp;diff=12531"/>
		<updated>2018-09-18T19:59:50Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* The raw info */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== TL;DR ==&lt;br /&gt;
&#039;&#039;&#039;px&#039;&#039;&#039;, &#039;&#039;&#039;py&#039;&#039;&#039; and &#039;&#039;&#039;pz&#039;&#039;&#039; are camera position in world coords.&lt;br /&gt;
&lt;br /&gt;
=== Free camera ===&lt;br /&gt;
&#039;&#039;&#039;rx&#039;&#039;&#039; and &#039;&#039;&#039;ry&#039;&#039;&#039; are camera rotation in radians about the X and Y axes respectively, where an rx of 0 is horizontal and an ry of 0 is facing south, positive values running anticlockwise. &#039;&#039;&#039;rz&#039;&#039;&#039; currently (91.0) does nothing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;dx&#039;&#039;&#039;, &#039;&#039;&#039;dy&#039;&#039;&#039; and &#039;&#039;&#039;dz&#039;&#039;&#039; have &#039;&#039;nothing&#039;&#039; to do with camera rotation.&lt;br /&gt;
&lt;br /&gt;
== The raw info ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
I wanted to use Spring.SetCameraState( table camState, number camTime) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
The wiki said: camState has the same format as the output of Spring.GetCameraState().&lt;br /&gt;
&lt;br /&gt;
So I ran Spring.Echo(Spring.GetCameraState())&lt;br /&gt;
All I got was:&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
TABLE: &lt;br /&gt;
&lt;br /&gt;
So, I ran, for every kind of camera:&lt;br /&gt;
for index,value in pairs(Spring.GetCameraState()) do&lt;br /&gt;
	Spring.Echo(index,value)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
This is what I got:&lt;br /&gt;
&lt;br /&gt;
Switching to Overhead (TA) style camera&lt;br /&gt;
name : &amp;quot;ta&amp;quot;&lt;br /&gt;
mode : 1&lt;br /&gt;
px,py,pz : Position of the ground point in screen center (not camera position)&lt;br /&gt;
dx,dy,dz : Camera direction vector?&lt;br /&gt;
zscale: how tilted is the camera, from 10 (near horizontal) to 0.05 (near vertical). We have y/z = 1.0/zscale (with a -1 thrown in if flipped)&lt;br /&gt;
height : how much above the ground is the camera, cannot be negative -- &#039;&#039; it&#039;s absolute height of the camera, ie the camera positions y value, actually (so no difference if cam is above mountain or valley)~~~~&#039;&#039;&lt;br /&gt;
flipped : -1 for when south is down, 1 for when north is down&lt;br /&gt;
&lt;br /&gt;
exemple:&lt;br /&gt;
px, 2000&lt;br /&gt;
py, 70&lt;br /&gt;
pz, 1800&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, 0&lt;br /&gt;
name, ta&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 500&lt;br /&gt;
mode, 1&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Total War style camera&lt;br /&gt;
rz, 0&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
name, tw&lt;br /&gt;
ry, 3.1415927410126&lt;br /&gt;
px, 477.53298950195&lt;br /&gt;
py, 100&lt;br /&gt;
pz, 447.54751586914&lt;br /&gt;
mode, 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Rotatable overhead camera&lt;br /&gt;
name : &amp;quot;rot&amp;quot;&lt;br /&gt;
mode : 3&lt;br /&gt;
px,py,pz : Position of the ground point in screen center (not camera position) -- &#039;&#039; actually it seems to be the camera position to me (I set the height with py, not so sure about the others...) ~~~~&#039;&#039;&lt;br /&gt;
dx,dy,dz : Camera direction vector?&lt;br /&gt;
rx,ry,rz : Camera rotation?&lt;br /&gt;
oldHeight : how much above the ground is the camera, cannot be negative, cannot be changed (I guess it&#039;s just in for when switching to a view that requires it next)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
exemple:&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 600&lt;br /&gt;
pz, 441.25302124023&lt;br /&gt;
rz, 0&lt;br /&gt;
dx, -4.9136563262664e-008&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
name, rot&lt;br /&gt;
ry, 3.1415927410126&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
mode, 3&lt;br /&gt;
dz, -0.56205677986145&lt;br /&gt;
oldHeight, 500&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Free style camera&lt;br /&gt;
avx, 0&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
gravity, -500&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
autoTilt, 2.6179938316345&lt;br /&gt;
dx, -0.011240424588323&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
dz, -0.5619443655014&lt;br /&gt;
py, 964.28167724609&lt;br /&gt;
gndOffset, 16&lt;br /&gt;
gndLock, -1&lt;br /&gt;
goForward, -1&lt;br /&gt;
mode, 4&lt;br /&gt;
tiltSpeed, 2.6179938316345&lt;br /&gt;
velTime, 1.5&lt;br /&gt;
slide, 0.5&lt;br /&gt;
avz, 0&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
invertAlt, -1&lt;br /&gt;
rz, 0&lt;br /&gt;
ry, 3.1615927219391&lt;br /&gt;
avy, 0&lt;br /&gt;
scrollSpeed, 100&lt;br /&gt;
name, free&lt;br /&gt;
fov, 45&lt;br /&gt;
vz, 0&lt;br /&gt;
avelTime, 1&lt;br /&gt;
vx, 0&lt;br /&gt;
vy, 0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Smooth style camera&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 109.49719238281&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, -0.89428168535233&lt;br /&gt;
name, sm&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 500&lt;br /&gt;
mode, 5&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, -0.44714084267616&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Orbit style camera&lt;br /&gt;
tx, 522.32415771484&lt;br /&gt;
ty, 241.19664001465&lt;br /&gt;
name, OrbitController&lt;br /&gt;
tz, 644.45776367188&lt;br /&gt;
px, 522.32415771484&lt;br /&gt;
py, 556.63806152344&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
mode, 6&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to FPS style camera&lt;br /&gt;
px, 1233.4810791016&lt;br /&gt;
py, 554.39453125&lt;br /&gt;
pz, 873.39385986328&lt;br /&gt;
rz, 0&lt;br /&gt;
dx, -0.011240424588323&lt;br /&gt;
dy, -0.82505232095718&lt;br /&gt;
name, fps&lt;br /&gt;
ry, 3.1615927219391&lt;br /&gt;
rx, -0.9727737903595&lt;br /&gt;
mode, 0&lt;br /&gt;
dz, -0.5619443655014&lt;br /&gt;
oldHeight, 300&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Switching to Overhead (TA) style camera&lt;br /&gt;
px, 1324.8835449219&lt;br /&gt;
py, 254.39453125&lt;br /&gt;
pz, 871.56591796875&lt;br /&gt;
flipped, -1&lt;br /&gt;
dy, -0.89428168535233&lt;br /&gt;
name, ta&lt;br /&gt;
zscale, 0.5&lt;br /&gt;
height, 713.52716064453&lt;br /&gt;
mode, 1&lt;br /&gt;
dx, 0&lt;br /&gt;
dz, -0.44714084267616&lt;br /&gt;
&lt;br /&gt;
Now someone go comment that.&lt;br /&gt;
&lt;br /&gt;
It appears that mod eis simply a number containing the same information as name, but while name is a string, mode is an integer between 0 and 6.&lt;br /&gt;
&lt;br /&gt;
I guess px,py,pz could be the postion, while dx,dy,dz could be the direction?&lt;br /&gt;
px,py,pz is the position.&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera/CameraController.cpp#L75&lt;br /&gt;
dx,dy,dz is the directional vector, this determinates where the camera points towards.&lt;br /&gt;
fov is the field of view.&lt;br /&gt;
&lt;br /&gt;
These values are part of the inherited base class, thus apply to all camera controllers.&lt;br /&gt;
rx,ry,rz - are part of a derived class and thus can not be found in all cameras.&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera.cpp#L383&lt;br /&gt;
It denotes the rotation of the camera, found in some camera controllers- theroretically these cameras could tilt and tumble around the viewing direction. In practice, setting the direction - always overrides the rotation.&lt;br /&gt;
&lt;br /&gt;
All the other values are also part of the derived classes. Found here:&lt;br /&gt;
https://github.com/spring/spring/blob/30862626214bd263b1c4489bb197ef1c3dbc0738/rts/Game/Camera/FreeController.cpp#L380&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But what is height? What is zscale? What is flipped? What is oldHeigh? What are rx,ry,rz? Why has orbit no dx,dy,dz but some tx,ty,tz? What about all the free style camera settings? If you know edit that page please!&lt;br /&gt;
&lt;br /&gt;
From testing, I found out flipped invert north/south depending on whether it&#039;s negative or positive.&lt;br /&gt;
&lt;br /&gt;
From testing, I found out zscale is how horizontal/vertical are some camera, 10 for almost horizontal TA overhead, 0.05 for almost vertical TA overhead.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11044</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=11044"/>
		<updated>2018-03-25T11:32:05Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Unit-Specific: */  Do not want to be that grumpy guy- but please do not look into gadgets.lua for the content of callin arguments. Look at the source: https://github.com/spring/spring/blob/d085e297416bd963ec25eaa3dbf0796ba22a3582/rts/Lua/LuaHandleSynce&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
==Engine Source==&lt;br /&gt;
If you can understand Lua code well and wish to get the most up to date info, you can refer to:&lt;br /&gt;
{{sourcelink|file=cont/base/springcontent/LuaGadgets/actions.lua}}, &lt;br /&gt;
{{sourcelink|file=cont/LuaUI/widgets.lua}} and &amp;lt;br&amp;gt;&lt;br /&gt;
{{sourcelink|file=cont/base/springcontent/LuaGadgets/gadgets.lua}} &amp;lt;br&amp;gt;&lt;br /&gt;
to see how widget/gadget call-ins are distributed, find call-in and widgetHandler function definitions, see how they are processed and what values should be returned from some call ins&lt;br /&gt;
(are these the only files?)&lt;br /&gt;
&lt;br /&gt;
==What is a callin anyway?==&lt;br /&gt;
Call-ins are calls from the engine, into the gadget or widget script. In other words, these functions are called when a particular &#039;&#039;event&#039;&#039; happens.&lt;br /&gt;
Some call-in functions can return values to the engine.&lt;br /&gt;
===Blocking events with return values===&lt;br /&gt;
The call-in functions named &#039;&#039;&#039;&#039;&#039;Allow&#039;&#039;&#039;&#039;&#039;XXX can block their event by returning &#039;&#039;false&#039;&#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
For example &#039;&#039;AllowUnitTransfer()&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;return true&amp;lt;/code&amp;gt; = allow transfer &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;return false&amp;lt;/code&amp;gt; = deny transfer&lt;br /&gt;
&lt;br /&gt;
==Commands, general-purpose:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Initialize()&amp;lt;/font&amp;gt; --&amp;gt; none.&amp;lt;br&amp;gt;&lt;br /&gt;
called when widget/gadget gets (re-)loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Shutdown()&amp;lt;/font&amp;gt; --&amp;gt; none.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;PlayerChanged&amp;lt;/font&amp;gt; --&amp;gt; (playerID).&lt;br /&gt;
gadget/widget: Use this to check whether a player has become spectator for instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;LayoutButtons()&amp;lt;/font&amp;gt; --&amp;gt; unknown, please document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ConfigureLayout()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;command&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandNotify()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;id, params, options&amp;quot;, where id = the CommandID&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;KeyPress()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;key, mods, isRepeat&amp;quot;, where key = keymap, mods = SHIFT, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;KeyRelease()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;key&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseMove()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, dx, dy, button&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MousePress()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, button&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;button parameter values: left - 1, middle - 2, right - 3&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{new|&amp;gt;96.0}} buttom param removed  {{Sourcelinkhash|4c104344e92256e33d79820e9012c5e1178e212b}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseRelease()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, button&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Please note that in order to have Spring call MouseRelease, you need to have a MousePress call-in in the same widget that returns true.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MouseWheel()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;up, value&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;IsAbove()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y&amp;quot; where x,y = screen coordinates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;GetTooltip()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y&amp;quot; where x,y = screen coordinates.  Returns WorldTooltip.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AddConsoleLine()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;msg, priority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;MapDrawCmd()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;playerID, cmdType, px, py, pz, labeltext&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandFallback()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;CommandsChanged()&amp;lt;/font&amp;gt; --&amp;gt; unknown (none?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitCreation()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitDefID, builderID, builderTeam, x, y, z, facing&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitTransfer()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, oldTeam, newTeam, capture&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowUnitBuildStep()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;builderID, builderTeam, unitID, unitDefID, part&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowFeatureCreation()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;featureDefID, teamID, x, y, z&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowFeatureBuildStep()&amp;lt;/font&amp;gt; --&amp;gt; unknown, please document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowResourceLevel()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;teamID, res, level&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowResourceTransfer()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;teamID, res, level&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;Update()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;dt&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;called every screenframe. dt is the time since the last screenframe&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;DefaultCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;type,id&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;can return an [[Lua_CMDs|CMD]] to change cursor and command. {{forumlink|topic=26438|title=example usage}}&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;AllowDirectUnitControl(unitID, unitDefID, unitTeam, playerID)   &amp;lt;/font&amp;gt; -&amp;gt; allowFpsControl&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;return true&#039;&#039; allows fps mode, &#039;&#039;return false&#039;&#039; blocks it.&lt;br /&gt;
&lt;br /&gt;
==Unit-Specific:==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(prior to 94.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 94.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Can overwrite the taken damage by returning a new number value.&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
As of 88.0 for both UnitDamaged and UnitPreDamaged:&lt;br /&gt;
     weaponDefID -1 --&amp;gt; debris collision&lt;br /&gt;
     weaponDefID -2 --&amp;gt; ground collision&lt;br /&gt;
     weaponDefID -3 --&amp;gt; object collision&lt;br /&gt;
     weaponDefID -4 --&amp;gt; fire damage&lt;br /&gt;
     weaponDefID -5 --&amp;gt; water damage&lt;br /&gt;
     weaponDefID -6 --&amp;gt; kill damage&lt;br /&gt;
     weaponDefID -7 --&amp;gt; crush damage&lt;br /&gt;
&lt;br /&gt;
As of 96.0 {Unit,Feature}{Pre}Damaged events receive the &#039;attacker&#039; ID when object is crushed&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitExperience()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, experience, oldExperience&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Spring.SetExperienceGrade must be called first to determine how often it is called&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCreated()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, builderID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitFinished()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitFromFactory()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, factID, factDefID, userOrders&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDestroyed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, attackerID, attackerDefID, attackerTeamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitTaken()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, newTeam&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit still belongs to old team&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitGiven()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, oldTeam&amp;quot;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;font color=#dd9944&amp;gt;Unit now belongs to new team&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitIdle()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCommand()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, cmdID, cmdOpts, cmdParams, cmdTag&amp;quot; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(cmdTag only available from version 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitSeismicPing()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;x, y, z, strength&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredRadar()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredLos()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftRadar()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftLos()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLoaded()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, transportID, transportTeam&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitUnloaded()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID, transportID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitCloaked()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitDecloaked)&amp;lt;/font&amp;gt;--&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitMoveFailed()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;font color=#dd9944&amp;gt;Only called for unitDefIDs registered via [[Lua_System#Synced|Script.SetWatchUnit]] since 85.0&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;StockpileChanged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredWater()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitEnteredAir()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftWater()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;UnitLeftAir()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;unitID, unitDefID, teamID&amp;quot;&lt;br /&gt;
&amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;(as of 95.0)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=#55ee99&amp;gt;ShieldPreDamaged()&amp;lt;/font&amp;gt; --&amp;gt; &amp;quot;proID, 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10799</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=10799"/>
		<updated>2018-03-25T11:28:27Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Damage Controllers */&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;
== 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Performance&amp;diff=11556</id>
		<title>Lua Performance</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Performance&amp;diff=11556"/>
		<updated>2017-08-04T15:05:58Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Test 13 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is copied from the [http://trac.caspring.org/wiki/LuaPerformance CA wiki]. The widget used in the performance tests is available from the [http://trac.caspring.org/browser/trunk/mods/ca-sandbox/LuaUI/Widgets/performance.lua CA SVN].&lt;br /&gt;
&lt;br /&gt;
=Other Considerations=&lt;br /&gt;
&lt;br /&gt;
It is a well known axiom in computing that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;quot;We should forget about small efficiencies, say about 97% of the time: &#039;&#039;&#039;premature optimization is the root of all evil&#039;&#039;&#039;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 - [http://en.wikipedia.org/wiki/Donald_Knuth Donald Knuth]&lt;br /&gt;
&lt;br /&gt;
Lua coders should keep that in mind, and especially when visiting this page. Readability and maintainability are in most cases just as important, and optimizing code for every last ounce of performance can severely impact those qualities. On the other hand, some of the optimizations suggested have little bearing on readability and should generally always be applied, e.g. localization of API functions, or actually make for neater code e.g. the use of &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt; rather than a nil-check. Generally speaking, optimize only once you are sure that there is or will be a performance bottleneck.&lt;br /&gt;
&lt;br /&gt;
=Performance Tests=&lt;br /&gt;
&lt;br /&gt;
==TEST 1: Localize==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local min = math.min&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;Non-local: 0.719 (158%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;Localized: 0.453 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Yes, we should localize all standard lua and Spring API functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 2: Localized Class-Methods (with only 3 accesses!)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local x = class.test()&lt;br /&gt;
    local y = class.test()&lt;br /&gt;
    local z = class.test()&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local test = class.test&lt;br /&gt;
    local x = test()&lt;br /&gt;
    local y = test()&lt;br /&gt;
    local z = test()&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Normal way: 1.203 (102%)&lt;br /&gt;
:Localized: 1.172 (100%)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:No, it isn&#039;t faster to localize a class method IN the function call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 3: Unpack A Table==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local x = min( a[1],a[2],a[3],a[4] )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local unpack = unpack&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = min( unpack(a) )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local function unpack4(a)&lt;br /&gt;
    return a[1],a[2],a[3],a[4]&lt;br /&gt;
  end&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = min( unpack4(a) )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;with [ ]: 0.485 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;unpack(): 1.093 (225%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:custom unpack4: 0.641 (131%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;unpack()&amp;lt;/code&amp;gt; in time critical code!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 4: Determine Maximum And Set It (&#039;&amp;gt;&#039; vs. max)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local max = math.max&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
     x = max(random(cnt),x)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local r = random(cnt)&lt;br /&gt;
    if (r&amp;gt;x) then x = r end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;math.max: 0.437 (156%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;&#039;if &amp;gt; then&#039;: 0.282 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;math.[max|min]()&amp;lt;/code&amp;gt; in time critical code!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 5: Nil Checks (&#039;if&#039; vs. &#039;or&#039;)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local y,x&lt;br /&gt;
    if (random()&amp;gt;0.5) then y=1 end &lt;br /&gt;
    if (y==nil) then x=1 else x=y end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local y&lt;br /&gt;
    if (random()&amp;gt;0.5) then y=1 end &lt;br /&gt;
    local x=y or 1&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;nil-check: 0.297 (106%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;a=x or y: 0.281 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:The &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;-operator is faster than a nil-check. Use it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 6: &#039;x^2&#039; vs. &#039;x*x&#039;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
     local y = x^2&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
     local y = x*x&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;x^2: 1.422 (110%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;x*x: 1.297 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:The second syntax is marginally faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 7: Modulus Operators (math.mod vs. %)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local fmod = math.fmod&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    if (fmod(i,30)&amp;lt;1) then&lt;br /&gt;
      local x = 1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    if ((i%30)&amp;lt;1) then&lt;br /&gt;
      local x = 1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;math.mod: 0.281 (355%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;%: 0.079 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;math.fmod()&amp;lt;/code&amp;gt; for positive numbers (for negative ones &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fmod()&amp;lt;/code&amp;gt; have different results!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 8: Functions As Param For Other Functions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local func1 = function(a,b,func) &lt;br /&gt;
    return func(a+b) &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = func1(1,2,function(a) return a*2 end)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local func1 = function(a,b,func) &lt;br /&gt;
    return func(a+b) &lt;br /&gt;
  end&lt;br /&gt;
  local func2 = function(a) &lt;br /&gt;
    return a*2 &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = func1(1,2,func2)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;defined in function param: 3.890 (1144%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;defined as local: 0.344 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:REALLY, LOCALIZE YOUR FUNCTIONS ALWAYS BEFORE SENDING THEM INTO ANOTHER FUNCTION!!! i.e if you use gl.BeginEnd(), gl.CreateList(), ...!!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 9: for-loops==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for j,v in pairs(a) do&lt;br /&gt;
      x=v&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for j,v in ipairs(a) do&lt;br /&gt;
      x=v&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for i=1,100 do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 4:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for i=1,#a do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 5:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local length = #a&lt;br /&gt;
    for i=1,length do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:pairs: 3.078 (217%)&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;ipairs: 3.344 (236%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;for i=1,x do: 1.422 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:for i=1,#atable do 1.422 (100%)&lt;br /&gt;
:for i=1,atable_length do: 1.562 (110%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;pairs()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ipairs()&amp;lt;/code&amp;gt; in critical code! Try to save the table-size somewhere and use &amp;lt;code&amp;gt;for i=1,x do&amp;lt;/code&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 10: Array Access (with [ ]) vs. Object Access (with .method)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    x = a[&amp;quot;foo&amp;quot;]&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    x = a.foo&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:atable[&amp;quot;foo&amp;quot;]: 1.125 (100%)&lt;br /&gt;
:atable.foo: 1.141 (101%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:No difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 11: Buffered Table Item Access==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for n=1,100 do&lt;br /&gt;
      a[n].x=a[n].x+1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for n=1,100 do&lt;br /&gt;
      local y = a[n]&lt;br /&gt;
      y.x=y.x+1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;&#039;a[n].x=a[n].x+1&#039;: 1.453 (127%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;&#039;local y=a[n]; y.x=y.x+1&#039;: 1.140 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Buffering can speed up table item access.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 12: Adding Table Items (table.insert vs. [ ])==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local tinsert = table.insert&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    tinsert(a,i)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    a[i]=i&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    a[#a+1]=i&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 4:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local count = 1&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    d[count]=i&lt;br /&gt;
    count=count+1&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;table.insert: 1.250 (727%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;a[i]: 0.172 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:a[#a+1]=x: 0.453 (263%)&lt;br /&gt;
:a[count++]=x: 0.203 (118%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;table.insert&amp;lt;/code&amp;gt;!!! Try to save the table-size somewhere and use &amp;lt;code&amp;gt;a[count+1]=x&amp;lt;/code&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 12: Adding Table Items (mytable ={} vs. mytable={...})==&lt;br /&gt;
&lt;br /&gt;
When you write {true, true, true} , Lua knows beforehand that the table will need three slots in its array part, so Lua creates the table with that size. Similarly, if you write&lt;br /&gt;
{x = 1, y = 2, z = 3}, Lua will create a table with four slots in its hash part.&lt;br /&gt;
&lt;br /&gt;
As an example, the next loop runs in 2.0 seconds:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;for i = 1, 1000000 do&lt;br /&gt;
&lt;br /&gt;
local a = {}&lt;br /&gt;
&lt;br /&gt;
a[1] = 1; a[2] = 2; a[3] = 3&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we create the tables with the right size, we reduce the run t&lt;br /&gt;
ime to 0.7 seconds:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
for i = 1, 1000000 do&lt;br /&gt;
&lt;br /&gt;
local a = {true, true, true}&lt;br /&gt;
&lt;br /&gt;
a[1] = 1; a[2] = 2; a[3] = 3&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you write something like {[1] = true, [2] = true, [3] = true}, however, Lua is not smart enough to detect that the given expressions (literal numbers, in this case) describe array indices, so it creates a table with four slots in its hash part, wasting memory and CPU time&lt;br /&gt;
&lt;br /&gt;
[http://www.lua.org/gems/sample.pdf]&lt;br /&gt;
&lt;br /&gt;
=Test 13=&lt;br /&gt;
Table initialisation with local members and static intialisation. &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
local x = os.clock()&lt;br /&gt;
T={}&lt;br /&gt;
print(string.format(&amp;quot;start time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
local CachedTable= {&amp;quot;abc&amp;quot;,&amp;quot;def&amp;quot;,&amp;quot;ghk&amp;quot;}&lt;br /&gt;
for i=1 , 10000000, 1 do&lt;br /&gt;
T[i] = CachedTable&lt;br /&gt;
end&lt;br /&gt;
print(string.format(&amp;quot;elapsed time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
local x = os.clock()&lt;br /&gt;
A={}&lt;br /&gt;
print(string.format(&amp;quot;start time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
for i=1 , 10000000, 1 do&lt;br /&gt;
A[i] = {&amp;quot;abc&amp;quot;,&amp;quot;def&amp;quot;,&amp;quot;ghk&amp;quot;}&lt;br /&gt;
end&lt;br /&gt;
print(string.format(&amp;quot;elapsed time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Result:&lt;br /&gt;
local table initializer = 100 %&lt;br /&gt;
static intializer = 500 %&lt;br /&gt;
&lt;br /&gt;
Analysis: Lua sucks at identifying static initializers, do not use them, use local initalizations instead.&lt;br /&gt;
&lt;br /&gt;
=Lua Garbage Collection=&lt;br /&gt;
Forum thread about {{forumlink|topic=31049|title= Lua Garbage collection info}} &lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Performance&amp;diff=11555</id>
		<title>Lua Performance</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Performance&amp;diff=11555"/>
		<updated>2017-08-04T15:04:55Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lua Garbage Collection */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
This page is copied from the [http://trac.caspring.org/wiki/LuaPerformance CA wiki]. The widget used in the performance tests is available from the [http://trac.caspring.org/browser/trunk/mods/ca-sandbox/LuaUI/Widgets/performance.lua CA SVN].&lt;br /&gt;
&lt;br /&gt;
=Other Considerations=&lt;br /&gt;
&lt;br /&gt;
It is a well known axiom in computing that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;quot;We should forget about small efficiencies, say about 97% of the time: &#039;&#039;&#039;premature optimization is the root of all evil&#039;&#039;&#039;&amp;quot;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 - [http://en.wikipedia.org/wiki/Donald_Knuth Donald Knuth]&lt;br /&gt;
&lt;br /&gt;
Lua coders should keep that in mind, and especially when visiting this page. Readability and maintainability are in most cases just as important, and optimizing code for every last ounce of performance can severely impact those qualities. On the other hand, some of the optimizations suggested have little bearing on readability and should generally always be applied, e.g. localization of API functions, or actually make for neater code e.g. the use of &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt; rather than a nil-check. Generally speaking, optimize only once you are sure that there is or will be a performance bottleneck.&lt;br /&gt;
&lt;br /&gt;
=Performance Tests=&lt;br /&gt;
&lt;br /&gt;
==TEST 1: Localize==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local min = math.min&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;Non-local: 0.719 (158%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;Localized: 0.453 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Yes, we should localize all standard lua and Spring API functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 2: Localized Class-Methods (with only 3 accesses!)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local x = class.test()&lt;br /&gt;
    local y = class.test()&lt;br /&gt;
    local z = class.test()&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local test = class.test&lt;br /&gt;
    local x = test()&lt;br /&gt;
    local y = test()&lt;br /&gt;
    local z = test()&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Normal way: 1.203 (102%)&lt;br /&gt;
:Localized: 1.172 (100%)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:No, it isn&#039;t faster to localize a class method IN the function call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 3: Unpack A Table==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local x = min( a[1],a[2],a[3],a[4] )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local unpack = unpack&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = min( unpack(a) )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local function unpack4(a)&lt;br /&gt;
    return a[1],a[2],a[3],a[4]&lt;br /&gt;
  end&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = min( unpack4(a) )&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;with [ ]: 0.485 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;unpack(): 1.093 (225%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:custom unpack4: 0.641 (131%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;unpack()&amp;lt;/code&amp;gt; in time critical code!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 4: Determine Maximum And Set It (&#039;&amp;gt;&#039; vs. max)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local max = math.max&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
     x = max(random(cnt),x)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local r = random(cnt)&lt;br /&gt;
    if (r&amp;gt;x) then x = r end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;math.max: 0.437 (156%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;&#039;if &amp;gt; then&#039;: 0.282 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;math.[max|min]()&amp;lt;/code&amp;gt; in time critical code!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 5: Nil Checks (&#039;if&#039; vs. &#039;or&#039;)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local y,x&lt;br /&gt;
    if (random()&amp;gt;0.5) then y=1 end &lt;br /&gt;
    if (y==nil) then x=1 else x=y end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local y&lt;br /&gt;
    if (random()&amp;gt;0.5) then y=1 end &lt;br /&gt;
    local x=y or 1&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;nil-check: 0.297 (106%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;a=x or y: 0.281 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:The &amp;lt;code&amp;gt;or&amp;lt;/code&amp;gt;-operator is faster than a nil-check. Use it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 6: &#039;x^2&#039; vs. &#039;x*x&#039;==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
     local y = x^2&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
     local y = x*x&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;x^2: 1.422 (110%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;x*x: 1.297 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:The second syntax is marginally faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 7: Modulus Operators (math.mod vs. %)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local fmod = math.fmod&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    if (fmod(i,30)&amp;lt;1) then&lt;br /&gt;
      local x = 1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    if ((i%30)&amp;lt;1) then&lt;br /&gt;
      local x = 1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;math.mod: 0.281 (355%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;%: 0.079 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;math.fmod()&amp;lt;/code&amp;gt; for positive numbers (for negative ones &amp;lt;code&amp;gt;%&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;fmod()&amp;lt;/code&amp;gt; have different results!)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 8: Functions As Param For Other Functions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local func1 = function(a,b,func) &lt;br /&gt;
    return func(a+b) &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = func1(1,2,function(a) return a*2 end)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local func1 = function(a,b,func) &lt;br /&gt;
    return func(a+b) &lt;br /&gt;
  end&lt;br /&gt;
  local func2 = function(a) &lt;br /&gt;
    return a*2 &lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    local x = func1(1,2,func2)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;defined in function param: 3.890 (1144%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;defined as local: 0.344 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:REALLY, LOCALIZE YOUR FUNCTIONS ALWAYS BEFORE SENDING THEM INTO ANOTHER FUNCTION!!! i.e if you use gl.BeginEnd(), gl.CreateList(), ...!!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 9: for-loops==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for j,v in pairs(a) do&lt;br /&gt;
      x=v&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for j,v in ipairs(a) do&lt;br /&gt;
      x=v&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for i=1,100 do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 4:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for i=1,#a do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 5:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    local length = #a&lt;br /&gt;
    for i=1,length do&lt;br /&gt;
      x=a[i]&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:pairs: 3.078 (217%)&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;ipairs: 3.344 (236%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;for i=1,x do: 1.422 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:for i=1,#atable do 1.422 (100%)&lt;br /&gt;
:for i=1,atable_length do: 1.562 (110%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;pairs()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ipairs()&amp;lt;/code&amp;gt; in critical code! Try to save the table-size somewhere and use &amp;lt;code&amp;gt;for i=1,x do&amp;lt;/code&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 10: Array Access (with [ ]) vs. Object Access (with .method)==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    x = a[&amp;quot;foo&amp;quot;]&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    x = a.foo&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:atable[&amp;quot;foo&amp;quot;]: 1.125 (100%)&lt;br /&gt;
:atable.foo: 1.141 (101%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:No difference.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 11: Buffered Table Item Access==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for n=1,100 do&lt;br /&gt;
      a[n].x=a[n].x+1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    for n=1,100 do&lt;br /&gt;
      local y = a[n]&lt;br /&gt;
      y.x=y.x+1&lt;br /&gt;
    end&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;&#039;a[n].x=a[n].x+1&#039;: 1.453 (127%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;&#039;local y=a[n]; y.x=y.x+1&#039;: 1.140 (100%) &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:Buffering can speed up table item access.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 12: Adding Table Items (table.insert vs. [ ])==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 1:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local tinsert = table.insert&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    tinsert(a,i)&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 2:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    a[i]=i&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 3:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  for i=1,1000000 do&lt;br /&gt;
    a[#a+1]=i&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Code 4:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;  local count = 1&lt;br /&gt;
  for i=1,1000000 do&lt;br /&gt;
    d[count]=i&lt;br /&gt;
    count=count+1&lt;br /&gt;
  end&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Results:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;span class=warning&amp;gt;table.insert: 1.250 (727%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:&amp;lt;span class=note&amp;gt;a[i]: 0.172 (100%)&amp;lt;/span&amp;gt;&lt;br /&gt;
:a[#a+1]=x: 0.453 (263%)&lt;br /&gt;
:a[count++]=x: 0.203 (118%) &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Conclusion:&#039;&#039;&#039;&lt;br /&gt;
:Don&#039;t use &amp;lt;code&amp;gt;table.insert&amp;lt;/code&amp;gt;!!! Try to save the table-size somewhere and use &amp;lt;code&amp;gt;a[count+1]=x&amp;lt;/code&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TEST 12: Adding Table Items (mytable ={} vs. mytable={...})==&lt;br /&gt;
&lt;br /&gt;
When you write {true, true, true} , Lua knows beforehand that the table will need three slots in its array part, so Lua creates the table with that size. Similarly, if you write&lt;br /&gt;
{x = 1, y = 2, z = 3}, Lua will create a table with four slots in its hash part.&lt;br /&gt;
&lt;br /&gt;
As an example, the next loop runs in 2.0 seconds:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;for i = 1, 1000000 do&lt;br /&gt;
&lt;br /&gt;
local a = {}&lt;br /&gt;
&lt;br /&gt;
a[1] = 1; a[2] = 2; a[3] = 3&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we create the tables with the right size, we reduce the run t&lt;br /&gt;
ime to 0.7 seconds:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
for i = 1, 1000000 do&lt;br /&gt;
&lt;br /&gt;
local a = {true, true, true}&lt;br /&gt;
&lt;br /&gt;
a[1] = 1; a[2] = 2; a[3] = 3&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you write something like {[1] = true, [2] = true, [3] = true}, however, Lua is not smart enough to detect that the given expressions (literal numbers, in this case) describe array indices, so it creates a table with four slots in its hash part, wasting memory and CPU time&lt;br /&gt;
&lt;br /&gt;
[http://www.lua.org/gems/sample.pdf]&lt;br /&gt;
&lt;br /&gt;
=Test 13=&lt;br /&gt;
Table initialisation with local members and static intialisation. &lt;br /&gt;
local x = os.clock()&lt;br /&gt;
T={}&lt;br /&gt;
print(string.format(&amp;quot;start time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
local CachedTable= {&amp;quot;abc&amp;quot;,&amp;quot;def&amp;quot;,&amp;quot;ghk&amp;quot;}&lt;br /&gt;
for i=1 , 10000000, 1 do&lt;br /&gt;
T[i] = CachedTable&lt;br /&gt;
end&lt;br /&gt;
print(string.format(&amp;quot;elapsed time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
&lt;br /&gt;
local x = os.clock()&lt;br /&gt;
A={}&lt;br /&gt;
print(string.format(&amp;quot;start time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
for i=1 , 10000000, 1 do&lt;br /&gt;
A[i] = {&amp;quot;abc&amp;quot;,&amp;quot;def&amp;quot;,&amp;quot;ghk&amp;quot;}&lt;br /&gt;
end&lt;br /&gt;
print(string.format(&amp;quot;elapsed time: %.2f\n&amp;quot;, os.clock() - x))&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
local table initializer = 100 %&lt;br /&gt;
static intializer = 500 %&lt;br /&gt;
&lt;br /&gt;
Analysis: Lua sucks at identifying static initializers, do not use them, use local initalizations instead.&lt;br /&gt;
&lt;br /&gt;
=Lua Garbage Collection=&lt;br /&gt;
Forum thread about {{forumlink|topic=31049|title= Lua Garbage collection info}} &lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2102</id>
		<title>Animation-LuaScripting</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2102"/>
		<updated>2017-04-22T23:56:51Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;Picassoct: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
A Comprehensive list of tools to make Spring content.&lt;br /&gt;
&lt;br /&gt;
*Those that are Open Source are marked with a &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&lt;br /&gt;
*Those that are Free are marked with a &amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&lt;br /&gt;
*Those that Cost are marked with a &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Image Editing ===&lt;br /&gt;
# &#039;&#039;&#039;[http://krita.org/ Krita]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt; digital painting application, cross platform, with 16bit image support.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.gimp.org Gimp]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&lt;br /&gt;
# &#039;&#039;&#039;[http://www.adobe.com/products/photoshop/main.html Adobe Photoshop]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The most widely used image editing program ever.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.getpaint.net Paint.NET]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Basically an expanded version of Paint. Contains many functions such as layers, and is much easier to use then The Gimp.&lt;br /&gt;
&lt;br /&gt;
=== 3d Modeling ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[http://blender.org Blender]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;FREE-&amp;gt; The most used open-source modeller that has its own way of doing things.&lt;br /&gt;
Now features animation export for dae and s3o.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.wings3d.com/ Wings 3D]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;FREE-&amp;gt; Probably the most popular modeller for Spring.&amp;lt;br&amp;gt;-&amp;gt; Easy to learn modelling and UV mapping environments.&amp;lt;br&amp;gt;-&amp;gt; Excellent introduction to using it can be found [http://www.wings3d.com/doghouse.php here]. &amp;lt;br&amp;gt;-&amp;gt; For help on how to UV map with it just ask around.low poly&lt;br /&gt;
# &#039;&#039;&#039;[http://www.anim8or.com/main/index.html Anim8or]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[http://www.autodesk.com/products/autodesk-3ds-max/overview 3DS MAX]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The most widely used and acclaimed modelling program ever. Used in creation of many games and movies (The Matrix). One of the three major modelling programs used by professionals.&amp;lt;br&amp;gt;-&amp;gt; The s3o plugin for 3DS MAX can be found here. NOTE: This is not backwards compatible with versions prior to 7. Also this only exports: &#039;&#039;&#039;[http://taspring.clan-sy.com/temp/s3oexport.dle broken link fix if possible]&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[https://www.lightwave3d.com Lightwave]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; A popular modelling program that&#039;s been around a long time. One of the three major modelling programs used by professionals.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.rhino3d.com/ Rhinoceros]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Uses a lot of nurbs surfaces. &lt;br /&gt;
# &#039;&#039;&#039;[http://www.turbosquid.com/gmax GMAX]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Great for learning as it is 3DS MAX v4 without rendering and has game packs for a fair amount of games. It is locked in exporting however there are a few workarounds.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.autodesk.com/products/autodesk-maya/overview MAYA]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The other most widely used and acclaimed modeling program. Used in creation of many games and movies. One of the three major model programs used by professionals.&lt;br /&gt;
&lt;br /&gt;
===3d Model converters/Assemblers===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[[upspring|UpSpring]]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Help, information, manual and tips can be found here: &#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2839&amp;amp;start=0 Forum]&amp;lt;br&amp;gt;-&amp;gt; This is the only other way to get files into the [[About_s3o|s3o]] file format for Spring other then the [[About_s3o|s3o]] plugin for 3DS MAX.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=9&amp;amp;t=28156 S3O &amp;lt;-&amp;gt; OBJ Converter]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Sound/Audio Editors and Recorders===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[http://audacity.sourceforge.net/ Audacity]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Audacity is a free, easy-to-use audio editor and recorder for Windows, Mac OS X, GNU/Linux, and other operating systems.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.goldwave.com/ GoldWave]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; GoldWave is a commercial digital audio editing software developed by GoldWave Inc for Windows. It was first released to public in April 1993, and is similar to applications like the open source Audacity.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.sonycreativesoftware.com/products/soundforgefamily.asp Sound Forge]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The Sound Forge is an digital audio production suite includes everything you need to quickly get from raw audio to finished master. Use this suite to create and edit stereo and multichannel audio files with speed and precision. Efficiently analyze, record and edit audio, digitize and restore old recordings, model acoustic environments, design sound for multimedia, and master replication-ready CDs.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.speech.kth.se/wavesurfer/ WaveSurfer]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Wavesurfer is an audio editor widely used for studies of acoustic phonetics. Wavesurfer provides basic audio editing operations, such as excision, copying, pasting, zero-crossing adjustment, and effects such as fading, normalization, echo, inversion, reversal, replacement with silence, and DC-removal, but, in view of its scientific orientation, does not offer effects of interest to musicians such as flange.&lt;br /&gt;
&lt;br /&gt;
=== Scripting And Unit Stats files ===&lt;br /&gt;
# &#039;&#039;&#039;[http://springfiles.com/spring/tools/scriptor-v1 Scriptor]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The by far best compiler for your handmade .bos scripts into endless lines of letters and numbers that the TA engine reads. The program is large, easy to operate and with broad error tracing (well, better than the other two alternatives). While other versions of this program sometimes refuse to compile on-off functions, this download is guaranteed to work in every condition.&lt;br /&gt;
# &#039;&#039;&#039;[http://springfiles.com/spring/tools/cobbler-v4 Cobbler]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; This is a very simple script compiler that converts your newly written .bos files understood by humans into a hexadecimal .cob gibberish used by the TA engine. Beware, however, that this program may fail to compile some perfectly valid scripts and it doesn&#039;t always tell where the alleged error lies either. Parts of the program are in French.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=9&amp;amp;t=24702&amp;amp;p=460639 Servo]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Rhad&#039;s awesome but somewhat buggy animation scripting program. It features keyframed animation script generation from a 3D positioner.&lt;br /&gt;
# &#039;&#039;&#039;[https://github.com/Anarchid/blender2lus blender2lus]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; A Blender addon that allows Spring lua unitscripts (for assimp models only) to be authored in Blender, with (almost) all the goodies involved therein.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=14&amp;amp;t=25104 Spring Poser by knorke]&#039;&#039;&#039;  A not-yet-so-usefull gadget-widget-unitscript brewage that allows you to &amp;quot;pose&amp;quot; units by moving &amp;amp; rotating their pieces. It can then save the posed position as a list of Move &amp;amp; Turn commands.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=23&amp;amp;t=24499 CEG Browser/Spawn by CarRepairer]&#039;&#039;&#039; Spawn particle effects from a menu, ie if you want to reuse effects from another game.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=23&amp;amp;t=25847 piece tree widget]&#039;&#039;&#039; Print an ascii view of a units piece hierachy. Might be usefull to create notes for scripting.&lt;br /&gt;
# &#039;&#039;&#039;[http://springrts.com/phpbb/viewtopic.php?f=67&amp;amp;t=23391 bos2lua converter page by CarRepairer]&#039;&#039;&#039; Converts .bos scripts to .lua scripts.&lt;br /&gt;
# &#039;&#039;&#039;[[ToolBox]]&#039;&#039;&#039; A game-mutator with some tools for modding. Contains newest version of some of the above scripts plus others.&lt;br /&gt;
&lt;br /&gt;
=== Map Creation ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[[Maps:SpringMapEdit|SpringMapEdit]]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Our very own complete map making solution, created by Frostregen.&lt;br /&gt;
# &#039;&#039;&#039;[http://www.springfiles.com/show_file.php?id=2441 Beherith&#039;s mapconv]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; The latest map compiler, supports all features of maps while still retaining backwards compatibility with previous scripts. &lt;br /&gt;
# &#039;&#039;&#039;[http://taspring.clan-sy.com/phpbb/viewtopic.php?t=2420 SMD Creator]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Maelstroms SMD creator&lt;br /&gt;
# &#039;&#039;&#039;[http://www.bundysoft.com/L3DT/ L3DT Large 3D Terrain Generator]&#039;&#039;&#039;&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;*&amp;lt;/font&amp;gt;&amp;lt;br&amp;gt;-&amp;gt; Commercial Map Maker, standard version is free, but pro version requires payment but includes all the tools required to make an SD7 Spring map from scratch.&lt;br /&gt;
#  &#039;&#039;&#039;[http://code.google.com/p/conflictterra/wiki/MapsAndRocks#Coordinate_Helper_Widget Coordinate helper widget]&#039;&#039;&#039; Need to find lots of coordinates, for example to position units? Log the coordinates into a file just by placing markers, no more pen&amp;amp;paper!&lt;br /&gt;
#  &#039;&#039;&#039;[http://www.world-machine.com/ World Machine]&#039;&#039;&#039; Commercial terrain generation software, can output height and diffuse textures.&lt;br /&gt;
#  &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Bryce_(software) Bryce3D]&#039;&#039;&#039; Shareware terrain generation software.&lt;br /&gt;
#  &#039;&#039;&#039;[http://en.wikipedia.org/wiki/Carrara_(software) Carrara]&#039;&#039;&#039; Shareware 3D software.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12317</id>
		<title>Lua UnsyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12317"/>
		<updated>2016-11-26T16:29:41Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Sun */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: Prior to 102.0, entries below marked &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt; require the setting ModUICtrl to be enabled in the users [[springrc]], if you want to use them in unsynced LuaRules/LuaGaia. It is enabled by default in previous versions and removed in 102.0 so you generally don&#039;t need to care.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLastMessagePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Ingame Console =&lt;br /&gt;
&#039;&#039;&#039;Spring.Echo&#039;&#039;&#039;&lt;br /&gt;
  ( arg1 [, arg2 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Useful for debugging.&amp;lt;br&amp;gt; Prints values in the spring chat console.&amp;lt;br&amp;gt; Hint: the default print() writes to STDOUT.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Log&#039;&#039;&#039;&lt;br /&gt;
  ( string section, int logLevel | string logLevel,&lt;br /&gt;
    arg2 [, arg3 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Possible values for logLevel are:&lt;br /&gt;
    &amp;quot;debug&amp;quot;   | LOG.DEBUG&lt;br /&gt;
    &amp;quot;info&amp;quot;    | LOG.INFO&lt;br /&gt;
    &amp;quot;notice&amp;quot;  | LOG.NOTICE (engine default) {{new|97}}&lt;br /&gt;
    &amp;quot;warning&amp;quot; | LOG.WARNING&lt;br /&gt;
    &amp;quot;error&amp;quot;   | LOG.ERROR&lt;br /&gt;
    &amp;quot;fatal&amp;quot;   | LOG.FATAL&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendCommands&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string command1 [, string command2 [ ... ] ] ) -&amp;gt; nil&lt;br /&gt;
  ( {string command1, string command2, ...} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== GUI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetActiveCommand&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string action [, string actionExtra ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  ( number cmdIndex [, number button = 1&lt;br /&gt;
    [, boolean leftClick, boolean rightClick,&lt;br /&gt;
     boolean alt, boolean ctrl, boolean meta, boolean shift]] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCmdColorsConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCtrlPanelConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ForceLayoutUpdate&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;disables the &amp;quot;Selected Units x&amp;quot; box in the GUI&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Mouse ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMouseCursor&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string cursorName [, number scale ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.WarpMouse&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== LOS Colors ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLosViewColors&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;New arguments since 100.0 (radar2 is the inside of radar edge):&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( always = {r,g,b}, LOS = {r,g,b}, radar = {r,g,b}, jam = {r,g,b}, radar2 = {r,g,b}) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;Arguments for 99.0 and before:&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table reds = { number always, number LOS, number radar, number jam }, &lt;br /&gt;
    table greens = { number always, number LOS, number radar, number jam },&lt;br /&gt;
    table blues = { number always, number LOS, number radar, number jam } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== SendMessage ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessage&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToPlayer&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToAllyTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number allyID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToSpectators&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
Funfact:&lt;br /&gt;
&amp;lt;PLAYER#&amp;gt; (with # being a playerid) inside the string will be replaced with the players name.&lt;br /&gt;
ie&lt;br /&gt;
Spring.SendMessage (&amp;quot;&amp;lt;PLAYER1&amp;gt; did something&amp;quot;)&lt;br /&gt;
might display as &amp;quot;ProRusher did something&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Markers ==&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddPoint&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z [, string text = &amp;quot;&amp;quot; [, bool localOnly] ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddLine&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number z1, number x2, number y2, number z2 ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerErasePosition&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sounds =&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadSoundDef&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; ) -&amp;gt; nil | boolean success&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Loads a SoundDefs file, the format is the same as in `gamedata/sounds.lua`.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundFile&#039;&#039;&#039;  &amp;lt;span class=note&amp;gt;Plays WAV or OGG sounds.&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, number posx, number posy, number posz &lt;br /&gt;
    [, number speedx, number speedy, number speedz ] ] ], [string/number &amp;lt;span class=note&amp;gt;channel&amp;lt;/span&amp;gt; ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`channel` is new in Spring0.83, and can be one of those:&lt;br /&gt;
    &amp;quot;general&amp;quot; || 0 || nil (default)&lt;br /&gt;
    &amp;quot;battle&amp;quot; || &amp;quot;sfx&amp;quot; | 1&lt;br /&gt;
    &amp;quot;unitreply&amp;quot; || &amp;quot;voice&amp;quot; || 2&lt;br /&gt;
    &amp;quot;userinterface&amp;quot; || &amp;quot;ui&amp;quot; || 3&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;oggfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, bool enqueue ]] ) -&amp;gt; nil | boolean true&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Allow you to play an Ogg Vorbis (.OGG) compressed sound file.&amp;lt;br&amp;gt; In 83.0 and up multiple sound streams may be played at once &amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.StopSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Terminates any SoundStream currently running.&amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.PauseSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSoundStreamVolume&#039;&#039;&#039;&lt;br /&gt;
  ( number volume ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= SendLuaMessage =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Very important! (allows synced inter-lua-enviroment communications)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaUIMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message, string mode ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;possible modes are:&amp;lt;br&amp;gt;&amp;quot;s&amp;quot;/&amp;quot;specs&amp;quot; &amp;amp; &amp;quot;a&amp;quot;/&amp;quot;allies&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaGaiaMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaRulesMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= AI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SendSkirmishAIMessage&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number aiTeam, string message )&lt;br /&gt;
  -&amp;gt; nil | boolean ai_processed, { [1] = string response1, etc... }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note there is nothing in this table due to &amp;quot;limitations&amp;quot; of the AI interface.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Units =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLeaveTracks&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean leavetracks ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Selection ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( { [unitID] = anything, ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( { [1] = unitID1 , [2] = unitID2 , ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSelectionInfo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Group ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitGroup&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number groupID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Give Order ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrder&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;gives order to all selected units&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    },&lt;br /&gt;
    [boolean pairwise]&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;pairwise param ({{new|89.0}}) is used to send multiple units a single individual command&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Facing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildSpacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Spacing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit NoDraw,NoSelect,NoMinimap ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoSelect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoMinimap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noMinimap ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureFade&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( int featureID, bool allow ) -&amp;gt; nil&lt;br /&gt;
Control whether a feature will fade or not when zoomed out.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSky&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSky ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawWater&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawWater ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGround&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawGround ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWaterParams&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs cheating enabled!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Allows to change water params (mostly BumpWater ones) at runtime. You may want to set BumpWaterUseUniforms in your [[springrc]] to 1, then you don&#039;t even need to restart BumpWater via `/water 4`.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`params` table may contain:&lt;br /&gt;
  params = {&lt;br /&gt;
    absorb = {number r, number g, number b},&lt;br /&gt;
    baseColor = {number r, number g, number b},&lt;br /&gt;
    minColor = {number r, number g, number b},&lt;br /&gt;
    surfaceColor = {number r, number g, number b},&lt;br /&gt;
    diffuseColor = {number r, number g, number b},&lt;br /&gt;
    specularColor = {number r, number g, number b},&lt;br /&gt;
    planeColor = {number r, number g, number b},&lt;br /&gt;
    texture = string file,&lt;br /&gt;
    foamTexture = string file,&lt;br /&gt;
    normalTexture = string file,&lt;br /&gt;
    damage = number value,&lt;br /&gt;
    repeatX = number value,&lt;br /&gt;
    repeatY = number value,&lt;br /&gt;
    surfaceAlpha = number value,&lt;br /&gt;
    ambientFactor = number value,&lt;br /&gt;
    diffuseFactor = number value,&lt;br /&gt;
    specularFactor = number value,&lt;br /&gt;
    specularPower = number value,&lt;br /&gt;
    fresnelMin = number value,&lt;br /&gt;
    fresnelMax = number value,&lt;br /&gt;
    fresnelPower = number value,&lt;br /&gt;
    reflectionDistortion = number value,&lt;br /&gt;
    blurBase = number value,&lt;br /&gt;
    blurExponent = number value,&lt;br /&gt;
    perlinStartFreq = number value,&lt;br /&gt;
    perlinLacunarity = number value,&lt;br /&gt;
    perlinAmplitude = number value,&lt;br /&gt;
    numTiles = number value,&lt;br /&gt;
    shoreWaves = boolean value,&lt;br /&gt;
    forceRendering = boolean value,&lt;br /&gt;
    hasWaterPlane = boolean value,&lt;br /&gt;
  }&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLogSectionFilterLevel&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   (string sectionName, string|number logLevel)&lt;br /&gt;
see [[infolog.txt]] for possible log sections (?)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGroundDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    ( boolean drawGroundDeferred [, boolean drawGroundForward] ) -&amp;gt; nil&lt;br /&gt;
{{new|101.0}} {{var|drawGroundForward}} allows disabling of the forward pass&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawModelsDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    (     boolean drawUnitsDeferred,&lt;br /&gt;
          boolean drawFeaturesDeferred&lt;br /&gt;
       [, boolean drawUnitsForward&lt;br /&gt;
       [, boolean drawFeaturesForward ]]&lt;br /&gt;
     ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} {{var|drawFeaturesForward}}, {{var|drawUnitsForward}} allows disabling of the respective forward passes&lt;br /&gt;
&lt;br /&gt;
= GUI =&lt;br /&gt;
&#039;&#039;&#039;Spring.DrawUnitCommands&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
  ( { [1] = unitID, ... } [, false ] ) -&amp;gt; nil&lt;br /&gt;
  ( { [unitID] = anything, ... }, true  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;changes/creates the cursor of a single CursorCmd&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;cmdName&amp;quot;, string &amp;quot;iconFileName&amp;quot;&lt;br /&gt;
    [, boolean overwrite = true [, boolean hotSpotTopLeft = false] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font class=note&amp;gt;Note, that iconFileName is not the full filename instead it is like this:&amp;lt;br/&amp;gt;&lt;br /&gt;
wanted filename: Anims/cursorattack_0.bmp&amp;lt;br/&amp;gt;&lt;br /&gt;
=&amp;gt; iconFileName: cursorattack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ReplaceMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;mass replace all occurrence of the cursor in all CursorCmds&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;oldFileName&amp;quot;, string &amp;quot;newFileName&amp;quot; [, boolean hotSpotTopLeft = false] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCustomCommandDrawData&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;register your custom cmd so it gets visible in the unit&#039;s cmd queue&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number cmdID,&lt;br /&gt;
    number cmdID_cloneIcon | string iconname,&lt;br /&gt;
    { number r, number g, number b, number a } [, boolean showArea ] ) -&amp;gt; nil&lt;br /&gt;
  ( number cmdID, nil) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sharing =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetShareLevel&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: shareLevel is 0&amp;lt;= x &amp;lt;= 1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number shareLevel ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareResources&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number teamID, string &amp;quot;units&amp;quot; ) -&amp;gt; nil&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;
= UnitDef RadarIcons &amp;amp; BuildPics =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName, string texFile [, number size [, number dist [, boolean radAdjust ]]] )&lt;br /&gt;
  -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.FreeUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefIcon&#039;&#039;&#039;  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(RadarIcon)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, string iconName ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefImage&#039;&#039;&#039;   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(BuildPic)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, luaTexture | string texFile ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Camera =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraState&#039;&#039;&#039;&lt;br /&gt;
  ( table camState, number camTime) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;camState has the same format as the output of Spring.GetCameraState(). See [[Lua_camState]] for details about camState. &lt;br /&gt;
&lt;br /&gt;
The camState&#039;s mode/name must fit the rest of the state. Getting a state, changing its mode/name and then passing it to SetCameraState will have undesired results. [https://springrts.com/mantis/view.php?id=5028#c15491 Also see #5028]&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraTarget&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z [,number transTime] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;For Spring Engine XZ represents horizontal, from north west corner of map and Y vertical, from water level and rising.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraOffset&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( [number px = 0 [, number py = 0 [, number pz = 0&lt;br /&gt;
     [, number tx = 0 [, number ty = 0 [, number tz = 0]]]]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= (Virtual-)FileSystem =&lt;br /&gt;
&#039;&#039;&#039;Spring.ExtractModArchiveFile&#039;&#039;&#039;&lt;br /&gt;
  ( string modfile ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateDir&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number path ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
The full VFS API is available at [[Lua_VFS|link]].&lt;br /&gt;
&lt;br /&gt;
= Engine Config =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The following functions read the engine configs saved in [[springrc]], a version-ed instance of these or a custom file supplied on the command line.&lt;br /&gt;
If &#039;&#039;*Overlay&#039;&#039; is &#039;&#039;true&#039;&#039;, the value will only be set in memory, and not be restored for the next game&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, number default [, boolean setInOverlay = false]] ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, number value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, string default [, boolean setInOverlay = false]] ) -&amp;gt; nil | string&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, string value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= World Primitives =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;outdated! use opengl api instead!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldIcon&#039;&#039;&#039;&lt;br /&gt;
  ( number cmdID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldText&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot;, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    number team, number facing) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sun  =&lt;br /&gt;
The dynamic Sun must be invoked via /dynamicsun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunManualControl&#039;&#039;&#039;&lt;br /&gt;
  ( boolean setManualControl ) - &amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunParameters&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ, number dist, number startTime, number orbitTime ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunLighting&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following sun lighting parameters: &lt;br /&gt;
     {ground,unit}{Ambient,Diffuse,Specular}Color and specularExponent&lt;br /&gt;
     All Colourvalues have to in the Range from 0.0 to 255.0 for all colors and the alpha&lt;br /&gt;
     Example usage: Spring.SetSunLighting({groundAmbientColor = {1, 0.1, 1}, groundDiffuseColor = {1, 0.1, 1} })&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following atmosphere parameters:&lt;br /&gt;
     fog{Start,End}, {sun,sky,cloud}Color&lt;br /&gt;
     Example usage: Spring.SetAtmosphere({ fogStart = 0, fogEnd   = 0.5, fogColor = { 0.7, 0.2, 0.2, 1 }})&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Misc =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Reload&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( string startscript )&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Restart&#039;&#039;&#039; {{new|0.79}}&lt;br /&gt;
  ( string commandline_args, string startscript )&lt;br /&gt;
    -&amp;gt; if this call returns, something went wrong&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;commandline_args&#039;&#039; are commandline arguments passed to spring executable&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start (if empty, no start-script is added, you can still point spring to your custom script.txt when you add the file-path to &#039;&#039;commandline_args&#039;&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMIcon&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string iconFileName ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the icon for the process which is seen in the OS task-bar and other places (default: spring-logo).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: has to be 24bit or 32bit&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: on windows, it has to be 32x32 pixels in size (recommended for cross-platform)&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.bmp&#039;&#039; images have to be in BGR format (default for m$ ones).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.ico&#039;&#039; images are not supported.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMCaption&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string title [, string titleShort = title ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the window &#039;&#039;title&#039;&#039; for the process (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The &#039;&#039;shortTitle&#039;&#039; is displayed in the OS task-bar (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &#039;&#039;shortTitle&#039;&#039; is only ever possibly used under X11 (Linux &amp;amp; OS X), but not with QT (KDE) and never under Windows. See [http://www.gpwiki.org/index.php/SDL:Tutorials:Initializing_SDL_Libraries#About_the_icon_.28.22Icon_Title.22.29_parameter_on_different_window-managers this site] for more details.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearWatchdogTimer&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( [ string threadName = main ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetClipboard&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string text) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Rendering =&lt;br /&gt;
== Preload ==&lt;br /&gt;
Allow the engine to load the unit&#039;s model (and texture) in a background thread. Wreckages and buildOptions of a unit are automatically preloaded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadUnitDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadFetureDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Lighting ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;NOTE: these (0.83+) lighting callouts only work when called from unsynced gadgets!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddMapLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicMapLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&#039;&#039;&#039;Spring.AddModelLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicModelLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateMapLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateModelLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.SetModelLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;lightParams&#039;&#039;&#039; is a table that should contain at least one of the following recognized key/value pairs:&lt;br /&gt;
&lt;br /&gt;
    lightParams = {&lt;br /&gt;
        position = {px, py, pz},&lt;br /&gt;
        direction = {dx, dy, dz},&lt;br /&gt;
        ambientColor = {red, green, blue},&lt;br /&gt;
        diffuseColor = {red, green, blue},&lt;br /&gt;
        specularColor = {red, green, blue},&lt;br /&gt;
        intensityWeight = {ambientWeight, diffuseWeight, specularWeight},&lt;br /&gt;
&lt;br /&gt;
        -- per-frame decay of ambientColor (spread over TTL frames)&lt;br /&gt;
        ambientDecayRate = {ambientRedDecay, ambientGreenDecay, ambientBlueDecay},&lt;br /&gt;
        -- per-frame decay of diffuseColor (spread over TTL frames)&lt;br /&gt;
        diffuseDecayRate = {diffuseRedDecay, diffuseGreenDecay, diffuseBlueDecay},&lt;br /&gt;
        -- per-frame decay of specularColor (spread over TTL frames)&lt;br /&gt;
        specularDecayRate = {specularRedDecay, specularGreenDecay, specularBlueDecay},&lt;br /&gt;
        -- *DecayType = 0.0 -&amp;gt; interpret *DecayRate values as linear, else as exponential&lt;br /&gt;
        decayFunctionType = {ambientDecayType, diffuseDecayType, specularDecayType},&lt;br /&gt;
&lt;br /&gt;
        radius = number elmos,&lt;br /&gt;
        fov = number degrees,&lt;br /&gt;
        ttl = number frames,&lt;br /&gt;
        priority = number,&lt;br /&gt;
        ignoreLOS = boolean,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
= Map =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSkyBoxTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texName ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShadingTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texType, string texName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;Example usage: Spring.SetMapShadingTexture(&amp;quot;$ssmf_specular&amp;quot;, &amp;quot;name_of_my_shiny_texture&amp;quot;)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTexture&#039;&#039;&#039;&lt;br /&gt;
  ( number texSqrX, number texSqrY, string luaTexName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShader&#039;&#039;&#039; {{101.0}}&lt;br /&gt;
  ( number standardShaderID, number deferredShaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;The ID&#039;s must refer to valid programs returned by gl.CreateShader. Passing in a value of 0 will cause the respective shader to revert back to its engine default. Custom map shaders that declare a uniform ivec2 named &amp;quot;texSquare&amp;quot; can sample from the default diffuse texture(s), which are always bound to TU 0.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12316</id>
		<title>Lua UnsyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12316"/>
		<updated>2016-11-26T12:34:11Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Sun */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: Prior to 102.0, entries below marked &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt; require the setting ModUICtrl to be enabled in the users [[springrc]], if you want to use them in unsynced LuaRules/LuaGaia. It is enabled by default in previous versions and removed in 102.0 so you generally don&#039;t need to care.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLastMessagePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Ingame Console =&lt;br /&gt;
&#039;&#039;&#039;Spring.Echo&#039;&#039;&#039;&lt;br /&gt;
  ( arg1 [, arg2 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Useful for debugging.&amp;lt;br&amp;gt; Prints values in the spring chat console.&amp;lt;br&amp;gt; Hint: the default print() writes to STDOUT.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Log&#039;&#039;&#039;&lt;br /&gt;
  ( string section, int logLevel | string logLevel,&lt;br /&gt;
    arg2 [, arg3 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Possible values for logLevel are:&lt;br /&gt;
    &amp;quot;debug&amp;quot;   | LOG.DEBUG&lt;br /&gt;
    &amp;quot;info&amp;quot;    | LOG.INFO&lt;br /&gt;
    &amp;quot;notice&amp;quot;  | LOG.NOTICE (engine default) {{new|97}}&lt;br /&gt;
    &amp;quot;warning&amp;quot; | LOG.WARNING&lt;br /&gt;
    &amp;quot;error&amp;quot;   | LOG.ERROR&lt;br /&gt;
    &amp;quot;fatal&amp;quot;   | LOG.FATAL&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendCommands&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string command1 [, string command2 [ ... ] ] ) -&amp;gt; nil&lt;br /&gt;
  ( {string command1, string command2, ...} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== GUI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetActiveCommand&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string action [, string actionExtra ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  ( number cmdIndex [, number button = 1&lt;br /&gt;
    [, boolean leftClick, boolean rightClick,&lt;br /&gt;
     boolean alt, boolean ctrl, boolean meta, boolean shift]] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCmdColorsConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCtrlPanelConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ForceLayoutUpdate&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;disables the &amp;quot;Selected Units x&amp;quot; box in the GUI&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Mouse ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMouseCursor&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string cursorName [, number scale ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.WarpMouse&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== LOS Colors ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLosViewColors&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;New arguments since 100.0 (radar2 is the inside of radar edge):&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( always = {r,g,b}, LOS = {r,g,b}, radar = {r,g,b}, jam = {r,g,b}, radar2 = {r,g,b}) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;Arguments for 99.0 and before:&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table reds = { number always, number LOS, number radar, number jam }, &lt;br /&gt;
    table greens = { number always, number LOS, number radar, number jam },&lt;br /&gt;
    table blues = { number always, number LOS, number radar, number jam } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== SendMessage ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessage&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToPlayer&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToAllyTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number allyID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToSpectators&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
Funfact:&lt;br /&gt;
&amp;lt;PLAYER#&amp;gt; (with # being a playerid) inside the string will be replaced with the players name.&lt;br /&gt;
ie&lt;br /&gt;
Spring.SendMessage (&amp;quot;&amp;lt;PLAYER1&amp;gt; did something&amp;quot;)&lt;br /&gt;
might display as &amp;quot;ProRusher did something&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Markers ==&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddPoint&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z [, string text = &amp;quot;&amp;quot; [, bool localOnly] ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddLine&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number z1, number x2, number y2, number z2 ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerErasePosition&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sounds =&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadSoundDef&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; ) -&amp;gt; nil | boolean success&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Loads a SoundDefs file, the format is the same as in `gamedata/sounds.lua`.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundFile&#039;&#039;&#039;  &amp;lt;span class=note&amp;gt;Plays WAV or OGG sounds.&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, number posx, number posy, number posz &lt;br /&gt;
    [, number speedx, number speedy, number speedz ] ] ], [string/number &amp;lt;span class=note&amp;gt;channel&amp;lt;/span&amp;gt; ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`channel` is new in Spring0.83, and can be one of those:&lt;br /&gt;
    &amp;quot;general&amp;quot; || 0 || nil (default)&lt;br /&gt;
    &amp;quot;battle&amp;quot; || &amp;quot;sfx&amp;quot; | 1&lt;br /&gt;
    &amp;quot;unitreply&amp;quot; || &amp;quot;voice&amp;quot; || 2&lt;br /&gt;
    &amp;quot;userinterface&amp;quot; || &amp;quot;ui&amp;quot; || 3&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;oggfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, bool enqueue ]] ) -&amp;gt; nil | boolean true&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Allow you to play an Ogg Vorbis (.OGG) compressed sound file.&amp;lt;br&amp;gt; In 83.0 and up multiple sound streams may be played at once &amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.StopSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Terminates any SoundStream currently running.&amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.PauseSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSoundStreamVolume&#039;&#039;&#039;&lt;br /&gt;
  ( number volume ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= SendLuaMessage =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Very important! (allows synced inter-lua-enviroment communications)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaUIMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message, string mode ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;possible modes are:&amp;lt;br&amp;gt;&amp;quot;s&amp;quot;/&amp;quot;specs&amp;quot; &amp;amp; &amp;quot;a&amp;quot;/&amp;quot;allies&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaGaiaMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaRulesMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= AI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SendSkirmishAIMessage&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number aiTeam, string message )&lt;br /&gt;
  -&amp;gt; nil | boolean ai_processed, { [1] = string response1, etc... }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note there is nothing in this table due to &amp;quot;limitations&amp;quot; of the AI interface.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Units =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLeaveTracks&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean leavetracks ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Selection ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( { [unitID] = anything, ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( { [1] = unitID1 , [2] = unitID2 , ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSelectionInfo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Group ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitGroup&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number groupID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Give Order ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrder&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;gives order to all selected units&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    },&lt;br /&gt;
    [boolean pairwise]&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;pairwise param ({{new|89.0}}) is used to send multiple units a single individual command&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Facing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildSpacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Spacing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit NoDraw,NoSelect,NoMinimap ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoSelect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoMinimap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noMinimap ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureFade&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( int featureID, bool allow ) -&amp;gt; nil&lt;br /&gt;
Control whether a feature will fade or not when zoomed out.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSky&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSky ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawWater&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawWater ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGround&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawGround ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWaterParams&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs cheating enabled!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Allows to change water params (mostly BumpWater ones) at runtime. You may want to set BumpWaterUseUniforms in your [[springrc]] to 1, then you don&#039;t even need to restart BumpWater via `/water 4`.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`params` table may contain:&lt;br /&gt;
  params = {&lt;br /&gt;
    absorb = {number r, number g, number b},&lt;br /&gt;
    baseColor = {number r, number g, number b},&lt;br /&gt;
    minColor = {number r, number g, number b},&lt;br /&gt;
    surfaceColor = {number r, number g, number b},&lt;br /&gt;
    diffuseColor = {number r, number g, number b},&lt;br /&gt;
    specularColor = {number r, number g, number b},&lt;br /&gt;
    planeColor = {number r, number g, number b},&lt;br /&gt;
    texture = string file,&lt;br /&gt;
    foamTexture = string file,&lt;br /&gt;
    normalTexture = string file,&lt;br /&gt;
    damage = number value,&lt;br /&gt;
    repeatX = number value,&lt;br /&gt;
    repeatY = number value,&lt;br /&gt;
    surfaceAlpha = number value,&lt;br /&gt;
    ambientFactor = number value,&lt;br /&gt;
    diffuseFactor = number value,&lt;br /&gt;
    specularFactor = number value,&lt;br /&gt;
    specularPower = number value,&lt;br /&gt;
    fresnelMin = number value,&lt;br /&gt;
    fresnelMax = number value,&lt;br /&gt;
    fresnelPower = number value,&lt;br /&gt;
    reflectionDistortion = number value,&lt;br /&gt;
    blurBase = number value,&lt;br /&gt;
    blurExponent = number value,&lt;br /&gt;
    perlinStartFreq = number value,&lt;br /&gt;
    perlinLacunarity = number value,&lt;br /&gt;
    perlinAmplitude = number value,&lt;br /&gt;
    numTiles = number value,&lt;br /&gt;
    shoreWaves = boolean value,&lt;br /&gt;
    forceRendering = boolean value,&lt;br /&gt;
    hasWaterPlane = boolean value,&lt;br /&gt;
  }&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLogSectionFilterLevel&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   (string sectionName, string|number logLevel)&lt;br /&gt;
see [[infolog.txt]] for possible log sections (?)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGroundDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    ( boolean drawGroundDeferred [, boolean drawGroundForward] ) -&amp;gt; nil&lt;br /&gt;
{{new|101.0}} {{var|drawGroundForward}} allows disabling of the forward pass&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawModelsDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    (     boolean drawUnitsDeferred,&lt;br /&gt;
          boolean drawFeaturesDeferred&lt;br /&gt;
       [, boolean drawUnitsForward&lt;br /&gt;
       [, boolean drawFeaturesForward ]]&lt;br /&gt;
     ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} {{var|drawFeaturesForward}}, {{var|drawUnitsForward}} allows disabling of the respective forward passes&lt;br /&gt;
&lt;br /&gt;
= GUI =&lt;br /&gt;
&#039;&#039;&#039;Spring.DrawUnitCommands&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
  ( { [1] = unitID, ... } [, false ] ) -&amp;gt; nil&lt;br /&gt;
  ( { [unitID] = anything, ... }, true  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;changes/creates the cursor of a single CursorCmd&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;cmdName&amp;quot;, string &amp;quot;iconFileName&amp;quot;&lt;br /&gt;
    [, boolean overwrite = true [, boolean hotSpotTopLeft = false] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font class=note&amp;gt;Note, that iconFileName is not the full filename instead it is like this:&amp;lt;br/&amp;gt;&lt;br /&gt;
wanted filename: Anims/cursorattack_0.bmp&amp;lt;br/&amp;gt;&lt;br /&gt;
=&amp;gt; iconFileName: cursorattack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ReplaceMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;mass replace all occurrence of the cursor in all CursorCmds&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;oldFileName&amp;quot;, string &amp;quot;newFileName&amp;quot; [, boolean hotSpotTopLeft = false] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCustomCommandDrawData&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;register your custom cmd so it gets visible in the unit&#039;s cmd queue&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number cmdID,&lt;br /&gt;
    number cmdID_cloneIcon | string iconname,&lt;br /&gt;
    { number r, number g, number b, number a } [, boolean showArea ] ) -&amp;gt; nil&lt;br /&gt;
  ( number cmdID, nil) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sharing =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetShareLevel&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: shareLevel is 0&amp;lt;= x &amp;lt;= 1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number shareLevel ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareResources&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number teamID, string &amp;quot;units&amp;quot; ) -&amp;gt; nil&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;
= UnitDef RadarIcons &amp;amp; BuildPics =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName, string texFile [, number size [, number dist [, boolean radAdjust ]]] )&lt;br /&gt;
  -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.FreeUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefIcon&#039;&#039;&#039;  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(RadarIcon)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, string iconName ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefImage&#039;&#039;&#039;   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(BuildPic)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, luaTexture | string texFile ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Camera =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraState&#039;&#039;&#039;&lt;br /&gt;
  ( table camState, number camTime) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;camState has the same format as the output of Spring.GetCameraState(). See [[Lua_camState]] for details about camState. &lt;br /&gt;
&lt;br /&gt;
The camState&#039;s mode/name must fit the rest of the state. Getting a state, changing its mode/name and then passing it to SetCameraState will have undesired results. [https://springrts.com/mantis/view.php?id=5028#c15491 Also see #5028]&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraTarget&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z [,number transTime] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;For Spring Engine XZ represents horizontal, from north west corner of map and Y vertical, from water level and rising.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraOffset&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( [number px = 0 [, number py = 0 [, number pz = 0&lt;br /&gt;
     [, number tx = 0 [, number ty = 0 [, number tz = 0]]]]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= (Virtual-)FileSystem =&lt;br /&gt;
&#039;&#039;&#039;Spring.ExtractModArchiveFile&#039;&#039;&#039;&lt;br /&gt;
  ( string modfile ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateDir&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number path ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
The full VFS API is available at [[Lua_VFS|link]].&lt;br /&gt;
&lt;br /&gt;
= Engine Config =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The following functions read the engine configs saved in [[springrc]], a version-ed instance of these or a custom file supplied on the command line.&lt;br /&gt;
If &#039;&#039;*Overlay&#039;&#039; is &#039;&#039;true&#039;&#039;, the value will only be set in memory, and not be restored for the next game&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, number default [, boolean setInOverlay = false]] ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, number value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, string default [, boolean setInOverlay = false]] ) -&amp;gt; nil | string&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, string value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= World Primitives =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;outdated! use opengl api instead!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldIcon&#039;&#039;&#039;&lt;br /&gt;
  ( number cmdID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldText&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot;, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    number team, number facing) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sun  =&lt;br /&gt;
The dynamic Sun must be invoked via /dynamicsun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunManualControl&#039;&#039;&#039;&lt;br /&gt;
  ( boolean setManualControl ) - &amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunParameters&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ, number dist, number startTime, number orbitTime ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunLighting&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following sun lighting parameters: &lt;br /&gt;
     {ground,unit}{Ambient,Diffuse,Specular}Color and specularExponent&lt;br /&gt;
     All Colourvalues have to in the Range from 0.0 to 1.0&lt;br /&gt;
     Example usage: Spring.SetSunLighting({groundAmbientColor = {1, 0.1, 1}, groundDiffuseColor = {1, 0.1, 1} })&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following atmosphere parameters:&lt;br /&gt;
     fog{Start,End}, {sun,sky,cloud}Color&lt;br /&gt;
     Example usage: Spring.SetAtmosphere({ fogStart = 0, fogEnd   = 0.5, fogColor = { 0.7, 0.2, 0.2, 1 }})&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Misc =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Reload&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( string startscript )&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Restart&#039;&#039;&#039; {{new|0.79}}&lt;br /&gt;
  ( string commandline_args, string startscript )&lt;br /&gt;
    -&amp;gt; if this call returns, something went wrong&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;commandline_args&#039;&#039; are commandline arguments passed to spring executable&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start (if empty, no start-script is added, you can still point spring to your custom script.txt when you add the file-path to &#039;&#039;commandline_args&#039;&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMIcon&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string iconFileName ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the icon for the process which is seen in the OS task-bar and other places (default: spring-logo).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: has to be 24bit or 32bit&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: on windows, it has to be 32x32 pixels in size (recommended for cross-platform)&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.bmp&#039;&#039; images have to be in BGR format (default for m$ ones).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.ico&#039;&#039; images are not supported.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMCaption&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string title [, string titleShort = title ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the window &#039;&#039;title&#039;&#039; for the process (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The &#039;&#039;shortTitle&#039;&#039; is displayed in the OS task-bar (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &#039;&#039;shortTitle&#039;&#039; is only ever possibly used under X11 (Linux &amp;amp; OS X), but not with QT (KDE) and never under Windows. See [http://www.gpwiki.org/index.php/SDL:Tutorials:Initializing_SDL_Libraries#About_the_icon_.28.22Icon_Title.22.29_parameter_on_different_window-managers this site] for more details.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearWatchdogTimer&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( [ string threadName = main ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetClipboard&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string text) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Rendering =&lt;br /&gt;
== Preload ==&lt;br /&gt;
Allow the engine to load the unit&#039;s model (and texture) in a background thread. Wreckages and buildOptions of a unit are automatically preloaded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadUnitDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadFetureDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Lighting ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;NOTE: these (0.83+) lighting callouts only work when called from unsynced gadgets!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddMapLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicMapLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&#039;&#039;&#039;Spring.AddModelLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicModelLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateMapLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateModelLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.SetModelLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;lightParams&#039;&#039;&#039; is a table that should contain at least one of the following recognized key/value pairs:&lt;br /&gt;
&lt;br /&gt;
    lightParams = {&lt;br /&gt;
        position = {px, py, pz},&lt;br /&gt;
        direction = {dx, dy, dz},&lt;br /&gt;
        ambientColor = {red, green, blue},&lt;br /&gt;
        diffuseColor = {red, green, blue},&lt;br /&gt;
        specularColor = {red, green, blue},&lt;br /&gt;
        intensityWeight = {ambientWeight, diffuseWeight, specularWeight},&lt;br /&gt;
&lt;br /&gt;
        -- per-frame decay of ambientColor (spread over TTL frames)&lt;br /&gt;
        ambientDecayRate = {ambientRedDecay, ambientGreenDecay, ambientBlueDecay},&lt;br /&gt;
        -- per-frame decay of diffuseColor (spread over TTL frames)&lt;br /&gt;
        diffuseDecayRate = {diffuseRedDecay, diffuseGreenDecay, diffuseBlueDecay},&lt;br /&gt;
        -- per-frame decay of specularColor (spread over TTL frames)&lt;br /&gt;
        specularDecayRate = {specularRedDecay, specularGreenDecay, specularBlueDecay},&lt;br /&gt;
        -- *DecayType = 0.0 -&amp;gt; interpret *DecayRate values as linear, else as exponential&lt;br /&gt;
        decayFunctionType = {ambientDecayType, diffuseDecayType, specularDecayType},&lt;br /&gt;
&lt;br /&gt;
        radius = number elmos,&lt;br /&gt;
        fov = number degrees,&lt;br /&gt;
        ttl = number frames,&lt;br /&gt;
        priority = number,&lt;br /&gt;
        ignoreLOS = boolean,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
= Map =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSkyBoxTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texName ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShadingTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texType, string texName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;Example usage: Spring.SetMapShadingTexture(&amp;quot;$ssmf_specular&amp;quot;, &amp;quot;name_of_my_shiny_texture&amp;quot;)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTexture&#039;&#039;&#039;&lt;br /&gt;
  ( number texSqrX, number texSqrY, string luaTexName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShader&#039;&#039;&#039; {{101.0}}&lt;br /&gt;
  ( number standardShaderID, number deferredShaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;The ID&#039;s must refer to valid programs returned by gl.CreateShader. Passing in a value of 0 will cause the respective shader to revert back to its engine default. Custom map shaders that declare a uniform ivec2 named &amp;quot;texSquare&amp;quot; can sample from the default diffuse texture(s), which are always bound to TU 0.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12315</id>
		<title>Lua UnsyncedCtrl</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12315"/>
		<updated>2016-11-25T23:13:29Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Sun */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Lua_Scripting|Lua Scripting]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;&lt;br /&gt;
NOTE: Prior to 102.0, entries below marked &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt; require the setting ModUICtrl to be enabled in the users [[springrc]], if you want to use them in unsynced LuaRules/LuaGaia. It is enabled by default in previous versions and removed in 102.0 so you generally don&#039;t need to care.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= UI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLastMessagePosition&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Ingame Console =&lt;br /&gt;
&#039;&#039;&#039;Spring.Echo&#039;&#039;&#039;&lt;br /&gt;
  ( arg1 [, arg2 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Useful for debugging.&amp;lt;br&amp;gt; Prints values in the spring chat console.&amp;lt;br&amp;gt; Hint: the default print() writes to STDOUT.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Log&#039;&#039;&#039;&lt;br /&gt;
  ( string section, int logLevel | string logLevel,&lt;br /&gt;
    arg2 [, arg3 [, ... ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Possible values for logLevel are:&lt;br /&gt;
    &amp;quot;debug&amp;quot;   | LOG.DEBUG&lt;br /&gt;
    &amp;quot;info&amp;quot;    | LOG.INFO&lt;br /&gt;
    &amp;quot;notice&amp;quot;  | LOG.NOTICE (engine default) {{new|97}}&lt;br /&gt;
    &amp;quot;warning&amp;quot; | LOG.WARNING&lt;br /&gt;
    &amp;quot;error&amp;quot;   | LOG.ERROR&lt;br /&gt;
    &amp;quot;fatal&amp;quot;   | LOG.FATAL&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendCommands&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string command1 [, string command2 [ ... ] ] ) -&amp;gt; nil&lt;br /&gt;
  ( {string command1, string command2, ...} ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== GUI ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetActiveCommand&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string action [, string actionExtra ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  ( number cmdIndex [, number button = 1&lt;br /&gt;
    [, boolean leftClick, boolean rightClick,&lt;br /&gt;
     boolean alt, boolean ctrl, boolean meta, boolean shift]] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCmdColorsConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadCtrlPanelConfig&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string config ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ForceLayoutUpdate&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;disables the &amp;quot;Selected Units x&amp;quot; box in the GUI&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( boolean enable ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Mouse ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMouseCursor&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string cursorName [, number scale ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.WarpMouse&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== LOS Colors ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLosViewColors&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;New arguments since 100.0 (radar2 is the inside of radar edge):&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( always = {r,g,b}, LOS = {r,g,b}, radar = {r,g,b}, jam = {r,g,b}, radar2 = {r,g,b}) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;Arguments for 99.0 and before:&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table reds = { number always, number LOS, number radar, number jam }, &lt;br /&gt;
    table greens = { number always, number LOS, number radar, number jam },&lt;br /&gt;
    table blues = { number always, number LOS, number radar, number jam } ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== SendMessage ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessage&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToPlayer&#039;&#039;&#039;&lt;br /&gt;
  ( number playerID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToAllyTeam&#039;&#039;&#039;&lt;br /&gt;
  ( number allyID, string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendMessageToSpectators&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;message&amp;quot; ) -&amp;gt; nil&lt;br /&gt;
Funfact:&lt;br /&gt;
&amp;lt;PLAYER#&amp;gt; (with # being a playerid) inside the string will be replaced with the players name.&lt;br /&gt;
ie&lt;br /&gt;
Spring.SendMessage (&amp;quot;&amp;lt;PLAYER1&amp;gt; did something&amp;quot;)&lt;br /&gt;
might display as &amp;quot;ProRusher did something&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Markers ==&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddPoint&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z [, string text = &amp;quot;&amp;quot; [, bool localOnly] ] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerAddLine&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x1, number y1, number z1, number x2, number y2, number z2 ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.MarkerErasePosition&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sounds =&lt;br /&gt;
&#039;&#039;&#039;Spring.LoadSoundDef&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; ) -&amp;gt; nil | boolean success&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Loads a SoundDefs file, the format is the same as in `gamedata/sounds.lua`.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundFile&#039;&#039;&#039;  &amp;lt;span class=note&amp;gt;Plays WAV or OGG sounds.&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, number posx, number posy, number posz &lt;br /&gt;
    [, number speedx, number speedy, number speedz ] ] ], [string/number &amp;lt;span class=note&amp;gt;channel&amp;lt;/span&amp;gt; ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`channel` is new in Spring0.83, and can be one of those:&lt;br /&gt;
    &amp;quot;general&amp;quot; || 0 || nil (default)&lt;br /&gt;
    &amp;quot;battle&amp;quot; || &amp;quot;sfx&amp;quot; | 1&lt;br /&gt;
    &amp;quot;unitreply&amp;quot; || &amp;quot;voice&amp;quot; || 2&lt;br /&gt;
    &amp;quot;userinterface&amp;quot; || &amp;quot;ui&amp;quot; || 3&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PlaySoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;oggfile&amp;quot; [, number volume = 1.0&lt;br /&gt;
    [, bool enqueue ]] ) -&amp;gt; nil | boolean true&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Allow you to play an Ogg Vorbis (.OGG) compressed sound file.&amp;lt;br&amp;gt; In 83.0 and up multiple sound streams may be played at once &amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.StopSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;Terminates any SoundStream currently running.&amp;lt;/span&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.PauseSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSoundStreamVolume&#039;&#039;&#039;&lt;br /&gt;
  ( number volume ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= SendLuaMessage =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Very important! (allows synced inter-lua-enviroment communications)&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaUIMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message, string mode ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;possible modes are:&amp;lt;br&amp;gt;&amp;quot;s&amp;quot;/&amp;quot;specs&amp;quot; &amp;amp; &amp;quot;a&amp;quot;/&amp;quot;allies&amp;quot;&amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaGaiaMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SendLuaRulesMsg&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string message ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= AI =&lt;br /&gt;
&#039;&#039;&#039;Spring.SendSkirmishAIMessage&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number aiTeam, string message )&lt;br /&gt;
  -&amp;gt; nil | boolean ai_processed, { [1] = string response1, etc... }&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Note there is nothing in this table due to &amp;quot;limitations&amp;quot; of the AI interface.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Units =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitLeaveTracks&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( number unitID, boolean leavetracks ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Selection ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitMap&#039;&#039;&#039;&lt;br /&gt;
  ( { [unitID] = anything, ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SelectUnitArray&#039;&#039;&#039;&lt;br /&gt;
  ( { [1] = unitID1 , [2] = unitID2 , ...} [,boolean append] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSelectionInfo&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSelectionInfo ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit Group ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitGroup&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number groupID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Give Order ==&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrder&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;gives order to all selected units&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnit&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&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 | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitMap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitMap = { [number unitID] = dontCare, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    }&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&#039;&#039;&#039;Spring.GiveOrderArrayToUnitArray&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( unitArray = { [1] = number unitID, etc... },&lt;br /&gt;
    orderArray = {&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;}&lt;br /&gt;
      }, ..&lt;br /&gt;
    },&lt;br /&gt;
    [boolean pairwise]&lt;br /&gt;
  ) -&amp;gt; nil | boolean true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;pairwise param ({{new|89.0}}) is used to send multiple units a single individual command&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Facing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetBuildSpacing&#039;&#039;&#039;&lt;br /&gt;
  ( int Spacing ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Unit NoDraw,NoSelect,NoMinimap ==&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoSelect&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noSelect ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitNoMinimap&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, boolean noMinimap ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Features =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureFade&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( int featureID, bool allow ) -&amp;gt; nil&lt;br /&gt;
Control whether a feature will fade or not when zoomed out.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetFeatureNoDraw&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number featureID, boolean noDraw ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Developers =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawSky&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawSky ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawWater&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawWater ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGround&#039;&#039;&#039;&lt;br /&gt;
  ( boolean drawGround ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWaterParams&#039;&#039;&#039; &amp;lt;span class=warning&amp;gt;needs cheating enabled!&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;span class=note&amp;gt;Allows to change water params (mostly BumpWater ones) at runtime. You may want to set BumpWaterUseUniforms in your [[springrc]] to 1, then you don&#039;t even need to restart BumpWater via `/water 4`.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;`params` table may contain:&lt;br /&gt;
  params = {&lt;br /&gt;
    absorb = {number r, number g, number b},&lt;br /&gt;
    baseColor = {number r, number g, number b},&lt;br /&gt;
    minColor = {number r, number g, number b},&lt;br /&gt;
    surfaceColor = {number r, number g, number b},&lt;br /&gt;
    diffuseColor = {number r, number g, number b},&lt;br /&gt;
    specularColor = {number r, number g, number b},&lt;br /&gt;
    planeColor = {number r, number g, number b},&lt;br /&gt;
    texture = string file,&lt;br /&gt;
    foamTexture = string file,&lt;br /&gt;
    normalTexture = string file,&lt;br /&gt;
    damage = number value,&lt;br /&gt;
    repeatX = number value,&lt;br /&gt;
    repeatY = number value,&lt;br /&gt;
    surfaceAlpha = number value,&lt;br /&gt;
    ambientFactor = number value,&lt;br /&gt;
    diffuseFactor = number value,&lt;br /&gt;
    specularFactor = number value,&lt;br /&gt;
    specularPower = number value,&lt;br /&gt;
    fresnelMin = number value,&lt;br /&gt;
    fresnelMax = number value,&lt;br /&gt;
    fresnelPower = number value,&lt;br /&gt;
    reflectionDistortion = number value,&lt;br /&gt;
    blurBase = number value,&lt;br /&gt;
    blurExponent = number value,&lt;br /&gt;
    perlinStartFreq = number value,&lt;br /&gt;
    perlinLacunarity = number value,&lt;br /&gt;
    perlinAmplitude = number value,&lt;br /&gt;
    numTiles = number value,&lt;br /&gt;
    shoreWaves = boolean value,&lt;br /&gt;
    forceRendering = boolean value,&lt;br /&gt;
    hasWaterPlane = boolean value,&lt;br /&gt;
  }&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetLogSectionFilterLevel&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   (string sectionName, string|number logLevel)&lt;br /&gt;
see [[infolog.txt]] for possible log sections (?)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawGroundDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    ( boolean drawGroundDeferred [, boolean drawGroundForward] ) -&amp;gt; nil&lt;br /&gt;
{{new|101.0}} {{var|drawGroundForward}} allows disabling of the forward pass&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetDrawModelsDeferred&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
    (     boolean drawUnitsDeferred,&lt;br /&gt;
          boolean drawFeaturesDeferred&lt;br /&gt;
       [, boolean drawUnitsForward&lt;br /&gt;
       [, boolean drawFeaturesForward ]]&lt;br /&gt;
     ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
{{new|101.0}} {{var|drawFeaturesForward}}, {{var|drawUnitsForward}} allows disabling of the respective forward passes&lt;br /&gt;
&lt;br /&gt;
= GUI =&lt;br /&gt;
&#039;&#039;&#039;Spring.DrawUnitCommands&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil&lt;br /&gt;
  ( { [1] = unitID, ... } [, false ] ) -&amp;gt; nil&lt;br /&gt;
  ( { [unitID] = anything, ... }, true  ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetTeamColor&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, number r, number g, number b ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AssignMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;changes/creates the cursor of a single CursorCmd&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;cmdName&amp;quot;, string &amp;quot;iconFileName&amp;quot;&lt;br /&gt;
    [, boolean overwrite = true [, boolean hotSpotTopLeft = false] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font class=note&amp;gt;Note, that iconFileName is not the full filename instead it is like this:&amp;lt;br/&amp;gt;&lt;br /&gt;
wanted filename: Anims/cursorattack_0.bmp&amp;lt;br/&amp;gt;&lt;br /&gt;
=&amp;gt; iconFileName: cursorattack&lt;br /&gt;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ReplaceMouseCursor&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;mass replace all occurrence of the cursor in all CursorCmds&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;oldFileName&amp;quot;, string &amp;quot;newFileName&amp;quot; [, boolean hotSpotTopLeft = false] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCustomCommandDrawData&#039;&#039;&#039; &amp;lt;font class=note&amp;gt;register your custom cmd so it gets visible in the unit&#039;s cmd queue&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number cmdID,&lt;br /&gt;
    number cmdID_cloneIcon | string iconname,&lt;br /&gt;
    { number r, number g, number b, number a } [, boolean showArea ] ) -&amp;gt; nil&lt;br /&gt;
  ( number cmdID, nil) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sharing =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetShareLevel&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;note: shareLevel is 0&amp;lt;= x &amp;lt;= 1&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;metal&amp;quot; | &amp;quot;energy&amp;quot;, number shareLevel ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.ShareResources&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number teamID, string &amp;quot;units&amp;quot; ) -&amp;gt; nil&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;
= UnitDef RadarIcons &amp;amp; BuildPics =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName, string texFile [, number size [, number dist [, boolean radAdjust ]]] )&lt;br /&gt;
  -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.FreeUnitIcon&#039;&#039;&#039;&lt;br /&gt;
  ( string iconName ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefIcon&#039;&#039;&#039;  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(RadarIcon)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, string iconName ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitDefImage&#039;&#039;&#039;   &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;(BuildPic)&amp;lt;/font&amp;gt; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitDefID, luaTexture | string texFile ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Camera =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraState&#039;&#039;&#039;&lt;br /&gt;
  ( table camState, number camTime) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;camState has the same format as the output of Spring.GetCameraState(). See [[Lua_camState]] for details about camState. &lt;br /&gt;
&lt;br /&gt;
The camState&#039;s mode/name must fit the rest of the state. Getting a state, changing its mode/name and then passing it to SetCameraState will have undesired results. [https://springrts.com/mantis/view.php?id=5028#c15491 Also see #5028]&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraTarget&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number y, number z [,number transTime] ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;For Spring Engine XZ represents horizontal, from north west corner of map and Y vertical, from water level and rising.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCameraOffset&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( [number px = 0 [, number py = 0 [, number pz = 0&lt;br /&gt;
     [, number tx = 0 [, number ty = 0 [, number tz = 0]]]]]] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= (Virtual-)FileSystem =&lt;br /&gt;
&#039;&#039;&#039;Spring.ExtractModArchiveFile&#039;&#039;&#039;&lt;br /&gt;
  ( string modfile ) -&amp;gt; boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.CreateDir&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number path ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
The full VFS API is available at [[Lua_VFS|link]].&lt;br /&gt;
&lt;br /&gt;
= Engine Config =&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The following functions read the engine configs saved in [[springrc]], a version-ed instance of these or a custom file supplied on the command line.&lt;br /&gt;
If &#039;&#039;*Overlay&#039;&#039; is &#039;&#039;true&#039;&#039;, the value will only be set in memory, and not be restored for the next game&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, number default [, boolean setInOverlay = false]] ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigInt&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, number value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.GetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name [, string default [, boolean setInOverlay = false]] ) -&amp;gt; nil | string&lt;br /&gt;
&#039;&#039;&#039;Spring.SetConfigString&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(needs ModUICtrl)&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string name, string value [, boolean useOverlay = false] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= World Primitives =&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;outdated! use opengl api instead!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldIcon&#039;&#039;&#039;&lt;br /&gt;
  ( number cmdID, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldText&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;text&amp;quot;, number x, number y, number z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;Spring.AddWorldUnit&#039;&#039;&#039;&lt;br /&gt;
  ( number unitDefID,&lt;br /&gt;
    number x, number y, number z,&lt;br /&gt;
    number team, number facing) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Sun  =&lt;br /&gt;
The dynamic Sun must be invoked via /dynamicsun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunManualControl&#039;&#039;&#039;&lt;br /&gt;
  ( boolean setManualControl ) - &amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunParameters&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ, number dist, number startTime, number orbitTime ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number dirX, number dirY, number dirZ ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSunLighting&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following sun lighting parameters: &lt;br /&gt;
     {ground,unit}{Ambient,Diffuse,Specular}Color and specularExponent&lt;br /&gt;
     Example usage: Spring.SetSunLighting({groundAmbientColor = {1, 0.1, 1}, groundDiffuseColor = {1, 0.1, 1} })&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetAtmosphere&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( table params ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;span class=note&amp;gt;It can be used to modify the following atmosphere parameters:&lt;br /&gt;
     fog{Start,End}, {sun,sky,cloud}Color&lt;br /&gt;
     Example usage: Spring.SetAtmosphere({ fogStart = 0, fogEnd   = 0.5, fogColor = { 0.7, 0.2, 0.2, 1 }})&lt;br /&gt;
  &amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Misc =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Reload&#039;&#039;&#039; {{new|99.0}}&lt;br /&gt;
  ( string startscript )&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Restart&#039;&#039;&#039; {{new|0.79}}&lt;br /&gt;
  ( string commandline_args, string startscript )&lt;br /&gt;
    -&amp;gt; if this call returns, something went wrong&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;commandline_args&#039;&#039; are commandline arguments passed to spring executable&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;start-script is the CONTENT of the [[script.txt]] spring should use to start (if empty, no start-script is added, you can still point spring to your custom script.txt when you add the file-path to &#039;&#039;commandline_args&#039;&#039;&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMIcon&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string iconFileName ) -&amp;gt; nil&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the icon for the process which is seen in the OS task-bar and other places (default: spring-logo).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: has to be 24bit or 32bit&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: on windows, it has to be 32x32 pixels in size (recommended for cross-platform)&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.bmp&#039;&#039; images have to be in BGR format (default for m$ ones).&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: &#039;&#039;*.ico&#039;&#039; images are not supported.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetWMCaption&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( string title [, string titleShort = title ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Sets the window &#039;&#039;title&#039;&#039; for the process (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;The &#039;&#039;shortTitle&#039;&#039; is displayed in the OS task-bar (default: &amp;quot;Spring &amp;lt;version&amp;gt;&amp;quot;).&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;&#039;&#039;&#039;NOTE:&#039;&#039;&#039; &#039;&#039;shortTitle&#039;&#039; is only ever possibly used under X11 (Linux &amp;amp; OS X), but not with QT (KDE) and never under Windows. See [http://www.gpwiki.org/index.php/SDL:Tutorials:Initializing_SDL_Libraries#About_the_icon_.28.22Icon_Title.22.29_parameter_on_different_window-managers this site] for more details.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.ClearWatchdogTimer&#039;&#039;&#039; {{new|83.0}}&lt;br /&gt;
  ( [ string threadName = main ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetClipboard&#039;&#039;&#039; {{new|98.0}}&lt;br /&gt;
  ( string text) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
= Rendering =&lt;br /&gt;
== Preload ==&lt;br /&gt;
Allow the engine to load the unit&#039;s model (and texture) in a background thread. Wreckages and buildOptions of a unit are automatically preloaded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadUnitDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number unitDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.PreloadFetureDefModel&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( number featureDefID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
== Lighting ==&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;NOTE: these (0.83+) lighting callouts only work when called from unsynced gadgets!&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.AddMapLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicMapLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&#039;&#039;&#039;Spring.AddModelLight&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot; style=&amp;quot;font-weight:600&amp;quot;&amp;gt;(requires MaxDynamicModelLights &amp;amp;gt; 0)&amp;lt;/font&amp;gt;&lt;br /&gt;
  (table lightParams) -&amp;gt; number lightHandle&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateMapLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.UpdateModelLight&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, table lightParams) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&#039;&#039;&#039;Spring.SetModelLightTrackingState&#039;&#039;&#039;&lt;br /&gt;
  (number lightHandle, number unitOrProjectileID,&lt;br /&gt;
   boolean enableTracking, boolean unitOrProjectile) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;lightParams&#039;&#039;&#039; is a table that should contain at least one of the following recognized key/value pairs:&lt;br /&gt;
&lt;br /&gt;
    lightParams = {&lt;br /&gt;
        position = {px, py, pz},&lt;br /&gt;
        direction = {dx, dy, dz},&lt;br /&gt;
        ambientColor = {red, green, blue},&lt;br /&gt;
        diffuseColor = {red, green, blue},&lt;br /&gt;
        specularColor = {red, green, blue},&lt;br /&gt;
        intensityWeight = {ambientWeight, diffuseWeight, specularWeight},&lt;br /&gt;
&lt;br /&gt;
        -- per-frame decay of ambientColor (spread over TTL frames)&lt;br /&gt;
        ambientDecayRate = {ambientRedDecay, ambientGreenDecay, ambientBlueDecay},&lt;br /&gt;
        -- per-frame decay of diffuseColor (spread over TTL frames)&lt;br /&gt;
        diffuseDecayRate = {diffuseRedDecay, diffuseGreenDecay, diffuseBlueDecay},&lt;br /&gt;
        -- per-frame decay of specularColor (spread over TTL frames)&lt;br /&gt;
        specularDecayRate = {specularRedDecay, specularGreenDecay, specularBlueDecay},&lt;br /&gt;
        -- *DecayType = 0.0 -&amp;gt; interpret *DecayRate values as linear, else as exponential&lt;br /&gt;
        decayFunctionType = {ambientDecayType, diffuseDecayType, specularDecayType},&lt;br /&gt;
&lt;br /&gt;
        radius = number elmos,&lt;br /&gt;
        fov = number degrees,&lt;br /&gt;
        ttl = number frames,&lt;br /&gt;
        priority = number,&lt;br /&gt;
        ignoreLOS = boolean,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
= Map =&lt;br /&gt;
&#039;&#039;&#039;Spring.SetSkyBoxTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texName ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShadingTexture&#039;&#039;&#039; {{new|101.0}}&lt;br /&gt;
  ( string texType, string texName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;Example usage: Spring.SetMapShadingTexture(&amp;quot;$ssmf_specular&amp;quot;, &amp;quot;name_of_my_shiny_texture&amp;quot;)&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapSquareTexture&#039;&#039;&#039;&lt;br /&gt;
  ( number texSqrX, number texSqrY, string luaTexName ) -&amp;gt; boolean success&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetMapShader&#039;&#039;&#039; {{101.0}}&lt;br /&gt;
  ( number standardShaderID, number deferredShaderID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;note&amp;quot;&amp;gt;The ID&#039;s must refer to valid programs returned by gl.CreateShader. Passing in a value of 0 will cause the respective shader to revert back to its engine default. Custom map shaders that declare a uniform ivec2 named &amp;quot;texSquare&amp;quot; can sample from the default diffuse texture(s), which are always bound to TU 0.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10786</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=10786"/>
		<updated>2016-09-07T16:09:15Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lua 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;
== 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.&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.&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;
|info = ???&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 = 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;
== 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.&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.&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.&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.&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]].&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 =  clampedX, clampedY, clampedZ, playerID, readyState, 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;
}}&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&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;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID&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.&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10785</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=10785"/>
		<updated>2016-09-07T16:08:24Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lua Callins */  Added the sources pages at the top.&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/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;
== 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.&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.&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;
|info = ???&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 = 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;
== 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.&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.&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.&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.&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]].&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 =  clampedX, clampedY, clampedZ, playerID, readyState, 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;
}}&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&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;
|args = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile, beamEmitterWeaponNum, beamEmitterUnitID&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.&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Building_Spring_on_Linux&amp;diff=3405</id>
		<title>Building Spring on Linux</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Building_Spring_on_Linux&amp;diff=3405"/>
		<updated>2016-08-27T14:47:31Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: Librarys needed for ubuntubuild updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; [[Building_spring|Building Spring]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
= Build From Source on Linux =&lt;br /&gt;
If you prefer to use your distributions package system (release versions only), refer to the Linux [[SetupGuide]].&lt;br /&gt;
&lt;br /&gt;
If there is no package tailored for your distribution, you have to install from sources manually. Doing this for distributions where packages are available is not recommended.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=warning&amp;gt;&#039;&#039;&#039;Warning:&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Be careful when building from source.&#039;&#039;&#039;&amp;lt;br/&amp;gt;&lt;br /&gt;
You might encounter sync errors in online play if:&lt;br /&gt;
* you are using an untested compiler (&#039;&#039;gcc&#039;&#039; from the &amp;gt;=4.6 series should be safe)&lt;br /&gt;
* you use non-standard compiler settings (be careful about &#039;&#039;-march&#039;&#039;)!&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Obtaining the Source ==&lt;br /&gt;
{{Obtaining_The_Source_Code}}&lt;br /&gt;
&lt;br /&gt;
= Get Dependencies =&lt;br /&gt;
&lt;br /&gt;
To compile, you will have to install some development packages Spring depends on. These vary from distro to distro and may also depend on your specific configuration.&lt;br /&gt;
&lt;br /&gt;
If your distributions is not listed below, you should be able to figure out the correct package names from this.&lt;br /&gt;
&lt;br /&gt;
== Full list ==&lt;br /&gt;
* Programs necessary to build&lt;br /&gt;
** &#039;&#039;cmake&#039;&#039;&lt;br /&gt;
** &#039;&#039;7zip&#039;&#039; (aka &#039;&#039;p7zip&#039;&#039; or &#039;&#039;7z&#039;&#039;)&lt;br /&gt;
** The usual build toolchain&lt;br /&gt;
*** &#039;&#039;gcc&#039;&#039;&lt;br /&gt;
*** &#039;&#039;make&#039;&#039;&lt;br /&gt;
* Libraries&lt;br /&gt;
** SDL2&lt;br /&gt;
** &#039;&#039;boost&#039;&#039; (version 1.47 or later)&lt;br /&gt;
*** &#039;&#039;chrono&#039;&#039;&lt;br /&gt;
*** &#039;&#039;filesystem&#039;&#039;&lt;br /&gt;
*** &#039;&#039;threads&#039;&#039;&lt;br /&gt;
*** &#039;&#039;regex&#039;&#039;&lt;br /&gt;
*** &#039;&#039;signals&#039;&#039;&lt;br /&gt;
*** &#039;&#039;system&#039;&#039;&lt;br /&gt;
*** &#039;&#039;program-options&#039;&#039;&lt;br /&gt;
** &#039;&#039;libdeviL&#039;&#039; (IL)&lt;br /&gt;
** OpenAL (openal-soft, older openal-0.0.8 does not work)&lt;br /&gt;
** OpenGL headers (mesa, GLEW, etc.)&lt;br /&gt;
** &#039;&#039;zlib&#039;&#039;&lt;br /&gt;
** &#039;&#039;freetype&#039;&#039; (2)&lt;br /&gt;
** &#039;&#039;ogg&#039;&#039;, &#039;&#039;vorbis&#039;&#039; and &#039;&#039;vorbisfile&#039;&#039;&lt;br /&gt;
* Optional (for AI Interfaces and Skirmish AIs)&lt;br /&gt;
** &#039;&#039;python&#039;&#039; (2.5+)&lt;br /&gt;
** &#039;&#039;jdk&#039;&#039; (1.5+)&lt;br /&gt;
&lt;br /&gt;
== Debian ==&lt;br /&gt;
&lt;br /&gt;
For Jessie (debian 8.0 stable) this should work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install build-essential zlib1g-dev libfreetype6-dev cmake \&lt;br /&gt;
libsdl2-dev libopenal-dev libglew-dev zip libvorbis-dev libxcursor-dev \&lt;br /&gt;
libdevil-dev libboost-system1.55-dev libboost-thread1.55-dev \&lt;br /&gt;
libboost-regex1.55-dev libboost-serialization1.55-dev \&lt;br /&gt;
libboost-program-options1.55-dev libboost-chrono1.55-dev \&lt;br /&gt;
libunwind-dev  libboost-filesystem1.55-dev \&lt;br /&gt;
libboost-signals1.55-dev libboost-test1.55-dev \&lt;br /&gt;
xsltproc libfontconfig1-dev libcurl4-openssl-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu  ===&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
# compiler and build tools&lt;br /&gt;
sudo apt-get install build-essential cmake cmake-gui git &lt;br /&gt;
&lt;br /&gt;
# spring dependencies&lt;br /&gt;
sudo apt-get install libglew-dev libsdl2-dev libdevil-dev libopenal-dev \&lt;br /&gt;
 libogg-dev libvorbis-dev libfreetype6-dev p7zip-full libxcursor-dev \&lt;br /&gt;
 libboost-thread-dev libboost-regex-dev libboost-system-dev \&lt;br /&gt;
 libboost-program-options-dev libboost-signals-dev \&lt;br /&gt;
 libboost-chrono-dev libboost-filesystem-dev libunwind8-dev &lt;br /&gt;
 default-jdk libcurl4-gnutls-dev &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to speed up compiling/linking, you can install gold, an alternative linker and when you plan to develop / recompile often ccache :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;sudo apt-get install binutils-gold ccache&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
to make ccache useful, the cache size needs to be increased by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;ccache -M 5G&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to set it to 5GB.&lt;br /&gt;
&lt;br /&gt;
== Gentoo ==&lt;br /&gt;
This has been tested to work with a clean install of gentoo 2008.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
emerge cmake \&amp;gt;=media-libs/freetype-2.0.0 \&amp;gt;=media-libs/libsdl-2&lt;br /&gt;
emerge media-libs/openal media-libs/glew dev-libs/boost&lt;br /&gt;
emerge app-arch/zip media-libs/libogg&lt;br /&gt;
USE=&amp;quot;png jpg tiff opengl&amp;quot; emerge media-libs/devil &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or better you install Spring via [http://springrts.com/wiki/Gentoo_install layman], it will install all dependencies.&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
On Fedora 12-21:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo yum install gcc-c++ cmake boost-devel DevIL-devel freetype-devel libunwind-devel \&lt;br /&gt;
glew-devel libvorbis-devel libXcursor-devel openal-devel SDL2-devel p7zip&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Fedora 8:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
yum install cmake boost-devel openal-devel SDL2-devel \&lt;br /&gt;
DevIL-devel glew-devel libvorbis-devel &lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slackware ==&lt;br /&gt;
&lt;br /&gt;
On Slackware 13, cmake, ogg &amp;amp; vorbis, boost, glew and SDL2 already come with the full regular install, both libs and headers. You can find helper scripts to easily compile and package DevIL, OpenAL and spring itself [http://slackbuilds.org/ here].&lt;br /&gt;
&lt;br /&gt;
Try to use [http://idlemoor.github.io/slackrepo/ slackrepo], will search, update and install spring and dependences.&lt;br /&gt;
&lt;br /&gt;
= Build And Install =&lt;br /&gt;
&lt;br /&gt;
== Using CMake (2.6 or newer) ==&lt;br /&gt;
Configure and build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake .&lt;br /&gt;
make spring&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
make install-spring&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Default install paths are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/bin/spring&amp;lt;/code&amp;gt; Spring executable&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;/usr/local/share/games/spring&amp;lt;/code&amp;gt; read-only data&lt;br /&gt;
&lt;br /&gt;
If you want &amp;lt;code&amp;gt;~/spring&amp;lt;/code&amp;gt; prefix instead of &amp;lt;code&amp;gt;/usr/local&amp;lt;/code&amp;gt;, configure like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake -DCMAKE_INSTALL_PREFIX=~/spring .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
For further ways of customizing your build, have a look at the variables shown with:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake -LH .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For other targets see the output of &amp;lt;code&amp;gt;make help&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= See Also: =&lt;br /&gt;
* [[Finalizing_linux_install]]&lt;br /&gt;
* [[Troubleshooting_linux]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Compiling]]&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9079</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9079"/>
		<updated>2016-06-04T01:11:29Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Proprietary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__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]]). &lt;br /&gt;
&lt;br /&gt;
Game can also be [[Getting_Spring_Content_and_Links|downloaded manually]], as sdz files, and placed into ../Spring/Games. Read the advice on [[Read_Me_First|this page]] if your lobby does not find your games. 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;
|-&lt;br /&gt;
| width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://zero-k.info/ Zero-K]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/legal.txt GPL, PD])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://spring1944.org/ Spring: 1944]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([https://github.com/spring1944/spring1944/blob/master/docs/License.txt CC-BY-NC])&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=Zero-k_image.jpg|link=http://zero-k.info/}}&lt;br /&gt;
|&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=S44_tigers.jpg|link=http://spring1944.org}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. [http://zero-k.info Download link]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | Spring:1944 is a WWII themed game with four fully functional sides (US, Germany, USSR, Britain), period-accurate units and strengths. Realism comes second only to creating a game that is fun and accessible to play.&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[http://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;([http://creativecommons.org/licenses/by-nc-nd/3.0/us/ CC-BY-NC-ND])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;([[Kernel_Panic#License:|FOSS, with only 2 FOSS maps]])&amp;lt;!-- Since you should be able to remove those, I wonâ€™t mark it as non-free. Other maps have non-free license or no license at all.) --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot;| {{navimgx|xsize=300|ysize=188|image=Evoimg.jpg|link=http://www.evolutionrts.info}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Kernel_Panic_3.4.jpg|link=Kernel Panic}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;&#039;&#039;&#039;[http://springfiles.com/spring/games/edge-1 On The Edge]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;  (GPL, [http://creativecommons.org/licenses/by-nc-sa/3.0/us/ CC-BY-NC-SA])&lt;br /&gt;
|&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://www.moddb.com/games/conflict-terra Conflict Terra]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([http://code.google.com/p/conflictterra/source/browse/games/CT/License.txt FOSS])&amp;lt;!-- The sounds from EvoRTS were removed, so we&#039;re clean now. --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=start3.jpg||link=http://springfiles.com/spring/games/edge-1}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimgx|xsize=300|ysize=225|image=CT_Hojos.png|link=http://www.moddb.com/games/conflict-terra}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | First Spring MOBA with unique pre-game hero setup. Under heavy development. How to setup working the game read on [http://springrts.com/phpbb/viewtopic.php?f=55&amp;amp;t=31476 On The Edge forum thread]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://www.indiedb.com/games/the-cursed The Cursed]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://creativecommons.org/licenses/by-nc-sa/4.0 CC-BY-NC-SA])&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &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;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=cursed_logo.jpg|link=http://www.indiedb.com/games/the-cursed}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Mf_spring_wiki.jpg|link=http://www.metalfactions.pt}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. &lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
&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;
|  width=&amp;quot;300px&amp;quot; | &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;
| width=40 |&lt;br /&gt;
|  width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=69 Journeywar] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Imperial Winter assault.jpg|link=https://springrts.com/phpbb/viewforum.php?f=46}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=JwLogo.jpg|link=https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1180}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
| align=&amp;quot;justify&amp;quot; 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. Download in Springlogbby as jw:test archive.&lt;br /&gt;
&lt;br /&gt;
 &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; [http://springrts.com/wiki/Balanced_Annihilation Balanced Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [http://springfiles.com/spring/games/tech-annihilation-8 Tech Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=BAScreenShot.jpg|link=http://springrts.com/phpbb/viewforum.php?f=44}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=200|image=Tech_Annihilation.png|link=http://springfiles.com/spring/games/tech-annihilation-8}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
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;
&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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! (by &#039;&#039;[BoS]Senna&#039;&#039;, currently no homepage)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt;[http://nota.machys.net/downloads NOTA]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [[XTA]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=notAgame02.jpg|link=http://nota.machys.net/downloads}}&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Screen508_s.jpg|link=XTA}}&lt;br /&gt;
|-&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.&lt;br /&gt;
| width=40 |&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! &lt;br /&gt;
&lt;br /&gt;
In some cases however, the game will only distribute a game-file, 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;. For these games, you have to [[Download|install the stand-alone Spring-Engine]] first, and then place the game-file in the &#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).&lt;br /&gt;
You may install multiple games in the same engine installation.&lt;br /&gt;
&lt;br /&gt;
To play a game, you also need a [[Maps|map]].&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=File:JwLogo.jpg&amp;diff=21831</id>
		<title>File:JwLogo.jpg</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=File:JwLogo.jpg&amp;diff=21831"/>
		<updated>2016-06-04T01:10:38Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: Logo of Journeywar&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Logo of Journeywar&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9078</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9078"/>
		<updated>2016-06-03T23:51:52Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Proprietary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__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]]). &lt;br /&gt;
&lt;br /&gt;
Game can also be [[Getting_Spring_Content_and_Links|downloaded manually]], as sdz files, and placed into ../Spring/Games. Read the advice on [[Read_Me_First|this page]] if your lobby does not find your games. 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;
|-&lt;br /&gt;
| width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://zero-k.info/ Zero-K]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/legal.txt GPL, PD])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://spring1944.org/ Spring: 1944]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([https://github.com/spring1944/spring1944/blob/master/docs/License.txt CC-BY-NC])&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=Zero-k_image.jpg|link=http://zero-k.info/}}&lt;br /&gt;
|&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=S44_tigers.jpg|link=http://spring1944.org}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. [http://zero-k.info Download link]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | Spring:1944 is a WWII themed game with four fully functional sides (US, Germany, USSR, Britain), period-accurate units and strengths. Realism comes second only to creating a game that is fun and accessible to play.&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[http://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;([http://creativecommons.org/licenses/by-nc-nd/3.0/us/ CC-BY-NC-ND])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;([[Kernel_Panic#License:|FOSS, with only 2 FOSS maps]])&amp;lt;!-- Since you should be able to remove those, I wonâ€™t mark it as non-free. Other maps have non-free license or no license at all.) --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot;| {{navimgx|xsize=300|ysize=188|image=Evoimg.jpg|link=http://www.evolutionrts.info}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Kernel_Panic_3.4.jpg|link=Kernel Panic}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;&#039;&#039;&#039;[http://springfiles.com/spring/games/edge-1 On The Edge]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;  (GPL, [http://creativecommons.org/licenses/by-nc-sa/3.0/us/ CC-BY-NC-SA])&lt;br /&gt;
|&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://www.moddb.com/games/conflict-terra Conflict Terra]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([http://code.google.com/p/conflictterra/source/browse/games/CT/License.txt FOSS])&amp;lt;!-- The sounds from EvoRTS were removed, so we&#039;re clean now. --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=start3.jpg||link=http://springfiles.com/spring/games/edge-1}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimgx|xsize=300|ysize=225|image=CT_Hojos.png|link=http://www.moddb.com/games/conflict-terra}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | First Spring MOBA with unique pre-game hero setup. Under heavy development. How to setup working the game read on [http://springrts.com/phpbb/viewtopic.php?f=55&amp;amp;t=31476 On The Edge forum thread]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://www.indiedb.com/games/the-cursed The Cursed]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://creativecommons.org/licenses/by-nc-sa/4.0 CC-BY-NC-SA])&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &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;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=cursed_logo.jpg|link=http://www.indiedb.com/games/the-cursed}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Mf_spring_wiki.jpg|link=http://www.metalfactions.pt}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. &lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
&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;
|  width=&amp;quot;300px&amp;quot; | &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;
| width=40 |&lt;br /&gt;
|  width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=69 Journeywar] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Imperial Winter assault.jpg|link=https://springrts.com/phpbb/viewforum.php?f=46}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image= JWLogo.jpg|link=https://springrts.com/phpbb/viewtopic.php?f=69&amp;amp;t=23275&amp;amp;start=1180}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
| align=&amp;quot;justify&amp;quot; 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. Download in Springlogbby as jw:test archive.&lt;br /&gt;
&lt;br /&gt;
 &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; [http://springrts.com/wiki/Balanced_Annihilation Balanced Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [http://springfiles.com/spring/games/tech-annihilation-8 Tech Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=BAScreenShot.jpg|link=http://springrts.com/phpbb/viewforum.php?f=44}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=200|image=Tech_Annihilation.png|link=http://springfiles.com/spring/games/tech-annihilation-8}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
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;
&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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! (by &#039;&#039;[BoS]Senna&#039;&#039;, currently no homepage)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt;[http://nota.machys.net/downloads NOTA]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [[XTA]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=notAgame02.jpg|link=http://nota.machys.net/downloads}}&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Screen508_s.jpg|link=XTA}}&lt;br /&gt;
|-&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.&lt;br /&gt;
| width=40 |&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! &lt;br /&gt;
&lt;br /&gt;
In some cases however, the game will only distribute a game-file, 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;. For these games, you have to [[Download|install the stand-alone Spring-Engine]] first, and then place the game-file in the &#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).&lt;br /&gt;
You may install multiple games in the same engine installation.&lt;br /&gt;
&lt;br /&gt;
To play a game, you also need a [[Maps|map]].&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9077</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=9077"/>
		<updated>2016-06-03T23:50:51Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Proprietary - Added my game into the  Section where Mech Warrior and Gundam will go.*/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__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]]). &lt;br /&gt;
&lt;br /&gt;
Game can also be [[Getting_Spring_Content_and_Links|downloaded manually]], as sdz files, and placed into ../Spring/Games. Read the advice on [[Read_Me_First|this page]] if your lobby does not find your games. 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;
|-&lt;br /&gt;
| width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://zero-k.info/ Zero-K]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://code.google.com/p/zero-k/source/browse/trunk/mods/zk/legal.txt GPL, PD])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://spring1944.org/ Spring: 1944]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([https://github.com/spring1944/spring1944/blob/master/docs/License.txt CC-BY-NC])&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=Zero-k_image.jpg|link=http://zero-k.info/}}&lt;br /&gt;
|&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=S44_tigers.jpg|link=http://spring1944.org}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. [http://zero-k.info Download link]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | Spring:1944 is a WWII themed game with four fully functional sides (US, Germany, USSR, Britain), period-accurate units and strengths. Realism comes second only to creating a game that is fun and accessible to play.&lt;br /&gt;
|-&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[http://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;([http://creativecommons.org/licenses/by-nc-nd/3.0/us/ CC-BY-NC-ND])&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;([[Kernel_Panic#License:|FOSS, with only 2 FOSS maps]])&amp;lt;!-- Since you should be able to remove those, I wonâ€™t mark it as non-free. Other maps have non-free license or no license at all.) --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  valign=&amp;quot;top&amp;quot;| {{navimgx|xsize=300|ysize=188|image=Evoimg.jpg|link=http://www.evolutionrts.info}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Kernel_Panic_3.4.jpg|link=Kernel Panic}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;&#039;&#039;&#039;[http://springfiles.com/spring/games/edge-1 On The Edge]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;  (GPL, [http://creativecommons.org/licenses/by-nc-sa/3.0/us/ CC-BY-NC-SA])&lt;br /&gt;
|&lt;br /&gt;
|  | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://www.moddb.com/games/conflict-terra Conflict Terra]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;([http://code.google.com/p/conflictterra/source/browse/games/CT/License.txt FOSS])&amp;lt;!-- The sounds from EvoRTS were removed, so we&#039;re clean now. --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  |{{navimgx|xsize=300|ysize=225|image=start3.jpg||link=http://springfiles.com/spring/games/edge-1}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimgx|xsize=300|ysize=225|image=CT_Hojos.png|link=http://www.moddb.com/games/conflict-terra}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | First Spring MOBA with unique pre-game hero setup. Under heavy development. How to setup working the game read on [http://springrts.com/phpbb/viewtopic.php?f=55&amp;amp;t=31476 On The Edge forum thread]&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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.&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt;[http://www.indiedb.com/games/the-cursed The Cursed]&amp;lt;/h2&amp;gt;&lt;br /&gt;
([http://creativecommons.org/licenses/by-nc-sa/4.0 CC-BY-NC-SA])&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;300px&amp;quot; | &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;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=cursed_logo.jpg|link=http://www.indiedb.com/games/the-cursed}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Mf_spring_wiki.jpg|link=http://www.metalfactions.pt}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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. &lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
&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;
|  width=&amp;quot;300px&amp;quot; | &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;
| width=40 |&lt;br /&gt;
|  width=&amp;quot;300px&amp;quot; | &amp;lt;h2&amp;gt; [https://springrts.com/phpbb/viewforum.php?f=69 Journeywar] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=Imperial Winter assault.jpg|link=https://springrts.com/phpbb/viewforum.php?f=46}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image= JWLogo.jpg|link=https://springrts.com/phpbb/viewforum.php?f=46}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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;
| align=&amp;quot;justify&amp;quot; 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. Download in Springlogbby as jw:test archive.&lt;br /&gt;
&lt;br /&gt;
 &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; [http://springrts.com/wiki/Balanced_Annihilation Balanced Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [http://springfiles.com/spring/games/tech-annihilation-8 Tech Annihilation] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=BAScreenShot.jpg|link=http://springrts.com/phpbb/viewforum.php?f=44}}&lt;br /&gt;
|&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=200|image=Tech_Annihilation.png|link=http://springfiles.com/spring/games/tech-annihilation-8}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; valign=&amp;quot;top&amp;quot; | &lt;br /&gt;
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;
&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; 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! (by &#039;&#039;[BoS]Senna&#039;&#039;, currently no homepage)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt;[http://nota.machys.net/downloads NOTA]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  |  &amp;lt;h2&amp;gt; [[XTA]] &amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|  | {{navimgx|xsize=300|ysize=225|image=notAgame02.jpg|link=http://nota.machys.net/downloads}}&lt;br /&gt;
| width=40 |&lt;br /&gt;
|  | {{navimg|xsize=300|ysize=225|image=Screen508_s.jpg|link=XTA}}&lt;br /&gt;
|-&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.&lt;br /&gt;
| width=40 |&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! &lt;br /&gt;
&lt;br /&gt;
In some cases however, the game will only distribute a game-file, 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;. For these games, you have to [[Download|install the stand-alone Spring-Engine]] first, and then place the game-file in the &#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).&lt;br /&gt;
You may install multiple games in the same engine installation.&lt;br /&gt;
&lt;br /&gt;
To play a game, you also need a [[Maps|map]].&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_WeaponDefs&amp;diff=12495</id>
		<title>Lua WeaponDefs</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_WeaponDefs&amp;diff=12495"/>
		<updated>2016-05-15T11:28:19Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: He who removed this from the page should be ashamed- rather show outdated information or just a link to source- then no information&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;
The &#039;&#039;&#039;WeaponDefs[]&#039;&#039;&#039; table holds all information about the weapons used in a game.&lt;br /&gt;
&lt;br /&gt;
Works the same way as [[Lua_UnitDefs]] except the tables are called &#039;&#039;&#039;WeaponDefs[]&#039;&#039;&#039; and &#039;&#039;&#039;WeaponDefNames[]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Note: Its entries are metatables, so you can&#039;t use the pairs() iterator on them, use this instead:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  for id,weaponDef in pairs(WeaponDefs) do&lt;br /&gt;
    for name,param in weaponDef:pairs() do&lt;br /&gt;
      Spring.Echo(name,param)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Naming==&lt;br /&gt;
If a unit named &amp;quot;tank&amp;quot; has a weapon named &amp;quot;gun&amp;quot;, the resulting &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt; will be &amp;quot;tank_gun&amp;quot; and you can get this weaponDefID like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;local gunID = WeaponDefNames[&amp;quot;tank_gun&amp;quot;].id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
For a more detailed, but outdated tag definition look at &lt;br /&gt;
[[Weapon_Variables]] or look directly at the source at &lt;br /&gt;
https://github.com/spring/spring/blob/5f08624585852b8c8dfd1a16d020ae530269dc09/rts/Sim/Weapons/WeaponLoader.cpp&lt;br /&gt;
&lt;br /&gt;
In key = value format, where WeaponDefs[weaponDefID].key==value, with subtables at the end.&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
    accuracy = 0,&lt;br /&gt;
    avoidFeature = false,&lt;br /&gt;
    avoidFriendly = true,&lt;br /&gt;
    avoidNeutral = false,&lt;br /&gt;
    beamTTL = 0,&lt;br /&gt;
    beamburst = false,&lt;br /&gt;
    beamtime = 0.10000000149012,&lt;br /&gt;
    bouncerebound = 1,&lt;br /&gt;
    canAttackGround = true,&lt;br /&gt;
    cegTag = &amp;quot;&amp;quot;,&lt;br /&gt;
    collisionSize = 0.050000000745058,&lt;br /&gt;
    coverageRange = 0,&lt;br /&gt;
    craterAreaOfEffect = 0,&lt;br /&gt;
    cylinderTargeting = 1,&lt;br /&gt;
    cylinderTargetting = 1,&lt;br /&gt;
    damageAreaOfEffect = 6,&lt;br /&gt;
    dance = 0,&lt;br /&gt;
    description = &amp;quot;J7Laser&amp;quot;,&lt;br /&gt;
    duration = 0.050000000745058,&lt;br /&gt;
    dynDamageExp = 0,&lt;br /&gt;
    dynDamageInverted = false,&lt;br /&gt;
    dynDamageMin = 0,&lt;br /&gt;
    dynDamageRange = 0,&lt;br /&gt;
    edgeEffectiveness = 0.99000000953674,&lt;br /&gt;
    energyCost = 0,&lt;br /&gt;
    explosionSpeed = 3.233583688736,&lt;br /&gt;
    exteriorShield = false,&lt;br /&gt;
    fireStarter = 0.69999998807907,&lt;br /&gt;
    flightTime = 0,&lt;br /&gt;
    gravityAffected = false,&lt;br /&gt;
    groundbounce = false,&lt;br /&gt;
    groundslip = 1,&lt;br /&gt;
    heightBoostFactor = -1,&lt;br /&gt;
    heightMod = 1,&lt;br /&gt;
    highTrajectory = 2,&lt;br /&gt;
    id = 220,&lt;br /&gt;
    impactOnly = true,&lt;br /&gt;
    intensity = 0.89999997615814,&lt;br /&gt;
    interceptSolo = true,&lt;br /&gt;
    interceptedByShieldType = 2,&lt;br /&gt;
    interceptor = 0,&lt;br /&gt;
    isShield = false,&lt;br /&gt;
    largeBeamLaser = false,&lt;br /&gt;
    laserHardStop = false,&lt;br /&gt;
    leadBonus = 0,&lt;br /&gt;
    leadLimit = -1,&lt;br /&gt;
    manualFire = false,&lt;br /&gt;
    maxAngle = 0.95873802900314,&lt;br /&gt;
    metalCost = 0,&lt;br /&gt;
    minIntensity = 0,&lt;br /&gt;
    movingAccuracy = 0,&lt;br /&gt;
    myGravity = 0,&lt;br /&gt;
    name = &amp;quot;corcom_armcomlaser&amp;quot;,&lt;br /&gt;
    noAutoTarget = false,&lt;br /&gt;
    noEnemyCollide = false,&lt;br /&gt;
    noExplode = false,&lt;br /&gt;
    noFeatureCollide = false,&lt;br /&gt;
    noFriendlyCollide = false,&lt;br /&gt;
    noGroundCollide = false,&lt;br /&gt;
    noNeutralCollide = false,&lt;br /&gt;
    noSelfDamage = true,&lt;br /&gt;
    numbounce = -1,&lt;br /&gt;
    onlyForward = false,&lt;br /&gt;
    paralyzer = false,&lt;br /&gt;
    predictBoost = 0,&lt;br /&gt;
    projectiles = 1,&lt;br /&gt;
    projectilespeed = 30.000001907349,&lt;br /&gt;
    proximityPriority = 1,&lt;br /&gt;
    range = 300,&lt;br /&gt;
    reload = 0.40000000596046,&lt;br /&gt;
    salvoDelay = 0.10000000149012,&lt;br /&gt;
    salvoSize = 1,&lt;br /&gt;
    selfExplode = false,&lt;br /&gt;
    shieldAlpha = 0.20000000298023,&lt;br /&gt;
    shieldBadColorB = 0.5,&lt;br /&gt;
    shieldBadColorG = 0.5,&lt;br /&gt;
    shieldBadColorR = 1,&lt;br /&gt;
    shieldEnergyUse = 0,&lt;br /&gt;
    shieldForce = 0,&lt;br /&gt;
    shieldGoodColorB = 1,&lt;br /&gt;
    shieldGoodColorG = 0.5,&lt;br /&gt;
    shieldGoodColorR = 0.5,&lt;br /&gt;
    shieldInterceptType = 0,&lt;br /&gt;
    shieldMaxSpeed = 0,&lt;br /&gt;
    shieldPower = 0,&lt;br /&gt;
    shieldPowerRegen = 0,&lt;br /&gt;
    shieldPowerRegenEnergy = 0,&lt;br /&gt;
    shieldRadius = 0,&lt;br /&gt;
    shieldRechargeDelay = 0,&lt;br /&gt;
    shieldRepulser = false,&lt;br /&gt;
    size = 2.1875,&lt;br /&gt;
    sizeGrowth = 0.5,&lt;br /&gt;
    smartShield = false,&lt;br /&gt;
    soundTrigger = true,&lt;br /&gt;
    sprayAngle = 0,&lt;br /&gt;
    startvelocity = 0.0099999997764826,&lt;br /&gt;
    stockpile = false,&lt;br /&gt;
    stockpileTime = 30,&lt;br /&gt;
    sweepFire = false,&lt;br /&gt;
    targetBorder = 0,&lt;br /&gt;
    targetMoveError = 0.050000000745058,&lt;br /&gt;
    targetable = 0,&lt;br /&gt;
    tdfId = 0,&lt;br /&gt;
    tracks = false,&lt;br /&gt;
    trajectoryHeight = 0,&lt;br /&gt;
    turnRate = 0,&lt;br /&gt;
    turret = true,&lt;br /&gt;
    type = &amp;quot;BeamLaser&amp;quot;,&lt;br /&gt;
    uptime = 0,&lt;br /&gt;
    visibleShield = false,&lt;br /&gt;
    visibleShieldHitFrames = 0,&lt;br /&gt;
    visibleShieldRepulse = false,&lt;br /&gt;
    waterWeapon = false,&lt;br /&gt;
    waterbounce = false,&lt;br /&gt;
    weaponAcceleration = 0,&lt;br /&gt;
    wobble = 0,&lt;br /&gt;
    customParams = {},&lt;br /&gt;
    damages = {&lt;br /&gt;
        craterBoost = 0,&lt;br /&gt;
        ...&lt;br /&gt;
    },&lt;br /&gt;
    fireSound = {&lt;br /&gt;
        [1] = {&lt;br /&gt;
            id = 36,&lt;br /&gt;
            name = &amp;quot;lasrfir1&amp;quot;,&lt;br /&gt;
            volume = 6.1237244606018,&lt;br /&gt;
        },&lt;br /&gt;
        ...&lt;br /&gt;
    },&lt;br /&gt;
    hitSound = {&lt;br /&gt;
        [1] = {&lt;br /&gt;
            id = -1,&lt;br /&gt;
            name = &amp;quot;&amp;quot;,&lt;br /&gt;
            volume = 6.1237244606018,&lt;br /&gt;
        },&lt;br /&gt;
        ...&lt;br /&gt;
    },&lt;br /&gt;
    visuals = {&lt;br /&gt;
        alphaDecay = 1,&lt;br /&gt;
        alwaysVisible = false,&lt;br /&gt;
        beamDecay = 1,&lt;br /&gt;
        beamWeapon = false,&lt;br /&gt;
        color2B = 1,&lt;br /&gt;
        color2G = 1,&lt;br /&gt;
        color2R = 1,&lt;br /&gt;
        colorB = 0,&lt;br /&gt;
        colorG = 0,&lt;br /&gt;
        colorR = 1,&lt;br /&gt;
        coreThickness = 0.10000000149012,&lt;br /&gt;
        laserFlareSize = 7,&lt;br /&gt;
        modelName = &amp;quot;&amp;quot;,&lt;br /&gt;
        noGap = true,&lt;br /&gt;
        pulseSpeed = 1,&lt;br /&gt;
        scrollSpeed = 5,&lt;br /&gt;
        separation = 1,&lt;br /&gt;
        sizeDecay = 0,&lt;br /&gt;
        smokeTrail = false,&lt;br /&gt;
        stages = 5,&lt;br /&gt;
        thickness = 2,&lt;br /&gt;
        tileLength = 200,&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8810</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=8810"/>
		<updated>2016-03-01T22:23:40Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /*He was a good tag, he served is time - and now he is gone. Replaced by some hardcoded behaviour sniff..  */&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;
|special = 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;
|special = 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;
|special = 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 = collideFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = 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;
|special = 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;
|special = 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. 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;
|special = 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;
|special = 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;
|special = 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;
|special = 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;
|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;
|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.&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|shieldrepulser|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 = shieldrepulser&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 = shieldForce&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 = shieldMaxSpeed&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 = visibleShieldRepulse&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 = shieldInterceptType&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 = smartShield&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 = exteriorShield&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 = shieldEnergyUse&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 = shieldRadius&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 = shieldPower&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 = shieldPowerRegen&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 = shieldPowerRegenEnergy&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 = shieldRechargeDelay&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 = visibleShield&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 = visibleShieldHitFrames&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 = shieldBadColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {1.0, 0.5, 0.5} (Red)&lt;br /&gt;
|description = The RGB 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 = shieldGoodColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.5, 0.5, 1.0} (Blue)&lt;br /&gt;
|description = The RGB 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 = shieldAlpha&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8809</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=8809"/>
		<updated>2016-03-01T22:19:54Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* https://github.com/spring/spring/blob/034a372c5017cd2f46fd57c904460a0775a59764/rts/Lua/LuaWeaponDefs.cpp    */&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;
|special = 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;
|special = 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;
|special = 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 = collideFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = 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;
|special = 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;
|special = 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. 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;
|special = 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;
|special = 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;
|special = 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;
|special = 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;
|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;
|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.&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|shieldrepulser|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 = shieldrepulser&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 = shieldForce&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 = shieldMaxSpeed&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 = visibleShieldRepulse&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 = shieldInterceptType&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 = smartShield&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 = exteriorShield&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 = shieldEnergyUse&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 = shieldRadius&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 = shieldPower&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 = shieldPowerRegen&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 = shieldPowerRegenEnergy&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 = shieldRechargeDelay&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 = visibleShield&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 = visibleShieldHitFrames&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 = shieldBadColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {1.0, 0.5, 0.5} (Red)&lt;br /&gt;
|description = The RGB 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 = shieldGoodColor&lt;br /&gt;
|type = float[3]&lt;br /&gt;
|default = {0.5, 0.5, 1.0} (Blue)&lt;br /&gt;
|description = The RGB 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 = shieldAlpha&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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8808</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=8808"/>
		<updated>2016-03-01T22:13:35Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Shield (WeaponType) */&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;
|special = 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;
|special = 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;
|special = 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 = collideFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = 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;
|special = 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;
|special = 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. 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;
|special = 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;
|special = 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;
|special = 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;
|special = 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;
|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;
|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.&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|shieldrepulser|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[3]&lt;br /&gt;
|default = {1.0, 0.5, 0.5} (Red)&lt;br /&gt;
|description = The RGB 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[3]&lt;br /&gt;
|default = {0.5, 0.5, 1.0} (Blue)&lt;br /&gt;
|description = The RGB 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Gamedev:WeaponDefs&amp;diff=8807</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=8807"/>
		<updated>2016-03-01T22:13:19Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Shield (WeaponType) */&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;
|special = 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;
|special = 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;
|special = 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 = collideFeature&lt;br /&gt;
|type = bool&lt;br /&gt;
|default = true&lt;br /&gt;
|special = 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;
|special = 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;
|special = 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. 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;
|special = 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;
|special = 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;
|special = 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;
|special = 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;
|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;
|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.&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|shieldrepulsor|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[3]&lt;br /&gt;
|default = {1.0, 0.5, 0.5} (Red)&lt;br /&gt;
|description = The RGB 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[3]&lt;br /&gt;
|default = {0.5, 0.5, 1.0} (Blue)&lt;br /&gt;
|description = The RGB 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>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10833</id>
		<title>Lua:Libarylinks</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10833"/>
		<updated>2015-09-13T18:03:41Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lua libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Lua]] &lt;br /&gt;
&lt;br /&gt;
== Lua libraries ==&lt;br /&gt;
&lt;br /&gt;
Many things you need for springs  lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel. This statement does in no way imply you are unable to code this, but that you rather invest your time into not fixing the same bugs others found before you.&lt;br /&gt;
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:&lt;br /&gt;
&lt;br /&gt;
To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add&lt;br /&gt;
 &amp;lt;sub&amp;gt;include &amp;quot;LibraryFileName.lua&amp;quot;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available. &lt;br /&gt;
&lt;br /&gt;
If you want to include a Lua-Function into your gadget or widget&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sub&amp;gt;VFS.Include(&amp;quot;Gamefolder/Relative/Path/ToLibrary/Library.lua&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; Librarys&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Journeywar =&lt;br /&gt;
Quality: Average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table and UnitScript Operations&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Library for Procedural Units and Buildings from Pieces&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Miniature Operatings Systems and Statemachines&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master&lt;br /&gt;
&lt;br /&gt;
=Zero-K=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua&lt;br /&gt;
&lt;br /&gt;
=S44=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_vector.lua&lt;br /&gt;
https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/utilities.lua&lt;br /&gt;
&lt;br /&gt;
=BAR=&lt;br /&gt;
Quality: Unknown&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10832</id>
		<title>Lua:Libarylinks</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10832"/>
		<updated>2015-09-13T18:02:02Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Journeywar */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Lua]] &lt;br /&gt;
&lt;br /&gt;
== Lua libraries ==&lt;br /&gt;
&lt;br /&gt;
Many things you need for springs  lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel.&lt;br /&gt;
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:&lt;br /&gt;
&lt;br /&gt;
To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add&lt;br /&gt;
 &amp;lt;sub&amp;gt;include &amp;quot;LibraryFileName.lua&amp;quot;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available. &lt;br /&gt;
&lt;br /&gt;
If you want to include a Lua-Function into your gadget or widget&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sub&amp;gt;VFS.Include(&amp;quot;Gamefolder/Relative/Path/ToLibrary/Library.lua&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; Librarys&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Journeywar =&lt;br /&gt;
Quality: Average&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table and UnitScript Operations&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Library for Procedural Units and Buildings from Pieces&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Miniature Operatings Systems and Statemachines&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master&lt;br /&gt;
&lt;br /&gt;
=Zero-K=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua&lt;br /&gt;
&lt;br /&gt;
=S44=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_vector.lua&lt;br /&gt;
https://github.com/spring1944/spring1944/blob/master/LuaRules/Includes/utilities.lua&lt;br /&gt;
&lt;br /&gt;
=BAR=&lt;br /&gt;
Quality: Unknown&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11778</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=11778"/>
		<updated>2015-09-11T09:21:40Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Unit Handling */ added Spring.SetUnitPieceParent&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&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.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;
= 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;&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; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt; Removed from version 83.0&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&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&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 ] ) -&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.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;&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.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.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;aimReady&amp;quot; = number value,] &amp;lt;span class=note&amp;gt;(&amp;lt;&amp;gt;0.0f := true)&amp;lt;/span&amp;gt;&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/span&amp;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;
&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.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.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, string &amp;quot;UnitDefName?&amp;quot; [, number facing | string &amp;quot;facing&amp;quot; ] ) -&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;
&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.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;
&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.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.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;
&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 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;
== 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;
    [ 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;
&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;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;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;
&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetExperienceGrade&#039;&#039;&#039;&lt;br /&gt;
  ( number expGrade&lt;br /&gt;
   &amp;lt;font color=#55ee99&amp;gt;[, number ExpPowerScale [, number ExpHealthScale [, number ExpReloadScale ]]]&amp;lt;/font&amp;gt; ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;expGrade defines how often UnitExperience() will be called,&lt;br /&gt;
   it is based on the following equation:&lt;br /&gt;
     (int) [exp/(exp+1)] / expGrade&lt;br /&gt;
   If this integer differs from the one before the experience change&lt;br /&gt;
   it will call UnitExperience().&lt;br /&gt;
  Also those 3 last params are only available in .cheat&lt;br /&gt;
  &amp;lt;/font&amp;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;
= 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.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;
&#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;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lobby_Development&amp;diff=10644</id>
		<title>Lobby Development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lobby_Development&amp;diff=10644"/>
		<updated>2015-08-16T21:25:19Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lobby server development */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Documentation=&lt;br /&gt;
&lt;br /&gt;
==Protocol==&lt;br /&gt;
* [http://springrts.com/dl/LobbyProtocol/ HTML] (is updated once a day)&lt;br /&gt;
* [https://github.com/spring/LobbyProtocol/blob/master/ProtocolDescription.xml XML] (raw, always latest)&lt;br /&gt;
&lt;br /&gt;
==Download Systems==&lt;br /&gt;
* [http://springrts.com/wiki/Dev:LobbyDownloadSystems Lobby Download Systems]&lt;br /&gt;
&lt;br /&gt;
=Lobby client development=&lt;br /&gt;
&lt;br /&gt;
==Useable lobby clients==&lt;br /&gt;
&lt;br /&gt;
===[[SpringLobby]]===&lt;br /&gt;
&lt;br /&gt;
===flobby===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;Linux&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C++&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;cleanrock&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/cleanrock/flobby github page]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Weblobby===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C++&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;CarRepairer&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/springweblobby/swl-website#spring-web-lobby project site]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==WIP, abandoned or unusable==&lt;br /&gt;
&lt;br /&gt;
===[[TASClient]]===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;Windows&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Delphi&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#FF0000&amp;quot;&amp;gt;unmaintained&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Alphalobby===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;Windows&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#FF0000&amp;quot;&amp;gt;unmaintained&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alphalobby is still very much work in progress. If you still wish to use it, source available from the [http://code.google.com/p/alphalobby/source/checkout mercurial repository], binary available on the [http://springfiles.com/spring/lobby-clients/alphalobby springfiles page].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CheeseLobby===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Java&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;Cheesecan&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://springrts.com/phpbb/viewtopic.php?f=64&amp;amp;t=24905 forum thread]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jahwag/cheeselobby binaries and code]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===QtLobby===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C++&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#FF0000&amp;quot;&amp;gt;unmaintained&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/tizbac/qtlobby project page]&lt;br /&gt;
&lt;br /&gt;
===muslce===&lt;br /&gt;
&lt;br /&gt;
Most useless spring lobby client ever&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;android&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;java&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#FF0000&amp;quot;&amp;gt;unmaintained&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://springrts.massive.ch/muslce/Muslce-20130617.tar.bz2&lt;br /&gt;
&lt;br /&gt;
===Zero-K Lobby===&lt;br /&gt;
&lt;br /&gt;
No longer uses the Spring lobby protocol&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;Windows/Linux&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C#&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;Licho&amp;lt;/font&amp;gt; &amp;amp; &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;quantum&amp;lt;/font&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[https://github.com/ZeroK-RTS/Zero-K-Infrastructure/tree/master/ZeroKLobby Zero-K Lobby github]&lt;br /&gt;
&lt;br /&gt;
=Libraries and frameworks=&lt;br /&gt;
&lt;br /&gt;
==Spring-PythonBotFramework==&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Python&amp;lt;/font&amp;gt;, by&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;BrainDamage&amp;lt;/font&amp;gt; &amp;amp; &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;koshi&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A bot framework written in python. [https://github.com/renemilk/tasbot/wiki GitHub wiki]&lt;br /&gt;
&lt;br /&gt;
==Go SpringLobbyClient==&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Go&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple client implementation of the lobby protocol in Go.&lt;br /&gt;
[https://github.com/Agon/go-slc/ project page]&lt;br /&gt;
&lt;br /&gt;
=Lobby server development=&lt;br /&gt;
==Actively maintained==&lt;br /&gt;
===UberServer===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Python&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;aegis&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The primary lobby server currently running on springrts.com. Most protocol commands in the primary documentation should be fully-functional and compatible between both uberserver and SpringLS (SpringLS hasn&#039;t seen as many updates recently). See the dedicated [[uberserver]] for more info.&lt;br /&gt;
&lt;br /&gt;
===ZeroK Server===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;C#&amp;lt;/font&amp;gt;,&lt;br /&gt;
by &amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;Licho&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LobbyServer for Zero-K. Uses a diffrent Protocoll. Source can be found at&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K-Infrastructure/tree/master/ZkLobbyServer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Abandoned==&lt;br /&gt;
===SpringLS===&lt;br /&gt;
&amp;lt;font color=&amp;quot;orange&amp;quot;&amp;gt;cross-platform&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00AAFF&amp;quot;&amp;gt;Java&amp;lt;/font&amp;gt;,&lt;br /&gt;
&amp;lt;font color=&amp;quot;#00CC00&amp;quot;&amp;gt;hoijui&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The longest-running lobby server, created by Betalord. You can fetch the sources through &#039;&#039;git&#039;&#039;. Details can be found on the [http://github.com/spring/SpringLS development site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Lobby]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedRead&amp;diff=12032</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=12032"/>
		<updated>2015-07-21T19:07:56Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Ground Informations */&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;&#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 | { [ruleIndex1] = {[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 | { [ruleIndex1] = {[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 | { [ruleIndex1] = {[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;
&#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;
&#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;
          table   customTeamKeys,&lt;br /&gt;
          number  incomeMultiplier&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.GetUnitBlocking&#039;&#039;&#039; {{new|85.0}}&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | boolean blocking, boolean crushable&lt;br /&gt;
{{new|95.0}} Now return values are: &lt;br /&gt;
  boolean isBlocking,&lt;br /&gt;
  boolean isSolidObjectCollidable,&lt;br /&gt;
  boolean isProjectileCollidable,&lt;br /&gt;
  boolean isRaySegmentCollidable,&lt;br /&gt;
  boolean crushable,&lt;br /&gt;
  boolean blockEnemyPushing,&lt;br /&gt;
  boolean blockHeightChanges&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitPosition&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, [, boolean midPos [, boolean aimPos ] ] ) -&amp;gt;&lt;br /&gt;
    nil |&lt;br /&gt;
    number bpx, number bpy, number bpz [,&lt;br /&gt;
    number mpx, number mpy, number mpz [,&lt;br /&gt;
    number apx, number apy, number apz ]]&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;since 89.0, returns the base (default), middle or aim position of the unit.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitBasePosition&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;Deprecated in 89.0, use GetUnitPosition&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns the bottom of the unit.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitDirection&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number dx, number dy, number dz&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;returns the direction vector&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitHeading&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number heading&lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;returns heading directions used in COB scripts&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitRotation&#039;&#039;&#039; {{New|95.0}}&lt;br /&gt;
   (number unitID) --&amp;gt; nil | number pitch, number yaw, number roll &lt;br /&gt;
&amp;lt;span class=&amp;quot;note&amp;quot;&amp;gt;Marked as (WIP) in changelog&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitVelocity&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;velw new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number velx, number vely, number velz, number velLength&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitBuildFacing&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsBuilding&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns what unit a constructor/factory is currently building&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitCurrentBuildPower&#039;&#039;&#039; {{new|92.0}}&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number buildPower&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitNanoPieces&#039;&#039;&#039; &lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { [1] = number piece1, etc ... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTransporter&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number unitID&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitIsTransporting&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | { [1] = number unitID, etc... }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID [, number weaponID = -1] ) -&amp;gt; nil | number isEnabled, number curPower&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitTravel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number travel, number travelPeriod&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitFuel&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitFlanking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string &amp;quot;dir&amp;quot; ) -&amp;gt; nil | number x, number y, number z&lt;br /&gt;
  ( number unitID, string &amp;quot;mode&amp;quot; | &amp;quot;moveFactor&amp;quot; | &amp;quot;minDamage&amp;quot; | &amp;quot;maxDamage&amp;quot; ) -&amp;gt; nil | number&lt;br /&gt;
  ( number unitID ) -&amp;gt; nil | number mode, number modilityAdd,&lt;br /&gt;
    number minDamage, number maxDamage, number dirX, number dirY, number dirZ&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSensorRadius&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, string type ) -&amp;gt; nil | number radius&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;possible types are:&amp;lt;br&amp;gt;los, airLos, radar, sonar, seismic, radarJammer &amp;amp; sonarJammer&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitLosState&#039;&#039;&#039; &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;raw is only available in gadgets&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID [, number allyTeamID [, boolean raw] ] ) -&amp;gt; nil | number raw |&lt;br /&gt;
  { [&amp;quot;los&amp;quot; = true] [, &amp;quot;radar&amp;quot; = true] [, &amp;quot;typed&amp;quot; = true] }&lt;br /&gt;
&#039;&#039;&#039;Spring.GetUnitSeparation&#039;&#039;&#039; &amp;lt;span class=&amp;quot;warning&amp;quot;&amp;gt;surfaceDist new in 95.0&amp;lt;/span&amp;gt;&lt;br /&gt;
  ( number unitID1, number unitID2 [, boolean 2D] [, boolean surfaceDist] ) -&amp;gt; nil | number distance&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;returns the distance of 2 units, surfaceDist calculates the distance between the unitsphere surfaces instead of their midpos&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.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;
&#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;
&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;&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;
&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;
&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;
&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;
&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;&#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 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;
&#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;&lt;br /&gt;
  ( number unitID, number piece ) -&amp;gt; number dirx, number diry, number dirz&lt;br /&gt;
&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;Consider this broken. It returns reverse direction in piece space (i.e. vertex(0)-vertex(1)) for pieces with &amp;gt;= 2 vertices and (1,1,1) for pieces with &amp;lt; 2 vertices)&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;
&#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;
&#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;
&#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;
&amp;quot;parent&amp;quot; field {{New|95.0}}&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;
&#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;
=== 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.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;
&#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;&lt;br /&gt;
  ( number featureID ) -&amp;gt; nil | number RemainingMetal, number maxMetal,&lt;br /&gt;
                                number RemainingEnergy, number maxEnergy, number reclaimLeft&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.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;
== 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;
=== Ground Informations ===&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;&#039;Spring.GetGroundNormal&#039;&#039;&#039;&lt;br /&gt;
  ( number x, number z ) -&amp;gt; number x, number y, number z, number slope&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;
=== 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;
[[category: Lua]]&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10830</id>
		<title>Lua:Libarylinks</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10830"/>
		<updated>2015-07-06T10:07:23Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* S44 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Lua]] &lt;br /&gt;
&lt;br /&gt;
== Lua libraries ==&lt;br /&gt;
&lt;br /&gt;
Many things you need for springs  lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel.&lt;br /&gt;
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:&lt;br /&gt;
&lt;br /&gt;
To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add&lt;br /&gt;
 &amp;lt;sub&amp;gt;include &amp;quot;LibraryFileName.lua&amp;quot;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available. &lt;br /&gt;
&lt;br /&gt;
If you want to include a Lua-Function into your gadget or widget&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sub&amp;gt;VFS.Include(&amp;quot;Gamefolder/Relative/Path/ToLibrary/Library.lua&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; Librarys&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Journeywar =&lt;br /&gt;
Quality: Poor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table and UnitScript Operations&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Library for Procedural Units and Buildings from Pieces&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Miniature Operatings Systems and Statemachines&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master&lt;br /&gt;
&lt;br /&gt;
=Zero-K=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua&lt;br /&gt;
&lt;br /&gt;
=S44=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/api_vector.lua&lt;br /&gt;
&lt;br /&gt;
=BAR=&lt;br /&gt;
Quality: Unknown&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10829</id>
		<title>Lua:Libarylinks</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10829"/>
		<updated>2015-07-06T10:03:09Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Lua libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Lua]] &lt;br /&gt;
&lt;br /&gt;
== Lua libraries ==&lt;br /&gt;
&lt;br /&gt;
Many things you need for springs  lua scripting, have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel.&lt;br /&gt;
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:&lt;br /&gt;
&lt;br /&gt;
To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add&lt;br /&gt;
 &amp;lt;sub&amp;gt;include &amp;quot;LibraryFileName.lua&amp;quot;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available. &lt;br /&gt;
&lt;br /&gt;
If you want to include a Lua-Function into your gadget or widget&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sub&amp;gt;VFS.Include(&amp;quot;Gamefolder/Relative/Path/ToLibrary/Library.lua&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; Librarys&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Journeywar =&lt;br /&gt;
Quality: Poor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table and UnitScript Operations&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Library for Procedural Units and Buildings from Pieces&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Miniature Operatings Systems and Statemachines&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master&lt;br /&gt;
&lt;br /&gt;
=Zero-K=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua&lt;br /&gt;
&lt;br /&gt;
=S44=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
=BAR=&lt;br /&gt;
Quality: Unknown&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10828</id>
		<title>Lua:Libarylinks</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Libarylinks&amp;diff=10828"/>
		<updated>2015-07-06T10:01:35Z</updated>

		<summary type="html">&lt;p&gt;Picassoct: /* Zero-K */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Lua libraries ==&lt;br /&gt;
Many things you need for spring-lua scripting, &lt;br /&gt;
have been allready implemented and tested by others. It is considered good practice in allmost every software project to not reinvent the wheel.&lt;br /&gt;
Other Projects have created lua-Librarys, lua files which you can include after copying (or referencing them on GitHub) into your project:&lt;br /&gt;
&lt;br /&gt;
To use them in lua Units-scripts, download them into the same folder the Unitscript resides in and add&lt;br /&gt;
 &amp;lt;sub&amp;gt;include &amp;quot;LibraryFileName.lua&amp;quot;&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The referenced functions are now available. Many Librarys also include a Headerfile of all Functions made available. &lt;br /&gt;
&lt;br /&gt;
If you want to include a Lua-Function into your gadget or widget&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;sub&amp;gt;VFS.Include(&amp;quot;Gamefolder/Relative/Path/ToLibrary/Library.lua&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt; Librarys&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Journeywar =&lt;br /&gt;
Quality: Poor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Table and UnitScript Operations&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_TableOp.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Library for Procedural Units and Buildings from Pieces&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/8cbe713fe3e1027a88f40f9a70f87b788a448048/scripts/lib_Build.lua?at=master&lt;br /&gt;
&lt;br /&gt;
Miniature Operatings Systems and Statemachines&lt;br /&gt;
&lt;br /&gt;
https://bitbucket.org/PicassoCT/journeywar/src/scripts/lib_OS.lua?at=master&lt;br /&gt;
&lt;br /&gt;
=Zero-K=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/constants.lua&lt;br /&gt;
https://github.com/ZeroK-RTS/Zero-K/blob/c4af9dc6043eb8d0a5d48b34bfe3ad55190b1e73/scripts/pieceControl.lua&lt;br /&gt;
&lt;br /&gt;
=S44=&lt;br /&gt;
Quality: Unknown&lt;br /&gt;
&lt;br /&gt;
=BAR=&lt;br /&gt;
Quality: Unknown&lt;/div&gt;</summary>
		<author><name>Picassoct</name></author>
	</entry>
</feed>