Script.txt - beyond-all-reason/springrts_engine_wiki_mirror GitHub Wiki
Script.txt
Start script file for Spring Engine.
Lobbies create it for spring, usually found in ~/.spring/script.txt
on
Linux/MacOSX.
On Windows it can be found mostly in My Documents\My Games\Spring\script.txt
or next to spring.exe.
Structure
See for a more detailed example.
Spring 97.0 added GAME/MUTATOR{0..9}
so you can load arbitrary mutator
archives before the game. Additionally since 97.0 GAME/GameID
is the
only seed of the synced random generator, so you can define the GameID
in a luaAI battle startscript and you will always get a syncing match.
Since 99.0 GAME/Gametype
can be a rapid tag, and
demo recording can be disabled by setting GAME/RecordDemo
to 0
Since 102.0 GAME/SaveFile
can be specified in start script in order to
start from a (lua) save (.slsf).
Overview of the structure:
[GAME]
{
// game attributes
[MUTATOR0]
{
// mutator attributes
}
[AI0]
{
// AI attributes
}
[PLAYER0]
{
// player attributes
}
[TEAM0]
{
// team attributes
}
[ALLYTEAM0]
{
// ally team attributes
}
[RESTRICT]
{
// restrictions
}
[MODOPTIONS]
{
// values for the options defined in Modoptions.lua
}
[MAPOPTIONS]
{
// values for the options defined in Mapoptions.lua
}
}
Examples
minimal functional startscript
Based on
[GAME]
{
MapName=DeltaSiegeDry;
GameType=Balanced Annihilation V8.10;
IsHost=1;
[PLAYER0]
{
Team=0;
}
[TEAM0]
{
TeamLeader=0;
AllyTeam=0;
}
[ALLYTEAM0]
{
}
}
More examples
startscripts used for pre-defined offline matches vs AI in different team configurations - https://code.google.com/p/springtanks/source/browse/#svn%2Ftrunk%2FMissions
Generating startscripts
It is possible to use for example Springlobby to setup a game via the Singleplayer tab.
The temporary file that gets generated can be copied for further use.
Converting Lua tables to script.txt format
- thread with two examples