Event Engine Unit Value

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++.
Post Reply
User avatar
Lobster
Posts: 5470
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

Event Engine Unit Value

Post by Lobster »

When a scenario is saved as an XML file (File/Save Game(XML) As...) units are addressed as values. The value is what is used to enable the game to undertake the process asked of it. For instance, unit withdrawal. Where can those unit values be found? In the XML file they are not a part of the XML file. An example of a withdraw Event:

Image

Where is the unit's value found? It's not in the XML file except where the withdraw event takes place.

Perhaps it's in the order the unit's were created? Still, it would be helpful to be able to see these values.
Attachments
ScreenHunter39.jpg
ScreenHunter39.jpg (25.34 KiB) Viewed 240 times
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Event Engine Unit Value

Post by 76mm »

I had to figure this out when coding TOAWxml. The note below refers to formations rather than units, I would guess it would be the same for units...

Value = Formation ID - 1, prefix of 2 for Force 2 (eg, Formation 1 of Force 2 = 2000; Formation 2 of Force 1 = 1; No XML for Formation1 of Force 1
User avatar
Lobster
Posts: 5470
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: Event Engine Unit Value

Post by Lobster »

Right. I had already found that using your XML editor I can insert the unit name and save, then the proper unit ID is inserted into an event for instance for a unit withdrawal.

I had wondered if, using the unit ID, a person could create a utility that allowed units to be passed in and out of formations in some way simply by changing the appropriate number. Would have to involve converting .sal to a .sce and back again. Probably also would have to be able to convert the turn counter to the proper turn after going from .sal to .sce and back again. All speculation of course. [;)]
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: Event Engine Unit Value

Post by 76mm »

You can already transfer units between formations in TOAWxml. I've actually finished coding a new module that allows the modification of saved games, including changing the turn to the proper turn, removing completed events, etc. It's pretty cool, although has not been tested other than by me.

Now I'm working on converting data from the gam files to a "tactical file" which includes additional data from the resolution of tactical level battles--you can convert both ways, so TOAW data from the gam file into a "tac" file, then resolve the tactical battle, but the data into the "tac" file, and send it back to the gam file. I've been working on this for several months, it is, um, rather complicated!
User avatar
golden delicious
Posts: 4121
Joined: Tue Sep 05, 2000 8:00 am
Location: London, Surrey, United Kingdom

RE: Event Engine Unit Value

Post by golden delicious »

ORIGINAL: Lobster

I had wondered if, using the unit ID, a person could create a utility that allowed units to be passed in and out of formations in some way simply by changing the appropriate number. Would have to involve converting .sal to a .sce and back again. Probably also would have to be able to convert the turn counter to the proper turn after going from .sal to .sce and back again. All speculation of course. [;)]

As soon as you're playing around with modding the scenario between saves, I would suggest you can make the whole experience a lot cleaner by simply doing away with any and all uses of the turn counter:
1) no turn-based events
2) no turn-based reinforcements
3) no turn-based replacements changes

Instead, you can handle all these things when you crack open the scenario to make your other changes. This is the way I handled things for my Grand Strategy projects; the strategic ruleset would output whatever units, replacements, force supply etc. etc. at the start of the strategic turn and that would be input into the scenario. The scenario has a fixed duration of 1-3 months and at the end of it you go back into the editor and add these factors back in again. The only thing you need to do with regard to the turn count is increment the start date for the new scenario.
"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”