XML Export from Trusted PBEM Games?

The sequel of the legendary wargame with a complete graphics and interface overhaul, major new gameplay and design features such as full naval combat modelling, improved supply handling, numerous increases to scenario parameters to better support large scenarios, and integrated PBEM++.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

XML Export from Trusted PBEM Games?

Post by 76mm »

I've finally got a bit more time now and want to start playing around with the editor.

On page 11 of the manual (Section 3.3.1), it says that if "Trusted PBEM" is turned on, you can export an XML file for loading into the editor. How exactly do you do that, I can't figure it out... Also, what exactly is exported, the current state of the game?

Two other issues:
1) In the editor, for some reason often when I hit "Open Scenario" absolutely nothing happens, and I have to exit the editor and re-enter before I can open a scenario--what might be going on there?

2) I am having trouble scrolling to the south for some reason, the other directions seem to work OK--any idea what I could be doing wrong here?
User avatar
Lobster
Posts: 5301
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: XML Export from Trusted PBEM Games?

Post by Lobster »

ORIGINAL: 76mm

I've finally got a bit more time now and want to start playing around with the editor.

On page 11 of the manual (Section 3.3.1), it says that if "Trusted PBEM" is turned on, you can export an XML file for loading into the editor. How exactly do you do that, I can't figure it out... Also, what exactly is exported, the current state of the game?

Two other issues:
1) In the editor, for some reason often when I hit "Open Scenario" absolutely nothing happens, and I have to exit the editor and re-enter before I can open a scenario--what might be going on there?

2) I am having trouble scrolling to the south for some reason, the other directions seem to work OK--any idea what I could be doing wrong here?


I would wager for the trusted PBEM thingy there's a hot key to make the XML file once the trusted PBEM game is loaded into your TOAW game. Then you would open the editor and load the XML file from there. Just guessing, never did this meself. Also it indicates both players have to have Trusted PBEM game turned on when the game is started, not after.

Not having either issue 1 or 2. Maybe Bob could help you out there?
http://www.operationbarbarossa.net/

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein

Q: What do you call a boomerang that doesn’t come back?
A: A stick.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

ORIGINAL: Lobster
Also it indicates both players have to have Trusted PBEM game turned on when the game is started, not after.
Ooops, I think I only turned it on for the first player.

Another note/question: to test this, I'm playing a "PBEM" game vs myself, and every time I open the name I get a message that I or my opponent may be playing with a pirated version... Any way to get that to stop?
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

OK, I just tried again from a hotseat game. "Trusted PBEM" is a game option, not a player option, so you only need to select it once as far as I can tell. In the game, the only option to save or export is to save it as a .sal file. If I do so, rename it as an .sce file, and open it in the editor, it opens but all of the game data seems to be encrypted. What am I doing wrong here?

User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

OK, making some progress... I figured out that I could open the xml file of a save game by:
1) turning on Trusted PBEM;
2) saving a turn as a .sal file;
3) changing the extension from .sal to .sce;
4) opening the .sce file in the scenario editor;
5) exporting the scenario as an XML (.gam) file; and
6) using Notepad++ to open the .gam file.

I could make simple changes to the .gam file, re-import in the scenario editor, save as an .sce file, and open the scenario. So far I just revised equipment numbers and dates, have not tried to add any units, etc. As many have pointed out, one problem with this aproach is that the turn is reset to 1; I thought that I could fix this by revising the turn number (and date) in the .gam file, but whatever I change it to there, the scenario opens on Turn 1, although the date changes are recognized.

This is a fairly clunky process, please let me know if I've missed some more streamlined process.
User avatar
larryfulkerson
Posts: 41193
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

RE: XML Export from Trusted PBEM Games?

Post by larryfulkerson »

ORIGINAL: 76mm

OK, making some progress... I figured out that I could open the xml file of a save game by:

1) turning on Trusted PBEM;
2) saving a turn as a .sal file;
3) changing the extension from .sal to .sce;
4) opening the .sce file in the scenario editor;
5) exporting the scenario as an XML (.gam) file; and
6) using Notepad++ to open the .gam file.

I could make simple changes to the .gam file, re-import in the scenario editor, save as an .sce file, and open the scenario. So far I just revised equipment numbers and dates, have not tried to add any units, etc. As many have pointed out, one problem with this aproach is that the turn is reset to 1; I thought that I could fix this by revising the turn number (and date) in the .gam file, but whatever I change it to there, the scenario opens on Turn 1, although the date changes are recognized.

This is a fairly clunky process, please let me know if I've missed some more streamlined process.
I found this in the KeyCommands.txt file in the Manuals folder:

F11 - Creates a NewGameText.xml file

And I assume that's the key you used and you already know about it.

Thanks for your help with this because I'd like to use your method myself. I know of no other way.
If you need to put warheads on foreheads who you gonna call? An FO...just one will do.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

ORIGINAL: larryfulkerson
I found this in the KeyCommands.txt file in the Manuals folder:

F11 - Creates a NewGameText.xml file
Hey Larry, actually I hadn't noticed that hotkey--I just saved from the normal menu and then renamed the file. But I will try this later today. I've also been playing with exporting/importing .oob files, will try to post about that as well.

User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

Larry, it looks like from an ongoing scenario the F11 hotkey saves equipment files (.eqp and .nqp) to the C:\Users\...\Documents\My Games\The Operational Art of War IV folder.

Not sure yet what, if anything, you can do with these files other than review them.

Also, you probably already know this, but you can also use the SHFT-CTRL-F4 keys to save each side's OOB during an ongoing scenario, with these OOBs showing current losses, etc. The problem is that it is not clear what, if anything, you can do with these files either.

For instance, in the scenario editor, if you go into the Force Editor and select "Open OOB" from the menu, it asks for an .ool file, not an .oob file. But if you go to the Force Editor and press the F5 key, it asks for an .oob file. But I have had two problems when I try to load an .oob file into a scenario:
1) when starting from a new scenario, sometimes I get an error "Parent Unit is invalid. Check the log for details." I have not been able to find the relevant log, but if I press OK for each of these errors (one for every unit in the OOB), the OOB actually seems to work; or
2) when starting from a new scenario, with some .oob files, they just don't work, nothing happens when I try to load them.

Trying to load the .oob file into the scenario from which it was extracted is even worse---every time I have tried it, the program hangs.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

One more weird thing I've noticed: if you save a Trusted PBEM game as a .sal file, change it to a .sce file, and export it to a .gam file, in which case the Turn Number is always converted to 1. You can, however revise the Turn Number in the .gam file to whatever turn you want, but the results will be slightly weird: when you reimport the .gam file, save it as a .sce file, and open the scenario, the game will say that it is Turn 1, whatever turn you revised the .gam file to say. BUT the event engine will recognize whatever turn you have inserted into the .gam file. Note that if you change the turn number in the .gam file, you should change the game date accordingly.

I'll see if I can upload a scenario file showing what I mean...
User avatar
larryfulkerson
Posts: 41193
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

RE: XML Export from Trusted PBEM Games?

Post by larryfulkerson »

ORIGINAL: 76mm
Larry, it looks like from an ongoing scenario the F11 hotkey saves equipment files (.eqp and .nqp) to the C:\Users\...\Documents\My Games\The Operational Art of War IV folder.

Not sure yet what, if anything, you can do with these files other than review them.

Also, you probably already know this, but you can also use the SHFT-CTRL-F4 keys to save each side's OOB during an ongoing scenario, with these OOBs showing current losses, etc. The problem is that it is not clear what, if anything, you can do with these files either.

For instance, in the scenario editor, if you go into the Force Editor and select "Open OOB" from the menu, it asks for an .ool file, not an .oob file. But if you go to the Force Editor and press the F5 key, it asks for an .oob file. But I have had two problems when I try to load an .oob file into a scenario:
1) when starting from a new scenario, sometimes I get an error "Parent Unit is invalid. Check the log for details." I have not been able to find the relevant log, but if I press OK for each of these errors (one for every unit in the OOB), the OOB actually seems to work; or
2) when starting from a new scenario, with some .oob files, they just don't work, nothing happens when I try to load them.

Trying to load the .oob file into the scenario from which it was extracted is even worse---every time I have tried it, the program hangs.
Hey there 76mm dude. Thanks for your observations. They sound like bugs, to me all of them. I've never heard of an OOL file and I've never started from a new scenario so of course I wouldn't have found what you've found....good job. They both sound like there's something seriously wrong. If I were you I'd cut and paste this report into the tech help section and see if the DEV can look into it.
A saved game file or a scenario file might help out the process. I hope there's a fix for this because you and I can't create a new scenario with what we've got.
If you need to put warheads on foreheads who you gonna call? An FO...just one will do.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

You can download and unzip this scenario, for which I've revised the .gam file to Turn 11, and inserted an event announcing "This is Turn 11". When the scenario starts, the game says it is Turn 1, but also fires the Turn 11 event. Moreover, the Turn 1 events are not fired.

Also, while it won't be obvious to anyone but me, I've also revised the OOB in this file by changing assigned equipment numbers and inserting a new unit. No problems with that so far...

Anyway, from what I've seeing it might indeed be possible to modify various parts of an ongoing scenario being played under Trusted PBEM settings and continue to play the scenario. So far the process is rather fiddly but I expect it could be automated by someone with more programming skills than me without much difficulty, if the interest is there.

Attachments
Anonymous..EMxx5.zip
(158.68 KiB) Downloaded 3 times
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

ORIGINAL: larryfulkerson
They sound like bugs, to me all of them. I've never heard of an OOL file and I've never started from a new scenario so of course I wouldn't have found what you've found....good job. They both sound like there's something seriously wrong. If I were you I'd cut and paste this report into the tech help section and see if the DEV can look into it.
Hey Larry, I'll try to post this into the tech forum later today, but in all fairness, I'm not sure if these are bugs, or if I'm just torturing the editor by using it for stuff for which it was not really designed--modifying saved game files and then re-importing them into the game.

But at the very least there is some weird and not very consistent stuff going on...

User avatar
larryfulkerson
Posts: 41193
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

RE: XML Export from Trusted PBEM Games?

Post by larryfulkerson »

It was my understanding that you indeed
COULD change the file extension and edit
a PBL file ( or a SAL file too ) as if it
were a scenario and then save it and change
the SCE back to a PBL and load it. But I
could be wrong. It would be a lot easier
to monkey with these games if you COULD
just change the file extension.

EDIT: I changed the SAL file I was working
on to an SCE file and loaded it in the
editor and edited it by moving one unit
to a different spot and then saved the
scenario with a different name than the
SAL file. Then I changed the file name of
the saved editor file to an SAL file and
then tried to load it in the game and
got an error message. Evidently you
CANNOT do that after all.

Image
Attachments
temp.jpg
temp.jpg (66.33 KiB) Viewed 205 times
If you need to put warheads on foreheads who you gonna call? An FO...just one will do.
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

ORIGINAL: larryfulkerson
It was my understanding that you indeed
COULD change the file extension and edit
a PBL file ( or a SAL file too ) as if it
were a scenario and then save it and change
the SCE back to a PBL and load it.
Larry, I am pretty sure that you CAN do this, but directly in the editor, and you don't change it back to a .pbl, but start it over as a new scenario (.sce) based on your .sal file. I am trying to see if you can modify the xml (.gam) file for a saved game outside of the editor. As far as I can tell, this is also possible, but a bit cludgy at the moment. I guess you could actually get back to a .sal file by opening the new .sce file and immediately saving it--resulting in a .sal--but I've never tried this...
ORIGINAL: larryfulkerson
EDIT: I changed the SAL file I was working
on to an SCE file and loaded it in the
editor and edited it by moving one unit
to a different spot and then saved the
scenario with a different name than the
SAL file. Then I changed the file name of
the saved editor file to an SAL file and
then tried to load it in the game and
got an error message. Evidently you
CANNOT do that after all.
Larry, as explained above, what you need to do is change the .sal file to a .sce file, and then use the .sce file, not change it back to a .sal file. You can do this, the only downside is that the turn is set back to 1, unless you monkey with it as described in one of my previous posts in this thread.
User avatar
golden delicious
Posts: 4114
Joined: Tue Sep 05, 2000 8:00 am
Location: London, Surrey, United Kingdom

RE: XML Export from Trusted PBEM Games?

Post by golden delicious »

Oh hey a really old thread- very useful:

I've been testing this feature myself:
1. I can convert a Hotseat .SAL into an .SCE no problems- just like it was in TOAW III
2. If I try this with a .PBL or a .SAL from a PBEM game, I get a "this version cannot load" error regardless of the "Trusted PBEM" setting
3. The F11 export (thanks Larry) comes out as a .XML file but the editor wants a .GAM file. Changing the file extension here and trying to import gives me some other error

Is there some step I'm missing when converting a save (of either type) from a PBEM save (with the Trusted PBEM flag "ON") to a .SCE so I can start editing it?
"What did you read at university?"
"War Studies"
"War? Huh. What is it good for?"
"Absolutely nothing."
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

I was able to convert a Trusted PBEM gam file to a .sce file as described above when I first started this thread, but since then have been working with hotseat files, so not sure if anything has changed. I will try a Trusted PBEM file in the next day or two, or if you have one handy send it over to me and I'll check it out.

One error I see with what you're doing is with the F11 key: AFAIK it does not generate a scenario file, but rather eqp and nqp files--see Sections 6.1.4 and 17.3.2 in the manual, for whatever it is worth, although from what I've seen the manual is riddled in inaccurate and/or outdated info.

The only way I'm aware of to create a gam file (an xml file of a scenario) is to use the File=>Save Game (XML) As... menu item in the Scenario Editor. So to change a sal to a sce to a gam, you should take the save game file, rename it as an sce, open it in the editor, then export it as a gam.

If anyone is interested, I'm about to start looking at the details of editing save game files, to allow for the use of tactical wargames to resolve battles in the TOAW layer. My main questions are whether things like time stamps, remaining MPs, and other "mid-turn" data is retained in the scenarios converted from saved game files. If things work more or less normally, I'll create a tool to automate as much of this as possible, including to renumber event turn numbers so that they'll still work in the edited save (now scenario) file, etc. If anyone has any thoughts, suggestions, or questions on this issue, please let me know.

[EDIT]Also, not sure if you've seen the XML editor I've created for TOAWIV:
https://www.matrixgames.com/forums/tm.asp?m=4547880

Depending on what you're trying to edit, you might find that it's easier than working with the built-in editor.
User avatar
Curtis Lemay
Posts: 13852
Joined: Fri Sep 17, 2004 3:12 pm
Location: Houston, TX

RE: XML Export from Trusted PBEM Games?

Post by Curtis Lemay »

Be sure you're using the old, e-mail, type PBEM. Trusted PBEM will not work under PBEM++.
My TOAW web site:

Bob Cross's TOAW Site
User avatar
76mm
Posts: 4765
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: XML Export from Trusted PBEM Games?

Post by 76mm »

ORIGINAL: Curtis Lemay
Be sure you're using the old, e-mail, type PBEM. Trusted PBEM will not work under PBEM++.
Yeah, as far as I know PBEM++ does not even leave the save game on your computer, only on the server.
User avatar
golden delicious
Posts: 4114
Joined: Tue Sep 05, 2000 8:00 am
Location: London, Surrey, United Kingdom

RE: XML Export from Trusted PBEM Games?

Post by golden delicious »

ORIGINAL: 76mm

One error I see with what you're doing is with the F11 key: AFAIK it does not generate a scenario file, but rather eqp and nqp files--see Sections 6.1.4 and 17.3.2 in the manual, for whatever it is worth, although from what I've seen the manual is riddled in inaccurate and/or outdated info.

It generates these files, but it also generates a .XML file in the same folder with a name like "NewGameFile" (on another machine now so I can't check). I didn't look in too much detail at what this file consists of.
If anyone is interested, I'm about to start looking at the details of editing save game files, to allow for the use of tactical wargames to resolve battles in the TOAW layer.

I'm definitely interested- but for the opposite reason. I'm interested in inserting a strategic layer over the top which would handle supply levels, replacements and reinforcements etc. I've run several of these strategic level games over the past (oh God has it really been) 20 years using TOAW and mostly MS Excel, but without Trusted PBEM this is a non-started in TOAW.
[EDIT]Also, not sure if you've seen the XML editor I've created for TOAWIV:
https://www.matrixgames.com/forums/tm.asp?m=4547880

Depending on what you're trying to edit, you might find that it's easier than working with the built-in editor.

Haven't- I was aware something like this existed but thankyou very much for the direct link.
"What did you read at university?"
"War Studies"
"War? Huh. What is it good for?"
"Absolutely nothing."
User avatar
golden delicious
Posts: 4114
Joined: Tue Sep 05, 2000 8:00 am
Location: London, Surrey, United Kingdom

RE: XML Export from Trusted PBEM Games?

Post by golden delicious »

ORIGINAL: 76mm


[EDIT]Also, not sure if you've seen the XML editor I've created for TOAWIV:
https://www.matrixgames.com/forums/tm.asp?m=4547880

I had a bit of a go at this. After 22 years I'm pretty quick with the classic editor, but there are some things in here which will be lifesavers:
1) switching unit formations quickly and without having to reset the deployment status
2) making sure everyone is a veteran (the proficiency variability range for untried units is just too large for most situations)
3) setting "ignore losses" for all static units

For 2 and 3 I normally try to set the unit right before making five thousand copies of it, but sometimes you miss something. In this regard it would be good to be able to set the Reconstitution option for units in the same way.

...however 1) on its own makes this a killer app for me. I had basically decided that for campaigns I would have to give up moving units between formations because it is such a bloody nightmare. You just brought back a feature.

"What did you read at university?"
"War Studies"
"War? Huh. What is it good for?"
"Absolutely nothing."
Post Reply

Return to “The Operational Art of War IV”