.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Command 3.0- Save $12.00
War Plan Pacific- Save $7.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old November 1st, 2006, 02:33 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default 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!)
Reply With Quote
  #2  
Old November 1st, 2006, 02:57 PM

thejeff thejeff is offline
General
 
Join Date: Apr 2005
Posts: 3,327
Thanks: 4
Thanked 133 Times in 117 Posts
thejeff is on a distinguished road
Default 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.
Reply With Quote
  #3  
Old November 1st, 2006, 04:45 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default 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!)
Reply With Quote
  #4  
Old November 2nd, 2006, 10:12 AM

Lollipop Lollipop is offline
Private
 
Join Date: Sep 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Lollipop is on a distinguished road
Default 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

Reply With Quote
  #5  
Old November 2nd, 2006, 02:16 PM
Gandalf Parker's Avatar

Gandalf Parker Gandalf Parker is offline
Shrapnel Fanatic
 
Join Date: Oct 2003
Location: Vacaville, CA, USA
Posts: 13,736
Thanks: 341
Thanked 479 Times in 326 Posts
Gandalf Parker is on a distinguished road
Default 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!)
Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 09:09 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.