Skip to content

Unit Types

Denadan edited this page Jun 7, 2021 · 6 revisions

Unit Types - new concept for CC that allow define unit type and use it for enable/disable/customize some feature for set unit. CC itself can define unit type by mech/chassis tags, but other mods can override this(for example fake vehicle mech from CustomUnits dont have any tags so cannot be categorised by CC, but LewdableTanks use vehicle tags instead)

Basics

Each mech can have set of unit types based on their tag, for example [Mech, AssaultMech, ClanMech, Omnimech] CC features that use UnitTypes usually have list of values for each unit types and default value for example Category

"BaseLimits" : ..
"UnitLimits" : [
  { "UnitType" : "Quad", "Limits" : .. }
  { "UnitType" : "ClanMech", "Limits" : .. }
  { "UnitType" : "OmniMech", "Limits" : .. }
]

feature fist through this list searching for first appearance of UnitType (in given example it will be ClanMech) and use it. if not found - it will use BaseLimits.

Declare UnitType

Unit Types declared in Custom CCUnitTypes resourse file like this example:

{
	"Settings" : [
			{	"Name" : "Mech", "RequiredTags" : [ "unit_mech" ]	},
			{	"Name" : "LightMech", "RequiredTags" : [ "unit_mech", "unit_light" ]	},
			{	"Name" : "MediumMech", "RequiredTags" : [ "unit_mech", "unit_medium" ]	},
			{	"Name" : "HeavyMech", "RequiredTags" : [ "unit_mech", "unit_heavy" ]	},
			{	"Name" : "AssaultMech", "RequiredTags" : [ "unit_mech", "unit_assault" ]	},
			{	"Name" : "IgnoreAutofix", "AnyTags" : [  "ignore_autofix", "noautofix", "fake_vehicle_chassis" ]	},
			{	"Name" : "IgnoreValidate", "AnyTags" : [  "ignore_validate", "novalidate", "fake_vehicle_chassis" ]	},
    ]
}

Parameters are

  • string Name - Name of unit type which will be used
  • string[] RequiredTags - all this tags should present in mech or chassis tags
  • string[] AnyTags - any of this tags should present in mech or chassis tags
  • string[] ForbiddenTags - none of this tags should be present in mech or chassis tag

Also UnitType can be defined in ChassisDef using UnitType custom

"Custom" : {
  "UnitType" : [ "Mech", "AssaultMech", "ClanMech", "Omnimech" ]
}

this completle override all other settings for unit type(i.e. tags will be ignored)

and UnitTypeAdd custom which add unit types to existing list(from UnitType custom or tags)

"Custom" : {
  "UnitTypeAdd" : [ "SpecialMech" ]
}

Clone this wiki locally