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

This Month's Specials

The Falklands War: 1982- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old November 9th, 2004, 01:12 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Request for auto backup of turn files

I do these backups in a very simple fashion: by running a script on Dom2 start (and on hosting too - for SP).

Here's the script: save_script.awk
Code:

BEGIN {
timestamp_file = "Last-total-save-timestamp.txt";
t = systime();
stamp = strftime("%Y%m%d-%H%M%S",t);
stamp2 = strftime("%Y-%m-%d",t);
saveAll = 1;
if ((getline Last_stamp < timestamp_file) > 0)
{
if (stamp2 == Last_stamp)
saveAll = 0;
}
close(timestamp_file);

if (saveAll)
{
cmd = sprintf("zip -r save-all-%s * -i@save.lst",stamp);
print stamp2 > timestamp_file;
}
else
cmd = sprintf("zip -r -t %s save-%s * -i@save.lst",Last_stamp,stamp);
system(cmd);
}



You'd need to insert
gawk -f save_script.awk into your Dom2 startup

And you'll need save.lst:
Code:

*/ftherlnd
*/*.2h
*/*.trn


That's the only Dom2-specific file.
Reply With Quote
  #2  
Old November 9th, 2004, 01:21 AM
Cainehill's Avatar

Cainehill Cainehill is offline
Lieutenant General
 
Join Date: Mar 2004
Location: Albuquerque New Mexico
Posts: 2,997
Thanks: 0
Thanked 0 Times in 0 Posts
Cainehill is on a distinguished road
Default Re: Request for auto backup of turn files

Yep, and I could do any variety of shell scripts in linux or unix (as an exercise in pain, it could even be done with sed instead of awk), or even a batch file to manage it in Windoze for my gaming box. The problem is that most players aren't going to go to this effort, and with Windoze I think you'd actually need a separate batch file for each game.

And thus, imo, it would be well worthwhile for it to be embedded in the game, so that all players wound up having access to verifying the previous turn, even if they're the types that have to upload their files for other more experienced players to figure things out (as often happens).
__________________
Wormwood and wine, and the bitter taste of ashes.
Reply With Quote
  #3  
Old November 9th, 2004, 02:02 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Request for auto backup of turn files

Actually, I'm using this one in Windows. And considering the Dom2 crowd I won't be surprised if the most of the players already use their own scripts to backup turn files

If developers are to implement something about that I think enumerating turns would have more uses (and probably easier to program). For example:
Code:

jotun.1.trn
jotun.1.2h
jotun.2.trn
jotun.2.2h
...

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 12:46 AM.


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