eg.
All/some archers are basically having same movement, bonuses, build places (where they spawn) and so on -> so you can reference the basic archer from the other archer's jsons.
So currently here are the places where there are possiblility to reference other units or dedicated "template" units.
1. trnWalkTerrain
2. trnBonusList
3. all generic unitlist based things (trnRevokerTechs, trnEquivalents, trnRequires, trnBestAgainstMeWater, trnBestAgainstMeGround, trnBuilders, trnModifiers, trnCanNotCarryMe, trnCanCarryThese, trnCanNotCarryThese)
all above places you can use a unit referencing, referencing it as a "template",
here are the cases
trnWalkTerrain
Code: Select all
"rangeWalk":3,
"trnWalkTerrain":[
{"copyFromUnitTerrain":"UNIT_ARCHER"}
],
Full extra:
you can mix the two: use a template and add few more lines (however it will only ADD them not replacing any in template)
Code: Select all
"rangeWalk":3,
"trnWalkTerrain":[
{"copyFromUnit":"UNIT_ARCHER"},
{"terrainType":"TERRAINS_SOMETERRAIN", "modifier":2}
],
trnBonusList
also works for bonuses (that is not a single unitlist but a weighted array of lists)
this case you can combine the template items with new additional items in current json like in example:
Code: Select all
"trnBonusList":[
{"copyFromUnitBonus":"UNIT_ARCHER"},
{"modifier":0.8,"unitList":{"categories":["U_SIEGE_MACHINE"]}}
],
generic unitlist based things
trnRevokerTechs, trnEquivalents, trnRequires, trnBestAgainstMeWater, trnBestAgainstMeGround, trnBuilders, trnModifiers, trnCanNotCarryMe, trnCanCarryThese, trnCanNotCarryThese
in all above cases the referencing looks like this, and the list will be overwrittem by the list in the "template" unit:
Code: Select all
"trnBuilders":{"copyFromUnit":"UNIT_ARCHER"},
Warning!
Templating ONLY usable INSIDE unit jsons!
In These objects you must not use it (might be not complete list, the key is non-unit jsons)
- consts.json - terrainAffects - trnAffectedUnits
- effects jsons - trnSpecCostTypeList
- buildlist.json - buildpriors
- achievements.json - what and withs
...