Sidedata.lua: Difference between revisions
From Spring
Jump to navigationJump to search
| Line 39: | Line 39: | ||
==Faction Icons== | ==Faction Icons== | ||
It seems they are not defined in this file but just read from a folder '''sidepics\''' | It seems they are not defined in this file but just read from a folder '''sidepics\''' | ||
<span class="note">(NB: Some widgets, such as advanced playerlist, may complain about missing faction icon if they are not present)</span> | |||
Can be .bmp and maybe other formats. | Can be .bmp and maybe other formats. | ||
Revision as of 12:48, 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:
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\
(NB: Some widgets, such as advanced playerlist, may complain about missing faction icon if they are not present)
Can be .bmp and maybe other formats. Filename is same as Faction name ie for above examples: AwesomeDudes.bmp NKG.bmp Drone.bmp