Script.txt: Difference between revisions
Funkencool (talk | contribs) m Fix broken link |
No edit summary |
||
| (One intermediate revision by one other user not shown) | |||
| Line 12: | Line 12: | ||
Since 99.0 <code>GAME/Gametype</code> can be a [[rapid]] tag, and demo recording can be disabled by setting <code>GAME/RecordDemo</code> to 0 | Since 99.0 <code>GAME/Gametype</code> can be a [[rapid]] tag, and demo recording can be disabled by setting <code>GAME/RecordDemo</code> to 0 | ||
Since 102.0 <code>GAME/SaveFile</code> can be specified in start script in order to start from a (lua) save (.slsf). | |||
Overview of the structure: | Overview of the structure: | ||
<pre>[GAME] | |||
{ | { | ||
// game attributes | // game attributes | ||
| Line 49: | Line 51: | ||
// values for the options defined in Mapoptions.lua | // values for the options defined in Mapoptions.lua | ||
} | } | ||
}</pre | }</pre> | ||
= Examples = | = Examples = | ||
== minimal functional startscript == | == minimal functional startscript == | ||
Based on {{forumlink|topic=32893&p=566971#p566953|title=these two posts:}} | Based on {{forumlink|topic=32893&p=566971#p566953|title=these two posts:}} | ||
<pre> | |||
[GAME] | [GAME] | ||
{ | { | ||
| Line 73: | Line 75: | ||
} | } | ||
} | } | ||
</pre | </pre> | ||
Latest revision as of 16:49, 15 January 2019
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 doc/StartScriptFormat.txt 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 these two posts:
[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
lua table -> script.txt generator - thread with two examples