

Random Battle Generator: 	More Random Options Mod.
Modder: 			dazoline ll
Current Version: 		0.2a



----------------------------------------------------------------------------------------------------------------------------------------------



RBG Wishlist for version 0.3

- Make the preplanned attribute for both sides a parameter.
  This is the ability to plot artillery in orders 1 and have it arrive during that playback. 

- Make turnlimit an attribute, Infantry battles may take longer than the standard 60 turns to complete.



RCG Wishlist for version 0.3

- Make the preplanned attribute for both sides a parameter. 
  This is the ability to plot artillery in orders 1 and have it arrive during that playback. 
  
- Allow purchasing of core units using a new UI.
  - Must regulate the availability and points for purchase.
  - Must be able to do this for upgrades and keep the unit names correct.

- Make the description more dynamic, including such things as dynamic Art of War.

- Make turnlimit an attribute, Infantry battles may take longer than the standard 60 turns to complete.



----------------------------------------------------------------------------------------------------------------------------------------------

Modifying the Core Units:
A new set of files have been created to allow easier modifying of core units for random campaigns.

Out of the box functionality when building a Random Campaign means using a campaign file (Data/Random Campaigns) and a set of battles files (Data/Battles), the battle files contain the core units, which means without the mod you have to edit the core units in every battle file.

The modded files are contained in (Data/Campaign Core Units) and are named exactly like their counterparts in (Data/Random Campaigns). There are a number of different bits of functionality to these new files. 

1. You only have to edit one file to affect all key core units across all campaign battles.

2. The modded files support upgrades. If you look in one of the longer modded campaign files such as 1st Inf, 41 - 44 you will see multiple core tags inside the coreunit tag. Each tag has a date and scenario attribute which describes when that upgrade takes place. In the core tag are unit tags, corresponding to the core units in that scenario. Remember that the unitname attribute of a unit tag is what keeps track of that unit between battles and provides the upgrade path.

3. A file, in (Data/Campaign Core Units) will provide some of the units for each of that campaigns battles subject to:
   a. An out of the box random campaign will have no CCU (Campaign Core Unit) file, the code will recognize this and only use the core units present in the battles files. This allows the code to execute on non modded campaign files without crashing.
   b. A random campaign that has a CCU file will have its key core units in Battles files replaced by the units in the CCU file. Note a key core unit is different than a core unit, not sure why but it is.
   c. Any non key core units in Battles files will not be replaced, so there will be variability retained in the units used from battle to battle in a campaign.
   d. The Random Campaign description will display the key core units described in the CCU not the original key core units from the campaign file.
   
   


Example.
In the Battle file below the units numbered from 1 to 6 are the key core units, these are present in every campaign battle. The CCU file below the battle file replaces these 6 units with nine modified units.
The scenario generated from the RCG will contain the units 7 - 10 from the battle file and the units from 1 - 9 from the CCU file.
An upgrade for unit 1 in the CCU file will look like below with the first instance being a Mark III G tank and the upgrade being a Mark III H tank type.

Note I've seen key core units that come as replacements in some battles so if you want all your key core units present for all turns in a battle you have to set the attributes reinforcementChance="1" reinforcementTurn="0" in the unit tags.


Battle File German Summer 41 (First) - 1st Pzr Div.xml
<coreunits>
1.	<unit unitid="Pz Kpfw IIIG" unitname="HQ 2/1-1 Panzer" exp="Veteran" number="2" max="2"></unit>
2.	<unit unitid="Pz Kpfw IIIG" unitname="2/2/1-1 Panzer" exp="Veteran" number="5" max="5"></unit>
3.	<unit unitid="Pz Kpfw IVE" unitname="2/1/1-1 Panzer" exp="Elite" number="4" max="4"></unit>
4.	<unit unitid="Pz Grenadier 41" unitname="1/2/1-1 PzGren" exp="Veteran" number="3" max="3"></unit>
5.	<unit unitid="Sd Kfz 251" unitname="1/2/1-1 Transport" exp="Veteran" number="3" max="3"></unit>
6.	<unit unitid="Sd Kfz 222" unitname="1/1-1 Aufkl" exp="Veteran" number="2" max="2"></unit>
7.	<unit unitid="81mm Mortar" unitname="2/1-1 81mm Mortar" exp="Veteran" number="6" max="6" probability="A=.99;D=0.5"></unit>
8.	<unit unitid="105mm Artillery" unitname="105mm Artillery" exp="Veteran" number="4" max="4" probability="A=0.75;D=0.5"></unit>
9.	<unit unitid="150mm Artillery" unitname="150mm Artillery" exp="Veteran" number="4" max="4" probability="A=0.33;D=0.25"></unit>
10.	<unit unitid="JU-87 Stuka" unitname="JU-87 Stuka" exp="Veteran" number="2" max="2" probability="A=0.75;D=0.75"></unit>
</coreunits>



1st Panzer Div 1941 Short.mine.xml
<coreunits desc="...">
	<core date="6/22/1941" battle="German Summer 41 (First) - 1st Pzr Div">
1.		<unit unitid="Pz Kpfw IIIG" unitname="HQ 2/1-1 Panzer" exp="Elite" number="2" max="2" reinforcementChance="1" reinforcementTurn="0"></unit>
2.		<unit unitid="Pz Kpfw IIIG" unitname="2/2/1-1 Panzer" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
3.		<unit unitid="Pz Kpfw IIB" unitname="2/2/1-2 Panzer" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>			
4.		<unit unitid="Pz Kpfw IVE" unitname="2/1/1-3 Panzer" exp="Veteran" number="4" max="4" reinforcementChance="1" reinforcementTurn="0"></unit>
5.		<unit unitid="Pz Grenadier 41" unitname="1/2/1-1 PzGren" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
6.		<unit unitid="Sd Kfz 251" unitname="1/2/1-1 Transport" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
7.		<unit unitid="Pz Grenadier 41" unitname="1/2/1-2 PzGren" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
8.		<unit unitid="Sd Kfz 251" unitname="1/2/1-2 Transport" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
9.		<unit unitid="Sd Kfz 231" unitname="1/1-1 Aufkl" exp="Veteran" number="3" max="3" reinforcementChance="1" reinforcementTurn="0"></unit>
	</core>
	<core ... >
1.		<unit unitid="Pz Kpfw IIIH" unitname="HQ 2/1-1 Panzer" exp="Elite" number="2" max="2" reinforcementChance="1" reinforcementTurn="0"></unit>
2.		<unit unitid="Pz Kpfw IIIG" unitname="2/2/1-1 Panzer" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
3.		<unit unitid="Pz Kpfw IIB" unitname="2/2/1-2 Panzer" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>			
4.		<unit unitid="Pz Kpfw IVE" unitname="2/1/1-3 Panzer" exp="Veteran" number="4" max="4" reinforcementChance="1" reinforcementTurn="0"></unit>
5.		<unit unitid="Pz Grenadier 41" unitname="1/2/1-1 PzGren" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
6.		<unit unitid="Sd Kfz 251" unitname="1/2/1-1 Transport" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
7.		<unit unitid="Pz Grenadier 41" unitname="1/2/1-2 PzGren" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
8.		<unit unitid="Sd Kfz 251" unitname="1/2/1-2 Transport" exp="Veteran" number="5" max="5" reinforcementChance="1" reinforcementTurn="0"></unit>
9.		<unit unitid="Sd Kfz 231" unitname="1/1-1 Aufkl" exp="Veteran" number="3" max="3" reinforcementChance="1" reinforcementTurn="0"></unit>
	</core>
</coreunits>



----------------------------------------------------------------------------------------------------------------------------------------------




Modifications for v 0.2
RBG

- Read the pixels in a map image to get the size of the map and display it in the map description. This is done by reading the 
  number of pixels in a map, Ostfront maps are 1 pixel = 1 meter. I've found no other way to get the size of the map. Sometimes the image
  will fail to load and a 0m x 0m result will be produced despite a wait statement, this means the image has failed to load not that its not there.
  A workaround is to select another template and select the original again..

- Support the RCG in random campaign scenarios.


  
RCG

- Pass increased objective point worth to the RGB for all battles. The multiplier is x4 here rather than x2 with just a single battle. 
  In any case a limit of 750 points is given.

- Pass the phase to the RGB for all battles.

- Pass the Art of War to the RGB for all battles. This sets Art of War near the start of the war (off) 
  and later in the conflict (on). The dividing date for this option is coded as July 42, around the date the Russians started fielding
  infantry corps.

- Modify the core units for a campaign. A new directory has been added to the Data directory called Campaign Core Units which holds
  files named identically to random campaign files. These files contain the core units for that campaign and a modified description to
  identify the changed units on the RCG. This means you only have to change the core units for an entire campaign in one place instead of in every 
  scenario. Players will have to modify this XML to change the core units. 
  
  The files reside in Data/Campaign Core Units. When the script finds a file corresponding to a random campaign it will take all the core units
  in the file and only the core units with a probability attached from the battle files. Note you may place core units with a probability in the file.
  If the script doesn't find a file it will use just the core units from the battle file. This means to retain the original core units just remove the appropriate
  campaign file from the Campaign Core Units directory.
  
  The campaign description will be altered to conform to the core units contained in the Campaign Core Units folder when that file is present,
  otherwise it will display the original description.
  
- Include "Random Campaign: " in the name of the campaign so it will show up better in the in-game drop down.

----------------------------------------------------------------------------------------------------------------------------------------------

v 0.1 
RBG

- Added 4 dropdown selections to override certain battle file parameters.
In extending the battle files to include more options I found the amount of files was growing 
unmanageable and hard to find in the single battle dropdown. This mod allows you to change some of those
parameters on the fly instead of in the XML files. Namely: increased buying modifiers, art of war, phases, 
and increased objective points. You acn use other battle plans (files) with it, only these parameters will be overwritten.


----------------------------------------------------------------------------------------------------------------------------------------------



Installation
1. Open the Ostfront game folder where the filepath should look like:
<drive>\<optional path>\Matrix Games\Panzer Command Ostfront

2. Rename the PzCRBg.hta file to something like PzCRBg.original.hta.
   Rename the PzCRCg.hta file to something like PzCRCg.original.hta.

3. Place the PzCRBg.hta from the zip into the Ostfront game folder.
   Place the PzCRCg.hta from the zip into the Ostfront game folder.
   
4. Place the Campaign Core Units folder from the Data folder into the Data folder in the game install.

4. Run the Random Battle/Campaign Generator from your start folder or double click on the the PzCRBg.hta or PzCRCg.hta file.


Or
1. This mod is JSGME ready. Extract the folder from the zip into your MODS folder and install with JSGME.

2. Run the Random Battle/Campaign Generator from your start folder or double click on the the PzCRBg.hta or PzCRCg.hta file.
