Skip to content

Unit initialization

László Major edited this page Jun 12, 2015 · 3 revisions

Hull3 initializes a unit by calling the `` in its init field with an array of config entries. An entry consists of a name and values.

  • Example of entries: [this, ["gear", "CO"], ["faction", "RU"], ["languages", ["en", 20]]] call hull3_unit_fnc_init;

###Config Entries

#####faction

  • Reqired: No
  • Value: ["faction", <Valid faction>]
  • Default: The unit's faction
  • Description: Sets the unit's faction to be used by Hull3. Note, that this doesn't change the actual faction of the unit. If the gear and uniform templates are not explicitly defined, the templates defined in the faction will be used.
  • Examples:
    • ["faction", "RU"] - This will force Hull3 to assign the gear and uniform templates and add the languages of the 'RU' faction regardless of the actual faction of the unit.

#####gear

  • Reqired: Yes, (gear class only)
  • Value: ["gear", <Valid gear class>, <(optional) Valid gear template>]
  • Default: None
  • Description: Sets the unit's gear class and/or gear template. Note, that if the given class or template don't exist, it will fallback to the default one. If gear template is defined, it will overwrite the faction gear template. You can always access the actual assigned gear class of a unit by _unit getVariable "hull3_gear_class".
  • Examples:
    • ["gear", "AAR"] - This will try to assign the AAR gear class to the unit from the gear template of the unit's faction
    • ["gear", "CO", "RU"] - This will try to assign the CO gear class to the unit from gear template RU

#####uniform

  • Reqired: No
  • Value: ["uniform", <Valid uniform template>]
  • Default: Faction defined uniform template
  • Description: Sets the unit's uniform template. Note, that if the given template doesn't exist, it will fallback to the default one. If uniform template is defined, it will overwrite the faction uniform template. There is no uniform class, the gear class will be used instead.
  • Examples:
    • ["uniform", "NATO"] - Unit's uniform will be assigned from the uniform template NATO with the unit's gear class

#####marker

  • Reqired: No
  • Value: ["marker", <Marker text>, <Marker color>]
  • Default: None
  • Description: Creates a group or unit marker for the given unit based on it's gear class. Group markers follow the leader of the group (who is the most senior alive group member), while unit markers will follow the unit only. Which marker is created by what gear class can be checked in hull3_marker_fnc_addGroupAndUnitMarker.
  • Examples:
    • ["marker", "A1", "ColorRed"] - This will create a red marker with A1 text.

#####languages

  • Reqired: No
  • Values: ["language", [<Language ID1>, <Percent chance>], [<Language ID2>, <Percent chance>], ...]
  • Default: None
  • Description: Adds given languages with the given chance to the unit's spoken languages. The language IDs have to exist in ACRE config.
  • Examples:
    • ["languages", ["fr", 10], ["de", 50]] - The unit will be able to speak French with a 10% chance and German with a 50% chance
Clone this wiki locally