Page 1 of 1

Help with a mod please

Posted: Tue Feb 17, 2009 3:29 pm
by Redeemer
I was wondering if someone could help me make a simple mod. If you could show me the steps that I need to do (in detail please) so I can see how it is done and learn from it. I know this may be asking alot and all I have to offer is my appreciation. Thanks in advance!

Fort Creation. I would like to change how forts are created.

Requirements changed to 1 infantry (by itself, any type), 2 artillery (any type), 10 WS, and a engineer unit must be present, but is not used up. In return you get level 1 fort, 1 garrison, 1 fortress battery. Would also like to increase the time required to 30 days. Also, would like to change where forts can be created so they can be built in emply regions.

Comments welcome!

Posted: Tue Feb 17, 2009 3:37 pm
by lodilefty
Redeemer wrote:I was wondering if someone could help me make a simple mod. If you could show me the steps that I need to do (in detail please) so I can see how it is done and learn from it. I know this may be asking alot and all I have to offer is my appreciation. Thanks in advance!

Fort Creation. I would like to change how forts are created.

Requirements changed to 1 infantry (by itself, any type), 2 artillery (any type), 10 WS, and a engineer unit must be present, but is not used up. In return you get level 1 fort, 1 garrison, 1 fortress battery. Would also like to increase the time required to 30 days. Also, would like to change where forts can be created so they can be built in emply regions.

Comments welcome!


AFAIK, all of these except the last [where built] are engine code changes and thus not moddable.


To build in empty regions, open 1Fort.str found in \AACW\GameData\Structures and delete the line that says [color="Red"]MinCityLvl = 1[/color]

Posted: Tue Feb 17, 2009 3:45 pm
by Redeemer
Heh! well that was a none starter. I assume that is because of the "button" you need to push for fort creation. Could I design an event that would be associated with the create fort function that would spawn a garrison and fort battery?

Posted: Wed Feb 18, 2009 10:54 am
by Pocus
You can change the unit usage though:
ModelType0 = $Artillery
UnitCost0 = 2
ModelType1 = $SupplyType
UnitCost1 = 2

As for adding back the used up units by script, you can't do that directly. What you can do is to tweak the auto-garrison rule so that an empty fort get a garrison unit made of one regiment and a battery though...

Posted: Wed Feb 18, 2009 1:46 pm
by lodilefty
Pocus wrote:You can change the unit usage though:
ModelType0 = $Artillery
UnitCost0 = 2
ModelType1 = $SupplyType
UnitCost1 = 2

As for adding back the used up units by script, you can't do that directly. What you can do is to tweak the auto-garrison rule so that an empty fort get a garrison unit made of one regiment and a battery though...


Are we limited to two model types?

Posted: Wed Feb 18, 2009 9:22 pm
by Redeemer
Pocus wrote:You can change the unit usage though:
ModelType0 = $Artillery
UnitCost0 = 2
ModelType1 = $SupplyType
UnitCost1 = 2

As for adding back the used up units by script, you can't do that directly. What you can do is to tweak the auto-garrison rule so that an empty fort get a garrison unit made of one regiment and a battery though...


An in which file is that located? Thanks!

Posted: Wed Feb 18, 2009 9:34 pm
by lodilefty
ACW\GameData\Structures\1Fort.str

Posted: Thu Feb 19, 2009 2:18 am
by Redeemer
Doh! didn't realize it was in the same one. So if I change that in notepad (stupid question) I don't have to do anything with the CSVSplitter right? That is only for the DB files.

Other assumptions - Daycost is the days for completion. I think I have MoneyCost figured out :thumbsup: Can I add a conscript and WS cost? or can I only modify the numbers in the code present?

Last question - what does BuildLevel = 2 represent?

Posted: Thu Feb 19, 2009 9:20 pm
by Redeemer
Pocus,

I'm having trouble finding the auto-garrison rule... The closest I could find was the event for garrisoning the coast forts after capture.

SelectFaction = $CSA
StartEvent = evt_nam_CSA_CaptureFtPickens|1|0|NULL|NULL|NULL|NULL

Conditions
MinDate = 1861/06/01

EvalRgnOwned = $Ft Pickens, FL

Actions
DescEvent = evt_desc_CSA_CaptureFtPickens

SelectRegion = $Ft Pickens, FL

SelectFaction = $CSA
SelectRegion = $Ft Pickens, FL
CreateGroup
Posture = $Defensive
SetKind = $Land
Entranch = 4
InCS = 1
FixType = 999
SetName = Ft Pickens Garrison
Apply
CreateUnit
SetType = $uni_CSA_Gar1
FlavorName = Col. A. Yates
SUFlavorName = Pickens Garrison|Pickens Ward|Pickens Def.
SetName = Pickens Garrison
Apply

EndEvent

Posted: Thu Feb 19, 2009 9:23 pm
by Redeemer
This would be my new 1fort.str file (not tested yet) I just need to figure out how to garrison the new forts with a 2 regiment garrison and fort batteries.

UID = 1
Name = $stc_nam_Fort
Text = $stc_txt_Fort
Bitmap = Fort.png
Z = 2
IsFort = 1
IsCityScape = 1
Supply = 10
FillAmmo = 1
NoRazeLevel = 2

MoneyCost = 10
Conscriptcost = 5
WarSupplyCost = 10
DayCost = 35

ModelType0 = $Militia
UnitCost0 = 1
ModelType1 = $Artillery
UnitCost1 = 2
BuildLevel = 2

RecoverRate = 10
RecovUseLevel = 0
RecovKind = $Land

RplMinLevel = 1


SupplyProd = 0
AmmoProd = 0
PowerProd = 0
SupplyWant = 50
AmmoWant = 35
PowerWant = 0
MinLevelSend = 1
MinLevelWant = 1

MaxLevel = 2

Posted: Fri Feb 20, 2009 5:33 am
by Redeemer
Building of fort works. 1 militia and 2 artillery plus 10 money, 5 conscripts, 10 WS. Adjusted the supply settings back to a normal fort. There is a report generated when the fort is completed. I wonder if the garrison/battery generation could be tied to that.

UID = 1
Name = $stc_nam_Fort
Text = $stc_txt_Fort
Bitmap = Fort.png
Z = 2
IsFort = 1
IsCityScape = 1
Supply = 10
FillAmmo = 1
NoRazeLevel = 2

MoneyCost = 10
Conscriptcost = 5
WarSupplyCost = 10
DayCost = 35

ModelType0 = $Militia
UnitCost0 = 1
ModelType1 = $Artillery
UnitCost1 = 2
BuildLevel = 2

RecoverRate = 10
RecovUseLevel = 0
RecovKind = $Land

RplMinLevel = 1

SupplyProd = 2
AmmoProd = 0
PowerProd = 0
SupplyWant = 20
AmmoWant = 20
PowerWant = 0
MinLevelSend = 10
MinLevelWant = 1

MaxLevel = 2

Posted: Sun Feb 22, 2009 8:42 pm
by Redeemer
I tried the AddGarrison command in events, but it didn't seem to work. Any suggestion? Format used is below added to the various events script.

SelectFaction = $CSA
StartEvent = Auto_Garrison|999|0|NULL|NULL|NULL|NULL

Conditions
MinDate = 1861/08/01

Actions

AddGarrison = $CT;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $CT;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $NY;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NY;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $PA;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $PA;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $MD;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MD;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $NJ;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NJ;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $DE;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $DE;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $OH;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $OH;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $MI;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MI;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $WV;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $WV;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $IN;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IN;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $IL;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IL;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $IA;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IA;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $MO;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MO;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $KS;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $KS;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $KY;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $KY;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $VA;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $VA;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $NC;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NC;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $SC;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $SC;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $GA;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $GA;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $FL;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $FL;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $AL;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $AL;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $MS;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MS;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $LA;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $LA;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $TN;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $TN;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $AR;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $AR;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $TX;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $TX;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

AddGarrison = $IT;1;$mdl_CSA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IT;1;$mdl_CSA_Inf10;100;NULL;NULL;NULL;NULL

EndEvent

SelectFaction = $USA
StartEvent = Auto_Garrison|999|0|NULL|NULL|NULL|NULL

Conditions
MinDate = 1861/08/01

Actions

AddGarrison = $CT;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $CT;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $NY;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NY;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $PA;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $PA;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $MD;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MD;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $NJ;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NJ;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $DE;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $DE;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $OH;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $OH;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $MI;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MI;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $WV;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $WV;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $IN;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IN;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $IL;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IL;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $IA;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IA;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $MO;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MO;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $KS;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $KS;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $KY;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $KY;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $VA;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $VA;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $NC;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $NC;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $SC;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $SC;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $GA;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $GA;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $FL;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $FL;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $AL;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $AL;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $MS;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $MS;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $LA;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $LA;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $TN;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $TN;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $AR;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $AR;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $TX;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $TX;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

AddGarrison = $IT;1;$mdl_USA_Bty;100;NULL;NULL;NULL;NULL
AddGarrison = $IT;1;$mdl_USA_Inf5;100;NULL;NULL;NULL;NULL

EndEvent