Sidedata.lua - beyond-all-reason/springrts_engine_wiki_mirror GitHub Wiki
sidedata.lua
is a file in the Gamedata/
directory of a Spring Game.
This file defines the playable factions/races/sides in a game. (ie ARM & CORE, Terran, Protoss, USA, Bananas,...)
The engine source code which parses the data from this file is viewable here:
Each faction can have two properties:
* name
(displayed in lobby)
*startUnit
(must be read by a gadget to actually spawn the start
unit)
These values are available to lua via Spring.GetSideData
(See
Lua_SyncedRead):
local sideName, startUnit = Spring.GetSideData(sideID)
local sideData = {
{
name = 'AwesomeDudes',
startunit = 'awesomedudebase',
},
}
return sideData
local sideData = {
{
name = 'NKG',
startunit = 'bflagship2',
},
{
name = 'Drone',
startunit = 'kdroneengineer',
},
...
}
return sideData
Faction icons are not defined in this file but just read from the
Sidepics/
directory.
(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
Category:gamedata