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

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 5th, 2008, 01:25 AM

MaxWilson MaxWilson is offline
Major General
 
Join Date: Mar 2007
Location: Seattle
Posts: 2,497
Thanks: 165
Thanked 105 Times in 73 Posts
MaxWilson is on a distinguished road
Default Backup tool

I realized that one reason my turns go so slow even in SP is because, having spent hours or days developing a strong gaming position, I don't want to throw it away with stupid errors like forgetting to re-hire Obscuro when I badly need an air mage. It makes me paranoid and I check everything thrice. (It's sort of the same reason that makes Axis and Allies play so slowly if you're playing against someone who rigidly enforces the phases and won't let you attack if you make a noncombat move.) So, I decided to address this by writing a quick little Python script that backs up my files each turn.

Remember that the distinction between a script and a program is that a program is opaque and a script is transparent and meant to be fiddled with by the end user--i.e. my error handling in this script is not robust. Oh well. You may still find it useful. Save it to your dom3 root directory and run dom3 with the --preexec switch and the name of the game you'll be playing. On Windows this would be

dom3 --preexec "backup.py <gamename>"

Yeah, I know, having to type in the name of the directory to back up is onerous, etc. Maybe I'll fix it later but right now this is what I'm using.

-Max

edit: That's funny. The attachment is gone, and there's no option to create a new one. I'll paste in the text here directly, although now maybe I'll use Ich's version instead. My script:

import sys
import os
if len(sys.argv) != 2:
print "Usage: backup <gamename>"
exit()

def execute(cmd):
print cmd
os.system(cmd)

gamedir = 'savedgames\%s' % sys.argv[1]
print 'Backing up', gamedir
execute('cd %s' % gamedir)
execute('mkdir %s\\backup' % gamedir) # Could already exist, but oh well, ignore the error
execute('erase %s\\backup\\* /Q' % gamedir)
execute('copy %s\\* %s\\backup /Y' % (gamedir, gamedir))
__________________
Bauchelain - "Qwik Ben iz uzin wallhax! HAX!"
Quick Ben - "lol pwned"

["Memories of Ice", by Steven Erikson. Retranslated into l33t.]
Reply With Quote
 

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 04:38 PM.


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