Cossacks 3 Mod Innitiative Group C3MIG
Cossacks 3 Mod Innitiative Group C3MIG
September 21, 2016
Kiergath Sep 23, 2016 @ 1:53pm
Adding units
For the turkish archer, specifically:

In data\scripts\lib\country.script
if (tur) then _country_AddMember(country, 'archertur', ind, True, gc_country_editorplace_category_infantry, 26, gc_ai_unit_archer);
assigns him to the country's unit list in the game and the editor. Searching for
" if (alg) then _country_AddMember(country, 'archer', ind, True, gc_country_editorplace_category_infantry, 28, gc_ai_unit_archer);
" will get you to the same place the rest of the units are assigned.

_country_AddFixedProduceWithAccessControl(country, fixedproduceind, member, 'archertur', 3, 0, ind, '', '', '');
under " member := csid+'bar'; " - which should be the list of units for the 17c barracks - should add him into the barracks in slot 3 (the empty row between the janissary musketeer and the drummer).

Finally, if you search for
" _country_ClearOfficerFormations(country); "

you can add the archertur to the rest of the possible Turkish formations, and it should work.

* You may also need to remove a line that adds the "archertur" specifically to the Turks in the editor - I don't know how the game will react to the same unit being enabled twice.

* * As a note, to anyone from GSC - if you want the above gone, say the word and I'll delete it. I'm planning to take it down as soon as we have a different example available.

______________________Below is literally nothing but a glorified scratchpad_____

I've been looking through the files to see what might be involved in adding units - started out by searching for instances of "musketeer18pru" in the file contents, figured it would give us an idea of where to start.

The following files returned hits for that unit:


section.begin {refurl=.\data\actors\ref\}
ShaderLODList.List[0].ShaderID = 18
ShaderLODList.List[0].ShaderIDIM = 11
Animations.LoadFromFile = .\data\animations\aaf\musketeer18pru.aaf
ActorList.Items[0].Name = musketeer18pru.mesh
ActorList.Items[0].LODList.Items[0].MeshObjects.LoadFromFile = .\data\actors\units\musketeer18pru.oss

Appears to reference the animations used, mesh, and textures?

#2. acl.lib

#3. actors.lib

#4. units.txt

#5. unit.script

This contains the stats of the unit, nested within the parent unit type (in this case the generic 18c musketeer). 'Unique' units by default share all stats with the parent, except as specifically overridden.

#6. country.script

Line 1056: This section appears to dictate the upgrades available for the unit in question.
Line 1793/94 : Appears to set whether or not the unit can be included into formations and with what officers/drummers.
Line 1932: Appears to dictate whether the unit appears in the editor and where.
Line 2236: "ba2" (18c Barracks) unit list, adding the unit to the production list, specifying where on the UI it appears, what its requirements are.

Section beginning at Line 2291; Appears to be section categorizing units - Prussian 18c musketeer appears at following lines:
2348 (sarrUnitsAll)
2396 (sarrUnitsShooters)
2441 (sarrUnitsBayonet)

Line 2690: Not actually related to training of the unit itself - section on an academy upgrade related to the unit gated behind the 18c research. (Flintlocks?)
Last edited by Kiergath; Sep 23, 2016 @ 5:53pm
< >
Showing 1-9 of 9 comments
Kiergath Sep 23, 2016 @ 5:16pm 
Minor update: Nothing major since its already half in the game, but I added non-mercenary Turkish archers to the Ottomans.

Randy Bobandy Sep 26, 2016 @ 2:02pm 
Originally posted by Kiergath:
Minor update: Nothing major since its already half in the game, but I added non-mercenary Turkish archers to the Ottomans.

Good work. i have seen this unused unit in the editor and wanted to do the same. Thx for your help.
[503] A. Soldier Sep 27, 2016 @ 4:31am 
Anyone got any idea on where the train time for a unit is?
Kiergath Sep 27, 2016 @ 10:43am 
I don't have time to look through things too much at the moment, but could


be it in unit.script?

Looking at the relative values for "mus" subtypes, the second numerical value looks like it could be build time.
Last edited by Kiergath; Sep 27, 2016 @ 10:48am
Ebel Sep 27, 2016 @ 8:36pm 
You are right Kiergath.

Training time/Building Time: (unit.script)

1. Buildings:

1.1 Most buildings use:
procedure SetObjBuildingExtProperties(var objprop : TObjProp; var objbase : TObjBase; maxhp, buildtime, costpercent : Integer; bcapture : Boolean; score, usage : Integer; food, wood, stone, gold, iron, coal : Integer);

E.g. for the Townhall:
SetObjBuildingExtProperties(objprop, objbase, 4000, 500, 300, True, 1000, gc_obj_usage_center, 0, 700, 700, 0, 0, 0);

Build Time is 500.

1.2 Some buildings use:
procedure SetObjBuildingProperties(var objprop : TObjProp; var objbase : TObjBase; maxhp, buildtime, costpercent : Integer);

Eg, for the blockhouse: (misblg)

SetObjBuildingProperties(objprop, objbase, 10000, 4500, 300);

Build Time is 4500.

2. Units : bit different:
procedure SetObjBaseSearchBuildVisionScore(var objprop : TObjProp; var objbase : TObjBase; searchradius, buildtime, vision, score : Integer);

Eg, for the peasant:

SetObjBaseSearchBuildVisionScore(objprop, objbase, 200, 400, 1, 20);

Training time is 400.
[503] A. Soldier Sep 28, 2016 @ 1:06am 
Yeah General WVPM helped me figure it out but I forgot to say it here.

Currently experimenting with Towers shooting through walls.
Randy Bobandy Sep 29, 2016 @ 2:11pm 
I play arround with the unit models at the moment. It is awesome. I plan to add the "Potsdam Giants" as a unit for Prussia. ^^
Good evening. Thanks for the tutorial. I have a problem that blocks me. I am trying to add for the officer18th the recruitment of a new unit.

I tried several solutions, none works.

-I tried on this line by adding at the end my unit
"AddOfficersFormationInfExt (country, ind, 'officer18', 'drummer18', 'pikeman18', ... 'jagerswi', 'musketeer18fra');"
but it's crashing.

Same for this line.
"AddOfficersFormationInfExt (country, ind, 'musketeer18fra', 0);"

thank you for helping me
Hello it would be nice to answer me ... Thank you:steamfacepalm:
< >
Showing 1-9 of 9 comments
Per page: 15 30 50