Page 1 of 1

Changing Reinforcement Choices

Posted: Fri Jun 29, 2007 7:51 pm
by wiltaz
I'm waiting on my copy to arrive that I ordered. I'm messing around with the 1.05c Demo trying to figure out modding so when I get the game I can make some changes I wanna see.

But I'm failing to grasp something probably very simple. I've read other posts and tried everything but I'm not succeeding. All I want to do is to define a new Bde type with an alternate force structure using existing models and have it appear as a reinforcement type I can recruit.

If I add a new unit, update the unit alias list and modify the early force pool inc file I still don't see the new unit on the reinforcement screen. If I take an existing unit that shows up on the reinforcement screen and modifiy it's attribute to match what I want for the unit, then the changes show for that unit except the number in the force pool stays the original number, not the new values I put in the force pool file and the unit file. So I know it's reading the files I'm modifying as far as what is in the unit, but if I up the force pool value to 20 in both places it still shows in the game as 10 which was the value before I did the modifying. I'm figuring the actual force pool value must be in another file but nothing I open seems to deal with the force pool.

I tried using the excel file for the early pool and making the changes and exporting the csv. Then using the csv splitter program to make the data file, but I get errors on the first line of the csv which isn't even a row I modified. Just to see it work I took the excel file, exported it and loaded it with the csv splitter and it errored out without me changing anything. So I gave up on that.

What has to be modified in the files to get a new type of Bde to show up as something I can recruit?

Posted: Fri Jun 29, 2007 8:09 pm
by Stonewall
There are two ways to do this. The "right" way is by editing the csv files and exporting everything. Primisprit has a detailed "how to" detailing this and those isntructions can be found here.

That said, if the only change you are making is adding one unit, you can do so fairly easily by directly editing the game files. Make backups prior to doing this.

You'll need to alter 3 files. One of those files depends on which scenario you are playing. If I'm right, the demo is based off of the July 1861 scenario. You'll need to modity the uni_alias.ini file in the 'aliases' directory. You'll need to create a new .uni file in the 'gamedata/units directory'. And the last file you need to alter is the scenario event file. If this is the July scenario, then you need the '1861 July Campaign.sct' file in the events directory.

Creating a new unit in the 'gamedara/units' directory.

This is easy. Just copy and paste one of the union brigades so that the new file is 'copyofxyz.uni' Rename this to '1071USABrigade1.uni' or whatever you want. Open it and you'll find something that looks like the following:

Code: Select all

UID = 201
NationTag = USA
Name = Infantry Bde (WV)
Alias = uni_USA_Bde4WV
ForcePool = 2
Text = $uni_txt_USA_Infantry1
Kind = $Land
Color = $colUSARegular
ModelType0 = $mdl_USA_Inf5|1
ModelType1 = $mdl_USA_Inf6|1
ModelType2 = $mdl_USA_Cav3|1
FamilyType0 = $famLeader|1
FamilyType1 = $famLine|2
FamilyType2 = $famCavalry|1
CmdCost = 3
Pillage = 0
RaiseRule = $recCity
Area = $WV
CustomNames = 1st W.Virginia|2nd W.Virginia


In this file, you can edit the contents of the unit you want to create. Be sure to change the unit ID to 1071, or whatever the next unused UID is. Also be sure to change the alias entry to the new name of your brigade. We'll call it 'uni_USA_AmericanBde123' as an example.

Modding the uni_alias.ini file.

Create a new line at the end of the file entry that utilizes the same UID as your unit. For the unit example above, your last line would look like this:

$uni_USA_AmericanBde123 = 1071

Obviously, if you use a different unit alias, this would change.

Save the file.

Modding the '1861 July Campaign.sct' file

Open the file and insert the following command:

Code: Select all

SelectFaction = $USA

SelectFaction = $USA
StartEvent = evt_nam_USA_New Troops|1|0|NULL|NULL|NULL|NULL

Conditions
  FixedDate = 1861/07/16

Actions
  ChangeUnitPool = $uni_USA_AmericanBde123;20

EndEvent


You can change the trigger date to whatever you want, but remember that events do not fire on the first turn. So, you need to trigger the event to occur on a subsequent turn. Also, unless you add a string entry into the local strings.csv file, your event name won't show up properly, it will just read "evt_nam_USA_New Troops" in the event window.

In short, thats the way I do it. I'm still learning the csv splitter stuff, but the procedure I outlined above will accomplish the same thing in about 5 minutes of editing.

Posted: Fri Jun 29, 2007 8:50 pm
by Primasprit
Hi wiltaz!

wiltaz wrote:[...]If I add a new unit, update the unit alias list and
modify the early force pool inc file I still don't see the new unit on the reinforcement screen. If I take an existing unit that shows up on the reinforcement screen and modifiy it's attribute to match what I want for the unit, then the changes show for that unit except the number in the force pool stays the original number, not the new values I put in the force pool file and the unit file. [...]

The game does not read from the [font="Courier New"]EarlyForcePool.inc[/font] while you play the scenario. This file is only needed if you create a new scenario and the information from that file is saved in the scenario file. This is the reason why your changes had no effect. So if you want to change the numbers of reinforcements without creating a new scenario you have to modify the event file as Stonewall described.

wiltaz wrote:[...] I tried using the excel file for the early pool and making the changes and exporting the csv. Then using the csv splitter program to make the data file, but I get errors on the first line of the csv which isn't even a row I modified. Just to see it work I took the excel file, exported it and loaded it with the csv splitter and it errored out without me changing anything. So I gave up on that. [...]

A csv-file can have different formats. The one you need for the CSV-Splitter is: Field delimiter semicolon and no text delimiter.
Take a look to your csv: It should look like this:

Code: Select all

CSA;NULL;ChangeUnitPool;$uni_CSA_Bde1VA|6;NULL;NULL;NULL;NULL;NULL;NULL
CSA;NULL;ChangeUnitPool;$uni_CSA_Bde2TN|8;NULL;NULL;NULL;NULL;NULL;NULL
CSA;NULL;ChangeUnitPool;$uni_CSA_Bde3NC|6;NULL;NULL;NULL;NULL;NULL;NULL
CSA;NULL;ChangeUnitPool;$uni_CSA_Bde3MS|4;NULL;NULL;NULL;NULL;NULL;NULL


while this would be wrong:

Code: Select all

"CSA","NULL","ChangeUnitPool","$uni_CSA_Bde1VA|6","NULL","NULL","NULL","NULL","NULL","NULL"
"CSA","NULL","ChangeUnitPool","$uni_CSA_Bde2TN|8","NULL","NULL","NULL","NULL","NULL","NULL"
"CSA","NULL","ChangeUnitPool","$uni_CSA_Bde3NC|6","NULL","NULL","NULL","NULL","NULL","NULL"
"CSA","NULL","ChangeUnitPool","$uni_CSA_Bde3MS|4","NULL","NULL","NULL","NULL","NULL","NULL"


With Open Office you can edit the output filter settings very easily, with Excel it is a bit more complicated (http://www.ageod-forum.com/showpost.php?p=30844&postcount=18).


Cheers
Norbert

Posted: Fri Jun 29, 2007 9:10 pm
by wiltaz
Thanks for all the info. My unit changes were correct, what I was doing wrong was modifying the force pool file and not using the events. I did some testing with events and changed a current unit's pool value and added a new unit to the list. So that works great.

But as noted events don't fire on turn 1. So how do you modify the starting list of units on the reinforcement tabs of a current scenario? Where is that data stored?

As for the csv splitter I will take a look at what format excel is exporting with.

Thanks again.

Posted: Sat Jun 30, 2007 11:03 pm
by Primasprit
wiltaz wrote:[...]But as noted events don't fire on turn 1. So how do you modify the starting list of units on the reinforcement tabs of a current scenario? [...]

Take a look here: http://www.ageod-forum.com/showpost.php?p=30711&postcount=16

It describes how to create a new scenario. In this example the cities.inc is modified, but of course the procedure to change the force pool.inc is similar.
I hope this helps, if something is not clear just ask again.

Cheers
Norbert