jobs

jobs.job_material_category

<bitfield-type type-name="job_material_category" base-type="uint32_t">
  <flag-bit name="plant"/>
  <flag-bit name="wood">
    wood log
  </flag-bit>
  <flag-bit name="cloth"/>
  <flag-bit name="silk"/>
  <flag-bit name="leather"/>
  <flag-bit name="bone"/>
  <flag-bit name="shell"/>
  <flag-bit name="wood2">
    wood material
  </flag-bit>
  <flag-bit name="soap"/>
  <flag-bit name="tooth"/>
  <flag-bit name="horn"/>
  <flag-bit name="pearl"/>
  <flag-bit name="yarn"/>
  <flag-bit name="strand"/>
</bitfield-type>

jobs.dfhack_material_category

<bitfield-type type-name="dfhack_material_category"
    base-type="uint32_t">
  An extended version of job_material_category, for use in some
  plugins, like workflow.
  The start must be identical to job_material_category
  <flag-bit name="plant"/>
  <flag-bit name="wood"/>
  <flag-bit name="cloth"/>
  <flag-bit name="silk"/>
  <flag-bit name="leather"/>
  <flag-bit name="bone"/>
  <flag-bit name="shell"/>
  <flag-bit name="wood2"/>
  <flag-bit name="soap"/>
  <flag-bit name="tooth"/>
  <flag-bit name="horn"/>
  <flag-bit name="pearl"/>
  <flag-bit name="yarn"/>
  <flag-bit name="strand"/>
  DFHack-specific fields
  <flag-bit name="metal"/>
  <flag-bit name="stone"/>
  <flag-bit name="sand"/>
  <flag-bit name="glass"/>
  <flag-bit name="clay"/>
  <flag-bit name="milk"/>
</bitfield-type>

jobs.job_flags

<bitfield-type type-name="job_flags" base-type="uint32_t">
  <flag-bit name="repeat"/>
  <flag-bit name="suspend"/>
  <flag-bit name="working">
    not for food, or store in sp
  </flag-bit>
  <flag-bit name="fetching">
    Actually going out to bring; corresponds to items->is_fetching
  </flag-bit>
  <flag-bit name="special">
    Sleep/Drink/Eat/Clean; cannot be aborted via the ui
  </flag-bit>
  <flag-bit name="bringing">
    When actually carrying non-last item to the workshop. If last,
    'working' is used instead.
  </flag-bit>
  <flag-bit name="item_lost">
    set when a Hauled item is removed; causes cancel
  </flag-bit>
  <flag-bit name="noise" count="2">
    on the sleep job causes thoughts
  </flag-bit>
  <flag-bit name="by_manager"/>
  <flag-bit name="store_item"/>
  <flag-bit name="quality" count="3">
    set by improvement code
  </flag-bit>
  <flag-bit name="specific_dropoff">
    for some jobs, blocks auto-restockpiling of the hauled item
  </flag-bit>
  <flag-bit/>
  <flag-bit name="on_break">
    job displayed as On Break
  </flag-bit>
  <flag-bit/>
  <flag-bit name="do_now"/>
</bitfield-type>

jobs.job_subtype_surgery

<enum-type type-name="job_subtype_surgery">
  <enum-item name="Surgery"/>
  <enum-item name="StopBleeding"/>
  <enum-item name="RepairCompoundFracture"/>
  <enum-item name="RemoveRottenTissue"/>
</enum-type>

jobs.job

<struct-type type-name="job" key-field="id">
  <int32_t name="id" init-value="-1"/>
  <pointer name="list_link" type-name="job_list_link"/>
  <int32_t name="posting_index" init-value="-1" since="v0.40.20">
    index into world.job_postings
  </int32_t>
  <enum name="job_type" base-type="int16_t" type-name="job_type"/>
  <int32_t name="job_subtype" init-value="-1"/>
  <compound name="pos" type-name="coord"/>
  <int32_t name="completion_timer" init-value="-1">
    -1 every time unit.counters.job_counter is below 0
  </int32_t>
  <uint32_t name="unk4">
    garbage, but serialized
  </uint32_t>
  <compound name="flags" type-name="job_flags"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index" init-value="-1"/>
  <int16_t name="unk5" init-value="-1"/>
  <enum base-type="int16_t" name="item_type" type-name="item_type">
    for Bait Trap jobs
  </enum>
  <int16_t name="item_subtype" init-value="-1">
    for StoreInStockpile: hauler_type
  </int16_t>
  <compound name="item_category" type-name="stockpile_group_set"/>
  <int32_t name="hist_figure_id" ref-target="historical_figure"/>
  <compound name="material_category"
      type-name="job_material_category"/>
  <stl-string name="reaction_name"/>
  <int32_t name="expire_timer">
    for stockpiling, +1 per 50 ticks if no worker; del when 20
  </int32_t>
  <int16_t name="recheck_cntdn">
    for process_jobs
  </int16_t>
  <int16_t name="wait_timer">
    for units to leave build sites; to recheck stockpiles
  </int16_t>
  <int32_t name="unk11" init-value="-1" since="v0.34.08"/>
  <stl-vector name="items" pointer-type="job_item_ref"/>
  <stl-vector name="specific_refs" pointer-type="specific_ref"/>
  <stl-vector name="general_refs" pointer-type="general_ref"/>
  <stl-vector name="job_items" pointer-type="job_item"/>
  <compound name="guide_path" type-name="coord_path"
      since="v0.34.08"/>
  <int32_t name="cur_path_index" since="v0.34.08"/>
  <compound name="unk_v4020_2" type-name="coord" since="v0.40.20"/>
  <compound name="art_spec" type-name="job_art_specification"
      since="v0.43.01"/>
  <int32_t name="unk_v43_4" init-value="-1" since="v0.43.01"/>
</struct-type>

jobs.job_item_ref

<struct-type type-name="job_item_ref">
  <pointer name="item" type-name="item"/>
  <enum base-type="int32_t" name="role">
    <enum-item/>
    <enum-item name="Reagent"/>
    <enum-item name="Hauled"/>
    <enum-item name="LinkToTarget"/>
    <enum-item name="LinkToTrigger"/>
    <enum-item/>
    <enum-item name="TargetContainer"/>
    <enum-item name="QueuedContainer"/>
    <enum-item name="PushHaulVehicle"/>
  </enum>
  <int32_t name="is_fetching">
    0 immediately once taken to be brought
  </int32_t>
  <int32_t name="job_item_idx"/>
</struct-type>

jobs.job_item_flags1

<bitfield-type type-name="job_item_flags1" base-type="uint32_t">
  <flag-bit name="improvable">
    vtable[155]:eax,-1,-1
  </flag-bit>
  <flag-bit name="butcherable">
    (call 0074c6d0)
  </flag-bit>
  <flag-bit name="millable">
    vtable[79]
  </flag-bit>
  <flag-bit name="allow_buryable">
    ALLOW items with flag "dead_dwarf"
  </flag-bit>
  <flag-bit name="unrotten">
    check for item flag "rotten"
  </flag-bit>
  <flag-bit name="undisturbed">
    check for item flag "spider_web"
  </flag-bit>
  <flag-bit name="collected">
    check for item flag "spider_web"
  </flag-bit>
  <flag-bit name="sharpenable">
    vtable[25]
  </flag-bit>
  <flag-bit name="murdered">
    check for item flag
  </flag-bit>
  <flag-bit name="distillable">
    vtable[105],1
  </flag-bit>
  <flag-bit name="empty">
    (call 00753a40)
  </flag-bit>
  <flag-bit name="processable">
    vtable[80]
  </flag-bit>
  <flag-bit name="bag">
    vtable[131]
  </flag-bit>
  <flag-bit name="cookable">
    (call 00753fe0)
  </flag-bit>
  <flag-bit name="extract_bearing_plant">
    vtable[164]
  </flag-bit>
  <flag-bit name="extract_bearing_fish">
    vtable[181]
  </flag-bit>
  <flag-bit name="extract_bearing_vermin">
    vtable[182]
  </flag-bit>
  <flag-bit name="processable_to_vial">
    vtable[81]
  </flag-bit>
  <flag-bit name="processable_to_bag">
    vtable[82]
  </flag-bit>
  <flag-bit name="processable_to_barrel">
    vtable[83]
  </flag-bit>
  <flag-bit name="solid">
    vtable[74]
  </flag-bit>
  <flag-bit name="tameable_vermin">
    vtable[104]
  </flag-bit>
  <flag-bit name="nearby"/>
  <flag-bit name="sand_bearing">
    vtable[108]
  </flag-bit>
  <flag-bit name="glass">
    check for material flag IS_GLASS
  </flag-bit>
  <flag-bit name="milk">
    (call 00753d30 - check if material has CHEESE_MAT?)
  </flag-bit>
  <flag-bit name="milkable">
    vtable[107],1,1
  </flag-bit>
  <flag-bit name="finished_goods"/>
  <flag-bit name="ammo"/>
  <flag-bit name="furniture"/>
  <flag-bit name="not_bin"/>
  <flag-bit name="lye_bearing"/>
</bitfield-type>

jobs.job_item_flags2

<bitfield-type type-name="job_item_flags2" base-type="uint32_t">
  <flag-bit name="dye">
    vtable[106]
  </flag-bit>
  <flag-bit name="dyeable">
    vtable[159]
  </flag-bit>
  <flag-bit name="dyed">
    vtable[161]
  </flag-bit>
  <flag-bit name="sewn_imageless">
    vtable[162]
  </flag-bit>
  <flag-bit name="glass_making">
    vtable[26]
  </flag-bit>
  <flag-bit name="screw">
    vtable[46]
  </flag-bit>
  <flag-bit name="building_material">
    vtable[47]
  </flag-bit>
  <flag-bit name="fire_safe">
    vtable[48],1
  </flag-bit>
  <flag-bit name="magma_safe">
    vtable[48],2
  </flag-bit>
  <flag-bit name="deep_material">
    check for inorganic material flag DEEP
  </flag-bit>
  <flag-bit name="melt_designated">
    check for item flag "melt"
  </flag-bit>
  <flag-bit name="non_economic">
    (call 0076be60)
  </flag-bit>
  <flag-bit name="allow_melt_dump">
    item can be designated for melting or dumping
  </flag-bit>
  <flag-bit name="allow_artifact">
    item can be artifact
  </flag-bit>
  <flag-bit name="plant">
    check if material is a PLANT_MAT
  </flag-bit>
  <flag-bit name="silk">
    check for material flag SILK
  </flag-bit>
  <flag-bit name="leather">
    check for material flag LEATHER
  </flag-bit>
  <flag-bit name="bone">
    check for material flag BONE
  </flag-bit>
  <flag-bit name="shell">
    check for material flag SHELL
  </flag-bit>
  <flag-bit name="totemable">
    vtable[158]
  </flag-bit>
  <flag-bit name="horn">
    check for material flag HORN
  </flag-bit>
  <flag-bit name="pearl">
    check for material flag PEARL
  </flag-bit>
  <flag-bit name="plaster_containing">
    vtable[17]
  </flag-bit>
  <flag-bit/>
  <flag-bit name="soap">
    check for material flag SOAP
  </flag-bit>
  <flag-bit name="body_part">
    itemtype CORPSE or CORPSEPIECE
  </flag-bit>
  <flag-bit name="ivory_tooth">
    check for material flag TOOTH
  </flag-bit>
  <flag-bit name="lye_milk_free">
    (call 00759110)
  </flag-bit>
  <flag-bit name="blunt">
    vtable[157]
  </flag-bit>
  <flag-bit name="unengraved">
    vtable[214]
  </flag-bit>
  <flag-bit name="hair_wool">
    ??? (pretty sure this is [ANY_STRAND_TISSUE])
  </flag-bit>
  <flag-bit name="yarn">
    check for material flag YARN
  </flag-bit>
</bitfield-type>

jobs.job_item_flags3

<bitfield-type type-name="job_item_flags3" base-type="uint32_t">
  <flag-bit name="unimproved">
    vtable[176]
  </flag-bit>
  <flag-bit name="any_raw_material">
    itemtype BAR, BOULDER, POWDER_MISC, or GLOB
  </flag-bit>
  <flag-bit name="non_absorbent">
    vtable[215]
  </flag-bit>
  <flag-bit name="non_pressed">
    vtable[91]
  </flag-bit>
  <flag-bit name="allow_liquid_powder"/>
  <flag-bit name="any_craft">
    FIGURINE, AMULET, SCEPTER, CROWN, RING, EARRING, BRACLET
  </flag-bit>
  <flag-bit name="hard">
    check for material flag ITEMS_HARD
  </flag-bit>
  <flag-bit name="food_storage">
    vtable[15]
  </flag-bit>
  <flag-bit name="metal"/>
  <flag-bit name="sand"/>
  <flag-bit/>
  <flag-bit name="written_on"/>
  <flag-bit name="edged"/>
</bitfield-type>

jobs.job_item

<struct-type type-name="job_item">
  <enum base-type="int16_t" name="item_type" type-name="item_type"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index" init-value="-1"/>
  <compound name="flags1" type-name="job_item_flags1"/>
  <int32_t name="quantity" init-value="1"/>
  <enum base-type="int16_t" name="vector_id"
      type-name="job_item_vector_id" init-value="IN_PLAY"/>
  <compound name="flags2" type-name="job_item_flags2"/>
  <compound name="flags3" type-name="job_item_flags3"/>
  <uint32_t name="flags4"/>
  <uint32_t name="flags5"/>
  <int32_t name="metal_ore" ref-target="inorganic_raw"/>
  <stl-string name="reaction_class"/>
  <stl-string name="has_material_reaction_product"/>
  <int32_t name="min_dimension" init-value="-1">
    pure guess by context
  </int32_t>
  <int32_t name="reagent_index" init-value="-1"/>
  <stl-vector type-name="int32_t" name="contains">
    used with custom reactions
  </stl-vector>
  <int32_t name="reaction_id" ref-target="reaction"/>
  <enum base-type="int16_t" name="has_tool_use"
      type-name="tool_uses"/>
  <int32_t name="unk_v43_1" since="v0.43.01"/>
  <int16_t name="unk_v43_2" init-value="-1" since="v0.43.01"/>
  <int32_t name="unk_v43_3" init-value="-1" since="v0.43.01"/>
  <int32_t name="unk_v43_4" since="v0.43.01"/>
</struct-type>

jobs.job_item_filter

<struct-type type-name="job_item_filter">
  <enum base-type="int16_t" name="item_type" type-name="item_type"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index" init-value="-1"/>
  <compound name="flags1" type-name="job_item_flags1"/>
  <pointer name="item_vector">
    <stl-vector pointer-type="item"/>
  </pointer>
  <bool name="use_mat_index"/>
  <compound name="flags2" type-name="job_item_flags2"/>
  <bool name="use_flags2"/>
  <compound name="flags3" type-name="job_item_flags3"/>
  <bool name="use_flags3"/>
  <uint32_t name="flags4"/>
  <bool name="use_flags4"/>
  <uint32_t name="flags5"/>
  <bool name="use_flags5"/>
  <stl-string name="reaction_class"/>
  <stl-string name="has_material_reaction_product"/>
  <int32_t name="metal_ore" ref-target="inorganic_raw"/>
  <bool name="use_metal_ore"/>
  <bool name="use_reaction_class"/>
  <bool name="use_reaction_product"/>
  <int32_t name="min_dimension" init-value="-1"/>
  <int32_t name="reaction_id" ref-target="reaction"/>
  <stl-vector name="contains" type-name="int32_t"/>
  <bool name="use_contains"/>
  <enum base-type="int16_t" name="has_tool_use"
      type-name="tool_uses"/>
  <enum base-type="int16_t" name="has_melee_skill"
      type-name="job_skill" since="v0.34.01"/>
  <int8_t name="unk_v40_1">
    noticed in v0.40.24
  </int8_t>
  <compound name="pos" type-name="coord"/>
  <pointer name="unit" type-name="unit"/>
  <pointer name="job" type-name="job"/>
  <pointer name="building" type-name="building"/>
  <pointer name="unk_74"/>
  <int32_t name="unk_v4305_1" since="v0.43.05"/>
  <stl-vector name="burrows" type-name="int32_t" ref-target="burrow"/>
  <bool name="use_burrows"/>
  <pointer name="take_from" since="v0.34.08">
    <stl-vector pointer-type="building"/>
  </pointer>
</struct-type>

jobs.manager_order_status

<bitfield-type type-name="manager_order_status" base-type="int32_t">
  <flag-bit name="validated"/>
  <flag-bit name="active"/>
</bitfield-type>

jobs.job_art_specification

<struct-type type-name="job_art_specification">
  <enum base-type="int32_t" name="type">
    <enum-item name="None" value="-1"/>
    <enum-item name="HistoricalFigure"/>
    <enum-item name="Site"/>
    <enum-item name="Entity"/>
    <enum-item name="ArtImage"/>
  </enum>
  <int32_t name="id" init-value="-1"/>
  <int32_t name="subid" init-value="-1"/>
</struct-type>

jobs.manager_order

<struct-type type-name="manager_order">
  <int32_t name="id"/>
  <enum name="job_type" base-type="int16_t" type-name="job_type"/>
  <enum base-type="int16_t" name="item_type" type-name="item_type"
      init-value="NONE"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)" init-value="-1"/>
  <stl-string name="reaction_name"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index" init-value="-1"/>
  <int32_t name="mat_index" init-value="-1"/>
  <compound name="item_category" type-name="stockpile_group_set"/>
  <int32_t name="hist_figure_id" ref-target="historical_figure"
      init-value="-1"/>
  <compound name="material_category"
      type-name="job_material_category"/>
  <compound name="art_spec" type-name="job_art_specification"/>
  <int16_t name="amount_left"/>
  <int16_t name="amount_total"/>
  <compound name="status" type-name="manager_order_status"/>
  <enum base-type="int32_t" name="frequency">
    <enum-item name="OneTime"/>
    <enum-item name="Daily"/>
    <enum-item name="Monthly"/>
    <enum-item name="Seasonally"/>
    <enum-item name="Yearly"/>
  </enum>
  <int32_t name="finished_year" init-value="-1"/>
  <int32_t name="finished_year_tick" init-value="-1"/>
  <int32_t name="workshop_id" ref-target="building" init-value="-1"/>
  <int32_t name="max_workshops">
    0 is unlimited
  </int32_t>
  <stl-vector name="item_conditions"
      pointer-type="manager_order_condition_item"/>
  <stl-vector name="order_conditions"
      pointer-type="manager_order_condition_order"/>
  <pointer>
    <stl-vector pointer-type="job_item"/>
  </pointer>
</struct-type>

jobs.manager_order_condition_item

<struct-type type-name="manager_order_condition_item">
  <enum base-type="int32_t" name="compare_type">
    <enum-item name="AtLeast"/>
    <enum-item name="AtMost"/>
    <enum-item name="GreaterThan"/>
    <enum-item name="LessThan"/>
    <enum-item name="Exactly"/>
    <enum-item name="Not"/>
  </enum>
  <int32_t name="compare_val"/>
  <enum base-type="int16_t" name="item_type" type-name="item_type"
      init-value="NONE"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)" init-value="-1"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index" init-value="-1"/>
  <int32_t name="mat_index" init-value="-1"/>
  <compound name="flags1" type-name="job_item_flags1"/>
  <compound name="flags2" type-name="job_item_flags2"/>
  <compound name="flags3" type-name="job_item_flags3"/>
  <uint32_t name="flags4"/>
  <uint32_t name="flags5"/>
  <stl-string name="reaction_class"/>
  <stl-string name="has_material_reaction_product"/>
  <int32_t name="inorganic_bearing" ref-target="inorganic_raw"/>
  <int32_t/>
  <stl-vector type-name="int32_t"/>
  <int32_t/>
  <enum base-type="int16_t" name="has_tool_use"
      type-name="tool_uses"/>
</struct-type>

jobs.manager_order_condition_order

<struct-type type-name="manager_order_condition_order">
  <int32_t name="order_id" ref-target="manager_order"/>
  <enum base-type="int32_t" name="condition" init-value="Completed">
    <enum-item name="Activated"/>
    <enum-item name="Completed"/>
  </enum>
  <int32_t/>
</struct-type>

jobs.manager_order_template

<struct-type type-name="manager_order_template">
  <enum name="job_type" base-type="int16_t" type-name="job_type"/>
  <stl-string name="reaction_name"/>
  <enum base-type="int16_t" name="item_type" type-name="item_type"
      init-value="NONE"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index"/>
  <compound name="item_category" type-name="stockpile_group_set"/>
  <int32_t name="hist_figure_id" ref-target="historical_figure"
      init-value="-1"/>
  <compound name="material_category"
      type-name="job_material_category"/>
  <int8_t init-value="1"/>
</struct-type>

jobs.guild_id

<enum-type type-name="guild_id" base-type="int16_t">
  <enum-item name="None" value="-1"/>
  <enum-item name="Miners"/>
  <enum-item name="Carpenters"/>
  <enum-item name="Masons"/>
  <enum-item name="Metalsmiths"/>
  <enum-item name="Jewelers"/>
  <enum-item name="Craftsmen"/>
</enum-type>

jobs.mandate

<struct-type type-name="mandate">
  <pointer name="unit" type-name="unit"/>
  <int16_t name="mode">
    0 export, 1 make, 2 guild jobs
  </int16_t>
  <enum base-type="int16_t" name="item_type" type-name="item_type"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index"/>
  <int16_t name="amount_total"/>
  <int16_t name="amount_remaining"/>
  <int32_t name="timeout_counter">
    counts once per 10 frames
  </int32_t>
  <int32_t name="timeout_limit">
    once counter passes limit, mandate ends
  </int32_t>
  <compound name="punishment">
    <int32_t name="hammerstrikes"/>
    <int32_t name="prison_time"/>
    <int32_t name="give_beating"/>
  </compound>
  <uint8_t name="punish_multiple"/>
  <int32_t name="unk4"/>
</struct-type>

jobs.training_assignment

<struct-type type-name="training_assignment"
    instance-vector="$global.ui.equipment.training_assignments"
    key-field="animal_id">
  <int32_t name="animal_id" ref-target="unit"/>
  <int32_t name="trainer_id" ref-target="unit"/>
  <bitfield name="flags">
    <flag-bit name="any_trainer"/>
    <flag-bit name="any_unassigned_trainer"/>
    <flag-bit name="train_war"/>
    <flag-bit name="train_hunt"/>
  </bitfield>
</struct-type>

jobs.unit_demand

<struct-type type-name="unit_demand">
  <int16_t name="unk_0"/>
  <enum base-type="int16_t" name="place">
    <enum-item name="Office"/>
    <enum-item name="Bedroom"/>
    <enum-item name="DiningRoom"/>
    <enum-item name="Tomb"/>
  </enum>
  <enum base-type="int16_t" name="item_type" type-name="item_type"/>
  <int16_t name="item_subtype" refers-to="(item-subtype-target
      $$._parent.item_type $)"/>
  <int16_t name="mat_type" ref-target="material"
      aux-value="$$.mat_index"/>
  <int32_t name="mat_index" init-value="-1"/>
  <int32_t name="timeout_counter">
    counts once per 10 frames
  </int32_t>
  <int32_t name="timeout_limit">
    once counter passes limit, mandate ends
  </int32_t>
</struct-type>