-
Notifications
You must be signed in to change notification settings - Fork 5
Categories changes
Categories and Defaults handling changed alot in v2.0. There are "shortlist" of changes to adapt old category and defaults files
- Have one new parameter - "Weight" (default 1) which can be used to override "size" of item in category (for example if category accept 3 items in location it can be three items with Weight=1 or one item with Weight=3 or combination of two items with Weight=2 and Weight=1
- Parameter "Tag" have default value
"*"
which ignored in AllowMixTags=false categories(i.e. such category will Accept "Tag1" and"*"
or "Tag2" and"*"
combinations but not "Tag1" and "Tag2") so all variants of category custom will look like
"Category" : [
{ "CategoryID" : "c1" },
{ "CategoryID" : "c2", "Tag" : "tag1" }
{ "CategoryID" : "c3", "Weight" : 2 }
{ "CategoryID" : "c4", "Weight" : 2, "Tag" : "ctag1" }
]
Two main changes
- MaxEqiped/MinEquiped/MaxEquipedPerLocation replaced with new flex Limits.
- Limits can be defined for unit type via CCCategory custom ressource for UnitType or ChassisCategory custom for single mech, this allow use of different limits for units(for example normal mech have 2 leg actuators in legs, quad 4 in legs and arms and vehicle should have any leg actuator at all, but have own separete categories like tracks, wheels or rotor that not present on mech)
##Limit Declaration
Default Values(which basicly dont limit anything):
{ "Location" : "All", "Min" : 0, "Max" : -1 }
To forbid item category on mech this can be used:
{ "Location" : "All", "Max" : 0 }
Location are ChassisLocations enum and can be single location, preset multilocation(like Torso) or comma separeted list of values (like LeftArm, LeftTorso
)
With combination of AllowedLocations property on component and new AllowedLocations custom this allow made very flex settings
For example set of limits that allow max 3 items in torso, but not more then 1 item in each side torso (so allowed combinations will be 1-2-0 or 1-1-1 or 0-3-0 but not 2-1-0)
{ "Location" : "Torso", "Max" : 3 }
{ "Location" : "RightTorso", "Max" : 1 }
{ "Location" : "LeftTorso", "Max" : 1 }
NOTE: this not limit items in other locations, so for example you can install any ammount of this items in leg or arm. This should be limited by "AllowedLocations" : "Torso" on component json;
Mech can have only one limits set per category. Limits will be choose in order:
- From ChassisCategory custom if present
- From Category UnitLimits if mech have any UnitType from it
- From BaseLimits
-
string Name
- Name of category used in json as CategoryID or Category -
string DisplayName = ""
- Display name of category used in game messages, if empty Name will be used -
bool AllowMaxOverflow = false
- Allow put items in mechlab that overflow Max limit for category, still give validation error and should be fixed before accept changes -
bool AllowMinOverflow = true
- Same for Min limit -
bool AllowMixTags = true
- if set to false category items with different tags (except*
) will invalidate mech -
bool AllowMixTagsMechlab = true
- if previsious set to false - allow mix tag in mechlab, still invalidate mech and sould be fixed before accept changes -
bool ReplaceDefaultsFirst = true
- if true use min limit for defaults, if false - max limit. for example Limit is 1-2 and location have 1 default. with true if you place other item it replace default([d-]=>[i-]=>[ii]). if false - default left till you place 2 items([d-]=>[id]=>[ii]). -
bool AddCategoryToDescription = true
- add displayName to item description -
Dictionary<string, object> DefaultCustoms = null
- custom which will be added on item with this category. if item already have custom of this type - ignored.
-
BaseLimits : []
- limits for all units that dont fall any specific category -
UnitLimits : []
- limits per unit type
if null - message from Settings.Message will be used. to details check Error Messages
-
string AddMaximumReached
- show in mechlab if maximum of category reached (AllowMaxOverflow set to false) -
string AddMinimumReached
- show in mechlab if minimum of category reached (AllowMaxinOverflow set to false) -
string AddMixed
- show in mechlab if AllowMixTags and AllowMixTagsMechlab set to false and trying to mix tags -
string ValidateMinimum
- Validation message for "to many items of this category" -
string ValidateMaximum
- Validation message for "not enough items of this category" -
string ValidateMixed
- Validation message for mixed tags;
{
"Name" : "LegActuatorUpper",
"DisplayName" : "Upper Leg Actuator",
"AddCategoryToDescription" : true,
"BaseLimits" : [
{ "Location" : "LeftLeg", "Min" : 1, "Max" : 1 },
{ "Location" : "RightLeg", "Min" : 1, "Max" : 1 }
],
"DefaultCustoms" : {
"Sorter" : 0,
"AllowedLocations" : "LegActuator"
},
"UnitLimits" : [
{
"UnitType" : "Quad",
"Limits" : [
{ "Location" : "LeftLeg", "Min" : 1, "Max" : 1 },
{ "Location" : "RightLeg", "Min" : 1, "Max" : 1 },
{ "Location" : "LeftArm", "Min" : 1, "Max" : 1 }
{ "Location" : "RightLeg", "Min" : 1, "Max" : 1 }
]
},
{
"UnitType" : "Vehicle",
"Limits" : [
{ "Location" : "All", "Max" : 0 }
]
}
]
}
old
{
"Name" : "Armor",
"DisplayName" : "Armor",
"MaxEquiped" : 1,
"MinEquiped" : 1,
"AutoReplace" : true,
"DefaultCustoms" : {
"InventorySorter" : {
"SortKey" : "CzOrder0"
},
"Color" : {
"UIColor" : "ArmorDamaged"
},
"Sorter" : {
"Order" : 0
}
}
},
new
{
"Name" : "Armor",
"DisplayName" : "Armor",
"DefaultCustoms" : {
"InventorySorter" : "CzOrder0",
"Color" : "ArmorDamaged",
"Sorter" : 0
},
"BaseLimits" : [
{ "Location" : "All", "Min" : 1, "Max" : 1 }
]
},
old
{
"Name" : "LegUpperActuator",
"DisplayName" : "Upper Leg Actuator",
"MaxEquipedPerLocation" : 1,
"MinEquiped" : 2,
"AutoReplace" : true,
"DefaultCustoms" : {
"InventorySorter" : {
"SortKey" : "ActuatorLeg1"
},
"Sorter" : {
"Order" : 1
},
"CriticalEffects" : {
"OnDestroyedEffectIDs" : ["CriticalEffect-LegUpperActuatorDestroyed-{location}"]
},
"TRGBColor" : { "Color" : "#DEFF00" },
"ComponentExplosion": {
"StabilityDamage": 10
}
}
},
new
{
"Name" : "LegUpperActuator",
"DisplayName" : "Upper Leg Actuator",
"DefaultCustoms" : {
"InventorySorter" : "ActuatorLeg1",
"Sorter" : 1,
"CriticalEffects" : {
"OnDestroyedEffectIDs" : ["CriticalEffect-LegUpperActuatorDestroyed-{location}"]
},
"TRGBColor" : { "Color" : "#DEFF00" },
"ComponentExplosion": {
"StabilityDamage": 10
}
},
"BaseLimits" : [
{ "Location" : "LeftLeg", "Min" : 1, "Max" : 1 },
{ "Location" : "RightLeg", "Min" : 1, "Max" : 1 }
]
},
Allow to define limits per mech.
"Custom" : {
"ChassisCategory" : [
{
"Category" : "SomeCategory1",
"Limits" : [{ "Location" : "RightTorso", "Min" : 1 }]
},
{
"Category" : "SomeCategory2",
"Limits" : [{ "Location" : "All", "Max" : 0 }]
},
{
"Category" : "SomeCategory3",
"Limits" : null,
}
]
}
set minimum 1 of SomeCategory1 in right torso, disallow SomeCategory2 for mech and remove all limits for SomeCategory3