User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Modifying and Adding Units

Fri Aug 19, 2016 3:08 pm

Can someone help me with where to start regarding adding and modifying units?


For instance things like this:

1) edit the Union Brigades that have sharpshooters, artillery, or cavalry attached to infantry and make these brigades all infantry.

2) add an elite brigade to either USA/CSA that spawns on its own like the other ones do

3) make a new pure artillery, infantry, or cavalry brigade



I would greatly appreciate the help!

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Fri Aug 19, 2016 9:05 pm

I know there are some other threads that have some of this similar information, just wondering if anyone can boil some of the basics down for me.

dhy
Private
Posts: 25
Joined: Sun Aug 14, 2016 8:50 am

Sat Aug 20, 2016 3:55 am

The events folder has scenarios where units are created and placed. You should make a backup and experiment with the files to learn this stuff. Other than that, the stuff in the models folder and units folder I think should be of interest. Artillery is one I've been trying to tweak and having no luck so far.

Get yourself a decent grepping utility like 'Agent Ransack' because Windows search sucks and so do most other search tools.
http://www.mythicsoft.com/agentransack/download

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Sun Aug 21, 2016 3:55 pm

Ok let me know if anything works out, I know JohanDenver seems to have figure it out for his mod, it would be great to list some basic fundamentals here so we can get a good system for people to use.

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Thu Sep 01, 2016 8:17 pm

Can someone tell me how to edit the recruitment units? I would love to add and edit some units, i.e. replacing cavalry and artillery from the units with infantry and conscripts to allow more flexibility

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Fri Sep 02, 2016 12:40 am

Can someone tell me how to edit the recruitment units?

If you mean the unit composition, most of what you'd be editing is the unit files and replacing/adding/subtracting model file references and the appropriate family.

If you mean the units available in the recruitment panel to build, that's set by scripting in the scenario and associated event files.

Let me know which, if either, of these you mean and I'll share what I know or point you to a resource.

jm

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Fri Sep 02, 2016 4:14 pm

Hey Grimjaw and thanks for responding. I'd like to edit unit composition, as well as be able to create new units and make them recruitable.

I'd also like to make some elite forces that I think are missing for the South and have them appear as events.

I have mastered the entry and editing of generals, but for some reason I am finding the process for units elusive. If you can help with this I'd be very appreciative.

johandenver2
Lieutenant
Posts: 101
Joined: Mon May 09, 2016 9:46 pm

Fri Sep 02, 2016 11:54 pm

To create new recruitable brigades you need to do this:
1. Create a new alias for the unit in \Aliases\uni_Alias.ini and GameData\Units\uni_Alias.ini (it's the same file on two different places)
2. Copy an existing unit file, for example 242USAInfantry Bde (NY).uni located in GameData\Units\ (the name of the new file doesn't really matter)
3. Edit the new file to your liking and make sure to change the first line (UID = 2310) to your new alias number

You can mix different units with the below lines. Just make sure that you don't add any more units than is defined by the number after familytype.
If you put a greater number in familytype it just means that the unit will be able to merge with other units, until the max amount of units is reached.

Code: Select all

ModelType0 = $mdl_USA_Inf5|1
ModelType1 = $mdl_USA_Inf5|1
ModelType2 = $mdl_USA_Inf5|1
ModelType3 = $mdl_USA_Inf6|1
FamilyType0 = $famLeader|1
FamilyType1 = $famLine|4



4. If you want, you can also create new models (like I did with USCT cavalry) and include them in your new unit file (models also need to be added to their respective alias files)
As I see it, the model-files are the different unit types in the game and the unit-files put these different models together. Most often by themselves (as with leaders) but also with brigades.

Most models are also very often depending on CMN-models to get their stats.
If you look at 199USAPioneers.mdl you can see that it does not contain any stats about it's quality, weight, supply etc.
All these values are taken from $mdl_CMN_Pio which is the file called 37CMNPioneers.mdl

5. When the unit's ready you must add a forcepool for the new unit with an event like below.
You can add the event to an existing event file or create your own like I've done.
It's easier to keep track of things if you create your own and just call it from the main scenario event file (in my case 1861 April Campaign.sct)
Look at line 50 in "1861 April Campaign.sct" to see how it's done

Code: Select all

SelectFaction = USA
StartEvent = evt_nam_USA_CWDB_Forcepool_WV64|1|1|NULL|NULL|NULL |NULL

Conditions
FixedDate = 1864/07/01

Actions

ChangeUnitPool = $uni_USA_newbrigade;5

EndEvent



6. To make a unit spawn in the game at a specific time you need to first create it with above steps.
Then you need to add the unit as with the forcepools but instead you create the unit itself with a command like below:

Code: Select all

CreateUnit
SetType = $uni_CSA_Art4VA
FlavorName = Col. G. Gabriel
SUFlavorName = 22nd GA Bty
SetName = Savannah Artillery
Apply



A recommendation is to get a good program with which to search the different textfiles. I use a program called Total Commander which is excellent for this kind of work.
Get it at http://www.ghisler.com/

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sat Sep 03, 2016 12:24 am

If you're going to be working with existing models and recombining them into new units, you should have a pretty easy time of it.

I haven't done any editing lately and I can't remember off the top of my head, but I *think* this is the way it works. Say you have a unit called $unit_CSA_bigdarngun1VA, and you edit the forcepool to contain four of those units. If you then create one of those units via an event rather than the player creating it via recruitment, I *think* it will detract from the forcepool you've defined anyway. I don't have the game near me to test this, but I ran into something like it when I was researching.

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Sat Sep 03, 2016 3:59 am

Thanks guys much appreciated

I guess the part that is eluding me is where the addition of the elite units takes place in the files. For instance, where is the Gamecock Brigade for the CSA, I can find the unit file but not the event that spawns it. I'm looking for this so I can mirror the way it is made.

User avatar
tribeticus
Captain
Posts: 191
Joined: Tue Jan 19, 2016 9:05 pm
Location: Ocean, NJ

Sat Sep 03, 2016 4:55 am

tribeticus wrote:Thanks guys much appreciated

I guess the part that is eluding me is where the addition of the elite units takes place in the files. For instance, where is the Gamecock Brigade for the CSA, I can find the unit file but not the event that spawns it. I'm looking for this so I can mirror the way it is made.




I found them, they are in Various Events...

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Sun Sep 04, 2016 4:29 pm

Is there a way to create a unit that appears if a city is captured? For example, say if Sibley's New Mexico campaign captures Denver or Los Angeles, could I have a unit of volunteers appear? I saw this happen a lot in my vanilla play through.
Image

johandenver2
Lieutenant
Posts: 101
Joined: Mon May 09, 2016 9:46 pm

Sun Sep 04, 2016 5:05 pm

Sorry, I don't know how to do that. Somebody else might :-)

grimjaw
General
Posts: 506
Joined: Wed Feb 09, 2011 5:38 am
Location: Arkansas

Sun Sep 04, 2016 5:06 pm

Is there a way to create a unit that appears if a city is captured?

Yeah, that's fairly simple. You can use an existing event as a template. There are a few events that the Union has that create volunteers if they capture specific regions. Below is the one for Nashville, TN. It's using an EvalRgnVP test as a condition (http://www.ageod.net/agewiki/EvalRgnVP), which isn't quite the same thing as capturing the city. However, I think EvalRgnVP is probably more accurate if you were going to be able to produce volunteers, as it also is a measure of the loyalty of the region.

Code: Select all

SelectFaction = USA
SelectRegion = $Davidson_TN
StartEvent = evt_nam_USA_TennesseeUnionist1|1|1|NULL|NULL|$Davidson_TN|NULL

Conditions
  MinDate = 1861/05/01
  MaxDate = 1863/03/01

EvalRgnVP = $Davidson_TN

Actions
  DescEvent = evt_desc_USA_TennesseeUnionist1

SelectFaction = USA
  CreateGroup
  Posture = $Defensive
  SetKind = $Land
  Entranch = 0
  InCS = 0
  FixType = 0
  SetName = _genName
  Apply
  CreateUnit
  SetType = $uni_USA_VolBde
  FlavorName = Brig.Gen. C.Vaughn
  SUFlavorName = 1st TN Vol.|2nd TN Vol.|Tennessee Rifles
  SetName = 1st TN Volunteer Brigade
  Apply

EndEvent

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Sun Sep 04, 2016 5:45 pm

grimjaw wrote:Is there a way to create a unit that appears if a city is captured?

Yeah, that's fairly simple. You can use an existing event as a template. There are a few events that the Union has that create volunteers if they capture specific regions. Below is the one for Nashville, TN. It's using an EvalRgnVP test as a condition (http://www.ageod.net/agewiki/EvalRgnVP), which isn't quite the same thing as capturing the city. However, I think EvalRgnVP is probably more accurate if you were going to be able to produce volunteers, as it also is a measure of the loyalty of the region.

Code: Select all

SelectFaction = USA
SelectRegion = $Davidson_TN
StartEvent = evt_nam_USA_TennesseeUnionist1|1|1|NULL|NULL|$Davidson_TN|NULL

Conditions
  MinDate = 1861/05/01
  MaxDate = 1863/03/01

EvalRgnVP = $Davidson_TN

Actions
  DescEvent = evt_desc_USA_TennesseeUnionist1

SelectFaction = USA
  CreateGroup
  Posture = $Defensive
  SetKind = $Land
  Entranch = 0
  InCS = 0
  FixType = 0
  SetName = _genName
  Apply
  CreateUnit
  SetType = $uni_USA_VolBde
  FlavorName = Brig.Gen. C.Vaughn
  SUFlavorName = 1st TN Vol.|2nd TN Vol.|Tennessee Rifles
  SetName = 1st TN Volunteer Brigade
  Apply

EndEvent


Thank you! This helped a lot.
Image

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Sun Sep 04, 2016 6:07 pm

Did I do something wrong? It's not spawning the brigade after I capture South Park. I use copperheads since the loyalty there is 55 percent Confederate. Here's what I did:

SelectFaction = CSA
SelectRegion = $South_Park_CO
StartEvent = evt_nam_CSA_ColoradoSouthernSympathizers1|1|1|NULL|NULL|$South_Park_CO|NULL

Conditions
MinDate = 1861/05/01
MaxDate = 1864/03/01

EvalRgnVP = $South_Park_CO

Actions
DescEvent = evt_desc_CSA_ColoradoSouthernSympathizers1

SelectFaction = CSA
CreateGroup
Posture = $Defensive
SetKind = $Land
Entranch = 0
InCS = 0
FixType = 0
SetName = _genName
Apply
CreateUnit
SetType = $uni_CSA_VolBde
FlavorName = Col. W. Scurry
SUFlavorName = 1st CO Vol.|2nd CO Vol.|Colorado Miners
SetName = 1st CO Volunteer Brigade
Apply

EndEvent
Image

Teatime
Lieutenant
Posts: 132
Joined: Wed Apr 27, 2016 2:56 pm

Mon Sep 05, 2016 3:01 am

Here is an event, which I have tested, to create an MD vol bde if Baltimore is captured

SelectFaction = CSA
SelectRegion = $Baltimore_MD
StartEvent = evt_nam_CSA_MarylandRebels1|1|1|NULL|NULL|$Baltimore_MD|NULL

Conditions
MinDate = 1861/05/01
MaxDate = 1865/03/01

EvalRgnVP = $Baltimore_MD

Actions

SelectFaction = CSA
CreateGroup
Posture = $Defensive
SetKind = $Land
Entranch = 0
InCS = 0
FixType = 0
SetName = Maryland Volunteers
Apply
CreateUnit
SetType = $uni_CSA_VolBde
FlavorName = Col Francis J. Thomas
SUFlavorName = 1st Maryland Vols|2nd Maryland Vols|Baltimore Rifles
SetName = Maryland Volunteers
Apply

EndEvent


Only difference I see is the format of the Setname of the group so you could try changing that

The only other possible reason i can think of is that South Park is only a size 1 town .. but I didn't think that would impact an event .. only if you made it recruitable

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Mon Sep 05, 2016 3:43 am

Teatime wrote:Here is an event, which I have tested, to create an MD vol bde if Baltimore is captured

SelectFaction = CSA
SelectRegion = $Baltimore_MD
StartEvent = evt_nam_CSA_MarylandRebels1|1|1|NULL|NULL|$Baltimore_MD|NULL

Conditions
MinDate = 1861/05/01
MaxDate = 1865/03/01

EvalRgnVP = $Baltimore_MD

Actions

SelectFaction = CSA
CreateGroup
Posture = $Defensive
SetKind = $Land
Entranch = 0
InCS = 0
FixType = 0
SetName = Maryland Volunteers
Apply
CreateUnit
SetType = $uni_CSA_VolBde
FlavorName = Col Francis J. Thomas
SUFlavorName = 1st Maryland Vols|2nd Maryland Vols|Baltimore Rifles
SetName = Maryland Volunteers
Apply

EndEvent


Only difference I see is the format of the Setname of the group so you could try changing that

The only other possible reason i can think of is that South Park is only a size 1 town .. but I didn't think that would impact an event .. only if you made it recruitable


Damn, how can I make those cities recruitable? In the far west all of them except San Francisco (juggernaug of a garrison) are maximum of size 3 cities.
Image

Teatime
Lieutenant
Posts: 132
Joined: Wed Apr 27, 2016 2:56 pm

Mon Sep 05, 2016 8:34 am

Not too hard to do that

in CW2>Gamedata>Units

First you need to find a unit that is not in use .. I think you could probably use one of the units in the 209 to 215 range as I haven't come across anywhere that these are used

If we take 209CSAVolunteersRgt ..

That file is currently (excluding the customnames lines)

UID = 209
NationTag = CSA
Name = Volunteers Rgt
Alias = uni_CSA_Reb1
ShortName = Volunteers
Text = $uni_txt_CSA_VolRgt
Color = $colCSAMilitia
ModelType0 = $mdl_CSA_Reb1|1
FamilyType0 = $famMilitia|1
CmdCost = 1
Pillage = 0
BuildRule = $recCity

You would change that to (assuming you want to be able to build up to 3 of them .. so I have only included 3 custom names)

UID = 209
NationTag = CSA
Name = Volunteers Rgt (CO)
Alias = uni_CSA_Reb1CO
ShortName = Volunteers
Text = $uni_txt_CSA_VolRgt
Color = $colCSAMilitia
ModelType0 = $mdl_CSA_Reb1|1
FamilyType0 = $famMilitia|1
CmdCost = 1
Pillage = 0
BuildRule = $recTown
Area = $CO
Customnames = 1st CO Vols|2nd CO Vols|3rd CO Vols

$recTown means you can build in size 1 towns and above
Area = $CO restricts you to building in Colorado

Last thing to do is go to the events file

CW2>Events

Find the file for your relevant campaign .. e.g. 1861 April Campaign

search that file for evt_nam_CSA_InitialForcePoolMay61

Add a line under actions
ChangeUnitPool = $uni_CSA_Reb1CO;3


So now you can recruit up to 3 Colorado volunteer regiments once you control any size 1 town in Colorado!!

I used this approach to allow the USA to recruit AR, TN and LA regiments once they had a presence there (as they historically did)

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Mon Sep 05, 2016 4:50 pm

Teatime wrote:Not too hard to do that

in CW2>Gamedata>Units

First you need to find a unit that is not in use .. I think you could probably use one of the units in the 209 to 215 range as I haven't come across anywhere that these are used

If we take 209CSAVolunteersRgt ..

That file is currently (excluding the customnames lines)

UID = 209
NationTag = CSA
Name = Volunteers Rgt
Alias = uni_CSA_Reb1
ShortName = Volunteers
Text = $uni_txt_CSA_VolRgt
Color = $colCSAMilitia
ModelType0 = $mdl_CSA_Reb1|1
FamilyType0 = $famMilitia|1
CmdCost = 1
Pillage = 0
BuildRule = $recCity

You would change that to (assuming you want to be able to build up to 3 of them .. so I have only included 3 custom names)

UID = 209
NationTag = CSA
Name = Volunteers Rgt (CO)
Alias = uni_CSA_Reb1CO
ShortName = Volunteers
Text = $uni_txt_CSA_VolRgt
Color = $colCSAMilitia
ModelType0 = $mdl_CSA_Reb1|1
FamilyType0 = $famMilitia|1
CmdCost = 1
Pillage = 0
BuildRule = $recTown
Area = $CO
Customnames = 1st CO Vols|2nd CO Vols|3rd CO Vols

$recTown means you can build in size 1 towns and above
Area = $CO restricts you to building in Colorado

Last thing to do is go to the events file

CW2>Events

Find the file for your relevant campaign .. e.g. 1861 April Campaign

search that file for evt_nam_CSA_InitialForcePoolMay61

Add a line under actions
ChangeUnitPool = $uni_CSA_Reb1CO;3


So now you can recruit up to 3 Colorado volunteer regiments once you control any size 1 town in Colorado!!

I used this approach to allow the USA to recruit AR, TN and LA regiments once they had a presence there (as they historically did)


I did the steps above but it's still not working. It might be easier if I could watch a video on this. Can I contact you via Steam?
Image

Teatime
Lieutenant
Posts: 132
Joined: Wed Apr 27, 2016 2:56 pm

Tue Sep 06, 2016 2:13 am

I have led you astray there James, sorry for that

We need to use the original Alias

Alias = uni_CSA_Reb1 ... do not make it Alias = uni_CSA_Reb1CO

and therefore the unit pool line in the event file needs to be

ChangeUnitPool = $uni_CSA_Reb1;3


I will try to get some time to test this myself in the next couple of days

Did you get the event working??

If this doesn't work for you then I will try to get it working and then set up a session so I can take you through it

User avatar
James W. Starnes
Corporal
Posts: 64
Joined: Thu Jan 28, 2016 12:05 am
Location: TN

Tue Sep 06, 2016 3:33 am

Teatime wrote:I have led you astray there James, sorry for that

We need to use the original Alias

Alias = uni_CSA_Reb1 ... do not make it Alias = uni_CSA_Reb1CO

and therefore the unit pool line in the event file needs to be

ChangeUnitPool = $uni_CSA_Reb1;3


I will try to get some time to test this myself in the next couple of days

Did you get the event working??

If this doesn't work for you then I will try to get it working and then set up a session so I can take you through it


That would be much preferred, thanks a lot Tea.
Image

Return to “CW2 Mods”

Who is online

Users browsing this forum: No registered users and 9 guests