|
|
|
 |

November 1st, 2006, 02:33 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: Automatic backup of turn files
Very nice. And excellent explanation.
One note. If your icon has a Target line like
"C:\Program Files\dominions3\dom3.exe"
with the quotes (windows puts the quotes because of the space in that line) then put the --preexec backup.bat outside of the second quote.
It also answers a question I had about windows variables that I was going to look up so that I could convert some of my linux scripts to windows batch files.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|

November 1st, 2006, 02:57 PM
|
General
|
|
Join Date: Apr 2005
Posts: 3,327
Thanks: 4
Thanked 133 Times in 117 Posts
|
|
Re: Automatic backup of turn files
Another thing I found useful is to pass the game name on the --preexec line.
--preexec "backup.bat GameName"
This way you can use the same script for every game you play and just change the line in properties.
If you also generate the score dump, you can parse that for the turn number and actually save each turn.
I had a fairly simple bash script version, but gave up on converting it to Windows, since the current version behaves badly when running the postexec, at least if it's full screen.
|

November 1st, 2006, 04:45 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: Automatic backup of turn files
The passed name is a good thing. Thanks.
I can see it being useful since I tend to create a seperate icon for every server game Im in because it saves me changing the server and port when Im playing multiple games on multiple servers. With your hint I can have one bat file making backups of all of my MP games, and just have each icon telling it which game to save. Very handy since multiple games makes it hard to remember what I did last turn.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|

November 2nd, 2006, 10:12 AM
|
Private
|
|
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Re: Automatic backup of turn files
Quote:
thejeff said:
If you also generate the score dump, you can parse that for the turn number and actually save each turn.
|
Thanks, that was exactly what I was looking for.
I attached a python script. Instead of long winded explanations:
Code:
pia@Lollipop:~/dominions3$ ./dom3backup.py --help
usage: dom3backup.py [options]
options:
-h, --help show this help message and exit
-n NAME, --name=NAME Process file <name>. Otherwise latest file
-f FREQ, --freq=FREQ create a Zipfile every <n> turns. Default: 0 (no
zipfile)
-m MAXFILES, --maxfiles=MAXFILES
keep max. <n> Zipfiles. Delete oldest. Default: 0
(keep all)
-d ARCHDIR, --archdir=ARCHDIR
create Zipfiles in archdir. archdir must exists.
Default: <dom3>/archivedgames
--nocopy don't copy files to backup-dir. Default: False
--clean remove all zipfiles and the backup-dir
|

November 2nd, 2006, 02:16 PM
|
 |
Shrapnel Fanatic
|
|
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
|
|
Re: Automatic backup of turn files
I posted a batch file for playing with the map making commands. It makes it easy to generate map after map with the same settings. It also lets you play with things like the color settings. I posted it into the MOD/MAP subforum since I think it is more useful to that crowd.
__________________
-- DISCLAIMER:
This game is NOT suitable for students, interns, apprentices, or anyone else who is expected to pass tests on a regular basis. Do not think about strategies while operating heavy machinery. Before beginning this game make arrangements for someone to check on you daily. If you find that your game has continued for more than 36 hours straight then you should consult a physician immediately (Do NOT show him the game!)
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
|
|