Skip to content

Instantly share code, notes, and snippets.

@ab9rf
Last active August 23, 2018 17:15
Show Gist options
  • Save ab9rf/17673572fc2898af0b3b37af61397e69 to your computer and use it in GitHub Desktop.
Save ab9rf/17673572fc2898af0b3b37af61397e69 to your computer and use it in GitHub Desktop.
some df-structures notes

in item-vectors.xml:

  • ANY_GENERIC37 appears to be "all clothing".
  • ANY_GENERIC39 appears to be "all armor".

in clothing and armor items, the size of the garment is determined by the maker_race field

manager orders:

"Make 1 leather leggings": #<ManagerOrder id=4 job_type=:MakePants item_type=:NONE item_subtype=2 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=-1 material_category=#<JobMaterialCategory _whole=0x10 leather> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=NULL>

"Make 1 leather leggings sized for a dwarf": #<ManagerOrder id=5 job_type=:MakePants item_type=:NONE item_subtype=2 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=572 material_category=#<JobMaterialCategory _whole=0x10 leather> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=#<Pointer StlVector64 0x1CBA0AFBDC0>>

anon_1 = [#<JobItem item_type=:SKIN_TANNED item_subtype=-1 mat_type=-1 mat_index=-1 flags1=#<JobItemFlags1 _whole=0x0> quantity=1 vector_id=:SKIN_TANNED flags2=#<JobItemFlags2 _whole=0x0> flags3=#<JobItemFlags3 _whole=0x0> flags4=0 flags5=0 metal_ore=-1 reaction_class="" has_material_reaction_product="" min_dimension=-1 reagent_index=-1 contains=[] reaction_id=-1 has_tool_use=:NONE unk_v43_1=0 unk_v43_2=-1 unk_v43_3=-1 unk_v43_4=0>]

"Make 1 leather leggings sized for a human": #<ManagerOrder id=6 job_type=:MakePants item_type=:NONE item_subtype=2 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=573 material_category=#<JobMaterialCategory _whole=0x10 leather> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=#<Pointer StlVector64 0x1CBA0AFC140>>

anon_1 = [#<JobItem item_type=:SKIN_TANNED item_subtype=-1 mat_type=-1 mat_index=-1 flags1=#<JobItemFlags1 _whole=0x0> quantity=1 vector_id=:SKIN_TANNED flags2=#<JobItemFlags2 _whole=0x0> flags3=#<JobItemFlags3 _whole=0x0> flags4=0 flags5=0 metal_ore=-1 reaction_class="" has_material_reaction_product="" min_dimension=-1 reagent_index=-1 contains=[] reaction_id=-1 has_tool_use=:NONE unk_v43_1=0 unk_v43_2=-1 unk_v43_3=-1 unk_v43_4=0>]

"Make one traction bench": #<ManagerOrder id=8 job_type=:ConstructTractionBench item_type=:NONE item_subtype=-1 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=-1 material_category=#<JobMaterialCategory _whole=0x0> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=#<Pointer StlVector64 0x1CBA0AFC080>>

anon_1 = [#<JobItem item_type=:TABLE item_subtype=-1 mat_type=-1 mat_index=-1 flags1=#<JobItemFlags1 _whole=0x0> quantity=1 vector_id=:TABLE flags2=#<JobItemFlags2 _whole=0x0> flags3=#<JobItemFlags3 _whole=0x0> flags4=0 flags5=0 metal_ore=-1 reaction_class="" has_material_reaction_product="" min_dimension=-1 reagent_index=-1 contains=[] reaction_id=-1 has_tool_use=:NONE unk_v43_1=0 unk_v43_2=-1 unk_v43_3=-1 unk_v43_4=0>, #<JobItem item_type=:TRAPPARTS item_subtype=-1 mat_type=-1 mat_index=-1 flags1=#<JobItemFlags1 _whole=0x0> quantity=1 vector_id=:TRAPPARTS flags2=#<JobItemFlags2 _whole=0x0> flags3=#<JobItemFlags3 _whole=0x0> flags4=0 flags5=0 metal_ore=-1 reaction_class="" has_material_reaction_product="" min_dimension=-1 reagent_index=-1 contains=[] reaction_id=-1 has_tool_use=:NONE unk_v43_1=0 unk_v43_2=-1 unk_v43_3=-1 unk_v43_4=0>, #<JobItem item_type=:CHAIN item_subtype=-1 mat_type=-1 mat_index=-1 flags1=#<JobItemFlags1 _whole=0x0> quantity=1 vector_id=:CHAIN flags2=#<JobItemFlags2 _whole=0x0> flags3=#<JobItemFlags3 _whole=0x0> flags4=0 flags5=0 metal_ore=-1 reaction_class="" has_material_reaction_product="" min_dimension=-1 reagent_index=-1 contains=[] reaction_id=-1 has_tool_use=:NONE unk_v43_1=0 unk_v43_2=-1 unk_v43_3=-1 unk_v43_4=0>]

in a manager job, hist_figure_id determines the size for a garment order; if left defaulted to -1 this to the race of whoever does the job

make cloth trousers: #<ManagerOrder id=10 job_type=:MakePants item_type=:NONE item_subtype=0 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=-1 material_category=#<JobMaterialCategory _whole=0x4 cloth> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=NULL>

make silk trousers: #<ManagerOrder id=11 job_type=:MakePants item_type=:NONE item_subtype=0 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=-1 material_category=#<JobMaterialCategory _whole=0x8 silk> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=NULL>

make yarn trousers: #<ManagerOrder id=12 job_type=:MakePants item_type=:NONE item_subtype=0 reaction_name="" mat_type=-1 mat_index=-1 item_category=#<StockpileGroupSet _whole=0x0> hist_figure_id=-1 material_category=#<JobMaterialCategory _whole=0x1000 yarn> art_spec=#<JobArtSpecification type=:None id=-1 subid=-1> amount_left=1 amount_total=1 status=#<ManagerOrderStatus _whole=0x1 validated> frequency=:OneTime finished_year=-1 finished_year_tick=-1 workshop_id=-1 max_workshops=0 item_conditions=[] order_conditions=[] anon_1=NULL>

Clothing is considered "same size" if the difference is between -size/8 and +size/6, endpoints excluded (where size is the size of the person trying to wear it). This makes clothing sized for races with adult sizes between 5251 and 6999 "dwarf sized", as dwarves are adultsize 6000.

for MakePants job, item_subtype determines which type of pants are made. Indexes are into world.raws.itemdefs.pants. Similarly for other garment categories (armor, gloves, shoes, helms). Game will let you request types your civilization does not know how to make; check against world.raws.all[ui.civ_id].resources.pants_type for types known to fortress civilization to avoid this.

for an itemdef raw, armorlevel of 0 indicates clothing; anything other than 0 is armor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment