![]() |
gauging interest. save game perl script
1 Attachment(s)
Well not sure why but I never got to actually using the Java dom save utility. I had problems with jre this and classpath that and probably I wasn't patient enough to get it to work.
So after some time of stupidly saving turns by manually copying them I decided to write a small perl script to save turns. So I did. It can save and restore turns. It is configurable. It is OS independent. It is CLI (though if there's interest I might add a GUI to it). I am using it and find it very convenient. I am trying to gauge if there's interest in this tool. If so I can upload it, also If there are any suggestions as to how it can be even more useful I can consider and maybe add them. One use for it that I can imagine is for PBEM hosts - it can be used as an easy way to save all turns. Usage (from script documentation): "Usage save_dom.pl [v|c|s|l] [game name] [turn number]. Examples. 1 To save turn 14 of game named "ermor" do: save_dom.pl s ermor 14. 2 To load turn 14 of game named "ermor" do: save_dom.pl l ermor 14. 3 To configure values of dominions II path and save game root path do: save_dom.pl c. 4 To view configuration parameters values do: save_dom.pl v " EDIT, In the zip file is the perl script (you need to install perl for it to work) also is a .save_dom_conf file, this is an example of the configuration file on my system. |
Re: gauging interest. save game perl script
I would download it and check it out, although the java one works fine for me now. One question: why do you have to give the turn number with the 's' command? Won't it just save the current turn no matter what? Is it that there no easy way for the script to know what the current turn is? |
Re: gauging interest. save game perl script
Quote:
The turn # is probably stored in the .2h/.trn file. If it is stored there then it can be extracted otherwise I'm not sure there's an easy way to know the turn #. The script could work like a deamon, in the background checking if the turn files are updated and then save them to the correct turn. only problem is how to know what is the correct turn. |
Re: gauging interest. save game perl script
I am *TREMENDOUSLY* interested in this heh. I've never used perl.... trying to figure out how to use it now, add a gui http://forum.shrapnelgames.com/images/smilies/wink.gif.
Edit: Okay i'm lost, how do I use this? Quote:
What java one? |
Re: gauging interest. save game perl script
izaqyos,
The turn number is in all of the .2h, .trn, and ftherland files. It's in bytes 15 and 16, low-order byte first. |
Re: gauging interest. save game perl script
@Evil Dave, Thanks. I'll modify the script so that the turn # is not needed.
@Slen, I mainly work with C/C++ and JAVA but for quick and dirty stuff they don't come close to Perl. |
Re: gauging interest. save game perl script
@Evil Dave, I used a hex editor to view the .2h and .trn files but I didn't see the turn numbers at all.
|
Re: gauging interest. save game perl script
I dont want to know you out of your project. Its always worthwhile to do something like it. The subject of the thread is "gauging interest. save game perl script" so we can wait and see if enough people are able to run perl scripts who are interested.
But yes, here are a number of versions of a save program. Bat file, java, basic, etc. I was tempted to EXE a basic one so that people didnt have to "download this and install it to run this". You can use the pre-exec and post-exec switches when starting Dom2 to make a save every turn but that doesnt do anything different than the game does without a save. The icon version with bat files works ok for me. I click the icon to make a save of the game. But you have to reach your desktop to do it and you have to edit the batch file to tell it which game. What I had in mind for an exe would be something that you clicked which would start the saver program, then start Dom2 with the "status file" switch. That file is ascii and easily parsed with a turn number in it. The exe could "see" the turn changes and make 2, 3, or 5 maybe.. rotating backups that are 5 turns apart from each other. |
Re: gauging interest. save game perl script
Quote:
<pre> 0000000: 0102 0444 4f4d f609 0000 d400 0000 ab00 ...DOM.......... ^address ^bytes ^ascii equivalent </pre> I've put the turn number bytes in bold. 0xab == 171 decimal. I hope the save file is the same under all architectures. |
All times are GMT -4. The time now is 12:49 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.