Sidedata.lua: Difference between revisions

From Spring
Jump to navigationJump to search
Knorke (talk | contribs)
page created
 
Flozi (talk | contribs)
Line 10: Line 10:


==Example==
==Example==
Shortest working:
Single faction:
(some widgets such as advanced playerlist complain about missing faction icon but otherwise works)
 
<pre>
<span class="note">(NB: Some widgets, such as advanced playerlist, may complain about missing faction icon with such a minimal entry)</span>
<code><pre>
local sideData = {
local sideData = {
[1] = {
{
name     = 'AwesomeDudes',
name = 'AwesomeDudes',
startunit = 'awesomedudebase',
startunit = 'awesomedudebase',
  },
},
}
}
return sideData
return sideData
</pre>
</pre></code>


multiple factions:
Multiple factions:
<pre>
<code><pre>
local sideData = {
local sideData = {
[1] = {
{
  name     = 'NKG',
name = 'NKG',
  startunit = 'bflagship2',
startunit = 'bflagship2',
},
},
[2] = {
{
  name     = 'Drone',
name = 'Drone',
  startunit = 'kdroneengineer',
startunit = 'kdroneengineer',
},
},
}
}
return sideData
return sideData
</pre>
</pre></code>
 
yea indenting sucks, deal with it.


==Faction Icons==
==Faction Icons==

Revision as of 12:45, 2 April 2011

What and & Where is it?

sitedata.lua is a file in the gamedata\ folder of a Spring Game. It defines the playable factions/races/sides in a game. (ie ARM & CORE, Terran, Protoss, USA, Bananas,...)

Details

A faction can have several properties, commonly used are:
-a name (displayed in lobby)
-a startunit (must be read by a gadget to actually spawn the start unit)
-an icon (displayed in lobby)

Example

Single faction:

(NB: Some widgets, such as advanced playerlist, may complain about missing faction icon with such a minimal entry)

local sideData = {
	{
	name		= 'AwesomeDudes',
	startunit	= 'awesomedudebase',
	},
}
return sideData

Multiple factions:

local sideData = {
	{
	name		= 'NKG',
	startunit	= 'bflagship2',
	},
	{
	name		= 'Drone',
	startunit	= 'kdroneengineer',
	},
}
return sideData

Faction Icons

It seems they are not defined in this file but just read from a folder sidepics\

Can be .bmp and maybe other formats. Filename is same as Faction name ie for above examples: AwesomeDudes.bmp NKG.bmp Drone.bmp