PDA

View Full Version : Adding new scenario utility


markgame
September 29th, 2005, 06:41 PM
I don't remember what it was called or where I last saw it, but wasn't there a utility that enabled you to install new scenarios to SP, and would number them to the next available slot? Does such a beastie exist for winSPMBT? I know it's not really needed, you can re-number manual, but I was just wondering...

Pyros
September 30th, 2005, 01:57 AM
Hi,

I think WB has mentioned something like this, probably in the campaign subforum.

cheers,
Pyros

desh44
September 30th, 2005, 03:41 AM
I had a utility for SP which enabled you to load it into a file and then move it from that file to the folders for the game. When you opened the utility it had a 2 listings one from the game and one from a temp folder. You could create any number of temp folders and each one held 100 scenarios. You could move scenarios from one slot to another and it would renumber them for the appropriate slot. The format showed the scenarios as they appear in the game menu and when you moved them it would move all the appropriate files and number them correctly. I bought this program a few years ago unfortunately when my hard drive crashed a year and a half ago it was lost. I haven't been able to find where I got this one from but I am still looking. If anyone else should find one like it I would like to know also as it was a real time saver.
Tom

jvankessel
September 30th, 2005, 11:55 AM
If you can spec precisely what the program is supposed to do, I'll take a few hours to write it. Not this weekend though; I'm going sailing. http://forum.shrapnelgames.com/images/smilies/happy.gif

junk2drive
September 30th, 2005, 12:50 PM
What was the "Scenario Wrangler" program?

markgame
September 30th, 2005, 01:59 PM
jvankessel said:
If you can spec precisely what the program is supposed to do, I'll take a few hours to write it. Not this weekend though; I'm going sailing. http://forum.shrapnelgames.com/images/smilies/happy.gif



Enjoy your sail!

The utility should be able to extract the scenario files from a zip file and move them to the scenario folder in winSPMBT, renaming the files to place them in the next available unoccupied slot.

The files are in the format "spscnXXX.YYY" where XXX can range from 001 to 999. YYY is the extention which can be .cmt, .dat and .txt and all three should exist for each scenario. The files must be placed in the \Scenarios folder of the winSPMBT installation, so the path to that folder could be variable but the name "Scenarios" is fixed.

Example of files in the Scenarios folder:
spscn000.cmt
spscn000.dat
Spscn000.txt
spscn001.cmt
spscn001.dat
Spscn001.txt
SPSCN002.CMT
SPSCN002.DAT
Spscn002.txt
SPSCN003.CMT
SPSCN003.DAT
Spscn003.txt

The XXX should be replaced in the name of each of the three files with the next unused slot in the Scenarios folder. In the example above the next unused slot would be "004". If you feel so motivated you could add an option to specify the minimum value of XXX, so that add-on scenarios would always be placed in slots at or above that value, so that they can be grouped together.

The source location of the zips should be able to be specified using a "Browse to" button and saved in something like an .ini file so that the user doesn't have to re-specify locations on each use. The same of course for the destination "Scenarios" folder.

Scenarios are usually supplied in Zip compressed files, does this present a problem?

You did say "precisely", didn't you http://forum.shrapnelgames.com/images/smilies/wink.gif? I review and approve software requirements and specifications for a living!

jvankessel
October 2nd, 2005, 03:55 PM
markgame said:
Enjoy your sail!



Thanks. I most certainly did.


markgame said:

<...> (Specs).

You did say "precisely", didn't you http://forum.shrapnelgames.com/images/smilies/wink.gif? I review and approve software requirements and specifications for a living!


I like precisely. I'll write and upload this before Friday.

jvankessel
October 7th, 2005, 10:57 AM
All done. See attachment. Please read the readme.txt file.

<edit> Version 1.01, which parses the zip file and notifies the user if it is not a valid WinSPMBT scenario zip file, with a continue/abort option.

Beeg
October 7th, 2005, 11:49 AM
Great utility! Amazing in it's simplicity. Thanks very much.

Beeg

markgame
October 7th, 2005, 02:32 PM
I just installed and tested it on a couple of zips and it indeed does work as requested http://forum.shrapnelgames.com/images/smilies/happy.gif. I also tested it on a non-scenario zip and verified (at least in this case) that it didn't put any of the extracted files into the scenarios folder.

For a "try to break it" test I did put a PDF file into another scenario zip and the unpacker renamed the PDF and put it into the scenarios folder with the three regular files. However, since it wasn't noted in the requirements that only those three files are to be renamed and transfered, I have no issues with extra files being put the folder.

It did transfer a scenario that was missing one of the three files. I don't have a problem with this, since jvankessel did nicely provide a window where the user can see the files before transfering them.

So in all a good job, jvankessel!!! Take another sail!!!

jvankessel
October 7th, 2005, 03:12 PM
Beeg:
You're welcome. Markgame gave me a clear functional design to base my code on. It helped a lot.

markgame:
You're welcome too. :-)
After I uploaded the app, it dawned on me that I never parse the contents of the zip file. I'll implement that asap in v1.01. I'll also upload the source so it'll always be available for further development, in case I get struck by lightning or something.

jvankessel
October 7th, 2005, 05:55 PM
Attached to this post is the source for the vb6 utility, for those of you who are interested in code.

desh44
October 12th, 2005, 02:29 PM
In a later version is there going to be the ability to look at the place you are extracting to to see if it is empty?

That would be a great help so you don't have to open the program to make sure you are not overwriting something

Tom http://forum.shrapnelgames.com/images/smilies/cool.gif

jvankessel
October 12th, 2005, 04:47 PM
It *never* overwrites. Ever. Say you have a default value of 140 in the 'scenario number' field and you have 150 scenarios. Now you add one. The program will start scanning from 140 upwards and will take the first free slot; 151 in our example.

junk2drive
August 3rd, 2006, 10:18 AM
bump for newcomers. This program is great.

Click the attachment in post number 385722

WoofGM
September 3rd, 2006, 04:12 PM
Thanks !!

MarkSheppard
March 3rd, 2007, 08:10 AM
Quadruple bump

junk2drive
October 3rd, 2009, 11:07 AM
Switched computers and didn't have this.

Still wish someone would look at the source code and make a version for WW2.