Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » M-File splitter, thanks to m.a@stars harassment :-)
M-File splitter, thanks to m.a@stars harassment :-) Thu, 06 April 2006 15:30 Go to next message
wumpus

 
Master Chief Petty Officer
Stars! V.I.P
Created tools and utilities to help the Stars! community
Past Weekly Puzzle Master

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 Smile

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 Smile

(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 Smile
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 Smile. The link above looks broken with the 'amp' in the middle, but does work... SAH Forum software not doing what I want Neutral]


[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 15:57 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
wumpus wrote on Thu, 06 April 2006 15:30

making a lot of subdirectories and putting one year's worth of M file into each subdirectory

I don't know about other people, but this is exactly what I do when backing up turns. I include the .xy, .x, and .h files too so they can be launched from the subdirectory.

Obviously you wouldn't have the .x files, and the .xy is easy to copy too, but the .h files would probably be a problem.



- LEit

Report message to a moderator

Re: M-File splitter, thanks to m.a@stars harassment :-) Thu, 06 April 2006 17:12 Go to previous messageGo to next message
Marduk is currently offline 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 Go to previous message
m.a@stars is currently offline 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 Smile


Glad to be of help. Very Happy


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. Cool



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Previous Topic: Nubians with BET?
Next Topic: 'magic' entry for stars! files (aka 'starsfile' for unix :-))
Goto Forum:
  


Current Time: Fri May 03 17:57:37 EDT 2024