-
Notifications
You must be signed in to change notification settings - Fork 5
Defaults Changes
Defaults is special component, that preinstalled on mech and cannot be removed but in difference from FixedComponents in vanila it can be replaced with same category modules. Also can be used as sort of placehoder for component or for some other utilitary needs. For example Linked customcomponent use defaults as own parts in other locations. Default components cannot be removed, installed directly, or obtained from salvage/shop/mech disassemble. Also they autorepaired for free(but cost of this repair can be part of repair main components).
To set component as default you need use Flags Custom
"Flags" : [ "default" ]
Also for placeholder that should be replaced with actual item (for example armor slot placeholder) you can also use flag "invalid"
"Flags" : [ "default", "invalid" ]
Main change from cc 1.0
- defaults now strictly tied to category and used only if category have set limits
- declaration may contain any ammount of defaults in any location, mech get only defaults that can fit(for example quad mech have 4 legs while normal mech 2 so defaults for leg actuator can contain all 4 actuators for any mech but only 2 in legs will be used for normal mech, while 2 in arms will be ignored cose cannot be installed there)
- which set of defaults mech receive depend of it unit type or mech
- defaults can have now several categories(this only depend on mech)
Defaults will be used in order
- Any MultiCategory Default that fit
- First exists default declaration in 2.1. Defaults from Chassis 2.2. Defaults from CategoryDefaults.UnitTypes 2.3. Defaults from CategoryDefaults.Defaults
if you dont want use any defults for mech/unittype declare empty list of defaults for it
{
"CategoryID" : "<Category>",
"Defaults" : [ // this defaults will be used for any mech that dont fit in any declared unittype or dont have personal set of defaults
{ "Location" : "<Location>", "DefID" : "<Default item ID>", "Type" : "<ComponentType>" }
...
],
"UnitTypes" : [ //Declarations for specific unit type
{
"UnitType" : "<Some unit type>",
"Defaults" : [ <list of defaults there> ]
},
...
]
}
This ChassisDef custom used to set personal defaults for mech. Any Category that not in this list will be taken from Defaults declarations from unittypes. If you want remove all defaults for category - use record with this "CategoryID" and empty "Defaults" list
"ChassisDefaults" : [
{
"CategoryID" : "<category>",
"Defaults" : [ <list of defaults there> ]
},
...
]
This ChassiDef custom allow set multicategory defaults for Mech. It not affect single category defaults for it. You can set few defaults with diferent set of overlaping categories - all be used in order in list when can fit. For example look into chassisdef_atlas_AS7-D_CCT.json declaration in test files - it declare one triple category custom and three double category custom(for single category defaults from defaults/defaults_test.json will be used) which on replace of single category with actual item replace other two with one double category default. while chassisdef_warhammer_WHM-7A_CCT.json, which dont have double category defaults put 2 single category on its place.
"Custom" : {
"MultiDefaults" : [
{
"Location" : "<Locatiom>",
"DefID" : "<Item ID>",
"ComponentType" : "<ComponentType>",
"Categories" : [ "Category1", "Category2", ... ]
},
...
]
},
Category settings
{
"Name" : "TestCategory1",
"DisplayName" : "First Test Category",
"AutoReplace" : true,
"AddCategoryToDescription" : true,
"AllowMixTags" : true,
"AllowMaxOverflow" : false,
"BaseLimits" : [
{ "Location" : "RightTorso", "Min" : 2, "Max" : 2 },
{ "Location" : "LeftTorso", "Min" : 2, "Max" : 2 }
],
"DefaultCustoms" : {
"Sorter" : 0,
"AllowedLocations" : { "Tag" : "TestCategory1" }
},
"UnitLimits" : [
{
"UnitType" : "LightMech",
"Limits" : [
{ "Location" : "RightTorso", "Min" : 1, "Max" : 1 },
{ "Location" : "LeftTorso", "Min" : 1, "Max" : 1 },
{ "Location" : "CenterTorso", "Min" : 1, "Max" : 1 }
]
},
{
"UnitType" : "AssaultMech",
"Limits" : [
{ "Location" : "RightTorso", "Min" : 3, "Max" : 3 },
{ "Location" : "LeftTorso", "Min" : 3, "Max" : 3 }
]
}
]
}
This settings set limits to
- 3 items in LT, RT for Assault Mech
- 1 items in LT, RT, CT for light mech
- 2 items in LT, RT for all other mech
Defaults settings
{
"CategoryID" : "TestCategory1",
"Defaults" : [
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
],
"UnitTypes" : [
{
"UnitType" : "LightMech",
"Defaults" : [
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "CenterTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
],
}
]
},
- 1 TestGear_Default_1slot in CT,RT,LT for light mech
- 3 TestGear_Default_1slot in RT,LT for all other mech
Cose medium/heavy Mech have only 2 avaliable slots in each sidetorso for defaults - they receive only first 2 of this defaults in each of torso parts. while Assault will get all 3 of them. Actually Light mech dont need independent record - his "unique" ct slot can be placed in main list too, but will used only if mech able to equip it, i.e. only on LighMech. But for optimisation reasons (mod logic check full defaults list each time when need to adjust defaults) it can be moved to separate definition, so less items to check for each mech (3 vs 7 for lights and 6 vs 7 for others)
another variant for same category
{
"CategoryID" : "TestCategory1",
"Defaults" : [
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_3slot", "Type" : "Upgrade" },
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_2slot", "Type" : "Upgrade" },
{ "Location" : "RightTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_3slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_2slot", "Type" : "Upgrade" },
{ "Location" : "LeftTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
{ "Location" : "CenterTorso", "DefID" : "TestGear_Default_1slot", "Type" : "Upgrade" },
]
},
- TestGear_Default_3slot, TestGear_Default_2slot, TestGear_Default_1slot items in RT, LT (this is items with weight 3,2,1 - one big slot that consume all 3 or 2 avaliable slots)
- TestGear_Default_1slot in CT
so when mech have 3 free slots in side torso(assault with no items installed) it will ocupied with single 3 slot item TestGear_Default_3slot
when mech have 2 free slots in side torso(assault with one item installed or heavy/medium mech) it will occupied by single 2 slot item TestGear_Default_2slot
and when have mech have only 1 free slot - it will be occupied by TestGear_Default_1slot
also lights will receive their slot in ct too
Main problem there - Define right unit types. Old tagged defaults should go into UnitTypes while Untagged defaults should go in Defaults directly
As example i take current RogueTech settings for Armor. They ditributed over different files in "RoguetechCore/defaults" folder. Also big problem - i cannot even say priority of tags. for example. what armor receive Clan LAM? standart(c) or alluminium lam? what if we need some separete Alluminium(C) for clan Lam?
Old settings
{ "Tag": "ClanMech", "CategoryID": "Armor", "Type": "Upgrade", "DefID": "emod_armorslots_clstandard", "Location": "CenterTorso" },
{ "Tag": "IndustrialMech", "CategoryID": "Armor", "Type": "Upgrade", "DefID": "default_armor_industrial", "Location": "CenterTorso", "AddIfNotPresent": true },
{ "Tag": "Primitive", "CategoryID": "Armor", "Type": "Upgrade", "DefID": "Gear_armorslots_Primitive", "Location": "CenterTorso", "AddIfNotPresent": true },
{ "Tag": "LandAirMech", "CategoryID": "Armor", "Type": "Upgrade", "DefID": "LAM_Aluminium_Default", "Location": "CenterTorso", "AddIfNotPresent": true },
{ "CategoryID" : "Armor", "Type" : "Upgrade", "DefID" : "emod_armorslots_standard", "Location" : "CenterTorso" },
we have tags ClanMech, IndustrialMech, Primitive, LandAirMech. lets define UnitTypes for them first
UnitTypes
order dont pay any effect there
UnitTypes" : [
{ "Name" : "ClanMech", "RequiredTags" : [ "ClanMech", "unit_mech" ] },
{ "Name" : "ClanLandAirMech", "RequiredTags" : [ "ClanMech", "LandAirMech", "unit_mech" ] },
{ "Name" : "IndustrialMech", "RequiredTags" : [ "IndustrialMech", "unit_mech" ] },
{ "Name" : "PrimitiveMech", "RequiredTags" : [ "Primitive", "unit_mech" ] },
{ "Name" : "LandAirMech", "RequiredTags" : [ "LandAirMech", "unit_mech" ] },
]
at last defaults file for armor where lam have priority over clan
Defaults
{
"CategoryID" : "Armor",
"Defaults" : [ { "Location" : "CenterTorso", "DefID" : "emod_armorslots_standard", "Type" : "Upgrade" } ],
"UnitTypes" : [
{ "UnitType" : "LandAirMech", "Defaults" : [ { "Location" : "CenterTorso", "DefID" : "LAM_Aluminium_Default", "Type" : "Upgrade" } ] },
{ "UnitType" : "ClanMech", "Defaults" : [ { "Location" : "CenterTorso", "DefID" : "emod_armorslots_clstandard", "Type" : "Upgrade" } ] },
{ "UnitType" : "IndustrialMech", "Defaults" : [ { "Location" : "CenterTorso", "DefID" : "default_armor_industrial", "Type" : "Upgrade" } ] },
{ "UnitType" : "PrimitiveMech", "Defaults" : [ { "Location" : "CenterTorso", "DefID" : "Gear_armorslots_Primitive", "Type" : "Upgrade" } ] }
]
}
And if you need separate armor for clan lam - you can insert ClanLandAirMech record before LandAirMech
By using mech based category limits and defaults possible to made defaults that used only by this mech, while other can use it free. For example prototype ECM equipment on Raven RVN-X1
category declaraion for ECM - max 1 in any location
{
"Name" : "ECM",
"BaseLimits" : [ { "Location" : "All", "Max" : 1 } ],
}
Custom block in chassis def that override min value and set gear_ecm_prototype as default
"Custom" : {
"ChassisCategory" :
{
"CategoryID" : "ECM",
"Limits" : [{ "Location" : "All", "Min" : 1, "Max" : 1 }]
},
"ChassisDefaults" : {
"CategoryID" : "ECM",
"Defaults" : [ { "Location" : "RightTorso", "DefID" : "gear_ecm_prototype", "Type" : "Upgrade" } ]
}
}
leg actuator in one piece(mech should have all single category actuators in case partialy replay this. they can be defined "normal" way in defaults or chassis defaults)
"Custom" : {
"MultiDefaults" : [
{
"Location" : "LeftLeg",
"DefID" : "gear_legactuator_single",
"ComponentType" : "Upgrafe",
"Categories" : [ "LegActuatorUpper", "LegActuatorLower", "LegActuatorHip", "LegActuatorFoot" ]
},
{
"Location" : "RightLeg",
"DefID" : "gear_legactuator_single",
"ComponentType" : "Upgrafe",
"Categories" : [ "LegActuatorUpper", "LegActuatorLower", "LegActuatorHip", "LegActuatorFoot" ]
},
...
]
},
Now we implement ArmActuators in RT way, so rules
- Each Mech should have at least shoulder and upper actuator in each hand
- Each Mech can have optional Hand/Lower actuator based on chassis limits
- For omni mech Lower/Hand is optional module of OmniPodLower/OmniPodHand category
- For non omni mech Lower/Hand always should exists if chassis allow it
for first rule we can use simple categories and defaults
Json
[
{
"Name" : "ArmShoulder",
"DisplayName" : "Shoulder actuator",
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 1, "Min" : 1 }
{ "Location" : "RightArm", "Max" : 1, "Min" : 1 }
]
},
{
"Name" : "ArmUpper",
"DisplayName" : "Upper arm actuator",
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 1, "Min" : 1 }
{ "Location" : "RightArm", "Max" : 1, "Min" : 1 }
]
}
]
[
{
"CategoryID" : "ArmShoulder",
"Defaults" : [
{ "Location" : "LeftArm", "DefID" : "gear_arm_shoulder", "Type" : "Upgrade" }
{ "Location" : "RightArm", "DefID" : "gear_arm_shoulder", "Type" : "Upgrade"}
]
},
{
"CategoryID" : "ArmUpper",
"Defaults" : [
{ "Location" : "LeftArm", "DefID" : "gear_arm_upper", "Type" : "Upgrade" }
{ "Location" : "RightArm", "DefID" : "gear_arm_upper", "Type" : "Upgrade"}
]
}
]
For lower and upper we use unit types. by default mech allow to have full arm actuators. so we need 8 additional unit types
ArmLimitLeft_Lower, ArmLimitRight_Lower, ArmLimitLeft_Upper, ArmLimitRight_Upper
ArmLimitLeftOmni_Lower, ArmLimitRightOmni_Lower, ArmLimitLeftOmni_Upper, ArmLimitRightOmni_Upper
we can add this unit types on mech using "UnitTypeAdd" custom Like
"UnitTypeAdd" : ["ArmLimitLeft_Lower", ArmLimitRight_Upper]
"UnitTypeAdd" : ["ArmLimitRightOmni_Lower", "ArmLimitLeftOmni_Lower"]
For categories we use two set of categories - one will define visuals and stats(like crit effects) second - limits for each arm
First Set
[
{
"Name" : "ArmLower",
"DisplayName" : "Lower arm actuator",
"DefaultCustoms" : {
"Category" : [
{ "CategoryID" : "ArmLower_Left" },
{ "CategoryID" : "ArmLower_Right" },
]
}
},
{
"Name" : "ArmHand",
"DisplayName" : "Hand actuator",
"DefaultCustoms" : {
"Category" : [
{ "CategoryID" : "ArmHand_Left" },
{ "CategoryID" : "ArmHand_Right" },
]
}
},
{
"Name" : "ArmLowerOmni",
"DisplayName" : "Lower arm OmniPod",
"DefaultCustoms" : {
"Category" : [
{ "CategoryID" : "ArmLowerOmni_Left" },
{ "CategoryID" : "ArmLowerOmni_Right" },
]
}
},
{
"Name" : "ArmHandOmni",
"DisplayName" : "Hand OmniPod",
"DefaultCustoms" : {
"Category" : [
{ "CategoryID" : "ArmHandOmni_Left" },
{ "CategoryID" : "ArmHandOmni_Right" },
]
}
}
]
Second set for non Omni
[
{
"Name" : "ArmLower_Left",
"AddCategoryToDescription" : false,
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 1, "Min" : 1 }
],
"UnitLimits" : [
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitLeft_Upper",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
}
]
},
{
"Name" : "ArmLower_Right",
"AddCategoryToDescription" : false,
"BaseLimits" : [
{ "Location" : "RightArm", "Max" : 1, "Min" : 1 }
],
"UnitLimits" : [
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitRight_Upper",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
}
]
},
{
"Name" : "ArmHand_Left",
"AddCategoryToDescription" : false,
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 1, "Min" : 1 }
],
"UnitLimits" : [
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitLeft_Lower",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitLeft_Upper",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
}
]
},
{
"Name" : "ArmHand_Right",
"AddCategoryToDescription" : false,
"BaseLimits" : [
{ "Location" : "RightArm", "Max" : 1, "Min" : 1 }
],
"UnitLimits" : [
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitRight_Upper",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitRight_Lower",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
}
]
},
]
Second set for Omni
[
{
"Name" : "ArmLowerOmni_Left",
"AddCategoryToDescription" : false,
"ReplaceDefaultsFirst" : false,
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 0, "Min" : 0 }
],
"UnitLimits" : [
{
"UnitType" : "ArmLimitLeftOmni_Upper",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "LeftArm", "Min" : 0, "Max" : 1 } ]
}
]
},
{
"Name" : "ArmLowerOmni_Right",
"AddCategoryToDescription" : false,
"ReplaceDefaultsFirst" : false,
"BaseLimits" : [
{ "Location" : "RightArm", "Max" : 0, "Min" : 0 }
],
"UnitLimits" : [
{
"UnitType" : "ArmLimitRightOmni_Upper",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "RightArm", "Min" : 0, "Max" : 1 } ]
}
]
},
{
"Name" : "ArmHandOmni_Left",
"AddCategoryToDescription" : false,
"ReplaceDefaultsFirst" : false,
"BaseLimits" : [
{ "Location" : "LeftArm", "Max" : 0, "Min" : 0 }
],
"UnitLimits" : [
{
"UnitType" : "ArmLimitLeftOmni_Upper",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitLeftOmni_Lower",
"Limits" : [ { "Location" : "LeftArm", "Max" : 0 } ]
},
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "LeftArm", "Min" : 0, "Max" : 1 } ]
}
]
},
{
"Name" : "ArmHandOmni_Right",
"AddCategoryToDescription" : false,
"ReplaceDefaultsFirst" : false,
"BaseLimits" : [
{ "Location" : "RightArm", "Max" : 0, "Min" : 0 }
],
"UnitLimits" : [
{
"UnitType" : "ArmLimitRightOmni_Upper",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "ArmLimitRightOmni_Lower",
"Limits" : [ { "Location" : "RightArm", "Max" : 0 } ]
},
{
"UnitType" : "Omnimech",
"Limits" : [ { "Location" : "RightArm", "Min" : 0, "Max" : 1 } ]
}
]
}
]
With this you need to define defaults for this "second set" categories. On component itself you can use only "first set" categories.
Omni actuators have "ReplaceDefaultsFirst" : false
and "Min" : 0 - so if default defined it will be used.