<?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=Funkencool</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=Funkencool"/>
	<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/wiki/Special:Contributions/Funkencool"/>
	<updated>2026-11-08T18:40:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Script.txt&amp;diff=16315</id>
		<title>Script.txt</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Script.txt&amp;diff=16315"/>
		<updated>2016-01-19T00:44:01Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: Fix broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Script.txt =&lt;br /&gt;
Start script file for Spring Engine. &lt;br /&gt;
&lt;br /&gt;
Lobbies create it for spring, usually found in &amp;lt;code&amp;gt;~/.spring/script.txt&amp;lt;/code&amp;gt; on Linux/MacOSX.&lt;br /&gt;
&lt;br /&gt;
On Windows it can be found mostly in &amp;lt;code&amp;gt;My Documents\My Games\Spring\script.txt&amp;lt;/code&amp;gt; or next to spring.exe.&lt;br /&gt;
&lt;br /&gt;
== Structure ==&lt;br /&gt;
See {{sourcelink|file=doc/StartScriptFormat.txt}} for a more detailed example.&lt;br /&gt;
&lt;br /&gt;
Spring 97.0 added &amp;lt;code&amp;gt;GAME/MUTATOR{0..9}&amp;lt;/code&amp;gt; so you can load arbitrary mutator archives before the game. Additionally since 97.0 &amp;lt;code&amp;gt;GAME/GameID&amp;lt;/code&amp;gt; is the only seed of the synced random generator, so you can define the &amp;lt;code&amp;gt;GameID&amp;lt;/code&amp;gt; in a luaAI battle startscript and you will always get a syncing match.&lt;br /&gt;
&lt;br /&gt;
Since 99.0 &amp;lt;code&amp;gt;GAME/Gametype&amp;lt;/code&amp;gt; can be a [[rapid]] tag, and demo recording can be disabled by setting &amp;lt;code&amp;gt;GAME/RecordDemo&amp;lt;/code&amp;gt; to 0&lt;br /&gt;
&lt;br /&gt;
Overview of the structure:&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;[GAME]&lt;br /&gt;
{&lt;br /&gt;
  // game attributes&lt;br /&gt;
  [MUTATOR0]&lt;br /&gt;
  {&lt;br /&gt;
    // mutator attributes&lt;br /&gt;
  }&lt;br /&gt;
  [AI0]&lt;br /&gt;
  {&lt;br /&gt;
    // AI attributes&lt;br /&gt;
  }&lt;br /&gt;
  [PLAYER0]&lt;br /&gt;
  {&lt;br /&gt;
    // player attributes&lt;br /&gt;
  }&lt;br /&gt;
  [TEAM0]&lt;br /&gt;
  {&lt;br /&gt;
    // team attributes&lt;br /&gt;
  }&lt;br /&gt;
  [ALLYTEAM0]&lt;br /&gt;
  {&lt;br /&gt;
    // ally team attributes&lt;br /&gt;
  }&lt;br /&gt;
  [RESTRICT]&lt;br /&gt;
  {&lt;br /&gt;
    // restrictions&lt;br /&gt;
  }&lt;br /&gt;
  [MODOPTIONS]&lt;br /&gt;
  {&lt;br /&gt;
    // values for the options defined in Modoptions.lua&lt;br /&gt;
  }&lt;br /&gt;
  [MAPOPTIONS]&lt;br /&gt;
  {&lt;br /&gt;
    // values for the options defined in Mapoptions.lua&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
== minimal functional startscript ==&lt;br /&gt;
Based on {{forumlink|topic=32893&amp;amp;p=566971#p566953|title=these two posts:}} &lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
[GAME]&lt;br /&gt;
{&lt;br /&gt;
	MapName=DeltaSiegeDry;&lt;br /&gt;
	GameType=Balanced Annihilation V8.10;&lt;br /&gt;
	IsHost=1;&lt;br /&gt;
	[PLAYER0]&lt;br /&gt;
	{&lt;br /&gt;
		Team=0;&lt;br /&gt;
	}&lt;br /&gt;
	[TEAM0]&lt;br /&gt;
	{&lt;br /&gt;
		TeamLeader=0;&lt;br /&gt;
		AllyTeam=0;&lt;br /&gt;
	}&lt;br /&gt;
	[ALLYTEAM0]&lt;br /&gt;
	{&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== More examples ==&lt;br /&gt;
startscripts used for pre-defined offline matches vs AI in different team configurations -  &lt;br /&gt;
https://code.google.com/p/springtanks/source/browse/#svn%2Ftrunk%2FMissions&lt;br /&gt;
&lt;br /&gt;
= Generating startscripts =&lt;br /&gt;
It is possible to use for example Springlobby to setup a game via the Singleplayer tab.&lt;br /&gt;
&lt;br /&gt;
The temporary file that gets generated can be copied for further use.&lt;br /&gt;
&lt;br /&gt;
== Converting Lua tables to script.txt format ==&lt;br /&gt;
&lt;br /&gt;
{{forumlink|topic=32643|title=lua table -&amp;gt; script.txt generator}} - thread with two examples&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Mapdev:SMF_format&amp;diff=13615</id>
		<title>Mapdev:SMF format</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Mapdev:SMF_format&amp;diff=13615"/>
		<updated>2014-10-03T06:53:58Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: to match source code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= SMF(Spring Map File) Reference =&lt;br /&gt;
SMF is a binary format&lt;br /&gt;
* [https://github.com/spring/spring/blob/2e5bc43dc464ec27d6b880d105f0c618e07c4ff8/rts/Map/SMF/mapfile.h mapfile.h]&lt;br /&gt;
* [https://github.com/spring/spring/blob/2e5bc43dc464ec27d6b880d105f0c618e07c4ff8/rts/Map/SMF/SmfMapFile.cpp SmfMapFile.cpp]&lt;br /&gt;
&lt;br /&gt;
== File location ==&lt;br /&gt;
maparchive.sd7/maps/mymapname.smf&lt;br /&gt;
&lt;br /&gt;
== Data Map ==&lt;br /&gt;
* smu = spring map unit, the size you see when in the lobby. roughly between 2 and 64.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | Header&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || Magic number; &amp;quot;spring map file\0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Version number; &amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;unsigned int&amp;lt;/code&amp;gt; || ID, should be as unique as possible.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Width; smu * 64&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Length; smu * 64&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Square size; 8&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Texels per square size; 8&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Tile size; 32&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || Depth/min height; 512 = 1*smu&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || Height/max height; 512 = 1*smu&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of height map&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of type map&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of tile index&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of mini map&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of metal map&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to start of features map&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || No of extra headers&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Extra Headers&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Size of the header&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Type of header&lt;br /&gt;
|-&lt;br /&gt;
| * || * || Data of header&lt;br /&gt;
|}&lt;br /&gt;
* &lt;br /&gt;
* &lt;br /&gt;
* &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Height Map&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| (width+1)*(length+1) || &amp;lt;code&amp;gt;unsigned short[]&amp;lt;/code&amp;gt; || Data for height map.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Type Map&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| (width/2)*(length/2) || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || Data for type map.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Mini Map&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 699048 || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || raw DXT1 compressed 1024x1024 image.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Tile Index Header&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Number of tile files&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Total number of tiles in all files.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + SMT File Infos&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Number of tiles in this file&lt;br /&gt;
|-&lt;br /&gt;
| size of filename || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || The filename of the smt.&lt;br /&gt;
|}&lt;br /&gt;
* &lt;br /&gt;
* &lt;br /&gt;
*&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Tile Index&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| (width / 4) * (length / 4) || &amp;lt;code&amp;gt;int[]&amp;lt;/code&amp;gt; || Index numbers of tiles in SMT&#039;s&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Metal Map&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| (width / 2) * (length / 2) || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || Metal Density&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Features Header&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Number of features&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Number of feature types&lt;br /&gt;
|-&lt;br /&gt;
| * || &amp;lt;code&amp;gt;char[]&amp;lt;/code&amp;gt; || List of feature names delimited by null&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Features&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Type of feature, corresponds with feature name list.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || X Position (along the width of the map)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || Y Position (Up into the sky)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || Z Position (along the length of the map)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || rotation, not sure of scale&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; || relative size (not implemented); 1&lt;br /&gt;
|}&lt;br /&gt;
* &lt;br /&gt;
* &lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
== Optional Extra Headers &amp;amp; data ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Grass Extra header&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Bytes&lt;br /&gt;
! style=&amp;quot;width: 20%&amp;quot; | Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Size of the header; 12&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Type of header; 1&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; || Byte offset to beginning of grass map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+ align=&amp;quot;left&amp;quot; | + Grass Data&lt;br /&gt;
| style=&amp;quot;width: 20%&amp;quot; | (width / 4) * (length / 4)&lt;br /&gt;
| style=&amp;quot;width: 20%&amp;quot; | &amp;lt;code&amp;gt;unsigned char&amp;lt;/code&amp;gt;&lt;br /&gt;
| Map defining the grass on the map. not sure what 256 available values mean.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Map Dev]]&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Skins&amp;diff=4221</id>
		<title>Chili:Skins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Skins&amp;diff=4221"/>
		<updated>2014-02-22T05:26:22Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: A basic page to describe altering/creating chili skins. I&amp;#039;m currently working on some code examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;First off this topic will probably benefit from a veterans touch. Still, I&#039;m going to try my best to explain the ease at which chili skins can be created and altered.&lt;br /&gt;
&lt;br /&gt;
Chili has been around since before I even touched lua (or any spring code for that matter) but it seems it&#039;s just finally becoming the standard. Just about every active/upcoming game is using it for their UI purposes now, and I&#039;m kind of surprised there hasn&#039;t been more interest in custom skins from the player base. Maybe it&#039;s because they don&#039;t know how easy it is.&lt;br /&gt;
&lt;br /&gt;
==What is a chili skin?==&lt;br /&gt;
Unlike previous UI frameworks, such as IceUI and RedUI, Chili can (and usually does) use textures for drawing elements.&lt;br /&gt;
&lt;br /&gt;
A skin consists of 1 or more images which are assigned to chili elements through the &#039;&#039;&#039;skin.lua&#039;&#039;&#039; file.&lt;br /&gt;
https://dl.dropboxusercontent.com/u/19847614/Spring/Screens/Chiliskin.PNG&lt;br /&gt;
&lt;br /&gt;
Each skin gets its own folder in &amp;quot;LuaUI/Chili/Skins/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==How to alter a skin?==&lt;br /&gt;
First find and open the skin&#039;s directory. A good starting point is JK&#039;s default skin &#039;Robocracy&#039; which is a very complete and well made skin (he did code chili).&lt;br /&gt;
In that case it would be in &amp;quot;luaui/chili/skins/robocracy&amp;quot;&lt;br /&gt;
&lt;br /&gt;
From there find the texture you&#039;d like to change, open it for editing with your program of choice, and let the creativity flow.&lt;br /&gt;
&lt;br /&gt;
For basic alterations it&#039;s really that easy. &lt;br /&gt;
&lt;br /&gt;
==Why?==&lt;br /&gt;
Because most, if not all of your Spring games will soon come with chili. What&#039;s cooler than seeing your own bad-ass skin while playing those games?&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10735</id>
		<title>Lua:Callins</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Lua:Callins&amp;diff=10735"/>
		<updated>2014-02-15T23:40:31Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: I believe MouseWheel has the same return treatment as MousePress (so widgets can get control of scrolling)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Lua Callins =&lt;br /&gt;
== Common ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Initialize&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the addon is (re)loaded.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Shutdown&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the addon or the game is shutdown.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Unsynced Only ==&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DefaultCommand&lt;br /&gt;
|params = type, id&lt;br /&gt;
|return = number cmdID&lt;br /&gt;
|description = Used to set the default command when a unit is selected.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandNotify&lt;br /&gt;
|params = cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = bool removeCmd&lt;br /&gt;
|description = Called when a command is issued. Returning &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; deletes the command and does not send it through the network.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = WorldTooltip&lt;br /&gt;
|params = ttType, data1, data2, data3&lt;br /&gt;
|return = string newTooltip&lt;br /&gt;
|description = The parameters can be &amp;lt;code&amp;gt;&amp;quot;unit&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;unitID&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;&amp;quot;feature&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;featureID&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;&amp;quot;ground&amp;quot;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;posX&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;posY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;posZ&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;quot;selection&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnsyncedHeightMapUpdate&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the unsynced copy of the height-map is altered.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameProgress&lt;br /&gt;
|params = serverFrameNum&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called every 60 frames, calculating delta between GameFrame and GameProgress. Can give an ETA about catching up with simulation for mid-game join players.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameSetup&lt;br /&gt;
|params =  state, ready, playerStates&lt;br /&gt;
|return = bool newReady, bool renderDefaultGUI&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = SunChanged&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AddConsoleLine&lt;br /&gt;
|params = msg, priority&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when text is entered into the console (e.g. Spring.Echo).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvSkirmishAIMessage&lt;br /&gt;
|params = aiTeam, dataStr&lt;br /&gt;
|return = ???&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvFromSynced&lt;br /&gt;
|params = ...&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Receives data sent via [[Lua_System#Synced|SendToUnsynced]] callout.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Save&lt;br /&gt;
|params = zip&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a chat command &#039;/save&#039; or &#039;/savegame&#039; is received. The single argument is a userdatum representing the savegame zip file. See [[Lua_SaveLoad#Save_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = LoadProgress&lt;br /&gt;
|params = message, replaceLastLine&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Only available to LuaIntro.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GroupChanged&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ConfigureLayout&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = ???&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Input ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = IsAbove&lt;br /&gt;
|params = x, y&lt;br /&gt;
|return = bool isAbove&lt;br /&gt;
|description = Called every Update. Must return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Mouse*&amp;lt;/code&amp;gt; events and &amp;lt;code&amp;gt;GetToolTip&amp;lt;/code&amp;gt; to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GetTooltip&lt;br /&gt;
|params = x, y&lt;br /&gt;
|return = string tooltip&lt;br /&gt;
|description = Called when &amp;lt;code&amp;gt;IsAbove&amp;lt;/code&amp;gt; returns true.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyPress&lt;br /&gt;
|params = key, mods, isRepeat&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called repeatedly when a key is pressed down. If you want an action to occur only once check for &amp;lt;code&amp;gt;isRepeat == false&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;mods&amp;lt;/code&amp;gt; parameter is a table, with keys &amp;lt;code&amp;gt;alt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ctrl&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;meta&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;shift&amp;lt;/code&amp;gt; each having a boolean value. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = KeyRelease&lt;br /&gt;
|params = key&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the key is released.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = JoystickEvent&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MousePress&lt;br /&gt;
|params = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|description = Called when a mouse button is pressed. The &amp;lt;code&amp;gt;button&amp;lt;/code&amp;gt; parameter supports up to 7 buttons. Must return &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;MouseRelease&amp;lt;/code&amp;gt; and other functions to be called.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseRelease&lt;br /&gt;
|params = x, y, button&lt;br /&gt;
|return = bool becomeMouseOwner&lt;br /&gt;
|description = Called when a mouse button is released. Please note that in order to have Spring call &amp;lt;code&amp;gt;MouseRelease&amp;lt;/code&amp;gt;, you need to have a &amp;lt;code&amp;gt;MousePress&amp;lt;/code&amp;gt; call-in in the same addon that returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseWheel&lt;br /&gt;
|params = up, value&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the mouse wheel is moved. The parameters indicate the direction and amount of travel.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MouseMove&lt;br /&gt;
|params = x, y, dx, dy, button&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the mouse is moved. The &amp;lt;code&amp;gt;dx&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;dy&amp;lt;/code&amp;gt; parameters indicate the distance travelled, whereas the first two indicate the final position.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Players ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerChanged&lt;br /&gt;
|params = playerID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called whenever a player&#039;s status changes e.g. becoming a spectator.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerAdded&lt;br /&gt;
|params = playerID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called whenever a new player joins the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = PlayerRemoved&lt;br /&gt;
|params = playerID, reason&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called whenever a player is removed from the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Drawing ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ViewResize&lt;br /&gt;
|params = viewSizeX, viewSizeY&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called whenever the window is resized.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Update&lt;br /&gt;
|params = none&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called for every draw frame. The parameter is the time since the last update. Perform calculations in here and only drawing in Draw* callins.}}&lt;br /&gt;
&lt;br /&gt;
Inside the Draw* functions, you can use the [[Lua_OpenGL_Api | Lua OpenGL Api]] to draw graphics.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawGenesis&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Don&#039;t render here. Spring draws the sky, the map, some water types, and unit selection.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldPreUnit&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = Spring draws units, features, some water types, cloaked units, and the sun.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorld&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Spring draws command queues, &#039;map stuff&#039;, and map marks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldShadow&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldReflection&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawWorldRefraction&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreen&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawScreenEffects&lt;br /&gt;
|params = vsx, vsy&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Where &amp;lt;code&amp;gt;vsx&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;vsy&amp;lt;/code&amp;gt; are screen coords.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawLoadScreen&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = {{new|95.0}} Only available to LuaIntro, draws custom load screens.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawInMinimap&lt;br /&gt;
|params = sx, sy&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Where &amp;lt;code&amp;gt;sx&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sy&amp;lt;/code&amp;gt; are values relative to the minimap&#039;s position and scale.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Custom Object Rendering ===&lt;br /&gt;
For the following calls &amp;lt;code&amp;gt;drawMode&amp;lt;/code&amp;gt; can be one of the following, &amp;lt;code&amp;gt;notDrawing = 0&amp;lt;/code&amp;gt;,	&amp;lt;code&amp;gt;normalDraw = 1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;shadowDraw = 2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;reflectionDraw = 3&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;refractionDraw = 4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawUnit&lt;br /&gt;
|params = unitID, drawMode&lt;br /&gt;
|return = bool suppressEngineDraw&lt;br /&gt;
|description = For custom rendering of units, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawFeature&lt;br /&gt;
|params = unitID, drawMode&lt;br /&gt;
|return = bool suppressEngineDraw&lt;br /&gt;
|description = For custom rendering of features, [[Lua_UnitRendering#Lua.27s_DrawXYZ-Callin|enabled here]].	&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawShield&lt;br /&gt;
|params = unitID, weaponID, drawMode&lt;br /&gt;
|return = bool suppressEngineDraw&lt;br /&gt;
|description = For custom rendering of [[Gamedev:WeaponDefs#Shield_(WeaponType)|shields]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = DrawProjectile&lt;br /&gt;
|params = projectileID, drawMode&lt;br /&gt;
|return = bool suppressEngineDraw&lt;br /&gt;
|description = For custom rendering of weapon (&amp;amp; other) projectiles.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced - Unsynced Shared ==&lt;br /&gt;
&lt;br /&gt;
=== Game ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameID&lt;br /&gt;
|params = gameID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called once to deliver the gameID.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePaused&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the game is paused.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameOver&lt;br /&gt;
|params = winningAllyTeams&lt;br /&gt;
|return = none&lt;br /&gt;
|description = The parameter is a list of winning allyTeams, if empty the game result was undecided (like when dropping from an host).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameFrame&lt;br /&gt;
|params = frame&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called for every game simulation frame (30 per second).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GamePreload&lt;br /&gt;
|params = &lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called before the 0 gameframe.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = GameStart&lt;br /&gt;
|params =&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called upon the start of the game.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Teams ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamChanged&lt;br /&gt;
|params = teamID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TeamDied&lt;br /&gt;
|params = teamID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a team dies (see [[Lua_SyncedCtrl#Game_End|Spring.KillTeam]]).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Units ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCreated&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, builderID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called at the moment the unit is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFinished&lt;br /&gt;
|params = unitID, unitDefID, unitTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called at the moment the unit is completed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFromFactory&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, factID, factDefID, userOrders&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a factory finishes construction of a unit.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitGiven&lt;br /&gt;
|params = unitID, unitDefID, newTeam, oldTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is transferred between teams.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitTaken&lt;br /&gt;
|params = unitID, unitDefID, oldTeam, newTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is transferred between teams.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDamaged&lt;br /&gt;
|params =  unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is damaged (after &amp;lt;code&amp;gt;UnitPreDamaged&amp;lt;/code&amp;gt;).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDestroyed&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnitCollision&lt;br /&gt;
|params = colliderID, collideeID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when two units collide. Both units must be registered with [[Lua_System#Synced|Script.SetWatchUnit]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitFeatureCollision&lt;br /&gt;
|params = colliderID, collideeID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit collides with a feature. The unit must be registered with [[Lua_System#Synced|Script.SetWatchUnit]] and the feature registered with [[Lua_System#Synced|Script.SetWatchFeature]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCommand&lt;br /&gt;
|params = unitID, unitDefID, teamID, cmdID, cmdParams, cmdOptions&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called after when a unit accepts a command, after &amp;lt;code&amp;gt;AllowCommand&amp;lt;/code&amp;gt; returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCmdDone&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, cmdID, cmdTag, cmdParams, cmdOpts&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit completes a command.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLoaded&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is loaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitUnloaded&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, transportID, transportTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is unloaded by a transport.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitExperience&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, experience, oldExperience&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit gains experience greater or equal to the minimum limit set by calling [[Lua_SyncedCtrl#Other|Spring.SetExperienceGrade]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitIdle&lt;br /&gt;
|params = unitID, unitDefID, unitTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit is idle (empty command queue).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitCloaked&lt;br /&gt;
|params = unitID, unitDefID, unitTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit cloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitDecloaked&lt;br /&gt;
|params = unitID, unitDefID, unitTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit decloaks.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoved&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitMoveFailed&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented in base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = StockpileChanged&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, weaponNum, oldCount, newCount&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a units stockpile of weapons increases or decreases. See {{xtaglink|Gamedev:WeaponDefs|stockpile}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredLos&lt;br /&gt;
|params = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit enters LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftLos&lt;br /&gt;
|params = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit leaves LOS of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredRadar&lt;br /&gt;
|params = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit enters radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftRadar&lt;br /&gt;
|params = unitID, unitTeam, allyTeam, unitDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit leaves radar of an allyteam.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredAir&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftAir&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitEnteredWater&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitLeftWater&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ??? Not implemented by base handler&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitSeismicPing&lt;br /&gt;
|params = x, y, z, strength, allyTeam, unitID, unitDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a unit emits a seismic ping. See {{xtaglink|Gamedev:UnitDefs|seismicSignature}}.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureCreated&lt;br /&gt;
|params = featureID, allyTeamID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a feature is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDamaged&lt;br /&gt;
|params =  featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a feature is damaged.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureDestroyed&lt;br /&gt;
|params = featureID, allyTeamID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when a feature is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeatureMoved&lt;br /&gt;
|params = ???&lt;br /&gt;
|return = none&lt;br /&gt;
|description = ???&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
The following Callins are only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileCreated&lt;br /&gt;
|params = proID, proOwnerID, weaponDefID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the projectile is created.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ProjectileDestroyed&lt;br /&gt;
|params = proID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called when the projectile is destroyed.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Explosion&lt;br /&gt;
|params = weaponDefID, px, py, pz, ownerTeamID&lt;br /&gt;
|return = bool noGfx&lt;br /&gt;
|description = Called when an explosion occurs. If it returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; then no graphical effects are drawn by the engine for this explosion.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Synced Only ==&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = CommandFallback&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag&lt;br /&gt;
|return = bool used, bool finished&lt;br /&gt;
|description = Called when the unit reaches an unknown command in its queue (i.e. one not handled by the engine). If no addon returns &amp;lt;code&amp;gt;used&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the command is dropped, if an addon returns &amp;lt;code&amp;gt;true, true&amp;lt;/code&amp;gt; the command is removed because it&#039;s done, with &amp;lt;code&amp;gt;true, false&amp;lt;/code&amp;gt; it&#039;s kept in the queue and &amp;lt;code&amp;gt;CommandFallback&amp;lt;/code&amp;gt; gets called again on the next slowupdate.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowCommand&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, cmdID, cmdParams, cmdOptions, cmdTag, synced&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called when the command is given, before the unit&#039;s queue is altered. The return&lt;br /&gt;
value is whether it should be let into the queue. The queue remains untouched when a command is blocked, whether it would be queued or replace the queue.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitCreation&lt;br /&gt;
|params = unitDefID, builderID, builderTeam, x, y, z, facing&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before unit is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitTransfer&lt;br /&gt;
|params = unitID, unitDefID, oldTeam, newTeam, capture&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before a unit is transferred to a different team, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowUnitBuildStep&lt;br /&gt;
|params = builderID, builderTeam, unitID, unitDefID, part&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before a unit progresses its build percentage, the boolean return value determines whether or not the build makes progress.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureCreation&lt;br /&gt;
|params = featureDefID, teamID, x, y, z&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before feature is created, the boolean return value determines whether or not the creation is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowFeatureBuildStep&lt;br /&gt;
|params = builderID, builderTeam, featureID, featureDefID, part&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before a feature progresses its build percentage, the boolean return value determines whether or not the progress change is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceLevel&lt;br /&gt;
|params = teamID, res, level&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called when a team sets the sharing level of a resource, the boolean return value determines whether or not the sharing level is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowResourceTransfer&lt;br /&gt;
|params = oldTeamID, newTeamID, res, amount&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Called just before resources are transferred between players, the boolean return value determines whether or not the transfer is permitted.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowStartPosition&lt;br /&gt;
|params =  clampedX, clampedY, clampedZ, playerID, readyState, rawX, rawY, rawZ&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = &amp;lt;code&amp;gt;clamped&amp;lt;/code&amp;gt; are the coordinates clamped into start-boxes, &amp;lt;code&amp;gt;raw&amp;lt;/code&amp;gt; is where player tried to place their marker. The &amp;lt;code&amp;gt;readyState&amp;lt;/code&amp;gt; can be any one of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - player picked a position, &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; - player clicked ready, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; - game was force-started (player did not click ready) or &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; the player failed to load. {{new|95.0}} the default &#039;failed to choose&#039; start-position is now just &amp;lt;code&amp;gt;(0,0,0)&amp;lt;/code&amp;gt;, not &amp;lt;code&amp;gt;(0,-500,0)&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowDirectUnitControl&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, playerID&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Determines if this unit can be controlled directly in FPS view.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTargetCheck&lt;br /&gt;
|params = attackerID, attackerWeaponNum, attackerWeaponDefID&lt;br /&gt;
|return = bool allow&lt;br /&gt;
|description = Determines if this weapon can automatically generate targets itself. See also {{xtaglink|Gamedev:WeaponDefs|commandFire}} weaponDef tag.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponTarget&lt;br /&gt;
|params = attackerID, targetID, attackerWeaponNum, attackerWeaponDefID, defPriority&lt;br /&gt;
|return = bool allowed, number priority&lt;br /&gt;
|description = Controls blocking of a specific target from being considered during a weapon&#039;s periodic auto-targeting sweep. The second return value controls the priority of the target (maximum of &amp;lt;code&amp;gt;1.0&amp;lt;/code&amp;gt;).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = AllowWeaponInterceptTarget&lt;br /&gt;
|params = interceptorUnitID, interceptorWeaponID, targetProjectileID&lt;br /&gt;
|return = bool allowed&lt;br /&gt;
|description = Controls blocking of a specific intercept target from being considered during an {{xtaglink|Gamedev:WeaponDefs|interceptor}} weapon&#039;s periodic auto-targeting sweep. Only called for weaponDefIDs registered via [[Lua_System#Synced|Script.SetWatchWeapon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = TerraformComplete&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, buildUnitID, buildUnitDefID, buildUnitTeam&lt;br /&gt;
|return = bool stop&lt;br /&gt;
|description = Called when pre-building terrain levelling terraforms are completed (c.f. {{xtaglink|Gamedev:UnitDefs|levelGround}}). If the return value is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the current build order is terminated.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = MoveCtrlNotify&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, data&lt;br /&gt;
|return = bool moveCtrlComplete&lt;br /&gt;
|description = Enable both [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetCollideStop]] and [[Lua_MoveCtrl#Options|Spring.MoveCtrl.SetTrackGround]] to enable this call-in, data was supposed to indicate the type of notification but currently never has a value other than &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; (&amp;quot;unit hit the ground&amp;quot;). The return value determines whether or not the unit should remain script-controlled (&amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;) or return to engine controlled movement (&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = RecvLuaMsg&lt;br /&gt;
|params = msg, playerID&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Receives messages from unsynced sent via [[Lua_UnsyncedCtrl#SendLuaMessage|Spring.SendLuaRulesMsg]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = Load&lt;br /&gt;
|params = zip&lt;br /&gt;
|return = none&lt;br /&gt;
|description = Called after &amp;lt;code&amp;gt;GamePreload&amp;lt;/code&amp;gt; and before &amp;lt;code&amp;gt;GameStart&amp;lt;/code&amp;gt;. See [[Lua_SaveLoad#Load_.28_zip_.29_-.3E_nil|Lua_SaveLoad]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Damage Controllers ===&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = UnitPreDamaged&lt;br /&gt;
|params = unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = number newDamage, number impulseMult&lt;br /&gt;
|description = Called before damage is applied to the unit, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = ShieldPreDamaged&lt;br /&gt;
|params = proID, proOwnerID, shieldEmitterWeaponNum, shieldCarrierUnitID, bounceProjectile&lt;br /&gt;
|return = bool handleCollision&lt;br /&gt;
|description = Called before any engine shield-vs-projectile logic executes. If the return value is &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; the gadget handles the collision event and the engine does not remove the projectile.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{LuaCallin&lt;br /&gt;
|name = FeaturePreDamaged&lt;br /&gt;
|params = featureID, featureDefID, featureTeam, damage, weaponDefID, projectileID, attackerID, attackerDefID, attackerTeam&lt;br /&gt;
|return = number newDamage, number impulseMult&lt;br /&gt;
|description = Called before damage is applied to the feature, allows fine control over how much damage and [http://en.wikipedia.org/wiki/Impulse_(physics) impulse] is applied.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category: Lua]]&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LUPS&amp;diff=10327</id>
		<title>LUPS</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=LUPS&amp;diff=10327"/>
		<updated>2013-06-11T20:55:14Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: Should look a little nicer now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Lua Particle System (LUPS)&lt;br /&gt;
&lt;br /&gt;
Licensed under the terms of the GNU GPL, v2 or later.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
First, you need to differ between synced and unsynced FX,&lt;br /&gt;
so there are 2 LUPS instances running:&lt;br /&gt;
one in LuaUI (widget) and&lt;br /&gt;
one in LuaRules (gadget).&lt;br /&gt;
(To start a new instance simply include lups/lups.lua)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Why differ between synced and unsynced FX? ==&lt;br /&gt;
LuaUI has only a limited access to engine values, so it&lt;br /&gt;
could never determine the unittype of enemy units in airlos,&lt;br /&gt;
nor is it able to catch weapon explosion or to interact with&lt;br /&gt;
cob.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Which files are used by LUPS? ==&lt;br /&gt;
the core uses the following:&lt;br /&gt;
lups/*&lt;br /&gt;
bitmaps/GPL/lups/*&lt;br /&gt;
LuaUI/Widgets/lups_wrapper.lua&lt;br /&gt;
LuaRules/Gadgets/lups_wrapper.lua (only if you want synced&lt;br /&gt;
FX like shockwaves/nanolasers)&lt;br /&gt;
and there are the managers:&lt;br /&gt;
LuaUI/Widgets/gfx_lups_manager.lua&lt;br /&gt;
LuaRules/Gadgets/gfx_lups_manager.lua&lt;br /&gt;
the shockwaves gadget:&lt;br /&gt;
LuaRules/Gadgets/lups_shockwaves.lua&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What are those managers? ==&lt;br /&gt;
LUPS itself doesn&#039;t start any FX. It needs other lua files&lt;br /&gt;
to tell LUPS when it should start a new FX.&lt;br /&gt;
There are many widgets and gadgets, which start LUPS FXs,&lt;br /&gt;
but the most interesting ones are the managers (and perhaps&lt;br /&gt;
the shockwaves gadget).&lt;br /&gt;
Also the manager in LuaRules differ from that one in LuaUI.&lt;br /&gt;
The manager in LuaUI starts FXs everytime an new unit gets&lt;br /&gt;
finished or an enemy unit enters the LOS, so those FX only&lt;br /&gt;
vanish if the unit dies or leaves the LOS again.&lt;br /&gt;
The LuaRules manager is much less customizable, it creates&lt;br /&gt;
very special FXs like cloaking and it also manage parts of&lt;br /&gt;
the LUPS nano particle handling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I implement my own FX? ==&lt;br /&gt;
Okay, in the case you use the LuaUI manager and you want to&lt;br /&gt;
create a per-unit FX (like a fusion FX, airjets, ...):&lt;br /&gt;
&lt;br /&gt;
1. open LuaUI/Widgets/gfx_lups_manager.lua&lt;br /&gt;
(don&#039;t shock the file seems huge, but most is only config,&lt;br /&gt;
and yeah it needs a cleanup ... someday :x)&lt;br /&gt;
2. scroll down (~50% scrollbar)&lt;br /&gt;
you will find the following table/array:&lt;br /&gt;
&amp;quot;local UnitEffects = {...}&amp;quot;&lt;br /&gt;
It holds the FX per-unitdef.&lt;br /&gt;
3. create a new sub-table like the following:&lt;br /&gt;
[UnitDefNames[&amp;quot;%UNITDEF_NAME%&amp;quot;].id] = {&lt;br /&gt;
{class=&#039;%FXCLASS%&#039;,options=%MY_FXOPTIONS_TABLE%}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What FXClasses exist and how do I know their options? ==&lt;br /&gt;
All FXClasses are located here:&lt;br /&gt;
/lups/ParticleClasses/*&lt;br /&gt;
If you open on of those files, you will see a function like this:&lt;br /&gt;
&lt;br /&gt;
function ShieldSphereParticle.GetInfo()&lt;br /&gt;
return {&lt;br /&gt;
name      = &amp;quot;ShieldSphere&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
That returned name is what you fill in %FXCLASS% (uppercase&lt;br /&gt;
doesn&#039;t matter), also it is in most cases same as the filename.&lt;br /&gt;
To see possible options of the FXClass scroll a bit down, you&lt;br /&gt;
will find a table like this:&lt;br /&gt;
&lt;br /&gt;
ShieldSphereParticle.Default = {&lt;br /&gt;
pos        = {0,0,0}, -- start pos&lt;br /&gt;
layer      = -23,&lt;br /&gt;
life       = 0, --in frames&lt;br /&gt;
size       = 0,&lt;br /&gt;
sizeGrowth = 0,&lt;br /&gt;
margin     = 1,&lt;br /&gt;
colormap1  = { {0, 0, 0, 0} },&lt;br /&gt;
colormap2  = { {0, 0, 0, 0} },&lt;br /&gt;
repeatEffect = false,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
The table contains all options and their default values.&lt;br /&gt;
So an example fx placed in LuaUI/Widgets/gfx_lups_manager.lua&lt;br /&gt;
could look like this:&lt;br /&gt;
[UnitDefNames[&amp;quot;armcom&amp;quot;].id] = {&lt;br /&gt;
{class=&#039;ShieldSphere&#039;,options={ life=3000, repeatEffect=true, size=300, colormap1={1,0,0,0.5}, colormap2={0,1,0,0.5} } }&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I start my own FX from my widget/gadget? ==&lt;br /&gt;
First, you need a link to the interface, to do so you need&lt;br /&gt;
to access the global shared table of the widget-/gadgetHandler.&lt;br /&gt;
for LuaUI:&lt;br /&gt;
local LupsApi = WG.Lups&lt;br /&gt;
for LuaRules:&lt;br /&gt;
local LupsApi = GG.Lups&lt;br /&gt;
(nil check those, it is possible that Lups hasn&#039;t started yet!)&lt;br /&gt;
&lt;br /&gt;
That Api contains the following functions:&lt;br /&gt;
LupsApi.GetStats()&lt;br /&gt;
LupsApi.GetErrorLog(minPriority)&lt;br /&gt;
-&amp;gt;  LupsApi.AddParticles(class,options)   //returns a fxID&lt;br /&gt;
-&amp;gt;  LupsApi.RemoveParticles(fxID)&lt;br /&gt;
LupsApi.AddParticlesArray({ {class=className, ..FX options..},{class=className, ..FX options..},.. } )&lt;br /&gt;
LupsApi.HasParticleClass(className)&lt;br /&gt;
and&lt;br /&gt;
LupsApi.Config = {...}  //contains the options of lups.cfg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example usage of AddParticles() ==&lt;br /&gt;
LupsApi.AddParticles(&#039;ShieldSphere&#039;, {&lt;br /&gt;
unit=unitID,&lt;br /&gt;
piece=&amp;quot;head&amp;quot;,&lt;br /&gt;
pos={0,100,0},&lt;br /&gt;
life=3000,&lt;br /&gt;
repeatEffect=true,&lt;br /&gt;
size=300,&lt;br /&gt;
colormap1={1,0,0,0.5},&lt;br /&gt;
colormap2={0,1,0,0.5}&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I bind a FX to an unit/unitpiece? ==&lt;br /&gt;
There are some special options tags, those are:&lt;br /&gt;
unit := binds fx to unitID&lt;br /&gt;
piece:= binds fx to pieceNAME&lt;br /&gt;
pos  := worldspace coord or offset coord from the unit/unitpiece center&lt;br /&gt;
onActive := only show FX if the unit is active (e.g. used for airjets - a plane is active, if it flies)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Can I modify FX on runtime? ==&lt;br /&gt;
Sure you can. There is only one issue in 76b1 (it will&lt;br /&gt;
be fixed in the next spring release):&lt;br /&gt;
you can&#039;t modify widgets if they are in a .sdd, so you&lt;br /&gt;
have to copy it to your local widgets folder,&lt;br /&gt;
then you can run:&lt;br /&gt;
/luaui reload&lt;br /&gt;
each time you modified the file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== I heard some options can contain Lua code? ==&lt;br /&gt;
Yeah, but only the SimpleParticles class support them and&lt;br /&gt;
_only_ in the &amp;quot;partpos&amp;quot; param:&lt;br /&gt;
&lt;br /&gt;
LupsApi.AddParticles(&#039;SimpleParticles&#039;, {&lt;br /&gt;
...&lt;br /&gt;
partpos = &amp;quot;r*cos(beta)*sin(alpha),r*cos(alpha),r*sin(beta)*sin(alpha) | r=random()*20, alpha=2*math.pi*random(), beta=2*math.pi*random()&amp;quot;&lt;br /&gt;
...&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
The syntax is a bit extended so it looks similar to the&lt;br /&gt;
definitions of a mathical sets, but it can still contain&lt;br /&gt;
any lua code.&lt;br /&gt;
&lt;br /&gt;
Valid examples are:&lt;br /&gt;
&amp;quot;x,y,z | x=10,y=30,z=0&amp;quot;&lt;br /&gt;
&amp;quot;10,30,0&amp;quot;&lt;br /&gt;
&amp;quot;random(),random(),random()&amp;quot;&lt;br /&gt;
&amp;quot;x,y,z | r=random(), if (r&amp;gt;10) then x=10; y=30; z=0; else x=-10; y=-30; z=-0; end&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[Category:Libraries]]&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Controls&amp;diff=4160</id>
		<title>Chili:Controls</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Chili:Controls&amp;diff=4160"/>
		<updated>2013-05-20T21:56:13Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: Created page with &amp;quot;== Checking The Source == As I fill this in or it becomes outdated, I suggest looking through the source code. The most up to date list of controls can be found at https://git...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Checking The Source ==&lt;br /&gt;
As I fill this in or it becomes outdated, I suggest looking through the source code.&lt;br /&gt;
The most up to date list of controls can be found at&lt;br /&gt;
https://github.com/jk3064/chiliui/tree/master/chili/controls&lt;br /&gt;
&lt;br /&gt;
A widget containing an example of all the controls will most likely be found here https://github.com/jk3064/chiliui/blob/master/gui_chiliguidemo.lua&lt;br /&gt;
&lt;br /&gt;
= Controls =&lt;br /&gt;
== control ==&lt;br /&gt;
== button ==&lt;br /&gt;
=== image ===&lt;br /&gt;
== checkbox ==&lt;br /&gt;
== colorbars ==&lt;br /&gt;
== label ==&lt;br /&gt;
== layoutpanel ==&lt;br /&gt;
=== imagelistview ===&lt;br /&gt;
=== grid ===&lt;br /&gt;
=== stackpanel ===&lt;br /&gt;
=== treeview ===&lt;br /&gt;
== progressbar ==&lt;br /&gt;
== scrollpanel ==&lt;br /&gt;
== textbox ==&lt;br /&gt;
== trackbar ==&lt;br /&gt;
== Window ==&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
	<entry>
		<id>https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Suggested_maps_for_3ffa&amp;diff=18064</id>
		<title>Suggested maps for 3ffa</title>
		<link rel="alternate" type="text/html" href="https://springrts-wiki.p2004a.com/mediawiki/index.php?title=Suggested_maps_for_3ffa&amp;diff=18064"/>
		<updated>2012-06-17T13:36:42Z</updated>

		<summary type="html">&lt;p&gt;Funkencool: /* Maps for 3 free for all games (xta) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Maps for 3 free for all games (xta) =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good maps&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=569 SaltRockColony]&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=878 Ternion]&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=579 Sherwood]&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/search_result.php?search=Red%2520Triangle&amp;amp;select=select_all Red Triangle] (v2 or remake).&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=2291 Sparewood Remake]&lt;br /&gt;
&lt;br /&gt;
*[http://mapinfo.adune.nl/?map=Chernobyl Chernobyl] is sort of lol map, but has interesting gameplay.&lt;br /&gt;
&lt;br /&gt;
*[http://mapinfo.adune.nl/?map=Curved_Focus Curved Focus] is an interesting alternative, it looks like chernobyl&#039;s less lol version.&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=304 Gods of war 2 remake] it has 6 islands, so it can be setup for 3ffa, and let an island in between each player. A sea 3ffa map!.&lt;br /&gt;
&lt;br /&gt;
*[http://springfiles.com/spring/spring-maps/trefoilv1 Trefoil v1] I may be biased as its my map, but I have a lot of fun with it!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Overplayed ones&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=189 Desert triad] (this map is also thought to be unbalanced, as right side hill has terrain disponibility advantage.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;unbalanced&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*[http://www.springfiles.com/show_file.php?id=699 The Cold Place] (remake is not suggested, as its too big, and has too much metal for a 3ffa, otoh it *may be well balanced for 3ffa unlike the original, reviewing upon testing)&lt;br /&gt;
&lt;br /&gt;
[[Category:Maps]]&lt;/div&gt;</summary>
		<author><name>Funkencool</name></author>
	</entry>
</feed>