Syntax of Spring client startscript?

Syntax of Spring client startscript?

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

Post Reply
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Syntax of Spring client startscript?

Post by CarRepairer »

bibim wrote:Starting with version 0.11.7, SPADS prints the players skills values (used for balancing) in the startscript, and sends them in the battle lobby using SETSCRIPTTAGS commands:

In the lobby
Lobby clients will receive the following new script tag for each player in the battle lobby, containing the corresponding skill value:

Code: Select all

game/players/<lowerCasePlayerName>/skill=<skillValue>
This script is not valid because there's [] inside []. What is the correct syntax?

Code: Select all

                [[dor]betterthanbob]
                {
                        skill=~35;
                }
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

CarRepairer wrote:This script is not valid because there's [] inside []. What is the correct syntax?

Code: Select all

                [[dor]betterthanbob]
                {
                        skill=~35;
                }
If you are speaking of the host startscript, written by SPADS (and sent by spring-dedicated to all Spring clients upon connection), the syntax is detailed in the "In the startscript" section of my post. Basically the "Skill" tag is exactly in the same place as the existing "Rank" tag for example, in the "PLAYER<N>" sections.

If you are speaking of the client startscript, written by lobby clients and only used to store information about how to connect to host, the syntax doesn't change at all and is still the one defined here. (you don't need to write these new tags, as well as you don't need to write modoptions, mapoptions etc.).
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: SPADS AutoHost beta release

Post by CarRepairer »

Spads now sends the name as part of the script but the name itself contains multiple properties, so it is surrounded by []. This causes breakage if the name itself has [] in it and I don't know how to fix my lobby client:

Code: Select all

Spring: Incorrect/Missing content:Parse error 'brace or further name value pairs expected' in buffer at line 27 column 5 near [[dor]betterthanbob]
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

Does your lobby client respect the startscript format for non-host clients as specified here?

Code: Select all

// If spring is started as client, it needs the following information to work properly
[GAME]
{
	HostIP=xxx.xxx.xxx.xxx; // which IP the server is hosting on. see "IP Support" at the start of this document.
	HostPort=xxx;       // (optional) default is 8452
	SourcePort=0;       // (optional) default is 0. set this if you want a different source port (as client), 0 means OS-select and should be preferred.

	MyPlayerName=somename;
	MyPasswd=secretpassword;
	IsHost=0;           // tell the engine this is a client
}
As I said, non-hosts shouldn't write the SCRIPTTAGS (mapoptions, modoptions etc) in the startscript, because this startscript is actually automatically sent by the host when the player connects to the game.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: SPADS AutoHost beta release

Post by CarRepairer »

Yes. The host sends the script tags, then the tags are put into the script file, then spring launches and crashes.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

Re: SPADS AutoHost beta release

Post by bibim »

CarRepairer wrote:Yes. The host sends the script tags, then the tags are put into the script file, then spring launches and crashes.
No, as I said 2 times already and as specified in Spring startscript doc, you shouldn't write these tags in the startscript.

Maybe it's not clear, but the Spring startscript doc contains 2 sections, one for clients (these startscripts only contain required information to connect to the host), and the other for hosts (these startscripts contain all game information such as mapoptions and modoptions). So only the hosts write tags sent in SETSCRIPTTAGS commands. You can write them if you want as a client, but they won't be used by Spring, which will use the tags contained in the startscript sent by the host upon connection to the game instead.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: SPADS AutoHost beta release

Post by CarRepairer »

bibim has explained this to me in PM. Thank you.

You can now see the player's skill in the tooltip when hovering over their little soldier icon in the battle in Weblobby.
Post Reply

Return to “SPADS AutoHost”