Here's a patch to read a value "scriptname" from the lobby-generated script.txt file:
http://manageddreams.com/csai/startscript.diff
This means you can specify arbitrary start script for lobby-generated games, opening up the possibility for multiplayer missions, and Use Map Settings type games.
How do I go about incorporating this into the Spring core?
Patch to allow use of lua scripts in lobby games
Moderator: Moderators
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Patch to allow use of lua scripts in lobby games
Last edited by hughperkins on 11 Nov 2006, 06:50, edited 1 time in total.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Note that here is a sample valid script.txt and lua script:
Save this to your spring application directory, taspring:
http://manageddreams.com/csai/script.txt
Save this to taspring/startscripts:
http://manageddreams.com/csai/lobbymissiontest.lua
Then just run:
spring.exe script.txt
Save this to your spring application directory, taspring:
http://manageddreams.com/csai/script.txt
Save this to taspring/startscripts:
http://manageddreams.com/csai/lobbymissiontest.lua
Then just run:
spring.exe script.txt
To get you code applied to the core:
Step 1: Creates a Patch file using subversion (or the subversion client you are using)
Step 2:
Option 1: Submit a bug to manits (the Bug tracker link at the top of this page) and include the patch file and a description of the patch. The devs will post comments for any changes they would like/need you to make. Submit new patches to the same bug until they are satisfied.
Option 2: Email the patch to the mailing list.
Step 1: Creates a Patch file using subversion (or the subversion client you are using)
Step 2:
Option 1: Submit a bug to manits (the Bug tracker link at the top of this page) and include the patch file and a description of the patch. The devs will post comments for any changes they would like/need you to make. Submit new patches to the same bug until they are satisfied.
Option 2: Email the patch to the mailing list.
Code: Select all
+
+ scriptName=file.SGetValueDef("","GAME\\scriptname");
+ if(scriptName.empty())
+ {
+ scriptName = "Commanders";
+ }
Code: Select all
+ scriptName=file.SGetValueDef("Commanders","GAME\\scriptname");
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14