M-File splitter, thanks to m.a@stars harassment :-) |
Thu, 06 April 2006 15:30 |
|
wumpus | | | Messages: 114
Registered: September 2004 | |
|
Well, m.a@stars has been hassling me about making an M-file splitter for a while now, so here, finally it is, complete with source code
http://sourceforge.net/project/showfiles.php?group_id=65726& amp;package_id=186619
Given an M-file which contains multiple years worth of data, mSplit will output one M file per year.
The naming of the output files is not exactly optimal yet, since you have to rename them in order to open them in stars!, but since stars! insists on a very specific name so that it can find the corresponding XY file, a simple solution didn't seem available. I didn't feel that making a lot of subdirectories and putting one year's worth of M file into each subdirectory was an acceptable solution.
Comments welcome ofc
(Just run the program at a command prompt / dos window / whatever those things are called these days - the usage message should be clear enough I hope
It's purely a console app at this stage, if someone feels like putting a nice GUI front end on it, feel free!)
[EDIT 17.4.2006: Corrected link - now points to list of releases on SF, rather than this specific version - so that a later update will not require changing this thread . The link above looks broken with the 'amp' in the middle, but does work... SAH Forum software not doing what I want ]
[Updated on: Mon, 17 April 2006 13:59]
Michael "Wumpus" Zinn
» Apply magic glue here «Report message to a moderator
|
|
|
|
Re: M-File splitter, thanks to m.a@stars harassment :-) |
Thu, 06 April 2006 17:12 |
|
Marduk | | Ensign | Messages: 345
Registered: January 2003 Location: Dayton, OH | |
|
I do the same as LEit. I keep a lot of records when I play to keep my enemy intel as current and accurate as possible, and sometimes go back to check old turns. I keep the whole game in one directory, with each year's files in a subdirectory named for the year (2400, 2435, 2512, etc.). The files from the current turn stay in the main game directory until I submit my turn, then are copied into the folder for that year.
The .h files shouldn't really be a problem, since they're built as you go. As part of the split routine, run a script to create the year folders and copy the .xy into all of them. Copy the .h file from the main directory into the folder for the first year being split off, and as you write the .m files out have Stars! fire up the game in that folder (I think the command line options include a target game to open), then exit. Copy the updated .h file into the next year's folder and continue in this manner until you get to the last year.
Report message to a moderator
|
|
|
Re: M-File splitter, thanks to m.a@stars harassment :-) |
Thu, 06 April 2006 20:34 |
|
m.a@stars | | Commander | Messages: 2765
Registered: October 2004 Location: Third star to the left | |
|
wumpus wrote on Thu, 06 April 2006 21:30 | Well, m.a@stars has been hassling me about making an M-file splitter for a while now, so here, finally it is, complete with source code
|
Glad to be of help.
Quote: | since stars! insists on a very specific name so that it can find the corresponding XY file, a simple solution didn't seem available. I didn't feel that making a lot of subdirectories and putting one year's worth of M file into each subdirectory was an acceptable solution.
|
Yet the subdirectory arrangement could be interesting for some. I wonder if it could be included, too.
So many Stars, so few Missiles!
In space no one can hear you scheme! Report message to a moderator
|
|
|