<?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=Seanheron</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=Seanheron"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Seanheron"/>
	<updated>2026-11-08T21:34:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=1992</id>
		<title>Animation-LuaCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaCallins&amp;diff=1992"/>
		<updated>2011-02-02T11:11:52Z</updated>

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

		<summary type="html">&lt;p&gt;Seanheron: /* Linux Setup Guide */ put images into Linktemplate - strangely, the interal links increase the vertical box size :/ . However, the external link one does not, so &amp;quot;navimgx&amp;quot; could be used (see Fedora)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Linux Setup Guide=&lt;br /&gt;
&lt;br /&gt;
{{#css:&lt;br /&gt;
  table.glossy {&lt;br /&gt;
    margin: 4px; padding:10px;&lt;br /&gt;
    border: 1px solid rgba(0,0,0,0.5);&lt;br /&gt;
    border-radius: 10px 10px 10px 10px;&lt;br /&gt;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);&lt;br /&gt;
    text-align: center;&lt;br /&gt;
  }&lt;br /&gt;
  /*table.glossy:hover {&lt;br /&gt;
    background: rgba(160,160,220,0.4);&lt;br /&gt;
  }*/&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width:70%; margin-left:15%; margin-right:15%;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| style=&amp;quot;height:31px&amp;quot; align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Git.png|link=Build_from_source}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Build_from_source|From Source]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| &lt;br /&gt;
{{navimg|xsize=64|ysize=64|image=Distributions-ubuntu.png|link=Ubuntu_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Ubuntu_install| Ubuntu]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Distributions-gentoo.png|link=Gentoo_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Gentoo_install|Gentoo]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px; padding:10px 0px 10px 0px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Distributions-slackware.pngâ€Ž|link=Slackware12_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Slackware12_install|Slackware]] &lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px; padding:10px 0px 5px 0px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Distributions-debian.pngâ€Ž|link=Debian_unstable_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Debian: [[Debian_lenny_install|Lenny]] - &amp;lt;br/&amp;gt;[[Debian_etch_install|Etch]] - [[Debian_unstable_install|Squeeze]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Distributions-mandriva_linux.pngâ€Ž|link=Mandriva_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[Mandriva_install|Mandriva]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimg|xsize=64|ysize=64|image=Distributions-opensuse_linux.pngâ€Ž|link=openSUSE_install}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [[openSUSE_install|openSUSE]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|&amp;lt;center&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; style=&amp;quot;width:120px;&amp;quot; |&lt;br /&gt;
| align=&amp;quot;center&amp;quot;| {{navimgx|xsize=64|ysize=64|image=Distributions-fedora.pngâ€Ž|link=http://projects.springlobby.info/projects/springlobby/wiki/Install#Fedora-10}} &amp;lt;!-- from: http://openiconlibrary.sourceforge.net --&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [http://projects.springlobby.info/projects/springlobby/wiki/Install#Fedora-10 Fedora]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GamesDownloads&amp;diff=9150</id>
		<title>GamesDownloads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GamesDownloads&amp;diff=9150"/>
		<updated>2010-07-17T14:37:02Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Engine download link - to appropriate section of download page, else we&amp;#039;re sending people in circles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#css:&lt;br /&gt;
  table.glossy {&lt;br /&gt;
    width: 200px;&lt;br /&gt;
    margin: 4px; padding:3px;&lt;br /&gt;
    border: 1px solid rgba(0,0,0,0.5);&lt;br /&gt;
    border-radius: 10px 10px 10px 10px;&lt;br /&gt;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5), inset 0 1px rgba(255,255,255,0.3), inset 0 10px rgba(255,255,255,0.2), inset 0 10px 20px rgba(255,255,255,0.25), inset 0 -15px 30px rgba(0,0,0,0.3);&lt;br /&gt;
    text-align: center;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  #installers img {&lt;br /&gt;
    border: 1px solid rgba(0,0,0,0.5);&lt;br /&gt;
    box-shadow: 0px -1px 3px rgba(0,0,0,0.8), 0px 1px 3px rgba(255,255,255,0.5);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /*table.glossy:hover {&lt;br /&gt;
    background: rgba(160,160,220,0.4);&lt;br /&gt;
  }*/&lt;br /&gt;
}}&lt;br /&gt;
= Game installers (for players) =&lt;br /&gt;
Below are some of the download pages of games using the Spring engine:&lt;br /&gt;
&amp;lt;div id=&amp;quot;installers&amp;quot; style=&amp;quot;padding-left:7px&amp;quot;&amp;gt;&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; |&lt;br /&gt;
| [http://www.evolutionrts.info/wordpress/?page_id=16 Evolution RTS]&lt;br /&gt;
| [[Image:EvoRTS_screenshot.jpg|55px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
| [http://springfiles.com/1683 Kernel Panic]&lt;br /&gt;
| [[Image:Kernel_Panic_3.4.jpg|55px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;glossy&amp;quot; |&lt;br /&gt;
| [http://spring1944.net/downloads.php Spring 1944]&lt;br /&gt;
| [[Image:S44_tigers.jpg|55px]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more Spring games, check out the [[Games]] page. Please note that some of them will require you to have the engine installed in order to work, as they don&#039;t come with their own installer.&lt;br /&gt;
&lt;br /&gt;
= Universal Downloaders =&lt;br /&gt;
As Spring itself is just an engine and does not contain game content.&amp;lt;br/&amp;gt;&lt;br /&gt;
There are several options for getting games/maps though, one is using the internal downloaders of the lobbies:&lt;br /&gt;
&lt;br /&gt;
  [http://trac.caspring.org/wiki/sd Spring Downloader]&lt;br /&gt;
  [http://springlobby.info/landing/index.php SpringLobby]&lt;br /&gt;
&lt;br /&gt;
more advanced Linux users may use [http://github.com/tvo/rapid rapid].&lt;br /&gt;
&lt;br /&gt;
(Note: Spring Downloader and SpringLobby are included in the Engine Installer which you can [[Download#Spring_Engine_Updates|download here]].)&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GadgetDatabase&amp;diff=7824</id>
		<title>GadgetDatabase</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=GadgetDatabase&amp;diff=7824"/>
		<updated>2010-02-23T21:23:12Z</updated>

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

		<summary type="html">&lt;p&gt;Seanheron: started docu page, for what would be good to include with gadgets uploaded to the DB&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Finally, the technicalities (I&#039;m wondering if there&#039;d be a better place for this info - maybe wiki ?):&lt;br /&gt;
&lt;br /&gt;
[b]&amp;quot;Modules&amp;quot;[/b] - As pointed out repeatedly, a lot of gadgets actually require multiple files, and potentially entries in unitdefs (or whatnot) to work properly. Thanks to the setup vbs has made though, it is trivial to upload multiple files and specify different places for them to go different :).&lt;br /&gt;
&lt;br /&gt;
I would suggest that where eg unitdefs are required. I realise anyone more savvy with lua will not require this per se - I think with a little extra effort though, we can keep the database accessible to people with little grasp of lua.&lt;br /&gt;
&lt;br /&gt;
In that vein, the following also seem a pretty much &amp;quot;must-have&amp;quot; to me:&lt;br /&gt;
As well as including an &amp;quot;Api&amp;quot; text file explaining how the gadget interfaces with the rest of Spring:&lt;br /&gt;
- ie what unitdefs it needs;&lt;br /&gt;
- any &amp;quot;calls&amp;quot; it requires (ie global vars be set) from non-generalisable seperate gadgets;&lt;br /&gt;
Or to pick up your example:&lt;br /&gt;
- what info it passes on to GUI elements;&lt;br /&gt;
- CMDs it depends on being given, etc.&lt;br /&gt;
&lt;br /&gt;
Finally, I&#039;d suggest some categories (if you want to categorise that is - as of now there&#039;s no functionality, since it&#039;s made with SpringDownloader in mind).&lt;br /&gt;
&lt;br /&gt;
UI, (GUI), Map, Unitbehaviour, Unitdefs, Unitvars, Antihack,&lt;br /&gt;
(I&#039;m sure there&#039;s some more that might be added.)&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Game_and_Unit_development&amp;diff=7973</id>
		<title>Game and Unit development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Game_and_Unit_development&amp;diff=7973"/>
		<updated>2010-02-05T13:08:10Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: /* Scripting and Animation - COB/BOS Files */ added link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Engine_Development|Development]] &amp;lt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
=Mod development=&lt;br /&gt;
Mods, next to Maps, is the content used in Spring.&amp;lt;br&amp;gt;&lt;br /&gt;
A mod is simply a combined file containing a small structure of files and directories holding all the data required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Mod_Development | Mod Development]] wiki is a starting page, linking to very useful information on the files included in a mod, their hierarchy and more.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Almost the entire mod developing is the creation of units. Which isn&#039;t an easy job.&amp;lt;br&amp;gt;&lt;br /&gt;
Information about the creation of units are everywere, but not combined.&amp;lt;br&amp;gt;&lt;br /&gt;
This is a gathered list of all Tutorials and helpfull forums threads I could find:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
*[[Mod Development]]&lt;br /&gt;
*[[Mod specification]]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://spring.clan-sy.com/phpbb/viewtopic.php?t=6015 What do I need to create a mod]&lt;br /&gt;
*[[Simple Mod Tutorial]]&lt;br /&gt;
*[[Freely available and reusable content|Freely available and reusable content/games/mods]]&lt;br /&gt;
*[[tools &amp;amp; software for make :map mod unit]]&lt;br /&gt;
&lt;br /&gt;
==Unit Development==&lt;br /&gt;
====Automated Mod Creation====&lt;br /&gt;
* [[TA2Spring]] - Automatically adds and converts Total Annihilation unit packs (.ufo files, etc..) into Spring mods (requires a base modification for the game rules, XTA is recommended)&lt;br /&gt;
====Models - s3o Files====&lt;br /&gt;
*[http://user.supradigital.org/jcnossen/UpspringInstaller-1.54-EulerAngles.exe UpSpring, our second-gen import / export / rigging / animation tool.]&lt;br /&gt;
* [http://lassie.student.utwente.nl/vliet/springtut.pdf Maestro&#039;s tutorial of Upspring and textures].&lt;br /&gt;
* [[Basic s3o unit making guide]]&lt;br /&gt;
* [[Simple Mod Tutorial]]&lt;br /&gt;
* [[Units:CreateModel|UV Mapping in Wings3D]]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10612 Wings UV Mapping Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=12354 Saving polygons in Wings3d Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10947 Greeble Tutorial 1]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=12356 Greeble Tutorial 2]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?p=75495 various things about unit making. (Also contains an illustrated alpha-channel tut)]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10503 Runecrafter&#039;s 3DS Max UV Mapping Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=15106 Argh&#039;s UpSpring Easy Workflow Guide]&lt;br /&gt;
* [[Trouble-shooting s3o units]]&lt;br /&gt;
&lt;br /&gt;
====Models - 3do Files====&lt;br /&gt;
outdated model format used by OTA&amp;lt;br&amp;gt;&lt;br /&gt;
(Note: UpSpring has some problems with empty objects and groundplates)&lt;br /&gt;
*use [http://spring.clan-sy.com/phpbb/viewtopic.php?f=12&amp;amp;t=7208&amp;amp;p=126129&amp;amp;hilit=upspring#p126129 UpSpring] and [http://www.fileuniverse.com/?p=show&amp;amp;a=it&amp;amp;id=305 3doBuilder] to edit those files&lt;br /&gt;
&lt;br /&gt;
====[http://springrts.com/wiki/Category:Animation Scripting and Animation - COB/BOS Files]====&lt;br /&gt;
To edit .bos files you need a program/compiler. The most famous one is [http://jobjol.nl/1384 Scriptor]&lt;br /&gt;
*[[Animation-LuaScripting]]&lt;br /&gt;
**[[Animation-LuaCallins]]&lt;br /&gt;
**[[Animation-LuaCallouts]]&lt;br /&gt;
**[[Animation-CobLuaDifferences]]&lt;br /&gt;
*[[Animation-CobOverview]]&lt;br /&gt;
**[[Animation-CobExamples]]&lt;br /&gt;
**[[Animation-CobAnimation]]&lt;br /&gt;
**[[Animation-CobCallins]]&lt;br /&gt;
**[[Animation-CobConstants]]&lt;br /&gt;
**[[Animation-CobThreads]]&lt;br /&gt;
**[[Animation-CobHitByWeaponID]]&lt;br /&gt;
*[http://www.planetannihilation.com/tadc/tut_unit_01_1.asp PlanetAnnihilation] has a nice tutorial&lt;br /&gt;
*[[Units:LuaCOB]] - how to interface COB with LUA&lt;br /&gt;
*[[CEG_For_Units|Mod Development:Calling basic CEGs from COB]]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?p=132943#132943 GPL-compliant sourcecode, scripting code examples, and other things.]&lt;br /&gt;
&lt;br /&gt;
====Units - FBI Files====&lt;br /&gt;
*[[Units:FBI]]&lt;br /&gt;
*[[All_FBI-variable_values:_min,_max,_default,_type|Units:FBI (variable datatype list)]]&lt;br /&gt;
*[[Unit_Categories]]&lt;br /&gt;
&lt;br /&gt;
====Units - MoveTypes====&lt;br /&gt;
*[[Units:MoveTypes]]&lt;br /&gt;
&lt;br /&gt;
====Weapons - TDF Files====&lt;br /&gt;
*[[Weapon Variables]] : This is the most up to date&lt;br /&gt;
*[[Units:WeaponMainDir]]&lt;br /&gt;
*[[Units:Weapons]] : Various informations about the weapontypes (uncompleted)&lt;br /&gt;
*[[All_Weapons_variable_values:_min%2C_max%2C_default%2C_type|Weapon datatype list]] : All weapon variables min/max/default values and datatypes listed.&lt;br /&gt;
*[[Weapons:Antinukes]]: All about antinukes.&lt;br /&gt;
&lt;br /&gt;
====Explosions====&lt;br /&gt;
*[[CEG]]&lt;br /&gt;
**[[CEG-Calls]] &lt;br /&gt;
**[[CEG-Format]] &lt;br /&gt;
**[[CEG-Classes]] &lt;br /&gt;
**[[CEG-Operators]] &lt;br /&gt;
**[[CEG-Miscellaneous]] &lt;br /&gt;
**[[CEG-OldInfo]]&lt;br /&gt;
&lt;br /&gt;
====Misc====&lt;br /&gt;
*[[Units:Design]]&lt;br /&gt;
*[[Units:Textures]]&lt;br /&gt;
*[[Units:Buildpics]]&lt;br /&gt;
*[[Units:SideData TDF]]&lt;br /&gt;
*[[Units:Download TDF]] &lt;br /&gt;
*[[Units:FlankingBonus]]&lt;br /&gt;
*[[Mod Development:Armor]]&lt;br /&gt;
*[[Mod Development:Cursors]]&lt;br /&gt;
*[[Mod Development:Archives]]&lt;br /&gt;
*[[Mod Development:Sidepics]]&lt;br /&gt;
*[[CustomUnitIcons|Mod Development:Custom unit icons]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=10950</id>
		<title>LuaCallinReturn</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LuaCallinReturn&amp;diff=10950"/>
		<updated>2010-01-04T11:52:43Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: /* Unit-Specific: */ this value is also available for UnitDestroyed&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;
===Lua Call-Ins, with parameters===&lt;br /&gt;
&amp;lt;font style=&amp;quot;font-size:90%&amp;quot;&amp;gt;&lt;br /&gt;
&#039;&#039;Here are the known reserved parameter values for all Lua Call-Ins.  If you add new Call-Ins to Spring, please document them here.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Commands, general-purpose:==&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;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;&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;&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;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&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;
==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, weaponID, attackerID, attackerDefID, attackerTeam&amp;quot;&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, weaponID, attackerID, attackerDefID, attackerTeam&amp;quot;&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&amp;quot; ... I hope that&#039;s self-explanatory&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?&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;&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;&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;  unknown, please document.&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;
&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;
&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;
&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;
&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;
&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&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Drawing:==&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;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;
==Game Events:==&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;
&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;&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.&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;GameOver()&amp;lt;/font&amp;gt; --&amp;gt; none.&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;
==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&amp;quot;&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;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_UnsyncedCtrl&amp;diff=12221</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=12221"/>
		<updated>2009-09-03T06:31:04Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: /* Unit NoDraw,NoSelect,NoMinimap */&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;
= 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.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;
&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.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;
  ( 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;
&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;] ) -&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.PlaySoundFile&#039;&#039;&#039;&lt;br /&gt;
  ( string &amp;quot;soundfile&amp;quot; [, number volume&lt;br /&gt;
    [, number x, number y, number z ] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Plays WAV or OGG sounds. &amp;lt;i&amp;gt;By default&amp;lt;/i&amp;gt;, the soundfile is expected to be in the &amp;quot;Sounds&amp;quot; folder.&amp;lt;/font&amp;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;
    [, number x, number y, number z ]] ) -&amp;gt; nil | boolean true&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Allow you to play an Ogg Vorbis (.OGG) compressed sound file.&amp;lt;br&amp;gt; &amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt; you may only play _ONE_ stream at a time. If another stream is playing and&amp;lt;br&amp;gt; you try to start a second one the call will fail, and silence will result.&amp;lt;br&amp;gt; &amp;lt;/font&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.StopSoundStream&#039;&#039;&#039;&lt;br /&gt;
  ( ) -&amp;gt; nil&lt;br /&gt;
  &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;Terminates any SoundStream is running.&amp;lt;br&amp;gt; Since only one may play at any time (see above), this can be used as an interrupt.&amp;lt;/font&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;
= Units =&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.GetDrawSelectionInfo&#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;
  ) -&amp;gt; nil | boolean true&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; Erm, &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;LuaGadgets only!&amp;lt;/font&amp;gt; erm, this seems to work only in &amp;quot;Synced&amp;quot; for me... So don&#039;t know if this might be misplaced&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;
= GUI =&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.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 color=&amp;quot;#55ee99&amp;quot;&amp;gt;default hotspot is center!&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 [, boolean hotSpotTopLeft] ] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.ReplaceMouseCursor&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;default hotspot is center!&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( string &amp;quot;oldFileName&amp;quot;, string &amp;quot;newFileName&amp;quot; [, boolean hotSpotTopLeft] ) -&amp;gt; nil | boolean&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetCustomCommandDrawData&#039;&#039;&#039; &amp;lt;font color=&amp;quot;#55ee99&amp;quot;&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 cmdIconID | string iconname | nil,&lt;br /&gt;
    { number r, number g, number b, number a } [, boolean showArea ] ) -&amp;gt; nil | true&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; &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 iconName, string texFile [, number size [, number dist [, boolean radAdjust ]]] ) -&amp;gt; nil | boolean&lt;br /&gt;
&#039;&#039;&#039;Spring.FreeUnitIcon&#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 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.&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 z, number y [,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;
= 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, registry or what ever your os prefers.&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] ) -&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 ) -&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] ) -&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 ) -&amp;gt; nil &lt;br /&gt;
&lt;br /&gt;
= Make Font =&lt;br /&gt;
&#039;&#039;&#039;Spring.MakeFont&#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 inputFile], table options ) -&amp;gt; nil | boolean&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;options = {&lt;br /&gt;
  outName = string,&lt;br /&gt;
  inData = string,&lt;br /&gt;
  height = number,&lt;br /&gt;
  texWidth = number,&lt;br /&gt;
  minChar = number,&lt;br /&gt;
  maxChar = number,&lt;br /&gt;
  outlineMode = number,&lt;br /&gt;
  outlineRadius = number,&lt;br /&gt;
  outlineWeight = number,&lt;br /&gt;
  padding = number,&lt;br /&gt;
  stuffing = number,&lt;br /&gt;
  debug = number,&lt;br /&gt;
}&amp;lt;/font&amp;gt;&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;
= Misc =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.Restart&#039;&#039;&#039; (0.79+)&lt;br /&gt;
  ( string commandline_args, string startscript ) -&amp;gt; if this call returns, something went wrong&lt;br /&gt;
commandline_args are commandline arguments passed to spring executable&lt;br /&gt;
&lt;br /&gt;
startscript is the CONTENT of the script.txt spring should use to start (if empty, no startscript is added, you can still point spring to your custom script.txt when you add the filepath to commandline_args&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11675</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=11675"/>
		<updated>2009-09-02T20:45:56Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: /* Unit Control */  Doh - of course it&amp;#039;s unsynced...!&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;
= Resources =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;m&amp;quot; | &amp;quot;e&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;m&amp;quot; | &amp;quot;e&amp;quot;, number amount |&lt;br /&gt;
    { m = number amount, e = 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;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&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 ) -&amp;gt; number unitID&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.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 makes the unit act like it was reclaimed&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.SetUnitLineage&#039;&#039;&#039;&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;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number enemyUnitID | number x, number y, number z,&lt;br /&gt;
    [ boolean dgun = false ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean blocking [, boolean collide ] ) -&amp;gt; nil&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.SetUnitArmored&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean armored ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, 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;
  &amp;lt;font color=&amp;quot;#55ee99&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;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;
    }&lt;br /&gt;
  &amp;lt;/font&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;
&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;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;used by default commands to get in build-,attackrange etc.&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number x, number y, number z,&lt;br /&gt;
    [, number radius = 0 [, number speed = unit-&amp;gt;maxSpeed * 2 ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPhysics&#039;&#039;&#039;&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;
  ) -&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.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 ) -&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;
== 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;
== Unit Ressourcing ==&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&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 featureID, number x, number y, number z&lt;br /&gt;
   [,number heading [, number AllyTeamID ]] ) -&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 ) -&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.SetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean noSelect ) -&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;
&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;
&#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;
&#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;
&lt;br /&gt;
= Give Order =&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;
= Heightmap =&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;font color=#55ee99&amp;gt;(heightmap[x][z] += height;)&amp;lt;/font&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;
&#039;&#039;&#039;Spring.SetHeightMapFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&#039;&#039;&#039;Spring.AddHeightMap&#039;&#039;&#039; &amp;lt;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/font&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;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&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;/font&amp;gt;&lt;br /&gt;
&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;
&#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;
&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;,&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&lt;br /&gt;
&lt;br /&gt;
= Projectiles =&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;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_SyncedCtrl&amp;diff=11674</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=11674"/>
		<updated>2009-09-02T20:31:02Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: /* Unit Control */ Added command I found in use, but don&amp;#039;t know documentation for&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;
= Resources =&lt;br /&gt;
&#039;&#039;&#039;Spring.AddTeamResource&#039;&#039;&#039;&lt;br /&gt;
  ( number teamID, string &amp;quot;m&amp;quot; | &amp;quot;e&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;m&amp;quot; | &amp;quot;e&amp;quot;, number amount |&lt;br /&gt;
    { m = number amount, e = 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;m&amp;quot; | &amp;quot;e&amp;quot;, number amount ) -&amp;gt; nil&lt;br /&gt;
&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 ) -&amp;gt; number unitID&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.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 makes the unit act like it was reclaimed&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;SpringSetUnitNoSelect&#039;&#039;&#039;&lt;br /&gt;
????&lt;br /&gt;
&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.SetUnitLineage&#039;&#039;&#039;&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;&lt;br /&gt;
  ( number unitID,&lt;br /&gt;
    number enemyUnitID | number x, number y, number z,&lt;br /&gt;
    [ boolean dgun = false ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitBlocking&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean blocking [, boolean collide ] ) -&amp;gt; nil&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.SetUnitArmored&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, boolean armored ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitShieldState&#039;&#039;&#039;&lt;br /&gt;
  ( number unitID, 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;
  &amp;lt;font color=&amp;quot;#55ee99&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;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;
    }&lt;br /&gt;
  &amp;lt;/font&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;
&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;font color=&amp;quot;#55ee99&amp;quot;&amp;gt;used by default commands to get in build-,attackrange etc.&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number unitID, number x, number y, number z,&lt;br /&gt;
    [, number radius = 0 [, number speed = unit-&amp;gt;maxSpeed * 2 ] ] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.SetUnitPhysics&#039;&#039;&#039;&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;
  ) -&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.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 ) -&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;
== 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;
== Unit Ressourcing ==&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&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 featureID, number x, number y, number z&lt;br /&gt;
   [,number heading [, number AllyTeamID ]] ) -&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 ) -&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.SetFeatureNoSelect&#039;&#039;&#039;&lt;br /&gt;
  ( number featureID, boolean noSelect ) -&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;
&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;
&#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;
&#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;
&lt;br /&gt;
= Give Order =&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;
= Heightmap =&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;font color=#55ee99&amp;gt;(heightmap[x][z] += height;)&amp;lt;/font&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;
&#039;&#039;&#039;Spring.SetHeightMapFunc&#039;&#039;&#039;&lt;br /&gt;
  ( lua_function [, arg1 ,[ arg2 [, ... ] ] ) -&amp;gt; nil | number absTotalHeightMapAmountChanged&lt;br /&gt;
&#039;&#039;&#039;Spring.AddHeightMap&#039;&#039;&#039; &amp;lt;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/font&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;font style=&amp;quot;color:red;font-weight:600&amp;quot;&amp;gt;can only be called in SetHeightMapFunc()&amp;lt;/font&amp;gt;&lt;br /&gt;
  ( number x, number z, number height [,number terraform = 1] ) -&amp;gt; nil | number absHeightDiff&lt;br /&gt;
&amp;lt;font color=&amp;quot;#55ee99&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;/font&amp;gt;&lt;br /&gt;
&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;
&#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;
&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;,&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&lt;br /&gt;
&lt;br /&gt;
= Projectiles =&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;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Spring_talk:PageNamingConventions&amp;diff=21421</id>
		<title>Spring talk:PageNamingConventions</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Spring_talk:PageNamingConventions&amp;diff=21421"/>
		<updated>2009-09-02T08:27:10Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: New page: Hey Athmos - sorry, I&amp;#039;ve been on holidays, so didn&amp;#039;t see you&amp;#039;re changes till today - I&amp;#039;ll be making some changes as well I think, cause I don&amp;#039;t agree with all of yours, and I&amp;#039;ll be justify...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hey Athmos - sorry, I&#039;ve been on holidays, so didn&#039;t see you&#039;re changes till today - I&#039;ll be making some changes as well I think, cause I don&#039;t agree with all of yours, and I&#039;ll be justifying them here.&lt;br /&gt;
[[User:Seanheron|Seanheron]] 08:27, 2 September 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22970</id>
		<title>Template:Navimg</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22970"/>
		<updated>2009-09-01T15:40:05Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: fixed info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;position: relative; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px; overflow: hidden;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; font-size: 200pt; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px;  overflow: hidden; line-height: {{{ysize|{{{size|}}}}}}px; z-index: 3;&amp;quot;&amp;gt;[[:{{{link|}}}|{{{linktext|&amp;amp;nbsp;}}}]]&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; z-index: 2;&amp;quot;&amp;gt;[[Image:{{{image|}}}|{{{xsize|{{{size|}}}}}}px|image page]]&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;This is the format the template needs to be used in: &amp;lt;pre&amp;gt;{{navimg|xsize=50|ysize=50|image=Wikimedia-logo.svg|link=Wikimedia}}&amp;lt;/pre&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=8922</id>
		<title>Games</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Games&amp;diff=8922"/>
		<updated>2009-09-01T15:34:34Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: fixed all images as links (this looses the borders though... use navimgx for external links, navimg for wikilinks!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
&lt;br /&gt;
There are a number of games made for the Spring Engine. Some of the more popular ones are listed below, sorted by their terms of use. &amp;lt;!--(/license schemes?)--&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Free/Open Source=&lt;br /&gt;
&#039;&#039;These games are all free to download and play and may be modded without the author&#039;s permission (asking permission is considered a common courtesy though).&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[http://www.evolutionrts.info Evolution RTS]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://www.spring1944.com Spring: 1944]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=EvoRTS screenshot.jpg|link=http://www.evolutionrts.info}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimgx|xsize=300|ysize=225|image=S44_tigers.jpg|link=http://www.spring1944.com}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | A new breed of Game for Spring. Prepare to engage in a war that changes every week, with objective based missions, evolving units, fast paced combat and a compelling plot line that YOU alter with every mission!&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&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;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[Kernel Panic]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[War Evolution]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimg|xsize=300|ysize=225|image=Kernel_Panic_3.4.jpg|link=Kernel Panic}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimg|xsize=300|ysize=225|image=Warevoscreen.jpg|link=War Evolution}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&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;
| align=&amp;quot;justify&amp;quot; | In short words, War Evolution is different. Different from all other games. You dont have a base and you can not reinforce your &amp;quot;army&amp;quot;. In fact, you command only one single mech and if he dies, you can only spectate until the game is over.&lt;br /&gt;
|}&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 (P.U.R.E.) include large GPL-friendly content collections.&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[http://www.wolfegames.com P.U.R.E.]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[Gundam RTS]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimgx|xsize=300|ysize=225|image=PURE_LOGO_1024.jpg|link=http://www.wolfegames.com}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimg|xsize=300|ysize=225|image=Screen104.jpg|link=Gundam RTS}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | A game based on a completely original IP, allowing players to participate in the epic, galaxy-spanning conflict between the human Resistance forces and the malevolent A.I. known as &#039;The Overmind&#039;.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | Set during the One-Year War in the Universal Century timeline of the Gundam Metaseries, Gundam RTS features fast, intense mech combat gameplay in a truly Gundam style.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[http://www.imperialwinter.com Star Wars: Imperial Winter]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[Expand_and_Exterminate|Expand and Exterminate]]&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=http://www.imperialwinter.com}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimg|xsize=300|ysize=225|image=E&amp;amp;E-screenshot2.jpg|link=Expand and Exterminate}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | A Star Wars themed game set in the troubled post-Return of the Jedi era, SW:IW features over a hundred units for the fractured Galactic Empire and Rebel Alliance fighting for control of the galaxy.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | An original IP game loosely based around the Earth 2150 series of games.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| width=180 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;&#039;&#039;&#039;[http://azaremoth.supremedesign.org The Cursed]&#039;&#039;&#039;&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=180 |&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimgx|xsize=300|ysize=225|image=cursed.jpg|link=http://azaremoth.supremedesign.org}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | The unique game is about bones, undead, demons and magic settled in a futuristic environment.&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;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[Complete Annihilation]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[NOTA]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimg|xsize=300|ysize=225|image=Pyro.jpg|link=Complete Annihilation}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; |{{navimg|xsize=300|ysize=225|image=Nota2nukes.jpg|link=NOTA}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | CA is a regularly updated game that is often regarded as a showcase of what the Spring Engine can do. The game is designed with a flat tech tree, where the effectiveness of a unit is based on its appropriateness to the situation rather than lighter units being superseded by heavier ones.&lt;br /&gt;
Although CA is a game that uses OTA content, it is currently working towards being TA-IP free.&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;justify&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;
&amp;lt;b&amp;gt;If you like complex warfare this is Your Mod.&amp;lt;/b&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[XTA]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
| width=40 |&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | &amp;lt;h2&amp;gt;[[Balanced Annihilation]]&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimg|xsize=300|ysize=225|image=XtaScreenShot.jpg|link=XTA}}&lt;br /&gt;
|&lt;br /&gt;
| align=&amp;quot;center&amp;quot; | {{navimg|xsize=300|ysize=225|image=BAScreenShot.jpg|link=Balanced Annihilation}}&lt;br /&gt;
|-&lt;br /&gt;
| align=&amp;quot;justify&amp;quot; | Originally developed as a Total Annihilation mod by the Swedish Yankspankers, XTA is the Original Public Mod released with first versions of Spring. Development of this mod 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;
| align=&amp;quot;justify&amp;quot; | A popular, highly balanced mod based on the late, immensely popular mod Absolute Annihilation. BA is designed for competitive 1v1 gameplay but is also perfectly suited for larger team games.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=Installing Games in Spring=&lt;br /&gt;
&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 &amp;quot;game-file&amp;quot; - in this case you will need to have [[Download|an installation of the Spring-Engine]], and place the file in the .../Spring/mods/ folder. If you are using a Lobby, this will often be able to do this for you automatically.&amp;lt;!--(which would these be?) Game packages requiring a more complex installation will usually come with instructions.--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an overview of information to get started, Click &#039;&#039;&#039;[[FAQ|Help]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=Game Development=&lt;br /&gt;
&lt;br /&gt;
For information on creating games for the Spring engine, see the [[Mod_and_Unit_development|Game Making]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category: Games]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22969</id>
		<title>Template:Navimg</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22969"/>
		<updated>2009-09-01T15:28:59Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: close, but no cigars...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;position: relative; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px; overflow: hidden;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; font-size: 200pt; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px;  overflow: hidden; line-height: {{{ysize|{{{size|}}}}}}px; z-index: 3;&amp;quot;&amp;gt;[[:{{{link|}}}|{{{linktext|&amp;amp;nbsp;}}}]]&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; z-index: 2;&amp;quot;&amp;gt;[[Image:{{{image|}}}|{{{xsize|{{{size|}}}}}}px|image page]]&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;This is the format the template needs to be used in: &amp;lt;pre&amp;gt;{{navimgx|xsize=50|ysize=50|image=Wikimedia-logo.svg|link=Wikimedia}}&amp;lt;/pre&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22968</id>
		<title>Template:Navimg</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Template:Navimg&amp;diff=22968"/>
		<updated>2009-09-01T15:27:24Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Doubt this is going to work, but worth a try&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;position: relative; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px; overflow: hidden;&amp;quot;&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; font-size: 200pt; width: {{{xsize|{{{size|}}}}}}px; height: {{{ysize|{{{size|}}}}}}px;  overflow: hidden; line-height: {{{ysize|{{{size|}}}}}}px; z-index: 3;&amp;quot;&amp;gt;[[{{{link|}}} {{{linktext|&amp;amp;nbsp;}}}]]&amp;lt;/div&amp;gt;&amp;lt;div style=&amp;quot;position: absolute; top: 0; left: 0; z-index: 2;&amp;quot;&amp;gt;[[Image:{{{image|}}}|{{{xsize|{{{size|}}}}}}px|image page]]&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;This is the format the template needs to be used in: &amp;lt;pre&amp;gt;{{navimgx|xsize=50|ysize=50|image=Wikimedia-logo.svg|link=Wikimedia}}&amp;lt;/pre&amp;gt;&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Category:Animation&amp;diff=23359</id>
		<title>Category:Animation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Category:Animation&amp;diff=23359"/>
		<updated>2009-08-23T21:22:55Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: best? + Category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We might want to change this to something more catchy ? Animating ? Scripting (though that&#039;s a bit impresice...&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2066</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=2066"/>
		<updated>2009-08-23T21:21:28Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: hmm, not sure if &amp;quot;Animation&amp;quot; is the best of Category name choices...&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, this gadget is not loaded, so a bit of setup is required to enable Lua unit scripts.&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 VFS.Include(&amp;quot;LuaGadgets/Gadgets/unit_script.lua&amp;quot;, nil, VFS.ZIP_ONLY)&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&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;/luarules reload&#039;&#039; to reload all Lua unit scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call-outs ==&lt;br /&gt;
&lt;br /&gt;
The new callouts are defined in the Spring.UnitScript table.&lt;br /&gt;
&lt;br /&gt;
Types for arguments are only shown where they&#039;re ambiguous. For a number of (common) arguments, the types are:&lt;br /&gt;
&lt;br /&gt;
* unitID: number&lt;br /&gt;
* piece: number&lt;br /&gt;
* axis: number (1 = x axis, 2 = y axis, 3 = z axis)&lt;br /&gt;
* destination: number (world coors or radians)&lt;br /&gt;
* speed: number (world coors or radians per second)&lt;br /&gt;
* accel/decel: number (radians per second per frame)&lt;br /&gt;
&lt;br /&gt;
=== Animation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetPieceVisibility&#039;&#039;&#039; ( unitID, piece, boolean visible ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Show&#039;&#039;&#039; ( unitID, piece ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Hide&#039;&#039;&#039; ( unitID, piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These may be used to show/hide pieces of the unit&#039;s model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Move&#039;&#039;&#039; ( unitID, piece, axis, destination[, speed] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Move piece along axis to the destination position. If speed is given, the piece isn&#039;t moved immediately, but will move there at the desired speed. The X axis is mirrored compared to BOS/COB scripts, to match the direction of the X axis in Spring world space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Turn&#039;&#039;&#039; ( unitID, piece, axis, destination[, speed] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Turn piece around axis to the destination angle. If speed is given, the piece isn&#039;t rotated immediately, but will turn at the desired angular velocity. Angles are in radians.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Spin&#039;&#039;&#039; ( unitID, piece, axis, speed[, accel] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Makes piece spin around axis at the desired angular velocity. If accel is given, the piece does not start at this velocity at once, but will accelerate to it. Both negative and positive angular velocities are supported. Accel should always be positive, even if speed is negative.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.StopSpin&#039;&#039;&#039; ( unitID, piece, axis[, decel] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Stops a piece from spinning around the given axis. If decel is given, the piece does not stop at once, but will decelerate to it. Decel should always be positive. This function is similar to Spin(unitID, piece, axis, 0, decel), however, StopSpin also frees up the animation record.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsMoving&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsTurning&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsSpinning&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Returns true iff the piece is moving along the axis, or turning/spinning around the axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.WaitForMove&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.WaitForTurn&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Waits until the piece has stopped moving along / turning around the axis. If the piece is not animating, this functions return at once. You can not wait for a spin, because a spin does never finish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Sleep&#039;&#039;&#039; ( unitID, number milliseconds ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Waits a number of milliseconds before returning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.StartThread&#039;&#039;&#039; ( unitID, function fun, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Starts a new (animation) thread, which will execute the function &#039;fun&#039;. All arguments after the function are passed as-is as arguments to &#039;fun&#039;. A thread is just a Lua thread, ie. a coroutine, so please refer to the Lua documentation about coroutines for exact semantics.&lt;br /&gt;
=== Effects ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.EmitSfx&#039;&#039;&#039; ( unitID, piece, number id ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Emits a particle from the given piece. The id may be one of:&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Explode&#039;&#039;&#039; ( unitID, piece, number flags ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Explodes a piece, optionally creating a particle which flies off. Typically used inside Killed. Explode does not hide the piece by itself; if using it outside Killed you may want to Hide the piece immediately after. The flags may be a combination of:&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.AttachUnit&#039;&#039;&#039; ( unitID, piece, passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.DetachUnit&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Attaches or detaches another unit (a passenger, as this is designed for transports) to this unit. For AttachUnit, piece specifies the attachment point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.GetUnitValue&#039;&#039;&#039; ( ... ) -&amp;gt; number | number, number&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetUnitValue&#039;&#039;&#039; ( ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This may be used instead of COB&#039;s get and set codes. It is recommended however, to use dedicated Lua functions (e.g. Spring.GetUnitHealth(unitID) instead of GetUnitValue(unitID, 4)): these functions should be considered a relic of the past.&lt;br /&gt;
&lt;br /&gt;
Note that these are identical to Spring.GetUnitCOBValue and Spring.SetUnitCOBValue (see also [[Lua_SyncedCtrl#Lua_to_COB]] for the signature of those functions.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetSignalMask&#039;&#039;&#039; ( unitID, number mask ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Signal&#039;&#039;&#039; ( unitID, number signal ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These two support functions offer a powerful way to kill running threads. SetSignalMask assigns a mask to the currently running thread (any new threads started by this one will inherit the signal mask). Signal immediately stops all threads of this unit for which the bitwise and of mask and signal is not zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call-ins ==&lt;br /&gt;
&lt;br /&gt;
Call-ins are calls from the engine, into the unit script. In other words, these functions are called, if they are defined, when a particular â€œeventâ€ happens.&lt;br /&gt;
&lt;br /&gt;
For Lua unit scripts, a new callin mechanism has been implemented, which is faster than the regular callin mechanism which is used for widgets and gadgets.&lt;br /&gt;
&lt;br /&gt;
=== Generic ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called just after the unit script has been created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StartMoving&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;StopMoving&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These are called whenever the unit starts or stops moving. Typical use for them is to trigger wheels to start spinning, animate treads, or start/stop a walking animation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Killed&#039;&#039;&#039; ( unitID, recentDamage, maxHealth ) -&amp;gt; number corpseType&lt;br /&gt;
&lt;br /&gt;
This is called when the unit is killed. The severity of the kill may be calculated as severity=recentDamage/maxHealth. Typically, this function would play a death animation for the unit, and finally return a corpse type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SetDirection&#039;&#039;&#039; ( heading ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;SetSpeed&#039;&#039;&#039; ( speed ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called only for wind generators and metal extractors.&lt;br /&gt;
&lt;br /&gt;
For wind generators, both of these are called each time the wind changes. SetDirection receives the new wind direction and SetSpeed receives the new wind speed.&lt;br /&gt;
&lt;br /&gt;
For metal extractors, only SetSpeed is called. It receives the amount of metal which will be extracted every second, and is called every time this amount changes. (Nearby overlapping metal extractor is destroyed, for example.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryNanopiece&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
Called for factories and builders each time a nano particle is to be created. Should return the piece at which the particle will be spawned. This may be used to iterate through a few pieces, to simulate the factory/builder having multiple nanolathes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSFXOccupy&#039;&#039;&#039; ( number curTerrainType ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
I don&#039;t see any use for this. I&#039;ll probably remove this from Spring at some point. Called when terrain type changes. Terrain type is a number, calculated with the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If unit is being transported -&amp;gt; curTerrainType = 0&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is always upright -&amp;gt; curTerrainType = 2&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is not always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* If ground height &amp;lt; 0 and unit is always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* Otherwise -&amp;gt; curTerrainType = 4&lt;br /&gt;
&lt;br /&gt;
Where is curTerrainType = 3 ? :-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryLandingPad&#039;&#039;&#039; ( ) -&amp;gt; { number piece1, number piece2, ... }&lt;br /&gt;
&lt;br /&gt;
Called one time for units with landing pads. Should return a table with pieces which should be used as landing pads. The number of pieces returned also determines the number of pads, so for Lua unit scripts there is no QueryLandingPadCount.&lt;br /&gt;
&lt;br /&gt;
=== Weapons ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;AimFromWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;AimWeapon1&#039;&#039;&#039; ( unitID, heading, pitch ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;FireWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Weapon support. The suffix &amp;quot;1&amp;quot; should be replaced with the actual weapon number.&lt;br /&gt;
The return value of QueryWeapon and AimFromWeapon determines the pieces which will be used for aiming: typically e.g. the barrel for QueryWeapon and the turret for AimFromWeapon. AimWeapon is then called to allow the script to turn the weapons in the target direction, which is passed as the heading and pitch argument (in radians). Only if AimWeapon returns true, the weapon is actually fired, in which case FireWeapon will be called, to inform the script about this. FireWeapon may play a recoil animation or emit some smoke using EmitSfx, for example.&lt;br /&gt;
&lt;br /&gt;
TODO: better explanation (?), note about AimWeapon being called very often etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RockUnit&#039;&#039;&#039; ( unitID, x, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
A bit like the weapon-specific FireWeapon function, this is called after any weapon fires. As argument it gets a two dimensional vector in the direction the unit just fired. This may be used to â€œrockâ€ the unit as a whole a bit as part of the firing animation. Note though that this vector is in world space, so for a truely realistic rock direction it needs to be rotated according to the unit&#039;s current heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HitByWeapon&#039;&#039;&#039; ( unitID, x, z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;HitByWeaponId&#039;&#039;&#039; ( unitID, x, z, weaponDefID, damage ) -&amp;gt; nil | number newDamage&lt;br /&gt;
&lt;br /&gt;
These are called if a unit has been hit by a weapon. (x, z) is the direction from which the projectile came in world space (the reverse direction of the impulse, to be exact.)&lt;br /&gt;
&lt;br /&gt;
In addition, HitByWeaponId also gets the weaponDefID of the weapon which is dealing the damage, and the amount of damage. If HitByWeaponId returns a number, this number will replace the damage value calculated by the engine.&lt;br /&gt;
&lt;br /&gt;
Note: these call-ins run just before the LuaRules UnitPreDamaged callin (see also [[LuaCallinReturn]]). If HitByWeaponId overrides the damage, UnitPreDamaged will see the new damage value, and may override again the damage value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Transports ===&lt;br /&gt;
&lt;br /&gt;
There are some different code paths inside Spring related to transports, each (unfortunately) also associated with a different set of unit script call-ins.&lt;br /&gt;
&lt;br /&gt;
This table shows for the three different transportUnloadMethods for both air transports and ground transports which callins are used and roughly when and how often they are called. Refer to the documentation below for a description of the call-ins.&lt;br /&gt;
&lt;br /&gt;
The entire behavior around transports should be considered subject to change; it is obvious it is far from a perfect design currently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; style=&amp;quot;border-spacing:0px;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!&lt;br /&gt;
!Load&lt;br /&gt;
!UnloadLand (0)&lt;br /&gt;
!UnloadDrop (1)&lt;br /&gt;
!UnloadLandFlood (2)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|default unload&lt;br /&gt;
|fly over and drop unit&lt;br /&gt;
|land, then release all units at once&lt;br /&gt;
|-&lt;br /&gt;
|air&lt;br /&gt;
|BeginTransport (each)&amp;lt;br&amp;gt;QueryTransport (each)&lt;br /&gt;
|EndTransport (last)&lt;br /&gt;
|EndTransport (each)&lt;br /&gt;
|StartUnload (first)&amp;lt;br&amp;gt;TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|-&lt;br /&gt;
|ground&lt;br /&gt;
|TransportPickup (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Air transports ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BeginTransport&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;QueryTransport&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For an air transport, if any one unit is picked up, these two are called in succession and the passenger is attached to the piece returned by the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StartUnload&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Signals the start of an unload cycle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportDrop&#039;&#039;&#039; ( unitID, passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Called when a passenger will be unloaded. Contrary to ground transports, Spring will detach the passenger after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;EndTransport&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
In UnloadLand and UnloadLandFlood behaviors, these are called one time after all units are unloaded. (The transport is empty.) For the UnloadDrop behavior, this is called for every unit that is unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ground transports ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportPickup&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be loaded into the transport. This should eventually call AttachUnit to actually attach the unit. Assuming the transport is in range of the next passenger, this will be called again for the next passenger 16 frames later, &#039;&#039;unless&#039;&#039; the script enters the BUSY state: then Spring will not move on to the next passenger until the script leaves the BUSY state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportDrop&#039;&#039;&#039; ( unitID, passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be unloaded. This should eventually call DetachUnit to actually detach the unit, &#039;&#039;unless&#039;&#039; the used unload method is UnloadLandFlood, in which case Spring will actually detach the unit after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;EndTransport&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior, after the last unit has been unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Passenger ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Falling&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
For a unit dropped from an UnloadDrop transport, this is called every frame to inform the script the unit is still falling. It may be used to show a parachute for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Landed&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called one time after the unit reached the ground. May be used to hide a parachute for example.&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Unit_Scripting&amp;diff=12181</id>
		<title>Lua Unit Scripting</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua_Unit_Scripting&amp;diff=12181"/>
		<updated>2009-08-23T21:18:00Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Lua Unit Scripting moved to Animation-LuaScripting: moved as per naming convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-LuaScripting]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-LuaScripting&amp;diff=2065</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=2065"/>
		<updated>2009-08-23T21:18:00Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Lua Unit Scripting moved to Animation-LuaScripting: moved as per naming convention&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, this gadget is not loaded, so a bit of setup is required to enable Lua unit scripts.&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 VFS.Include(&amp;quot;LuaGadgets/Gadgets/unit_script.lua&amp;quot;, nil, VFS.ZIP_ONLY)&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
|}&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;/luarules reload&#039;&#039; to reload all Lua unit scripts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call-outs ==&lt;br /&gt;
&lt;br /&gt;
The new callouts are defined in the Spring.UnitScript table.&lt;br /&gt;
&lt;br /&gt;
Types for arguments are only shown where they&#039;re ambiguous. For a number of (common) arguments, the types are:&lt;br /&gt;
&lt;br /&gt;
* unitID: number&lt;br /&gt;
* piece: number&lt;br /&gt;
* axis: number (1 = x axis, 2 = y axis, 3 = z axis)&lt;br /&gt;
* destination: number (world coors or radians)&lt;br /&gt;
* speed: number (world coors or radians per second)&lt;br /&gt;
* accel/decel: number (radians per second per frame)&lt;br /&gt;
&lt;br /&gt;
=== Animation ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetPieceVisibility&#039;&#039;&#039; ( unitID, piece, boolean visible ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Show&#039;&#039;&#039; ( unitID, piece ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Hide&#039;&#039;&#039; ( unitID, piece ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These may be used to show/hide pieces of the unit&#039;s model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Move&#039;&#039;&#039; ( unitID, piece, axis, destination[, speed] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Move piece along axis to the destination position. If speed is given, the piece isn&#039;t moved immediately, but will move there at the desired speed. The X axis is mirrored compared to BOS/COB scripts, to match the direction of the X axis in Spring world space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Turn&#039;&#039;&#039; ( unitID, piece, axis, destination[, speed] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Turn piece around axis to the destination angle. If speed is given, the piece isn&#039;t rotated immediately, but will turn at the desired angular velocity. Angles are in radians.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Spin&#039;&#039;&#039; ( unitID, piece, axis, speed[, accel] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Makes piece spin around axis at the desired angular velocity. If accel is given, the piece does not start at this velocity at once, but will accelerate to it. Both negative and positive angular velocities are supported. Accel should always be positive, even if speed is negative.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.StopSpin&#039;&#039;&#039; ( unitID, piece, axis[, decel] ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Stops a piece from spinning around the given axis. If decel is given, the piece does not stop at once, but will decelerate to it. Decel should always be positive. This function is similar to Spin(unitID, piece, axis, 0, decel), however, StopSpin also frees up the animation record.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsMoving&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsTurning&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.IsSpinning&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; boolean&lt;br /&gt;
&lt;br /&gt;
Returns true iff the piece is moving along the axis, or turning/spinning around the axis.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.WaitForMove&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.WaitForTurn&#039;&#039;&#039; ( unitID, piece, axis ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Waits until the piece has stopped moving along / turning around the axis. If the piece is not animating, this functions return at once. You can not wait for a spin, because a spin does never finish.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Sleep&#039;&#039;&#039; ( unitID, number milliseconds ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Waits a number of milliseconds before returning.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.StartThread&#039;&#039;&#039; ( unitID, function fun, ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Starts a new (animation) thread, which will execute the function &#039;fun&#039;. All arguments after the function are passed as-is as arguments to &#039;fun&#039;. A thread is just a Lua thread, ie. a coroutine, so please refer to the Lua documentation about coroutines for exact semantics.&lt;br /&gt;
=== Effects ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.EmitSfx&#039;&#039;&#039; ( unitID, piece, number id ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Emits a particle from the given piece. The id may be one of:&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Explode&#039;&#039;&#039; ( unitID, piece, number flags ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Explodes a piece, optionally creating a particle which flies off. Typically used inside Killed. Explode does not hide the piece by itself; if using it outside Killed you may want to Hide the piece immediately after. The flags may be a combination of:&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== Other ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.AttachUnit&#039;&#039;&#039; ( unitID, piece, passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.DetachUnit&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Attaches or detaches another unit (a passenger, as this is designed for transports) to this unit. For AttachUnit, piece specifies the attachment point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.GetUnitValue&#039;&#039;&#039; ( ... ) -&amp;gt; number | number, number&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetUnitValue&#039;&#039;&#039; ( ... ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This may be used instead of COB&#039;s get and set codes. It is recommended however, to use dedicated Lua functions (e.g. Spring.GetUnitHealth(unitID) instead of GetUnitValue(unitID, 4)): these functions should be considered a relic of the past.&lt;br /&gt;
&lt;br /&gt;
Note that these are identical to Spring.GetUnitCOBValue and Spring.SetUnitCOBValue (see also [[Lua_SyncedCtrl#Lua_to_COB]] for the signature of those functions.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.SetSignalMask&#039;&#039;&#039; ( unitID, number mask ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Spring.UnitScript.Signal&#039;&#039;&#039; ( unitID, number signal ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These two support functions offer a powerful way to kill running threads. SetSignalMask assigns a mask to the currently running thread (any new threads started by this one will inherit the signal mask). Signal immediately stops all threads of this unit for which the bitwise and of mask and signal is not zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Call-ins ==&lt;br /&gt;
&lt;br /&gt;
Call-ins are calls from the engine, into the unit script. In other words, these functions are called, if they are defined, when a particular â€œeventâ€ happens.&lt;br /&gt;
&lt;br /&gt;
For Lua unit scripts, a new callin mechanism has been implemented, which is faster than the regular callin mechanism which is used for widgets and gadgets.&lt;br /&gt;
&lt;br /&gt;
=== Generic ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called just after the unit script has been created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StartMoving&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;StopMoving&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
These are called whenever the unit starts or stops moving. Typical use for them is to trigger wheels to start spinning, animate treads, or start/stop a walking animation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Killed&#039;&#039;&#039; ( unitID, recentDamage, maxHealth ) -&amp;gt; number corpseType&lt;br /&gt;
&lt;br /&gt;
This is called when the unit is killed. The severity of the kill may be calculated as severity=recentDamage/maxHealth. Typically, this function would play a death animation for the unit, and finally return a corpse type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;SetDirection&#039;&#039;&#039; ( heading ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;SetSpeed&#039;&#039;&#039; ( speed ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called only for wind generators and metal extractors.&lt;br /&gt;
&lt;br /&gt;
For wind generators, both of these are called each time the wind changes. SetDirection receives the new wind direction and SetSpeed receives the new wind speed.&lt;br /&gt;
&lt;br /&gt;
For metal extractors, only SetSpeed is called. It receives the amount of metal which will be extracted every second, and is called every time this amount changes. (Nearby overlapping metal extractor is destroyed, for example.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryNanopiece&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
Called for factories and builders each time a nano particle is to be created. Should return the piece at which the particle will be spawned. This may be used to iterate through a few pieces, to simulate the factory/builder having multiple nanolathes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setSFXOccupy&#039;&#039;&#039; ( number curTerrainType ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
I don&#039;t see any use for this. I&#039;ll probably remove this from Spring at some point. Called when terrain type changes. Terrain type is a number, calculated with the following rules (in this order):&lt;br /&gt;
&lt;br /&gt;
* If unit is being transported -&amp;gt; curTerrainType = 0&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is always upright -&amp;gt; curTerrainType = 2&lt;br /&gt;
* If ground height &amp;lt; -5 and unit is not always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* If ground height &amp;lt; 0 and unit is always upright -&amp;gt; curTerrainType = 1&lt;br /&gt;
* Otherwise -&amp;gt; curTerrainType = 4&lt;br /&gt;
&lt;br /&gt;
Where is curTerrainType = 3 ? :-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryLandingPad&#039;&#039;&#039; ( ) -&amp;gt; { number piece1, number piece2, ... }&lt;br /&gt;
&lt;br /&gt;
Called one time for units with landing pads. Should return a table with pieces which should be used as landing pads. The number of pieces returned also determines the number of pads, so for Lua unit scripts there is no QueryLandingPadCount.&lt;br /&gt;
&lt;br /&gt;
=== Weapons ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QueryWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;AimFromWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; number piece&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;AimWeapon1&#039;&#039;&#039; ( unitID, heading, pitch ) -&amp;gt; boolean&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;FireWeapon1&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Weapon support. The suffix &amp;quot;1&amp;quot; should be replaced with the actual weapon number.&lt;br /&gt;
The return value of QueryWeapon and AimFromWeapon determines the pieces which will be used for aiming: typically e.g. the barrel for QueryWeapon and the turret for AimFromWeapon. AimWeapon is then called to allow the script to turn the weapons in the target direction, which is passed as the heading and pitch argument (in radians). Only if AimWeapon returns true, the weapon is actually fired, in which case FireWeapon will be called, to inform the script about this. FireWeapon may play a recoil animation or emit some smoke using EmitSfx, for example.&lt;br /&gt;
&lt;br /&gt;
TODO: better explanation (?), note about AimWeapon being called very often etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RockUnit&#039;&#039;&#039; ( unitID, x, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
A bit like the weapon-specific FireWeapon function, this is called after any weapon fires. As argument it gets a two dimensional vector in the direction the unit just fired. This may be used to â€œrockâ€ the unit as a whole a bit as part of the firing animation. Note though that this vector is in world space, so for a truely realistic rock direction it needs to be rotated according to the unit&#039;s current heading.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HitByWeapon&#039;&#039;&#039; ( unitID, x, z ) -&amp;gt; nil&lt;br /&gt;
&#039;&#039;&#039;HitByWeaponId&#039;&#039;&#039; ( unitID, x, z, weaponDefID, damage ) -&amp;gt; nil | number newDamage&lt;br /&gt;
&lt;br /&gt;
These are called if a unit has been hit by a weapon. (x, z) is the direction from which the projectile came in world space (the reverse direction of the impulse, to be exact.)&lt;br /&gt;
&lt;br /&gt;
In addition, HitByWeaponId also gets the weaponDefID of the weapon which is dealing the damage, and the amount of damage. If HitByWeaponId returns a number, this number will replace the damage value calculated by the engine.&lt;br /&gt;
&lt;br /&gt;
Note: these call-ins run just before the LuaRules UnitPreDamaged callin (see also [[LuaCallinReturn]]). If HitByWeaponId overrides the damage, UnitPreDamaged will see the new damage value, and may override again the damage value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Transports ===&lt;br /&gt;
&lt;br /&gt;
There are some different code paths inside Spring related to transports, each (unfortunately) also associated with a different set of unit script call-ins.&lt;br /&gt;
&lt;br /&gt;
This table shows for the three different transportUnloadMethods for both air transports and ground transports which callins are used and roughly when and how often they are called. Refer to the documentation below for a description of the call-ins.&lt;br /&gt;
&lt;br /&gt;
The entire behavior around transports should be considered subject to change; it is obvious it is far from a perfect design currently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; style=&amp;quot;border-spacing:0px;&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!&lt;br /&gt;
!Load&lt;br /&gt;
!UnloadLand (0)&lt;br /&gt;
!UnloadDrop (1)&lt;br /&gt;
!UnloadLandFlood (2)&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|default unload&lt;br /&gt;
|fly over and drop unit&lt;br /&gt;
|land, then release all units at once&lt;br /&gt;
|-&lt;br /&gt;
|air&lt;br /&gt;
|BeginTransport (each)&amp;lt;br&amp;gt;QueryTransport (each)&lt;br /&gt;
|EndTransport (last)&lt;br /&gt;
|EndTransport (each)&lt;br /&gt;
|StartUnload (first)&amp;lt;br&amp;gt;TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|-&lt;br /&gt;
|ground&lt;br /&gt;
|TransportPickup (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&lt;br /&gt;
|TransportDrop (each)&amp;lt;br&amp;gt;EndTransport (last)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Air transports ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;BeginTransport&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&amp;lt;br&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;QueryTransport&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; number piece&lt;br /&gt;
&lt;br /&gt;
For an air transport, if any one unit is picked up, these two are called in succession and the passenger is attached to the piece returned by the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;StartUnload&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Signals the start of an unload cycle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportDrop&#039;&#039;&#039; ( unitID, passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior. Called when a passenger will be unloaded. Contrary to ground transports, Spring will detach the passenger after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;EndTransport&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
In UnloadLand and UnloadLandFlood behaviors, these are called one time after all units are unloaded. (The transport is empty.) For the UnloadDrop behavior, this is called for every unit that is unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ground transports ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportPickup&#039;&#039;&#039; ( unitID, passengerID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be loaded into the transport. This should eventually call AttachUnit to actually attach the unit. Assuming the transport is in range of the next passenger, this will be called again for the next passenger 16 frames later, &#039;&#039;unless&#039;&#039; the script enters the BUSY state: then Spring will not move on to the next passenger until the script leaves the BUSY state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TransportDrop&#039;&#039;&#039; ( unitID, passengerID, x, y, z ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Called when a passenger should be unloaded. This should eventually call DetachUnit to actually detach the unit, &#039;&#039;unless&#039;&#039; the used unload method is UnloadLandFlood, in which case Spring will actually detach the unit after the call.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;EndTransport&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
Only called in UnloadLandFlood behavior, after the last unit has been unloaded.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Passenger ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Falling&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
For a unit dropped from an UnloadDrop transport, this is called every frame to inform the script the unit is still falling. It may be used to show a parachute for example.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Landed&#039;&#039;&#039; ( unitID ) -&amp;gt; nil&lt;br /&gt;
&lt;br /&gt;
This is called one time after the unit reached the ground. May be used to hide a parachute for example.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobHitByWeaponID&amp;diff=2114</id>
		<title>Animation:CobHitByWeaponID</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobHitByWeaponID&amp;diff=2114"/>
		<updated>2009-08-23T21:12:59Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobHitByWeaponID]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobThreads&amp;diff=2120</id>
		<title>Animation:CobThreads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobThreads&amp;diff=2120"/>
		<updated>2009-08-23T21:12:52Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobThreads]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobConstants&amp;diff=2111</id>
		<title>Animation:CobConstants</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobConstants&amp;diff=2111"/>
		<updated>2009-08-23T21:12:43Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobConstants]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobCallins&amp;diff=2108</id>
		<title>Animation:CobCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobCallins&amp;diff=2108"/>
		<updated>2009-08-23T21:12:36Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobCallins]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobAnimation&amp;diff=2105</id>
		<title>Animation:CobAnimation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobAnimation&amp;diff=2105"/>
		<updated>2009-08-23T21:12:29Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobAnimation]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Game_and_Unit_development&amp;diff=7969</id>
		<title>Game and Unit development</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Game_and_Unit_development&amp;diff=7969"/>
		<updated>2009-08-23T21:11:30Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: fix links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mod development=&lt;br /&gt;
Mods, next to Maps, is the content used in Spring.&amp;lt;br&amp;gt;&lt;br /&gt;
A mod is simply a combined file containing a small structure of files and directories holding all the data required.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Mod_Development | Mod Development]] wiki is a starting page, linking to very useful information on the files included in a mod, their hierarchy and more.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Almost the entire mod developing is the creation of units. Which isn&#039;t an easy job.&amp;lt;br&amp;gt;&lt;br /&gt;
Information about the creation of units are everywere, but not combined.&amp;lt;br&amp;gt;&lt;br /&gt;
This is a gathered list of all Tutorials and helpfull forums threads I could find:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
*[[Mod Development]]&lt;br /&gt;
*[[Mod specification]]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://spring.clan-sy.com/phpbb/viewtopic.php?t=6015 What do I need to create a mod]&lt;br /&gt;
*[[Simple Mod Tutorial]]&lt;br /&gt;
*[[Freely available and reusable content|Freely available and reusable content/games/mods]]&lt;br /&gt;
*[[tools &amp;amp; software for make :map mod unit]]&lt;br /&gt;
&lt;br /&gt;
==Unit Development==&lt;br /&gt;
====Automated Mod Creation====&lt;br /&gt;
* [[TA2Spring]] - Automatically adds and converts Total Annihilation unit packs (.ufo files, etc..) into Spring mods (requires a base modification for the game rules, XTA is recommended)&lt;br /&gt;
====Models - s3o Files====&lt;br /&gt;
*[http://user.supradigital.org/jcnossen/UpspringInstaller-1.54-EulerAngles.exe UpSpring, our second-gen import / export / rigging / animation tool.]&lt;br /&gt;
* [http://lassie.student.utwente.nl/vliet/springtut.pdf Maestro&#039;s tutorial of Upspring and textures].&lt;br /&gt;
* [[Basic s3o unit making guide]]&lt;br /&gt;
* [[Simple Mod Tutorial]]&lt;br /&gt;
* [[Units:CreateModel|UV Mapping in Wings3D]]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10612 Wings UV Mapping Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=12354 Saving polygons in Wings3d Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10947 Greeble Tutorial 1]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=12356 Greeble Tutorial 2]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?p=75495 various things about unit making. (Also contains an illustrated alpha-channel tut)]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?t=10503 Runecrafter&#039;s 3DS Max UV Mapping Tutorial]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?f=9&amp;amp;t=15106 Argh&#039;s UpSpring Easy Workflow Guide]&lt;br /&gt;
* [[Trouble-shooting s3o units]]&lt;br /&gt;
&lt;br /&gt;
====Models - 3do Files====&lt;br /&gt;
outdated model format used by OTA&amp;lt;br&amp;gt;&lt;br /&gt;
(Note: UpSpring has some problems with empty objects and groundplates)&lt;br /&gt;
*use [http://spring.clan-sy.com/phpbb/viewtopic.php?f=12&amp;amp;t=7208&amp;amp;p=126129&amp;amp;hilit=upspring#p126129 UpSpring] and [http://www.fileuniverse.com/?p=show&amp;amp;a=it&amp;amp;id=305 3doBuilder] to edit those files&lt;br /&gt;
&lt;br /&gt;
====Scripting and Animation - COB/BOS Files====&lt;br /&gt;
To edit those you need a program/compiler. The most famous one is [http://jobjol.nl/1384 Scriptor]&lt;br /&gt;
***[[Animation-CobOverview]]&lt;br /&gt;
***[[Animation-CobExamples]]&lt;br /&gt;
***[[Animation-CobAnimation]]&lt;br /&gt;
***[[Animation-CobCallins]]&lt;br /&gt;
***[[Animation-CobConstants]]&lt;br /&gt;
***[[Animation-CobThreads]]&lt;br /&gt;
***[[Animation-CobHitByWeaponID]]&lt;br /&gt;
*[http://www.planetannihilation.com/tadc/tut_unit_01_1.asp PlanetAnnihilation] has a nice tutorial&lt;br /&gt;
*[[Units:LuaCOB]] - how to interface COB with LUA&lt;br /&gt;
*[[CEG_For_Units|Mod Development:Calling basic CEGs from COB]]&lt;br /&gt;
* [http://spring.clan-sy.com/phpbb/viewtopic.php?p=132943#132943 GPL-compliant sourcecode, scripting code examples, and other things.]&lt;br /&gt;
&lt;br /&gt;
====Units - FBI Files====&lt;br /&gt;
*[[Units:FBI]]&lt;br /&gt;
*[[All_FBI-variable_values:_min,_max,_default,_type|Units:FBI (variable datatype list)]]&lt;br /&gt;
*[[Unit_Categories]]&lt;br /&gt;
&lt;br /&gt;
====Weapons - TDF Files====&lt;br /&gt;
*[[Weapon Variables]] : This is the most up to date&lt;br /&gt;
*[[Units:WeaponMainDir]]&lt;br /&gt;
*[[Units:Weapons]] : Various informations about the weapontypes (uncompleted)&lt;br /&gt;
*[[All_Weapons_variable_values:_min%2C_max%2C_default%2C_type|Weapon datatype list]] : All weapon variables min/max/default values and datatypes listed.&lt;br /&gt;
*[[Weapons:Antinukes]]: All about antinukes.&lt;br /&gt;
&lt;br /&gt;
====Explosions====&lt;br /&gt;
*[[CEG]]&lt;br /&gt;
**[[CEG-Calls]] &lt;br /&gt;
**[[CEG-Format]] &lt;br /&gt;
**[[CEG-Classes]] &lt;br /&gt;
**[[CEG-Operators]] &lt;br /&gt;
**[[CEG-Miscellaneous]] &lt;br /&gt;
**[[CEG-OldInfo]]&lt;br /&gt;
&lt;br /&gt;
====Misc====&lt;br /&gt;
*[[Units:Design]]&lt;br /&gt;
*[[Units:Textures]]&lt;br /&gt;
*[[Units:Buildpics]]&lt;br /&gt;
*[[Units:SideData TDF]]&lt;br /&gt;
*[[Units:Download TDF]] &lt;br /&gt;
*[[Units:FlankingBonus]]&lt;br /&gt;
*[[Mod Development:Armor]]&lt;br /&gt;
*[[Mod Development:Cursors]]&lt;br /&gt;
*[[Mod Development:Archives]]&lt;br /&gt;
*[[Mod Development:Sidepics]]&lt;br /&gt;
*[[CustomUnitIcons|Mod Development:Custom unit icons]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1960</id>
		<title>Animation-CobOverview</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1960"/>
		<updated>2009-08-23T21:10:39Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: fixed links I hadn&amp;#039;t fixed properly...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is COB?==&lt;br /&gt;
&lt;br /&gt;
COB is the Spring engine&#039;s scripting system. Each unit has a .cob bitfile which defines many of its major behaviors, including animation and weapon aiming. Of course, COB is also capable of doing a lot more if you wish. When Spring is actually running, it interprets the bitfile for each unit as necessary. This interpreter runs in a very straightforward way, without any fancy optimizations, so don&#039;t expect great performance from it.&lt;br /&gt;
&lt;br /&gt;
==BOS==&lt;br /&gt;
&lt;br /&gt;
The code that gets compiled into a .cob is written in a .bos file. A program called Scriptor generally does this compilation. BOS uses a C-like syntax, although it has many Spring-specific features and isn&#039;t as powerful as C.&lt;br /&gt;
&lt;br /&gt;
===BOS versus C===&lt;br /&gt;
&lt;br /&gt;
Similarities:&lt;br /&gt;
*Function syntax. A function is defined by FunctionName(args).&lt;br /&gt;
*Block delimiters. Like C, a statement block is delimited by curly braces ({}).&lt;br /&gt;
*General syntax. For example, to add two variables and assign the result to a third, you say x = y + z;&lt;br /&gt;
&lt;br /&gt;
Differences:&lt;br /&gt;
*Not case sensitive.&lt;br /&gt;
*Only one data type. There is only one type of data in COB, which is basically a 32-bit integer.&lt;br /&gt;
*Variable declaration. &lt;br /&gt;
&lt;br /&gt;
You can declare a static variable, whose scope encompasses the entire script, using&lt;br /&gt;
&lt;br /&gt;
 static-var x;&lt;br /&gt;
&lt;br /&gt;
You can declare multiple variables at once by separating them with commas.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can declare a local variable:&lt;br /&gt;
&lt;br /&gt;
 var x;&lt;br /&gt;
&lt;br /&gt;
The scope is limited to the function that it is in.&lt;br /&gt;
*No pointers or arrays.&lt;br /&gt;
*No internal return values. When the script receives a callin, it may return a value to the &amp;quot;outside&amp;quot;; however, there is no way to return a value directly to another function within the script. You will have to use a static variable.&lt;br /&gt;
*Function calls. &lt;br /&gt;
&lt;br /&gt;
Functions are called using&lt;br /&gt;
&lt;br /&gt;
 call-script Function(args);&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 start-script Function(args);&lt;br /&gt;
&lt;br /&gt;
See [[Animation-CobThreads|COB-Threads]] for details.&lt;br /&gt;
*Multiple threads. This isn&#039;t as exciting as it sounds. Again, see [[Animation-CobThreads|COB-Threads]] for details.&lt;br /&gt;
*Spring-specific features. There are too many here to name; please consult the other COB articles.&lt;br /&gt;
&lt;br /&gt;
==Further information==&lt;br /&gt;
Greater detail can be found on the following pages&lt;br /&gt;
*[[Animation-CobExamples]]&lt;br /&gt;
*[[Animation-CobAnimation]]&lt;br /&gt;
*[[Animation-CobCallins]]&lt;br /&gt;
*[[Animation-CobConstants]]&lt;br /&gt;
*[[Animation-CobHitByWeaponID]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1959</id>
		<title>Animation-CobOverview</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1959"/>
		<updated>2009-08-23T21:08:52Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: fix link and add links + category&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is COB?==&lt;br /&gt;
&lt;br /&gt;
COB is the Spring engine&#039;s scripting system. Each unit has a .cob bitfile which defines many of its major behaviors, including animation and weapon aiming. Of course, COB is also capable of doing a lot more if you wish. When Spring is actually running, it interprets the bitfile for each unit as necessary. This interpreter runs in a very straightforward way, without any fancy optimizations, so don&#039;t expect great performance from it.&lt;br /&gt;
&lt;br /&gt;
==BOS==&lt;br /&gt;
&lt;br /&gt;
The code that gets compiled into a .cob is written in a .bos file. A program called Scriptor generally does this compilation. BOS uses a C-like syntax, although it has many Spring-specific features and isn&#039;t as powerful as C.&lt;br /&gt;
&lt;br /&gt;
===BOS versus C===&lt;br /&gt;
&lt;br /&gt;
Similarities:&lt;br /&gt;
*Function syntax. A function is defined by FunctionName(args).&lt;br /&gt;
*Block delimiters. Like C, a statement block is delimited by curly braces ({}).&lt;br /&gt;
*General syntax. For example, to add two variables and assign the result to a third, you say x = y + z;&lt;br /&gt;
&lt;br /&gt;
Differences:&lt;br /&gt;
*Not case sensitive.&lt;br /&gt;
*Only one data type. There is only one type of data in COB, which is basically a 32-bit integer.&lt;br /&gt;
*Variable declaration. &lt;br /&gt;
&lt;br /&gt;
You can declare a static variable, whose scope encompasses the entire script, using&lt;br /&gt;
&lt;br /&gt;
 static-var x;&lt;br /&gt;
&lt;br /&gt;
You can declare multiple variables at once by separating them with commas.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can declare a local variable:&lt;br /&gt;
&lt;br /&gt;
 var x;&lt;br /&gt;
&lt;br /&gt;
The scope is limited to the function that it is in.&lt;br /&gt;
*No pointers or arrays.&lt;br /&gt;
*No internal return values. When the script receives a callin, it may return a value to the &amp;quot;outside&amp;quot;; however, there is no way to return a value directly to another function within the script. You will have to use a static variable.&lt;br /&gt;
*Function calls. &lt;br /&gt;
&lt;br /&gt;
Functions are called using&lt;br /&gt;
&lt;br /&gt;
 call-script Function(args);&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 start-script Function(args);&lt;br /&gt;
&lt;br /&gt;
See [[COB-Threads]] for details.&lt;br /&gt;
*Multiple threads. This isn&#039;t as exciting as it sounds. Again, see [[COB-Threads]] for details.&lt;br /&gt;
*Spring-specific features. There are too many here to name; please consult the other COB articles.&lt;br /&gt;
&lt;br /&gt;
==Further information==&lt;br /&gt;
Greater detail can be found on the following pages&lt;br /&gt;
*[[Animation-CobExamples]]&lt;br /&gt;
*[[Animation-CobAnimation]]&lt;br /&gt;
*[[Animation-CobCallins]]&lt;br /&gt;
*[[Animation-CobConstants]]&lt;br /&gt;
*[[Animation-CobThreads]]&lt;br /&gt;
*[[Animation-CobHitByWeaponID]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Animation]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobOverview&amp;diff=2117</id>
		<title>Animation:CobOverview</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobOverview&amp;diff=2117"/>
		<updated>2009-08-23T21:06:35Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: delete&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobOverview]]&lt;br /&gt;
{{delete}}&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobHitByWeaponID&amp;diff=2113</id>
		<title>Animation:CobHitByWeaponID</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobHitByWeaponID&amp;diff=2113"/>
		<updated>2009-08-23T21:05:39Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobHitByWeaponID moved to Animation-CobHitByWeaponID: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobHitByWeaponID]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobHitByWeaponID&amp;diff=1942</id>
		<title>Animation-CobHitByWeaponID</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobHitByWeaponID&amp;diff=1942"/>
		<updated>2009-08-23T21:05:39Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobHitByWeaponID moved to Animation-CobHitByWeaponID: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HitByWeaponId(z,x,weapon_id,shot_power)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The z and x angles are not returned unless the impulse of the weapon is high enough to move the unit.&lt;br /&gt;
&lt;br /&gt;
The weapon_id is the &amp;quot;id=xxx&amp;quot; from the weapon information in the weapon tdf.&lt;br /&gt;
&lt;br /&gt;
Always return(100); or the weapon won&#039;t deal full damage.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobThreads&amp;diff=2119</id>
		<title>Animation:CobThreads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobThreads&amp;diff=2119"/>
		<updated>2009-08-23T21:05:30Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobThreads moved to Animation-CobThreads: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobThreads]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobThreads&amp;diff=1971</id>
		<title>Animation-CobThreads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobThreads&amp;diff=1971"/>
		<updated>2009-08-23T21:05:30Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobThreads moved to Animation-CobThreads: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobThread.cpp&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Much of the time you can expect your script to execute sequentially; that is, looking through your code, the system progresses from statement to statement without anything &amp;quot;strange&amp;quot; (variables being changed, threads being started, etc.) between them. HOWEVER, &amp;quot;strange&amp;quot; things do happen, and in fact they happen quite regularly in scripts. We say that the script system has &amp;quot;concurrency&amp;quot; when things can happen between statements.&lt;br /&gt;
&lt;br /&gt;
===Why Concurrency?===&lt;br /&gt;
So why go to all this trouble with concurrency? The script system has concurrency because we never know when things are going to happen. The player could give a command to the unit, the unit could run into a wall, rocks could fall out of the sky and kill the unit, and so forth. Without concurrency we would have to check very often whether which of all possible events had happened recently in order to determine what to do next. This would suck.&lt;br /&gt;
&lt;br /&gt;
==Dealing With Concurrency==&lt;br /&gt;
Every time a callin is called or a start-script statement is executed, a &amp;quot;thread&amp;quot; is created. At any one time, only one thread is being executed at a time, but sometimes a thread will stop executing for a while and continue later, while several other threads will execute in the meantime. Most of the time your script is guaranteed to execute sequentially. If you say x = 1;, it will stay 1 unless you change it again. The exceptions are as follows:&lt;br /&gt;
&lt;br /&gt;
*Before a script starts.&lt;br /&gt;
*After a wait-for-move or wait-for-turn statement.&lt;br /&gt;
*After a sleep statement.&lt;br /&gt;
&lt;br /&gt;
During these times, any other thread has the ability to come in and change all your static variables, tell your pieces to move, turn, and spin, and so forth. Therefore, you cannot always assume these things will be the way you left them when execution of the thread resumes. If it is possible that another thread will change something that you need to know about, you need to check it after any of these times.&lt;br /&gt;
&lt;br /&gt;
==Sleeping==&lt;br /&gt;
&lt;br /&gt;
You can have a thread sleep by using a sleep statement:&lt;br /&gt;
&lt;br /&gt;
 sleep [time in ms];&lt;br /&gt;
&lt;br /&gt;
This is useful for delaying events and in making loops execute every so often. If you want to wait until a piece moves into position, use wait-for-move or wait-for-turn instead.&lt;br /&gt;
&lt;br /&gt;
==Signals==&lt;br /&gt;
&lt;br /&gt;
Signals provide a way to kill threads in their sleep. Signals are bitmasks. There are two statement types dealing with signals: signal and set-signal-mask.&lt;br /&gt;
&lt;br /&gt;
 signal [bitmask];&lt;br /&gt;
&lt;br /&gt;
kills all sleeping threads that overlap the bitmask.&lt;br /&gt;
&lt;br /&gt;
 set-signal-mask [bitmask];&lt;br /&gt;
&lt;br /&gt;
sets what signals kill the current thread.&lt;br /&gt;
&lt;br /&gt;
This has several applications. For functions that are called regularly, such as AimWeaponX(), this prevents multiple copies of the same thread from running at the same time. It is also a way (but not the only or necessarily best way) to interrupt another thread.&lt;br /&gt;
&lt;br /&gt;
==call-script==&lt;br /&gt;
&lt;br /&gt;
Use as follows:&lt;br /&gt;
&lt;br /&gt;
 call-script [function]([args]);&lt;br /&gt;
&lt;br /&gt;
This does not start a new thread! The calling function will not continue until the called function returns.&lt;br /&gt;
&lt;br /&gt;
==start-script==&lt;br /&gt;
&lt;br /&gt;
At first glance, this is similar to call-script:&lt;br /&gt;
&lt;br /&gt;
 start-script [function]([args]);&lt;br /&gt;
&lt;br /&gt;
However, start-script &#039;&#039;does&#039;&#039; create a new thread, and the calling function &#039;&#039;doesn&#039;t&#039;&#039; wait until the started function returns before continuing. By default, the new thread shares the same signal mask as its parent, although you can set it manually if you like. Apart from this, the two threads execute completely independently.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobConstants&amp;diff=2110</id>
		<title>Animation:CobConstants</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobConstants&amp;diff=2110"/>
		<updated>2009-08-23T21:05:22Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobConstants moved to Animation-CobConstants: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobConstants]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobConstants&amp;diff=1930</id>
		<title>Animation-CobConstants</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobConstants&amp;diff=1930"/>
		<updated>2009-08-23T21:05:22Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobConstants moved to Animation-CobConstants: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
This has a list of all COB SET/GET constants: http://github.com/spring/spring/blob/master/rts/Sim/Units/COB/CobInstance.cpp&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want to include a file with these constants in your script.&lt;br /&gt;
&lt;br /&gt;
==SET/GET==&lt;br /&gt;
&lt;br /&gt;
===Use===&lt;br /&gt;
Use GET [tag] to get a value. Some GETs refer to functions; in this case, use GET [tag](arg1, arg2, arg3, arg4).&lt;br /&gt;
Use SET [tag] to [value] to change a value.&lt;br /&gt;
&lt;br /&gt;
===Tags===&lt;br /&gt;
There&#039;s a lot of GET/SET tags; I&#039;ll cover some of the more useful but less intuitive ones.&lt;br /&gt;
&lt;br /&gt;
*ACTIVATION: Whether the unit is on (true) or off (false).&lt;br /&gt;
*ARMORED: When true, any damage dealt to the unit will be multiplied by its damageModifier.&lt;br /&gt;
*PRINT: You can use GET PRINT to send up to 4 arguments to chat. Useful for debugging.&lt;br /&gt;
*VETERAN_LEVEL: The unit&#039;s experience times 100. Note that you can SET this via script, although the unit won&#039;t gain any extra health from doing so.&lt;br /&gt;
&lt;br /&gt;
=== Custom Variables ===&lt;br /&gt;
Higher GET/SET numbers are reserved for custom variables. These are very useful for Lua integration. Setting these variables is much (perhaps 100x) faster than calling functions across Lua and COB; the disadvantages are the limited number of variables and the fact that the other side is not immediately notified of a change in the variable.&lt;br /&gt;
&lt;br /&gt;
*Unit variables: The 8 numbers starting at 1024 correspond to per-unit variables. To get at these from Lua, use Spring.[Get|Set]COBUnitVar.&lt;br /&gt;
*Team variables: The 64 numbers starting at 2048 correspond to per-team variables. To get at these from Lua, use Spring.[Get|Set]COBTeamVar.&lt;br /&gt;
*Ally variables: The 64 numbers starting at 3072 correspond to per-team variables. To get at these from Lua, use Spring.[Get|Set]COBAllyTeamVar.&lt;br /&gt;
*Global variables: The 4096 numbers starting at 4096 correspond to global variables. To get at these from Lua, use Spring.[Get|Set]COBGlobalVar.&lt;br /&gt;
&lt;br /&gt;
==emit-sfx==&lt;br /&gt;
&lt;br /&gt;
 emit-sfx [sfxtype] from [piece];&lt;br /&gt;
&lt;br /&gt;
The least significant byte of sfxtype is treated as an unsigned integer; the remaining bits are a bitmask. The bitmask indicates what &#039;&#039;type&#039;&#039; of sfx to emit, while the number indicates &#039;&#039;which&#039;&#039; sfx of that type to emit. The bits are as follows:&lt;br /&gt;
&lt;br /&gt;
*256: Point-based fx. Used for white smoke (1), black smoke (2), and bubbles (3).&lt;br /&gt;
*1024: Unit sfx. Use with the unit&#039;s sfxtypes.explosionGenerators. The first one is 0, the second one is 1, etc.&lt;br /&gt;
*2048: Fire weapon. Fires a weapon from the piece (no aiming involved). Again, the first weapon is 0, the second weapon is 1, etc.&lt;br /&gt;
*4096: Explode weapon. Detonates a weapon at the piece. Again, the first weapon is 0, the second weapon is 1, etc.&lt;br /&gt;
&lt;br /&gt;
==explode==&lt;br /&gt;
&lt;br /&gt;
Causes the piece to explode and possibly go flying. This actually gives the appearance of making a copy of the piece (henceforth referred to as &amp;quot;debris&amp;quot;) so if you&#039;re using it outside of Killed() you may want to hide the piece in question.&lt;br /&gt;
&lt;br /&gt;
 explode [piece] type [exptype];&lt;br /&gt;
&lt;br /&gt;
exptype is a bitmask. The bits are as follows:&lt;br /&gt;
&lt;br /&gt;
*SHATTER: Explodes the debris into tiny triangles. Looks like confetti.&lt;br /&gt;
*EXPLODE_ON_HIT: Debris will explode on impact, causing about 40 damage.&lt;br /&gt;
*FALL: Debris is affected by gravity.&lt;br /&gt;
*SMOKE&lt;br /&gt;
*FIRE&lt;br /&gt;
*BITMAPONLY: No debris, just an explosion graphic.&lt;br /&gt;
*NOCEGTRAIL&lt;br /&gt;
*NOHEATCLOUD: No explosion before the piece flies off.&lt;br /&gt;
*BITMAP[1...5]: Not used in Spring, may overlap with Spring specific bits.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobCallins&amp;diff=2107</id>
		<title>Animation:CobCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobCallins&amp;diff=2107"/>
		<updated>2009-08-23T21:05:11Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobCallins moved to Animation-CobCallins: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobCallins]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobCallins&amp;diff=1909</id>
		<title>Animation-CobCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobCallins&amp;diff=1909"/>
		<updated>2009-08-23T21:05:11Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobCallins moved to Animation-CobCallins: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
Some (but not all) are listed near the end of this file: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobFile.cpp&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
Callins have two purposes:&lt;br /&gt;
&lt;br /&gt;
First, they allow a script to be notified when an event happens, such as the unit being created or destroyed.&lt;br /&gt;
&lt;br /&gt;
Second, they allow the engine to get information from the script. Sometimes this is accomplished through a return value, but usually this is done by setting one of the arguments to a function to the requested value.&lt;br /&gt;
&lt;br /&gt;
==Callins==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
*Create(): Called when the unit is created. &amp;quot;Created&amp;quot; means when the unit&#039;s nanoframe is created; if you want to wait until the unit is actually finished, you&#039;ll have to use something like &lt;br /&gt;
&lt;br /&gt;
 while(GET BUILD_PERCENT_LEFT) sleep 250; &lt;br /&gt;
&lt;br /&gt;
*Activate()/Deactivate(): Called when the unit is turned on/off.&lt;br /&gt;
*Killed(severity, corpsetype): Called when the unit is killed. Severity indicates how many percent of the unit&#039;s hit points were dealt by the final blow. Corpsetype basically indicates the number of times the unit and its corpses are destroyed; for example, corpsetype = 3 acts as if the unit is destroyed, the corpse is destroyed, and the corpse&#039;s corpse is destroyed. If it runs out of corpses nothing is left behind. Set corpsetype to the desired value.&lt;br /&gt;
&lt;br /&gt;
===Movement===&lt;br /&gt;
&lt;br /&gt;
*StartMoving()/StopMoving(): Called when the unit starts/stops moving. This includes rotation, so don&#039;t be surprised if StartMoving() sometimes gets called when a unit starts aiming at a target.&lt;br /&gt;
*SetSFXOccupy(terraintype): Supposedly called when the unit changes terrain type, although it didn&#039;t work last time I tried it? Maybe I was using it wrong. terraintype: 0 = transported, 1 = sea, 2 = deep sea (greater than 5 water depth and unit is upright), 4 = land.&lt;br /&gt;
*MoveRate[0...3](): Appears to be the aircraft equivalent of SetSFXOccupy. MoveRate3 doesn&#039;t appear to actually be used. MoveRate1 is called when the aircraft takes off or lands. If the aircraft is not taking off or landing, MoveRate0 is called when the aircraft drops below 1/3 maximum speed, MoveRate2 is called when the aircraft exceeds 2/3 maximum speed, and MoveRate1 is called when the aircraft enters within 1/3-2/3 maximum speed. I don&#039;t know if this actually works.&lt;br /&gt;
*SetDirection(heading): Used only for wind generators. Gives the direction of the wind.&lt;br /&gt;
*SetSpeed(speed): Used for wind generators, tidals, and mexes. Basically more resources = higher speed.&lt;br /&gt;
&lt;br /&gt;
===Weapons===&lt;br /&gt;
&lt;br /&gt;
For weapons, X means either the number of the weapon, or &amp;quot;Primary&amp;quot;, &amp;quot;Secondary&amp;quot;, or &amp;quot;Tertiary&amp;quot; (don&#039;t put &amp;quot;Weapon&amp;quot; for these). I recommend using numbers, since it&#039;s cleaner and you can use more than three weapons that way.&lt;br /&gt;
&lt;br /&gt;
*AimWeaponX(heading, pitch): Called every ~0.5s when the unit is aiming the weapon at a target. This is used to turn a unit&#039;s turrets toward the target. Return 1 when the weapon is ready to fire. Alternately, return 0 if you don&#039;t want the weapon to fire (you can use this to disable weapons).&lt;br /&gt;
*AimFromWeaponX(piecenum): You should set piecenum to a piece of the model; LOS is traced from the here to the target to see if the weapon can fire.&lt;br /&gt;
*FireWeaponX(): Called whenever the trigger is pulled on a weapon. This occurs before the &#039;&#039;first&#039;&#039; shot in a burst/projectile salvo (only).&lt;br /&gt;
*ShotX(): Called before every shot a weapon fires. This includes burst and projectile tags. This happens after FireWeaponX(), even for the first shot.&lt;br /&gt;
*QueryWeaponX(piecenum): You should set piecenum to a piece of the model. The shot starts from this piece of the model; this is called for this purpose after FireWeaponX() and ShotX(). LOS is also traced from here to the target to see if a weapon can fire. Make sure this is a piece on the weapon&#039;s turret. Not doing this right can cause headaches; example: http://trac.caspring.org/wiki/GunsJammingOnShips&lt;br /&gt;
*EndBurstX(): Called after the last shot in a burst.&lt;br /&gt;
*BlockShotX(unitID, block)&lt;br /&gt;
*TargetWeightX(unitID, weightMod)&lt;br /&gt;
*RockUnit(anglex, anglez): Called when the unit fires. Use it to rock the unit on firing, although there are other ways to do this.&lt;br /&gt;
*HitByWeaponID(damage, weaponid?, unitid?): Called when the unit is hit by a weapon.&lt;br /&gt;
*SetMaxReloadTime(time): Called on unit creation. time is the time in ms that it takes the slowest-firing weapon to reload.&lt;br /&gt;
&lt;br /&gt;
===Construction===&lt;br /&gt;
&lt;br /&gt;
*StartBuilding(): Called when the unit starts building.&lt;br /&gt;
*StopBuilding(): Called when the unit stops building.&lt;br /&gt;
*QueryNanoPiece(piecenum): You should set piecenum to the piece you want the nanospray to come from.&lt;br /&gt;
*QueryBuildInfo(piecenum): For factories. You should set piecenum to the piece you want the unit to be built on.&lt;br /&gt;
&lt;br /&gt;
===Transportation===&lt;br /&gt;
*Falling(): Used for airdropping units?&lt;br /&gt;
*Landed(): Used for airdropping units?&lt;br /&gt;
*QueryTransport(piecenum): You should set piecenum to the piece you want the transported unit to be attached to.&lt;br /&gt;
*BeginTransport(): Called when an air transport picks up a unit.&lt;br /&gt;
*EndTransport(): Called when an air transport becomes empty.&lt;br /&gt;
*TransportPickup(): Called when a land transport picks up a unit.&lt;br /&gt;
*TransportDrop(): Called when a land transport becomes empty.&lt;br /&gt;
*StartUnload(): Called when the transport starts the unloading process.&lt;br /&gt;
&lt;br /&gt;
===Landing Pads===&lt;br /&gt;
*QueryLandingPadCount(count): You should set count to the number of landing pads. However, it doesn&#039;t seem to be actually necessary to do this unless you want more than 16 pads.&lt;br /&gt;
*QueryLandingPad(piecenum1, piecenum2, piecenum3...): Set each piecenum to a different landing pad piece.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobAnimation&amp;diff=2104</id>
		<title>Animation:CobAnimation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobAnimation&amp;diff=2104"/>
		<updated>2009-08-23T21:05:01Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobAnimation moved to Animation-CobAnimation: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobAnimation]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobAnimation&amp;diff=1880</id>
		<title>Animation-CobAnimation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobAnimation&amp;diff=1880"/>
		<updated>2009-08-23T21:05:01Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobAnimation moved to Animation-CobAnimation: oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pieces==&lt;br /&gt;
&lt;br /&gt;
Each unit has a root piece and a tree of other pieces attached to the root piece. At the top of each file you&#039;ll need to put the following line:&lt;br /&gt;
&lt;br /&gt;
 piece [names of pieces of the model separated by commas];&lt;br /&gt;
&lt;br /&gt;
As usual, capitalization does not matter; neither does the order of the pieces. You do not need to name every piece that the model actually has, although you should do so, and you cannot do anything to a piece that you have not named. If you try to do something to a piece that doesn&#039;t exist, Spring will throw an error. Generally it will not crash but you&#039;ll probably get lots of chat spam, so avoid this.&lt;br /&gt;
&lt;br /&gt;
Every piece starts in the position as it appears in any modeling program, such as Upspring. This is defined to be zero position and zero rotation.&lt;br /&gt;
&lt;br /&gt;
Pieces are really numbers, although Scriptor usually throws a fit if you try to use them as numbers (it will not accept a number in places where it expects a piece name, although for functions that involve a piecenum you can use the piece&#039;s number instead of the piece name if you so desire). The first piece you list is 0, and it counts from there.&lt;br /&gt;
&lt;br /&gt;
==Linear Units==&lt;br /&gt;
&lt;br /&gt;
Everything linear &#039;&#039;really&#039;&#039; happens in a unit I&#039;ll call Spring distance (sd). This is a tiny distance--there are 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; = 65536 sd in an elmo, which is the unit that is most commonly used. For example, weapon ranges are specified in elmos. Fortunately, Scriptor can automatically convert elmos to sd: just put the number of elmos you want in brackets ([]). Sometimes you&#039;ll see scripts that use 2.5 * 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; = 163840 instead. I recommend not doing this since it makes conversion more difficult.&lt;br /&gt;
&lt;br /&gt;
==Angular Units==&lt;br /&gt;
&lt;br /&gt;
Likewise, everything angular &#039;&#039;really&#039;&#039; happens in a unit I&#039;ll call Spring angle (sa). There are 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; sa in a full circle. Generally you&#039;ll be working in degrees. There are 182 and 2/45 sa in a degree. Again, Scriptor can automatically convert from degrees to sa; just put the number of degrees you want in angles (&amp;lt;&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
All COB animation statements specify an axis. There are three axes, &amp;quot;x-axis&amp;quot;, &amp;quot;y-axis&amp;quot;, and &amp;quot;z-axis&amp;quot;. Positive x is to the unit&#039;s left (the right if you are looking at the unit from the front). Positive y is to the unit&#039;s top. Positive z is to the unit&#039;s front.&lt;br /&gt;
&lt;br /&gt;
The position and rotation of each piece defines the coordinate system for all of its child pieces. So, if you move or rotate a piece, all of its child pieces will move and rotate with it.&lt;br /&gt;
&lt;br /&gt;
A positive angle is counterclockwise looking at the piece from the positive end of the axis toward the negative end of the axis.&lt;br /&gt;
&lt;br /&gt;
==move==&lt;br /&gt;
&lt;br /&gt;
 move [piece] to [axis] [distance] now;&lt;br /&gt;
&lt;br /&gt;
This moves the piece immediately. The piece will be in its new position along the axis before the next statement is executed.&lt;br /&gt;
&lt;br /&gt;
 move [piece] to [axis] [distance] speed [speed];&lt;br /&gt;
&lt;br /&gt;
This moves the piece at some speed until it reaches its destination, or the piece is told to move to a different distance along the same axis, whichever comes first. After this statement, the piece moves independent of the script; indeed, the script proceeds immediately to the next statement after it sets the piece moving.&lt;br /&gt;
&lt;br /&gt;
Speed is always positive, even if you are moving the piece to a negative distance. It is measured in Spring distance/second (sd/s).&lt;br /&gt;
&lt;br /&gt;
 wait-for-move [piece] along [axis];&lt;br /&gt;
&lt;br /&gt;
Makes the thread sleep until the piece stops moving along the axis.&lt;br /&gt;
&lt;br /&gt;
==turn==&lt;br /&gt;
&lt;br /&gt;
These are similar to movement in behavior, except they rotate the piece.&lt;br /&gt;
&lt;br /&gt;
 turn [piece] to [axis] [angle] now;&lt;br /&gt;
&lt;br /&gt;
Turns the piece to the specified angle around the axis immediately. The piece will be in its new rotation around the axis before the next statement is executed. Pieces rotate around their &amp;lt;u&amp;gt;own&amp;lt;/u&amp;gt; center, not their parent&#039;s (although if the parent rotates, they do as well). If the piece moves, the center moves with it, so a piece&#039;s movement occurs &amp;quot;before&amp;quot; its rotation in determining its final position.&lt;br /&gt;
&lt;br /&gt;
 turn [piece] to [axis] [angle] speed [angular speed];&lt;br /&gt;
&lt;br /&gt;
This turns the piece at some angular speed until it reaches its destination, or the piece is told to turn to a different distance around the same axis, whichever comes first. Angular speed is always positive, even if the angle is negative. The speed is in Spring angles/second (sa/s).&lt;br /&gt;
&lt;br /&gt;
 wait-for-turn [piece] around [axis];&lt;br /&gt;
&lt;br /&gt;
Makes the thread sleep until the piece stops turning around the axis.&lt;br /&gt;
&lt;br /&gt;
==spin==&lt;br /&gt;
&lt;br /&gt;
 spin [piece] around [axis] speed [angular speed];&lt;br /&gt;
&lt;br /&gt;
This starts the piece spinning at a constant speed immediately. Again, the speed is in Spring angles/second (sa/s); however, it can be negative if you want it to spin in that direction.&lt;br /&gt;
&lt;br /&gt;
 spin [piece] around [axis] speed [angular speed] accelerate [angular acceleration];&lt;br /&gt;
&lt;br /&gt;
The angular acceleration should always be positive, even if you are spinning the piece at a negative angular speed. It is measured in Spring angles per frame-second (sa/f*s); in other words, the speed of the piece will increase by that amount every &#039;&#039;frame&#039;&#039;, not every second. There are 30 frames per second.&lt;br /&gt;
&lt;br /&gt;
 stop-spin [piece] around [axis];&lt;br /&gt;
&lt;br /&gt;
Stops the piece from spinning immediately, regardless of its orientation.&lt;br /&gt;
&lt;br /&gt;
 stop-spin [piece] around [axis] decelerate [angular deceleration];&lt;br /&gt;
&lt;br /&gt;
Slows the piece&#039;s spinning down until it stops. As with angular acceleration, the angular deceleration should always be positive and is measured in Spring angles per frame-second.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobOverview&amp;diff=2116</id>
		<title>Animation:CobOverview</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation:CobOverview&amp;diff=2116"/>
		<updated>2009-08-23T21:04:27Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobOverview moved to Animation-CobOverview: oops - got confused with my own convention :P&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation-CobOverview]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1958</id>
		<title>Animation-CobOverview</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobOverview&amp;diff=1958"/>
		<updated>2009-08-23T21:04:27Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: Animation:CobOverview moved to Animation-CobOverview: oops - got confused with my own convention :P&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==What is COB?==&lt;br /&gt;
&lt;br /&gt;
COB is the Spring engine&#039;s scripting system. Each unit has a .cob bitfile which defines many of its major behaviors, including animation and weapon aiming. Of course, COB is also capable of doing a lot more if you wish. When Spring is actually running, it interprets the bitfile for each unit as necessary. This interpreter runs in a very straightforward way, without any fancy optimizations, so don&#039;t expect great performance from it.&lt;br /&gt;
&lt;br /&gt;
==BOS==&lt;br /&gt;
&lt;br /&gt;
The code that gets compiled into a .cob is written in a .bos file. A program called Scriptor generally does this compilation. BOS uses a C-like syntax, although it has many Spring-specific features and isn&#039;t as powerful as C.&lt;br /&gt;
&lt;br /&gt;
===BOS versus C===&lt;br /&gt;
&lt;br /&gt;
Similarities:&lt;br /&gt;
*Function syntax. A function is defined by FunctionName(args).&lt;br /&gt;
*Block delimiters. Like C, a statement block is delimited by curly braces ({}).&lt;br /&gt;
*General syntax. For example, to add two variables and assign the result to a third, you say x = y + z;&lt;br /&gt;
&lt;br /&gt;
Differences:&lt;br /&gt;
*Not case sensitive.&lt;br /&gt;
*Only one data type. There is only one type of data in COB, which is basically a 32-bit integer.&lt;br /&gt;
*Variable declaration. &lt;br /&gt;
&lt;br /&gt;
You can declare a static variable, whose scope encompasses the entire script, using&lt;br /&gt;
&lt;br /&gt;
 static-var x;&lt;br /&gt;
&lt;br /&gt;
You can declare multiple variables at once by separating them with commas.&lt;br /&gt;
&lt;br /&gt;
Alternately, you can declare a local variable:&lt;br /&gt;
&lt;br /&gt;
 var x;&lt;br /&gt;
&lt;br /&gt;
The scope is limited to the function that it is in.&lt;br /&gt;
*No pointers or arrays.&lt;br /&gt;
*No internal return values. When the script receives a callin, it may return a value to the &amp;quot;outside&amp;quot;; however, there is no way to return a value directly to another function within the script. You will have to use a static variable.&lt;br /&gt;
*Function calls. &lt;br /&gt;
&lt;br /&gt;
Functions are called using&lt;br /&gt;
&lt;br /&gt;
 call-script Function(args);&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 start-script Function(args);&lt;br /&gt;
&lt;br /&gt;
See [[COB_Threads]] for details.&lt;br /&gt;
*Multiple threads. This isn&#039;t as exciting as it sounds. Again, see [[COB_Threads]] for details.&lt;br /&gt;
*Spring-specific features. There are too many here to name; please consult the other COB articles.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_HitByWeaponID&amp;diff=3945</id>
		<title>COB HitByWeaponID</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_HitByWeaponID&amp;diff=3945"/>
		<updated>2009-08-23T20:58:29Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB HitByWeaponID moved to Animation:CobHitByWeaponID: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation:CobHitByWeaponID]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobHitByWeaponID&amp;diff=1941</id>
		<title>Animation-CobHitByWeaponID</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobHitByWeaponID&amp;diff=1941"/>
		<updated>2009-08-23T20:58:29Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB HitByWeaponID moved to Animation:CobHitByWeaponID: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;HitByWeaponId(z,x,weapon_id,shot_power)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The z and x angles are not returned unless the impulse of the weapon is high enough to move the unit.&lt;br /&gt;
&lt;br /&gt;
The weapon_id is the &amp;quot;id=xxx&amp;quot; from the weapon information in the weapon tdf.&lt;br /&gt;
&lt;br /&gt;
Always return(100); or the weapon won&#039;t deal full damage.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Threads&amp;diff=3949</id>
		<title>COB Threads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Threads&amp;diff=3949"/>
		<updated>2009-08-23T20:58:01Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Threads moved to Animation:CobThreads: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation:CobThreads]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobThreads&amp;diff=1970</id>
		<title>Animation-CobThreads</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobThreads&amp;diff=1970"/>
		<updated>2009-08-23T20:58:01Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Threads moved to Animation:CobThreads: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobThread.cpp&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Much of the time you can expect your script to execute sequentially; that is, looking through your code, the system progresses from statement to statement without anything &amp;quot;strange&amp;quot; (variables being changed, threads being started, etc.) between them. HOWEVER, &amp;quot;strange&amp;quot; things do happen, and in fact they happen quite regularly in scripts. We say that the script system has &amp;quot;concurrency&amp;quot; when things can happen between statements.&lt;br /&gt;
&lt;br /&gt;
===Why Concurrency?===&lt;br /&gt;
So why go to all this trouble with concurrency? The script system has concurrency because we never know when things are going to happen. The player could give a command to the unit, the unit could run into a wall, rocks could fall out of the sky and kill the unit, and so forth. Without concurrency we would have to check very often whether which of all possible events had happened recently in order to determine what to do next. This would suck.&lt;br /&gt;
&lt;br /&gt;
==Dealing With Concurrency==&lt;br /&gt;
Every time a callin is called or a start-script statement is executed, a &amp;quot;thread&amp;quot; is created. At any one time, only one thread is being executed at a time, but sometimes a thread will stop executing for a while and continue later, while several other threads will execute in the meantime. Most of the time your script is guaranteed to execute sequentially. If you say x = 1;, it will stay 1 unless you change it again. The exceptions are as follows:&lt;br /&gt;
&lt;br /&gt;
*Before a script starts.&lt;br /&gt;
*After a wait-for-move or wait-for-turn statement.&lt;br /&gt;
*After a sleep statement.&lt;br /&gt;
&lt;br /&gt;
During these times, any other thread has the ability to come in and change all your static variables, tell your pieces to move, turn, and spin, and so forth. Therefore, you cannot always assume these things will be the way you left them when execution of the thread resumes. If it is possible that another thread will change something that you need to know about, you need to check it after any of these times.&lt;br /&gt;
&lt;br /&gt;
==Sleeping==&lt;br /&gt;
&lt;br /&gt;
You can have a thread sleep by using a sleep statement:&lt;br /&gt;
&lt;br /&gt;
 sleep [time in ms];&lt;br /&gt;
&lt;br /&gt;
This is useful for delaying events and in making loops execute every so often. If you want to wait until a piece moves into position, use wait-for-move or wait-for-turn instead.&lt;br /&gt;
&lt;br /&gt;
==Signals==&lt;br /&gt;
&lt;br /&gt;
Signals provide a way to kill threads in their sleep. Signals are bitmasks. There are two statement types dealing with signals: signal and set-signal-mask.&lt;br /&gt;
&lt;br /&gt;
 signal [bitmask];&lt;br /&gt;
&lt;br /&gt;
kills all sleeping threads that overlap the bitmask.&lt;br /&gt;
&lt;br /&gt;
 set-signal-mask [bitmask];&lt;br /&gt;
&lt;br /&gt;
sets what signals kill the current thread.&lt;br /&gt;
&lt;br /&gt;
This has several applications. For functions that are called regularly, such as AimWeaponX(), this prevents multiple copies of the same thread from running at the same time. It is also a way (but not the only or necessarily best way) to interrupt another thread.&lt;br /&gt;
&lt;br /&gt;
==call-script==&lt;br /&gt;
&lt;br /&gt;
Use as follows:&lt;br /&gt;
&lt;br /&gt;
 call-script [function]([args]);&lt;br /&gt;
&lt;br /&gt;
This does not start a new thread! The calling function will not continue until the called function returns.&lt;br /&gt;
&lt;br /&gt;
==start-script==&lt;br /&gt;
&lt;br /&gt;
At first glance, this is similar to call-script:&lt;br /&gt;
&lt;br /&gt;
 start-script [function]([args]);&lt;br /&gt;
&lt;br /&gt;
However, start-script &#039;&#039;does&#039;&#039; create a new thread, and the calling function &#039;&#039;doesn&#039;t&#039;&#039; wait until the started function returns before continuing. By default, the new thread shares the same signal mask as its parent, although you can set it manually if you like. Apart from this, the two threads execute completely independently.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Constants&amp;diff=3943</id>
		<title>COB Constants</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Constants&amp;diff=3943"/>
		<updated>2009-08-23T20:57:48Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Constants moved to Animation:CobConstants: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation:CobConstants]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobConstants&amp;diff=1929</id>
		<title>Animation-CobConstants</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobConstants&amp;diff=1929"/>
		<updated>2009-08-23T20:57:48Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Constants moved to Animation:CobConstants: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
This has a list of all COB SET/GET constants: http://github.com/spring/spring/blob/master/rts/Sim/Units/COB/CobInstance.cpp&lt;br /&gt;
&lt;br /&gt;
You&#039;ll want to include a file with these constants in your script.&lt;br /&gt;
&lt;br /&gt;
==SET/GET==&lt;br /&gt;
&lt;br /&gt;
===Use===&lt;br /&gt;
Use GET [tag] to get a value. Some GETs refer to functions; in this case, use GET [tag](arg1, arg2, arg3, arg4).&lt;br /&gt;
Use SET [tag] to [value] to change a value.&lt;br /&gt;
&lt;br /&gt;
===Tags===&lt;br /&gt;
There&#039;s a lot of GET/SET tags; I&#039;ll cover some of the more useful but less intuitive ones.&lt;br /&gt;
&lt;br /&gt;
*ACTIVATION: Whether the unit is on (true) or off (false).&lt;br /&gt;
*ARMORED: When true, any damage dealt to the unit will be multiplied by its damageModifier.&lt;br /&gt;
*PRINT: You can use GET PRINT to send up to 4 arguments to chat. Useful for debugging.&lt;br /&gt;
*VETERAN_LEVEL: The unit&#039;s experience times 100. Note that you can SET this via script, although the unit won&#039;t gain any extra health from doing so.&lt;br /&gt;
&lt;br /&gt;
=== Custom Variables ===&lt;br /&gt;
Higher GET/SET numbers are reserved for custom variables. These are very useful for Lua integration. Setting these variables is much (perhaps 100x) faster than calling functions across Lua and COB; the disadvantages are the limited number of variables and the fact that the other side is not immediately notified of a change in the variable.&lt;br /&gt;
&lt;br /&gt;
*Unit variables: The 8 numbers starting at 1024 correspond to per-unit variables. To get at these from Lua, use Spring.[Get|Set]COBUnitVar.&lt;br /&gt;
*Team variables: The 64 numbers starting at 2048 correspond to per-team variables. To get at these from Lua, use Spring.[Get|Set]COBTeamVar.&lt;br /&gt;
*Ally variables: The 64 numbers starting at 3072 correspond to per-team variables. To get at these from Lua, use Spring.[Get|Set]COBAllyTeamVar.&lt;br /&gt;
*Global variables: The 4096 numbers starting at 4096 correspond to global variables. To get at these from Lua, use Spring.[Get|Set]COBGlobalVar.&lt;br /&gt;
&lt;br /&gt;
==emit-sfx==&lt;br /&gt;
&lt;br /&gt;
 emit-sfx [sfxtype] from [piece];&lt;br /&gt;
&lt;br /&gt;
The least significant byte of sfxtype is treated as an unsigned integer; the remaining bits are a bitmask. The bitmask indicates what &#039;&#039;type&#039;&#039; of sfx to emit, while the number indicates &#039;&#039;which&#039;&#039; sfx of that type to emit. The bits are as follows:&lt;br /&gt;
&lt;br /&gt;
*256: Point-based fx. Used for white smoke (1), black smoke (2), and bubbles (3).&lt;br /&gt;
*1024: Unit sfx. Use with the unit&#039;s sfxtypes.explosionGenerators. The first one is 0, the second one is 1, etc.&lt;br /&gt;
*2048: Fire weapon. Fires a weapon from the piece (no aiming involved). Again, the first weapon is 0, the second weapon is 1, etc.&lt;br /&gt;
*4096: Explode weapon. Detonates a weapon at the piece. Again, the first weapon is 0, the second weapon is 1, etc.&lt;br /&gt;
&lt;br /&gt;
==explode==&lt;br /&gt;
&lt;br /&gt;
Causes the piece to explode and possibly go flying. This actually gives the appearance of making a copy of the piece (henceforth referred to as &amp;quot;debris&amp;quot;) so if you&#039;re using it outside of Killed() you may want to hide the piece in question.&lt;br /&gt;
&lt;br /&gt;
 explode [piece] type [exptype];&lt;br /&gt;
&lt;br /&gt;
exptype is a bitmask. The bits are as follows:&lt;br /&gt;
&lt;br /&gt;
*SHATTER: Explodes the debris into tiny triangles. Looks like confetti.&lt;br /&gt;
*EXPLODE_ON_HIT: Debris will explode on impact, causing about 40 damage.&lt;br /&gt;
*FALL: Debris is affected by gravity.&lt;br /&gt;
*SMOKE&lt;br /&gt;
*FIRE&lt;br /&gt;
*BITMAPONLY: No debris, just an explosion graphic.&lt;br /&gt;
*NOCEGTRAIL&lt;br /&gt;
*NOHEATCLOUD: No explosion before the piece flies off.&lt;br /&gt;
*BITMAP[1...5]: Not used in Spring, may overlap with Spring specific bits.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Callins&amp;diff=3941</id>
		<title>COB Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Callins&amp;diff=3941"/>
		<updated>2009-08-23T20:57:31Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Callins moved to Animation:CobCallins: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation:CobCallins]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobCallins&amp;diff=1908</id>
		<title>Animation-CobCallins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobCallins&amp;diff=1908"/>
		<updated>2009-08-23T20:57:31Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Callins moved to Animation:CobCallins: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Source==&lt;br /&gt;
&lt;br /&gt;
Some (but not all) are listed near the end of this file: https://spring.clan-sy.com/svn/spring/trunk/rts/Sim/Units/COB/CobFile.cpp&lt;br /&gt;
&lt;br /&gt;
==Purpose==&lt;br /&gt;
Callins have two purposes:&lt;br /&gt;
&lt;br /&gt;
First, they allow a script to be notified when an event happens, such as the unit being created or destroyed.&lt;br /&gt;
&lt;br /&gt;
Second, they allow the engine to get information from the script. Sometimes this is accomplished through a return value, but usually this is done by setting one of the arguments to a function to the requested value.&lt;br /&gt;
&lt;br /&gt;
==Callins==&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
&lt;br /&gt;
*Create(): Called when the unit is created. &amp;quot;Created&amp;quot; means when the unit&#039;s nanoframe is created; if you want to wait until the unit is actually finished, you&#039;ll have to use something like &lt;br /&gt;
&lt;br /&gt;
 while(GET BUILD_PERCENT_LEFT) sleep 250; &lt;br /&gt;
&lt;br /&gt;
*Activate()/Deactivate(): Called when the unit is turned on/off.&lt;br /&gt;
*Killed(severity, corpsetype): Called when the unit is killed. Severity indicates how many percent of the unit&#039;s hit points were dealt by the final blow. Corpsetype basically indicates the number of times the unit and its corpses are destroyed; for example, corpsetype = 3 acts as if the unit is destroyed, the corpse is destroyed, and the corpse&#039;s corpse is destroyed. If it runs out of corpses nothing is left behind. Set corpsetype to the desired value.&lt;br /&gt;
&lt;br /&gt;
===Movement===&lt;br /&gt;
&lt;br /&gt;
*StartMoving()/StopMoving(): Called when the unit starts/stops moving. This includes rotation, so don&#039;t be surprised if StartMoving() sometimes gets called when a unit starts aiming at a target.&lt;br /&gt;
*SetSFXOccupy(terraintype): Supposedly called when the unit changes terrain type, although it didn&#039;t work last time I tried it? Maybe I was using it wrong. terraintype: 0 = transported, 1 = sea, 2 = deep sea (greater than 5 water depth and unit is upright), 4 = land.&lt;br /&gt;
*MoveRate[0...3](): Appears to be the aircraft equivalent of SetSFXOccupy. MoveRate3 doesn&#039;t appear to actually be used. MoveRate1 is called when the aircraft takes off or lands. If the aircraft is not taking off or landing, MoveRate0 is called when the aircraft drops below 1/3 maximum speed, MoveRate2 is called when the aircraft exceeds 2/3 maximum speed, and MoveRate1 is called when the aircraft enters within 1/3-2/3 maximum speed. I don&#039;t know if this actually works.&lt;br /&gt;
*SetDirection(heading): Used only for wind generators. Gives the direction of the wind.&lt;br /&gt;
*SetSpeed(speed): Used for wind generators, tidals, and mexes. Basically more resources = higher speed.&lt;br /&gt;
&lt;br /&gt;
===Weapons===&lt;br /&gt;
&lt;br /&gt;
For weapons, X means either the number of the weapon, or &amp;quot;Primary&amp;quot;, &amp;quot;Secondary&amp;quot;, or &amp;quot;Tertiary&amp;quot; (don&#039;t put &amp;quot;Weapon&amp;quot; for these). I recommend using numbers, since it&#039;s cleaner and you can use more than three weapons that way.&lt;br /&gt;
&lt;br /&gt;
*AimWeaponX(heading, pitch): Called every ~0.5s when the unit is aiming the weapon at a target. This is used to turn a unit&#039;s turrets toward the target. Return 1 when the weapon is ready to fire. Alternately, return 0 if you don&#039;t want the weapon to fire (you can use this to disable weapons).&lt;br /&gt;
*AimFromWeaponX(piecenum): You should set piecenum to a piece of the model; LOS is traced from the here to the target to see if the weapon can fire.&lt;br /&gt;
*FireWeaponX(): Called whenever the trigger is pulled on a weapon. This occurs before the &#039;&#039;first&#039;&#039; shot in a burst/projectile salvo (only).&lt;br /&gt;
*ShotX(): Called before every shot a weapon fires. This includes burst and projectile tags. This happens after FireWeaponX(), even for the first shot.&lt;br /&gt;
*QueryWeaponX(piecenum): You should set piecenum to a piece of the model. The shot starts from this piece of the model; this is called for this purpose after FireWeaponX() and ShotX(). LOS is also traced from here to the target to see if a weapon can fire. Make sure this is a piece on the weapon&#039;s turret. Not doing this right can cause headaches; example: http://trac.caspring.org/wiki/GunsJammingOnShips&lt;br /&gt;
*EndBurstX(): Called after the last shot in a burst.&lt;br /&gt;
*BlockShotX(unitID, block)&lt;br /&gt;
*TargetWeightX(unitID, weightMod)&lt;br /&gt;
*RockUnit(anglex, anglez): Called when the unit fires. Use it to rock the unit on firing, although there are other ways to do this.&lt;br /&gt;
*HitByWeaponID(damage, weaponid?, unitid?): Called when the unit is hit by a weapon.&lt;br /&gt;
*SetMaxReloadTime(time): Called on unit creation. time is the time in ms that it takes the slowest-firing weapon to reload.&lt;br /&gt;
&lt;br /&gt;
===Construction===&lt;br /&gt;
&lt;br /&gt;
*StartBuilding(): Called when the unit starts building.&lt;br /&gt;
*StopBuilding(): Called when the unit stops building.&lt;br /&gt;
*QueryNanoPiece(piecenum): You should set piecenum to the piece you want the nanospray to come from.&lt;br /&gt;
*QueryBuildInfo(piecenum): For factories. You should set piecenum to the piece you want the unit to be built on.&lt;br /&gt;
&lt;br /&gt;
===Transportation===&lt;br /&gt;
*Falling(): Used for airdropping units?&lt;br /&gt;
*Landed(): Used for airdropping units?&lt;br /&gt;
*QueryTransport(piecenum): You should set piecenum to the piece you want the transported unit to be attached to.&lt;br /&gt;
*BeginTransport(): Called when an air transport picks up a unit.&lt;br /&gt;
*EndTransport(): Called when an air transport becomes empty.&lt;br /&gt;
*TransportPickup(): Called when a land transport picks up a unit.&lt;br /&gt;
*TransportDrop(): Called when a land transport becomes empty.&lt;br /&gt;
*StartUnload(): Called when the transport starts the unloading process.&lt;br /&gt;
&lt;br /&gt;
===Landing Pads===&lt;br /&gt;
*QueryLandingPadCount(count): You should set count to the number of landing pads. However, it doesn&#039;t seem to be actually necessary to do this unless you want more than 16 pads.&lt;br /&gt;
*QueryLandingPad(piecenum1, piecenum2, piecenum3...): Set each piecenum to a different landing pad piece.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Animation&amp;diff=3939</id>
		<title>COB Animation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=COB_Animation&amp;diff=3939"/>
		<updated>2009-08-23T20:57:13Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Animation moved to Animation:CobAnimation: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Animation:CobAnimation]]&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobAnimation&amp;diff=1879</id>
		<title>Animation-CobAnimation</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Animation-CobAnimation&amp;diff=1879"/>
		<updated>2009-08-23T20:57:13Z</updated>

		<summary type="html">&lt;p&gt;Seanheron: COB Animation moved to Animation:CobAnimation: convention&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Pieces==&lt;br /&gt;
&lt;br /&gt;
Each unit has a root piece and a tree of other pieces attached to the root piece. At the top of each file you&#039;ll need to put the following line:&lt;br /&gt;
&lt;br /&gt;
 piece [names of pieces of the model separated by commas];&lt;br /&gt;
&lt;br /&gt;
As usual, capitalization does not matter; neither does the order of the pieces. You do not need to name every piece that the model actually has, although you should do so, and you cannot do anything to a piece that you have not named. If you try to do something to a piece that doesn&#039;t exist, Spring will throw an error. Generally it will not crash but you&#039;ll probably get lots of chat spam, so avoid this.&lt;br /&gt;
&lt;br /&gt;
Every piece starts in the position as it appears in any modeling program, such as Upspring. This is defined to be zero position and zero rotation.&lt;br /&gt;
&lt;br /&gt;
Pieces are really numbers, although Scriptor usually throws a fit if you try to use them as numbers (it will not accept a number in places where it expects a piece name, although for functions that involve a piecenum you can use the piece&#039;s number instead of the piece name if you so desire). The first piece you list is 0, and it counts from there.&lt;br /&gt;
&lt;br /&gt;
==Linear Units==&lt;br /&gt;
&lt;br /&gt;
Everything linear &#039;&#039;really&#039;&#039; happens in a unit I&#039;ll call Spring distance (sd). This is a tiny distance--there are 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; = 65536 sd in an elmo, which is the unit that is most commonly used. For example, weapon ranges are specified in elmos. Fortunately, Scriptor can automatically convert elmos to sd: just put the number of elmos you want in brackets ([]). Sometimes you&#039;ll see scripts that use 2.5 * 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; = 163840 instead. I recommend not doing this since it makes conversion more difficult.&lt;br /&gt;
&lt;br /&gt;
==Angular Units==&lt;br /&gt;
&lt;br /&gt;
Likewise, everything angular &#039;&#039;really&#039;&#039; happens in a unit I&#039;ll call Spring angle (sa). There are 2&amp;lt;sup&amp;gt;16&amp;lt;/sup&amp;gt; sa in a full circle. Generally you&#039;ll be working in degrees. There are 182 and 2/45 sa in a degree. Again, Scriptor can automatically convert from degrees to sa; just put the number of degrees you want in angles (&amp;lt;&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==Axes==&lt;br /&gt;
&lt;br /&gt;
All COB animation statements specify an axis. There are three axes, &amp;quot;x-axis&amp;quot;, &amp;quot;y-axis&amp;quot;, and &amp;quot;z-axis&amp;quot;. Positive x is to the unit&#039;s left (the right if you are looking at the unit from the front). Positive y is to the unit&#039;s top. Positive z is to the unit&#039;s front.&lt;br /&gt;
&lt;br /&gt;
The position and rotation of each piece defines the coordinate system for all of its child pieces. So, if you move or rotate a piece, all of its child pieces will move and rotate with it.&lt;br /&gt;
&lt;br /&gt;
A positive angle is counterclockwise looking at the piece from the positive end of the axis toward the negative end of the axis.&lt;br /&gt;
&lt;br /&gt;
==move==&lt;br /&gt;
&lt;br /&gt;
 move [piece] to [axis] [distance] now;&lt;br /&gt;
&lt;br /&gt;
This moves the piece immediately. The piece will be in its new position along the axis before the next statement is executed.&lt;br /&gt;
&lt;br /&gt;
 move [piece] to [axis] [distance] speed [speed];&lt;br /&gt;
&lt;br /&gt;
This moves the piece at some speed until it reaches its destination, or the piece is told to move to a different distance along the same axis, whichever comes first. After this statement, the piece moves independent of the script; indeed, the script proceeds immediately to the next statement after it sets the piece moving.&lt;br /&gt;
&lt;br /&gt;
Speed is always positive, even if you are moving the piece to a negative distance. It is measured in Spring distance/second (sd/s).&lt;br /&gt;
&lt;br /&gt;
 wait-for-move [piece] along [axis];&lt;br /&gt;
&lt;br /&gt;
Makes the thread sleep until the piece stops moving along the axis.&lt;br /&gt;
&lt;br /&gt;
==turn==&lt;br /&gt;
&lt;br /&gt;
These are similar to movement in behavior, except they rotate the piece.&lt;br /&gt;
&lt;br /&gt;
 turn [piece] to [axis] [angle] now;&lt;br /&gt;
&lt;br /&gt;
Turns the piece to the specified angle around the axis immediately. The piece will be in its new rotation around the axis before the next statement is executed. Pieces rotate around their &amp;lt;u&amp;gt;own&amp;lt;/u&amp;gt; center, not their parent&#039;s (although if the parent rotates, they do as well). If the piece moves, the center moves with it, so a piece&#039;s movement occurs &amp;quot;before&amp;quot; its rotation in determining its final position.&lt;br /&gt;
&lt;br /&gt;
 turn [piece] to [axis] [angle] speed [angular speed];&lt;br /&gt;
&lt;br /&gt;
This turns the piece at some angular speed until it reaches its destination, or the piece is told to turn to a different distance around the same axis, whichever comes first. Angular speed is always positive, even if the angle is negative. The speed is in Spring angles/second (sa/s).&lt;br /&gt;
&lt;br /&gt;
 wait-for-turn [piece] around [axis];&lt;br /&gt;
&lt;br /&gt;
Makes the thread sleep until the piece stops turning around the axis.&lt;br /&gt;
&lt;br /&gt;
==spin==&lt;br /&gt;
&lt;br /&gt;
 spin [piece] around [axis] speed [angular speed];&lt;br /&gt;
&lt;br /&gt;
This starts the piece spinning at a constant speed immediately. Again, the speed is in Spring angles/second (sa/s); however, it can be negative if you want it to spin in that direction.&lt;br /&gt;
&lt;br /&gt;
 spin [piece] around [axis] speed [angular speed] accelerate [angular acceleration];&lt;br /&gt;
&lt;br /&gt;
The angular acceleration should always be positive, even if you are spinning the piece at a negative angular speed. It is measured in Spring angles per frame-second (sa/f*s); in other words, the speed of the piece will increase by that amount every &#039;&#039;frame&#039;&#039;, not every second. There are 30 frames per second.&lt;br /&gt;
&lt;br /&gt;
 stop-spin [piece] around [axis];&lt;br /&gt;
&lt;br /&gt;
Stops the piece from spinning immediately, regardless of its orientation.&lt;br /&gt;
&lt;br /&gt;
 stop-spin [piece] around [axis] decelerate [angular deceleration];&lt;br /&gt;
&lt;br /&gt;
Slows the piece&#039;s spinning down until it stops. As with angular acceleration, the angular deceleration should always be positive and is measured in Spring angles per frame-second.&lt;/div&gt;</summary>
		<author><name>Seanheron</name></author>
	</entry>
</feed>