Page 1 of 1

sd7 shipping windows script

Posted: 03 Oct 2010, 11:22
by AnimateDream
Well I was trying to debug lua changes in a mod and I noticed how awful the testing cycle was of making a 7z of all the files, moving it up to the mod directory, changing the extension, running spring, and then launching a game with that mod.

This script just simplifies the first part of that process. Just copy the code into a text file, change the extension to .bat, and run it in your mod's folder. Note it assumes your mod's folder is inside spring's "mods" folder. Also note it removes any sd7 and 7z files in your mod's directory, which gets rid of temporary files and anything that might get in the way.

Code: Select all

DEL *.sd7
DEL *.7z
for %%* in (.) do set MyDir=%%~n*
"C:\Program Files\7-Zip\7z.exe" a %MyDir%.7z -ssw -slp -r -mx1 *
REN .\*.7z *.sd7
move .\*.sd7 ..\

@echo off
echo.
echo This script is for quickly building sd7 files to your mod directory. It uses low compression and is therefore unsuitable for building release files.
echo.
pause
It works fine for me, but I wrote it hastily and I don't write many windows scripts so let me know if you have any problems.

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 11:25
by hoijui
instead of an sd7 script in the mod dir, extract all the mod files to a folder with a name that ends in ".sdd", eg mods/BA.sdd/ModInfo.lua.

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 11:41
by AnimateDream
Woah. Thank you. That's such a relief.

I guess I'm a bit too hasty when it comes to documentation and spring's docs seem to be a bit erm.... scattered. I think this merits mention somewhere on this page... http://springrts.com/wiki/Mod_and_Unit_ ... evelopment

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 12:13
by Google_Frog
You don't even need to restart Spring to update many lua changes.

How long does your bat take to run? Currently Spring takes minutes to start .sdd mods so creating a sd7 could even be faster.

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 12:28
by AnimateDream
The script uses the fastest level of 7z compression so its very fast depending on the size of the mod. Well... there's actually an option to build a 7z file with no compression, but I didn't find it significantly faster on my computer. You could also modify the batch file to launch your mod with spring at the end of its current tasks.

Of course editing lua on the fly would probably be easier using the .sdd technique. I tried editing lua files directly in the sd7 file and using lua reload but I didn't have much luck.

I'm a self taught programmer so I tend to muck around with a bit too much trial and error when I'm learning a new language or api. I can't stand when testing changes takes longer than making them.

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 16:53
by FLOZi
Google_Frog wrote:You don't even need to restart Spring to update many lua changes.

How long does your bat take to run? Currently Spring takes minutes to start .sdd mods so creating a sd7 could even be faster.
Spring loads my .sdd of S44 just as quickly as the archive Market Garden release. :?

Re: sd7 shipping windows script

Posted: 03 Oct 2010, 17:22
by hoijui
i guess it heavily depends on what OS and file-system you use, and probably the hardware. i often heard of SDDs to take very long to load, but here it is not the case either.

Re: sd7 shipping windows script

Posted: 04 Oct 2010, 07:21
by Argh
If anything, it takes less time- no decompression overhead.

Re: sd7 shipping windows script

Posted: 04 Oct 2010, 08:04
by Forboding Angel
Set your AV to ignore your spring dir, that instantly fixed my .sdd loading issues.

Re: sd7 shipping windows script

Posted: 04 Oct 2010, 09:09
by Beherith
Spring loading slow only happens when I have a lot of .sdd directories floating around in mods and maps.