Further Explanation of Build/Unit Types

Discussion in 'Mod Discussions' started by bsergent, December 26, 2014.

  1. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Wiki links:
    Unit Blueprint UNITTYPE Flags
    Unittype Boolean Algebra


    I'm making this thread to ask the community to help me assemble a kind of index of types and what they mean in a practical sense with regard to making small changes to pre-existing units. I want a reference for what I can expect these changes to do.

    For example: In base_commander.json let's say I added

    "CmdBuild | (Advanced & Air)"

    What does advanced mean? What does Air mean? What would be the effect of this?

    I will update this reference as my understanding expands time etc permitting. Please reply with any comments that would help me provide definitions for each of these terms. I will update the original post to include them.

    Thank you all for your time and help.

    Notes:
    Some of these convey specific functionality, others are merely flags to indicate they are of a particular type. The buildable_types field then leverages this to specify what units a construction unit can build.

    Example: From fabrication_vehicle.json
    "buildable_types":"Land & Structure & Basic | Factory & Basic | Factory & Land & Tank & Advanced | FabBuild"

    These all line up with the unit type flags, eg:

    Advanced = UNITTYPE_Advanced and so on.

    Vertical bars (|) are logical ORs and ampersands (&) are logical ANDs. Brackets can also be used to divide up the statement.

    Definitions:
    Advanced
    Air
    AirDefense
    Artillery
    Basic
    Bomber
    Bot
    CannonBuildable
    CmdBuild
    CombatFabAdvBuild
    CombatFabBuild
    Commander
    Construction
    ControlModule (aka Catalyst)
    Custom1 (Used to distinguish custom units and allow custom fabrication build options.)
    Custom2 (...)
    Custom3 (...)
    Custom4 (...)
    Debug
    Defense
    Economy
    EnergyProduction
    FabAdvBuild
    Fabber (Determines whether a unit selects as a fabber in area-selects.)
    FabBuild
    FabBuild. Defense
    FabOrbBuild
    Factory (Can't move. Required for units that build units within themselves and receive factory style build bar orders. Untested: spectator factory count.)
    FactoryBuild
    Fighter
    Gunship
    Heavy
    Important (Conventionally used on superweapons and other things that should have notices sent even on other planets.)
    Land
    LaserPlatform
    MetalProduction
    Mobile (Engine generates a warning if a unit has navigation but is not marked as Mobile. Mobile units that can build build units outside of themselves. Untested: spectator mobile count.)
    Naval
    NoBuild'
    Nuke
    NukeDefense
    Offense (Used in keyboard commands that select combat units.)
    Orbital
    OrbitalDefense
    PlanetEngine
    Recon
    Scout
    Structure
    Sub
    SurfaceDefense
    Tactical
    Tank (aka. vehicle)
    Teleporter
    Transport
    Wall (Usually lowest targting priority, unless the unit is selected by another condition first.)

    Credits:
    Firstly, thank you Captain Conundrum for helping me get my foot in the door. :)
    Also, this list of types is harvested from this thread.
    Thank you raevn for creating this list and for your general help :)
    Thank you wondible for creating the the wikis that basically obviate this post. :)
    Last edited: December 26, 2014
    cptconundrum and Raevn like this.
  2. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Don't forget the custom ones:

    Custom1
    Custom2
    Custom3
    Custom4

    These all line up with the unit type flags, eg:

    Advanced = UNITTYPE_Advanced and so on.
    bsergent likes this.
  3. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Can you explain what Custom1 etc does? Why should I add them?

    Thanks for the flag comment I'll add that to the op.
  4. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    The way these work, is each unit has a number of UNITTYPE_* flags. Some of these convey specific functionality, others are merely flags to indicate they are of a particular type. The buildable_types field then leverages this to specify what units a construction unit can build. To take your example:

    buildable_types = "CmdBuild | (Advanced & Air)"

    This means that the construction unit can build any other unit that has the UNITTYPE_CmdBuild flag, OR has BOTH the UNITTYPE_Advanced flag AND the UNITTYPE_Air flag. Vertical bars (|) are logical ORs and ampersands (&) are logical ANDs. Brackets can also be used to divide up the statement.

    Custom1-4 are not used by any official units, but modders can add them to their units to distinguish them and allow custom fabrication build options.
    bsergent likes this.
  5. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Thank you very much :)

    _"Some of these convey specific functionality, others are merely flags to indicate they are of a particular type."_

    Is there a list anywhere that defines the ones with a functionality or which ones are just flags?

    I'll try to integrate your information into the original post.
  6. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    bsergent likes this.
  7. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
  8. bsergent

    bsergent Active Member

    Messages:
    236
    Likes Received:
    73
    Awesome!

    Typo :) "Mobile units that can build build units outside."
    You fixed it.

    I attempted to request an account on the wiki and I got:

    Database error
    A database query error has occurred. This may indicate a bug in the software.

    Hey raevn can you change my account name here? I'm "Innomen" most everywhere else.
    Last edited: December 26, 2014

Share This Page