Script.txt: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
97.0 - added GAME/MUTATOR{0..9} so you can load arbitrary mutator archives before the game
8611 (talk | contribs)
added: minimum script, generating scripts
Line 48: Line 48:
   }
   }
}</pre></code>
}</pre></code>
= Examples =
== minimal functional startscript ==
Based on {{forumlink|topic=32893&p=566971#p566953|title=these two posts:}}
<code><pre>
[GAME]
{
MapName=DeltaSiegeDry;
GameType=Balanced Annihilation V8.10;
IsHost=1;
[PLAYER0]
{
Team=0;
}
[TEAM0]
{
TeamLeader=0;
AllyTeam=0;
}
[ALLYTEAM0]
{
}
}
</pre></code>
== 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 ==
{{forumlink|topic=t=32643|title=lua table -> script.txt generator}} - thread with two examples
[[Category:Development]]
[[Category:Development]]

Revision as of 00:48, 27 February 2015

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. Addtionally 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.


[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