Easy saving: you can't get there from here!

The highly anticipated second release in the Panzer Command series, featuring an updated engine and many major feature improvements. 3D Tactical turn-based WWII combat on the Eastern Front, with historical scenarios and campaigns as well as support for random generated battles and campaigns from 1941-1944.
Post Reply
MarkShot
Posts: 7464
Joined: Sat Mar 29, 2003 6:04 am

Easy saving: you can't get there from here!

Post by MarkShot »

So, I finally completed reading the manual today and I have been in boot camp this evening.

Now, I like to when learning a game and maybe beyond that checkpointing my turns. This allows me to back track and simplify learning. (Yes, I know about the autosave and that I can easily script checkpointing the saves by DATE|TIME. But I like meaningful/useful names.)

Has anyone noticed just how many mouse actions it takes to save a game? I mean conceptually this should be:

(1) Hit SAVE key.
(2) Type save name.
(3) Hit ENTER.

or

(1) Hit SAVE key.
(2) Last used name defaults.
(3) Hit ENTER.

No problem. I thought I would just script this behavior like I have scripted things for many games with mouse coordinates/events and/or sending key strokes. It just doesn't work with this game.

In short, you cannot get there from here. (UI efficiency isn't just for back office data entry ... it's for games too.)
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
MarkShot
Posts: 7464
Joined: Sat Mar 29, 2003 6:04 am

RE: Easy saving: you can't get there from here!

Post by MarkShot »

Kind of like this naming wise, but I am wearing tracks in my mouse pad. :)

Camp0100.sav
Camp0101a.sav
Camp0101b.sav
Camp0102a.sav
Camp0102b.sav
Camp0103a.sav
Camp0103b.sav
Camp0104a.sav
Camp0104b.sav
Camp0105a.sav
Camp0105b.sav
Camp0106a.sav
Camp0106b.sav
Camp0107a.sav
Camp0107b.sav
Camp0108a.sav
Camp0108b.sav
Camp0109a.sav
Camp0109b.sav
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
rickier65
Posts: 14252
Joined: Thu Apr 20, 2000 8:00 am

RE: Easy saving: you can't get there from here!

Post by rickier65 »

MarkShot,

Not sure if it will suit you, but there was a utility that Stridor posted that i think does what you are describing. plus it adds the benefit of making the scenario briefing available. But maybe you already know about this utility.

in any event, its in the mods section. I'm pretty sure it's listed in the mods summary posted there as well:

tm.asp?m=2055612


But maybe this isn't what youre talking about?

EDIT: actaully, i think the direct link to the thread with his mod is here:
fb.asp?m=1779461

Rick
ORIGINAL: MarkShot

Kind of like this naming wise, but I am wearing tracks in my mouse pad. :)

Camp0100.sav
Camp0101a.sav
Camp0101b.sav
Camp0102a.sav
Camp0102b.sav
Camp0103a.sav
Camp0103b.sav
Camp0104a.sav
Camp0104b.sav
Camp0105a.sav
Camp0105b.sav
Camp0106a.sav
Camp0106b.sav
Camp0107a.sav
Camp0107b.sav
Camp0108a.sav
Camp0108b.sav
Camp0109a.sav
Camp0109b.sav
MarkShot
Posts: 7464
Joined: Sat Mar 29, 2003 6:04 am

RE: Easy saving: you can't get there from here!

Post by MarkShot »

Thanks, Rick.

I read through his VBS code and it seems to rename each save based on its date and time of creation.

I've taken a look at the autosave which first begins on turn two and is created at the start of each full turn. I think I will do something similar, but instead name files by their turn number. If you simply look for the max turn file name on startup of the utility, you should be able to resync the naming convention when starting a saved game. I think that's what I will program. Sadly, I will be the only one who gets to use it, since I script in WinBatch which is not part of Windows or public domain, but requires a license. However, if it works nicely, perhaps I will post my code. It could easily be redone in VBS.
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
MarkShot
Posts: 7464
Joined: Sat Mar 29, 2003 6:04 am

RE: Easy saving: you can't get there from here!

Post by MarkShot »

Here is my quick and dirty code. I decided not to bother with creating turn names, since the Load Dialogue shows the turn number anyway. This isn't much different than Stridor's VBS. However, you'll notice that the WinBatch is shorter and simpler as it is less general purpose and more of a scripting language.

Off to play now that my turns will be saved and I can back track while learning.

The code formatting is probably not preserved by the forums.
WinTitle(WinName(), "PZK Mgr")

; ----- Definitions ------

Interval=1
GameEXE="E:\Games\PZK\PCKharkov.exe"
GamePath="E:\Games\PZK\"
InitName="Panzer Command:"
SourceFile="E:\Games\PZK\Save\Autosave.sav"
DestinationDir="E:\Games\PZK\Save\"

; ----- Initialize -----

RunShell(GameEXE, "", GamePath, @Normal, @NOWAIT)
WinWaitExist(InitName, -1)
Delay(1)
WinActivate(InitName)
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{DOWN}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
SendKey("{TAB}")
Delay(2)
SendKey("{ENTER}")

; ----- Monitor Save Game Status -----

While @true
If FileExist(SourceFile) then
Delay(5) ; stabilize
GoSub RenameSaveGame
End If
TimeDelay(Interval)
End While

; ----- Shut Down -----

Exit

Message("Debug", "Pause")

; ##### RenameSaveGame #####

:RenameSaveGame

; ----- Form file name -----

BaseName=FileTimeGetEx(SourceFile, 2)
ReplaceName=StrClean(BaseName, ":", "", @False, 1)
ReplaceName=StrSub(ReplaceName, 1, 12)
ReplaceName=StrCat(StrSub(ReplaceName, 1, 8), " ", StrSub(ReplaceName, 9, 4),".sav")
TargetName=StrCat(DestinationDir, ReplaceName)
FileMove(SourceFile, TargetName, @True)

Return
2021 - Resigned in writing as a 20+ year Matrix Beta and never looked back ...
Post Reply

Return to “Panzer Command: Kharkov”