sd7 shipping windows script

sd7 shipping windows script

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
AnimateDream
Posts: 7
Joined: 30 Sep 2010, 03:40

sd7 shipping windows script

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: sd7 shipping windows script

Post 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.
AnimateDream
Posts: 7
Joined: 30 Sep 2010, 03:40

Re: sd7 shipping windows script

Post 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
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: sd7 shipping windows script

Post 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.
AnimateDream
Posts: 7
Joined: 30 Sep 2010, 03:40

Re: sd7 shipping windows script

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: sd7 shipping windows script

Post 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. :?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: sd7 shipping windows script

Post 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.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: sd7 shipping windows script

Post by Argh »

If anything, it takes less time- no decompression overhead.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: sd7 shipping windows script

Post by Forboding Angel »

Set your AV to ignore your spring dir, that instantly fixed my .sdd loading issues.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: sd7 shipping windows script

Post by Beherith »

Spring loading slow only happens when I have a lot of .sdd directories floating around in mods and maps.
Post Reply

Return to “Game Development”