STEAM GROUP
Cossacks 3 Mod Innitiative Group C3MIG
STEAM GROUP
Cossacks 3 Mod Innitiative Group C3MIG
0
IN-GAME
8
ONLINE
Founded
September 21, 2016
Language
English
Kiergath Sep 23, 2016 @ 1:53pm
Adding units
For the turkish archer, specifically:

In data\scripts\lib\country.script
Adding
"
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.

Adding
"
_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:

#1. musketeer18pru.actor

section.begin {refurl=.\data\actors\ref\refunit.actor}
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
section.end

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

#2. acl.lib

#3. actors.lib

#4. units.txt
Localization.

#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

Contains:
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.

http://steamcommunity.com/sharedfiles/filedetails/?id=768759904

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.

http://steamcommunity.com/sharedfiles/filedetails/?id=768759904

Good work. i have seen this unused unit in the editor and wanted to do the same. Thx for your help.
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

SetObjBaseSearchBuildVisionScore

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.
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. ^^

http://www2.pic-upload.de/img/31798150/new_units.png
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