Posts: 395
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

CW2 20 Subunits Mod

Sun Dec 29, 2019 2:07 am

20SubUnitExample.png (219.77 KiB) Viewed 446 times

Now testing, the Civil War 2 Twenty Subunits Mod!

Why would you need 20 sub-units in a division? Well, it's just like in Game of Thrones.


For the vanilla game, this mod is superfluous. I created it because in the main mod I'm working on, I've significantly altered artillery batteries. As originally designed, they usually represent a number of guns to fill two (or more) historical batteries but they are described as one. That's if they are described at all. My main mod will make most artillery units represent a single battery. Since many CSA divisions had attached artillery battalions of two or more batteries, I needed additional room in a division for better historical representation.

This mod consists of two files, and one value to edit in one file. Very easy.

Before you make any of these changes, *BACK UP THE ORIGINAL FILES*.
Also, this mod has potential negative impacts on PBEM games, so do *NOT* install it while you are in the middle of one or are planning on playing one. I repeat, *DO NOT USE THIS MOD WITH PBEM GAMES*. If you want, you can create a mod directory/install for CW2 and install it to there. Instructions for that are found elsewhere.

This can be used with a new or current *SINGLE-PLAYER* game, but you should BACK UP your saved games before installing if you want to try it. It should work for any of the scenarios that allow division creation. If you install it, start or continue a game with it installed, and then uninstall it I don't know what the result will be. Probably a crash, but nothing that will permanently break your game. The saved game will just be trash, but that's why you backed them up beforehand, isn't it?

On to the installation. The file you'll edit is GameLogic.opt, in the CW2/CW2/Settings folder/directory. The section you're looking for is SUB-UNITS, and this setting:

Wait, did you forget to *BACK UP THE ORIGINAL FILES*?

As I was saying.

subMaxNbPerUnit = 18

Change it to read:

subMaxNbPerUnit = 20

Then save the changes.

After that, the two files in the compressed file attached to this post, GUIInspector.dfm and GUIInspector.pas, are installed in the CW2/CW2/FrontEnd folder/directory. Overwrite the originals (that you previously *BACKED UP*) That's it! To uninstall, restore your original three files.

I have not had developer input to create this. The Brothers Philipe could have produced a better, more accurate result than what I'm posting. Mine is a hack, but a reasonably well-educated one. No binaries are changed. The two files are plain text definitions for front end graphics specific to the GUI inspector. They tell the engine where to place text and graphics on the screen. Through trial and error I've changed the coordinates of where things are positioned in the inspector, and added two new sets of fields to display the additional elements beyond the 18 originally defined. It's kind of cramped in the inspector (see image) but everything that's supposed to be clickable, is clickable. Hover tool-tip displays accurate information, and selecting individual elements produces the appropriate data in the model GUI. The additional elements bleed onto the model GUI, but they did that before I made any changes.

It will only work for CW2. 20 subunits is probably the maximum given how little I really know about how the engine positions things on screen and the data sets I'm pulling from. I cannot produce the same thing for any of the other AGE games without having a copy of them, and probably not even then. But if you want to send me a belated Christmas present, I'll give it a try...

Although this has been working for me on most of my recent test playthrough, I consider this VERY BETA. I've tried multiple combinations of units. I've run it at multiple screen resolutions. I haven't crashed it (yet) with the current configuration. If I recall correctly, there's a separate subunit limit on a specific type of element (cavalry? artillery?) and I haven't tested that as of 12/28/2019. I've been focusing on crashing and bugs. I haven't looked yet into what the AI is doing with the extra slots, if anything.

Any feedback is very welcome, please let me know if it works for you and if you do/don't like it. Happy upcoming New Year!

(224.19 KiB) Downloaded 38 times

Return to “CW2 Mods”

Who is online

Users browsing this forum: No registered users and 2 guests