Dwarf Fortress > DF Modding

Need lessons in adventure mode modding.

(1/2) > >>

Shudokai:
Right now I am trying to get into modding and I start that by adding some crafting reactions and later new weapons and armor and at last new creatures and materials.

Spoiler (click to show/hide)For now I try to make an adventure reaction to harden bones (Might not make a lot of sense but I use this to learn how to implement new materials).

First of, I have a reaction to make a spear out of a butchered corpses bones, works perfectly fine, now I know, bones are a pretty bad material for weaponry so I wanted to upgrade the bone.

For this I add a new material, let's call it hardbone for now, and I give it the properties of iron.

Thats all I can do so far, I have no idea how to handle the reagent and product tokens and I have no idea what material tokens I need to use.

I looked at a old mod to harden leather but that only confused me a lot :D !!!Thats done!!! Thanks to Nathail for helping me out.

Now that I know how to make reaction to alter and upgrade the material I want to add some materials.

I need to know how most of the material tokens work, wiki explains kinda WHAT they do but not what the max and min values are or whether high or low values are good.


This spoiler is kinda big and i added some questions and some stuff i know about each line behind it, so please read thru it and help me to understand what I dont get :D

Spoiler (click to show/hide)[MATERIAL_TEMPLATE:BONE_TEMPLATE] -thats some uniqueness stuff         
   [STATE_COLOR:ALL_SOLID:WHITE] -color
   [STATE_NAME:SOLID:bone] -solid state itemname
   [STATE_ADJ:SOLID:bone] -solid state adjective
   [STATE_NAME:POWDER:bone meal] -powdername
   [STATE_ADJ:POWDER:bone meal] -powderadjective
   [STATE_COLOR:LIQUID:WHITE] -liquid state color
   [STATE_NAME:LIQUID:n/a] -liquid name
   [STATE_ADJ:LIQUID:n/a] -liquid adjective
   [STATE_COLOR:GAS:WHITE] -gas color
   [STATE_NAME:GAS:n/a] -gas name
   [STATE_ADJ:GAS:n/a] -gas adjective
   [DISPLAY_COLOR:7:0:1] -color of the item in game


   [MATERIAL_VALUE:1] -value modifier for trading
   [SPEC_HEAT:1000] -?
   [IGNITE_POINT:10508] -when it starts to burn
   [MELTING_POINT:NONE] -when it starts to melt -NONE saying it will never melt?
   [BOILING_POINT:NONE] -when it starts to evaporate
   [HEATDAM_POINT:10250] -when it starts to get damaged by heat?
   [COLDDAM_POINT:9900] -when it starts to get damaged by cold?
   [MAT_FIXED_TEMP:NONE] -?
   [SOLID_DENSITY:500] -density ... modifying weight of the item considering the items size???
   [LIQUID_DENSITY:NONE] -same when liquid
   [MOLAR_MASS:NONE] -something about its density when in gas state



         Now here is all the stuff interesting for armors an weapons ... and the majority of it is pretty confusing to me for now.

   [IMPACT_YIELD:200000] - i guess the higher this value the more IMPACT / BLUNT force it can take before giving in.
   [IMPACT_FRACTURE:200000] - the higher the more I/B force it can take before breaking???? will the item get DAMAGED / DESTROYED when that happens?
                                               lets say its tissue or armor will it get penetrated??? how does this affect weapons?
   [IMPACT_STRAIN_AT_YIELD:100] - from the wiki i take, the higher this value the "less" damage it takes when at its yield ..... so if the I/B force is above the yield it will "bruise" the item when the strain is high and then ultimately break when the fracture point is reached?

I really need some help here :D and how i can apply this to armor, weapons and body materials.


   [COMPRESSIVE_YIELD:200000] - this is said to be something about strangulation and pinching instead of blunt and impact force .... no idea how to work with this :/
   [COMPRESSIVE_FRACTURE:200000]
   [COMPRESSIVE_STRAIN_AT_YIELD:100]


   [TENSILE_YIELD:115000] - same with latching and tearing .... so when scratches and bites happen???
   [TENSILE_FRACTURE:130000]
   [TENSILE_STRAIN_AT_YIELD:100]


   [TORSION_YIELD:115000] - this is even more confusing when reading the wiki .... latching and shaking with a blunt attack .... so ... as if i were in a viceclamp and shaken? or sitting between 2 grinders? absolutely no idea ... help :D
   [TORSION_FRACTURE:130000]
   [TORSION_STRAIN_AT_YIELD:100]


   [SHEAR_YIELD:115000] - this is for cutting i guess.
   [SHEAR_FRACTURE:130000]
   [SHEAR_STRAIN_AT_YIELD:100]


   [BENDING_YIELD:115000] - referring to the wiki this is mostly / only used in wrestling? to break shoulders and stuff .... so i wont really use this in metals unless i have metal bones in something???
   [BENDING_FRACTURE:130000]
   [BENDING_STRAIN_AT_YIELD:100]


   [MAX_EDGE:1000] - Now this is interesting ... wiki says if its above 10000 it will give stones the ability to be weaponized .... but if i apply this on other stuff like bones, does this help with cutting aswell????


   [ABSORPTION:100] - i guess this is only usefull for containers right?


   [IMPLIES_ANIMAL_KILL] - this mat is obtained by killing and butchering a living creature

   [BONE] - bone token .... used with ANY_BONE_MATERIAL???

   [ITEMS_HARD] - used for crafts

   [ITEMS_BARRED] - the same as ITEMS_HARD for bones ... so why do bones have both tags?

   ##[REACTION_CLASS:LEVEL_1]                                    - LEVEL_1 stating its the first stage of the upgrade
   ##[MATERIAL_REACTION_PRODUCT:HARDEN:LOCAL_CREATURE_MAT:BONE_HARDENED]   - Product using HARDEN will be BONE_HARDENED

Nathail:
First, you need to add a material reaction product token to standard bone. Say [MATERIAL_REACTION_PRODUCT:HARDEN:LOCAL_CREATURE_MAT:HARDBONE]. Then, go into the standard materials body detail plan (the first entry in b_detail_plan_default) and add [ADD_MATERIAL:HARDBONE:HARDBONE_TEMPLATE] to the list. The first bit lets the game know that reactions with the appropriate token using bone will produce hard bone. The second adds hard bone to the list of materials that creatures using standard materials (skin, bone, muscle, etc) can produce hard bone.

Now you need to make the reaction. For ease of design, let's say you want to just harden the bone spear, since hardening the bones themselves would have difficulties producing the appropriate number of hard bones. Anyway, the reaction would use a normal bone spear as a reagent and produce a hard bone one. So the reagent line would be [REAGENT:bone spear:WEAPON:ITEM_WEAPON_SPEAR:NONE:NONE][ANY_BONE_MATERIAL] and the product line would be [PRODUCT:100:1:WEAPON:ITEM_WEAPON_SPEAR:GET_MATERIAL_FROM_REAGENT:bone spear:HARDEN]. The product line tells the game there is a 100% chance to produce one spear with a material based on the HARDEN product of the material of the original spear.

And that should do it. Keep in mind that reaction makes a completely new spear out of the original bone one, so any decorations will be removed and a new quality modifier will be applied. I'm not actually sure that the game will actually recognize any of the things involving the HARDEN token, so you may wind up having to use TAN_MAT instead, which means there'll be hard bone cloaks and stuff in the arena (I think), but won't really effect genned worlds.

Shudokai:
Great, thank you for the detailed explaination, I will try that right now and tell you what works and what not :D

ADD: Okay, I tinkered with the reactions and materials a bit now.

First I tried to use BAR and GLOB as a Product but that ended up very weird and I had like 100+ Items in my inventory afterwards ... happened to me when I first tried to add metalmaking to adventure mode, I guess thats something with MATERIAL_SIZE or something, not sure.

Anyways, after that failed I now added a new ITEM_TOOL just named "material" for now.

my reaction now takes one "stack" of bones of the butchered enemy and "prepares" it to one "bone material" this can be used to craft or to process further.

second reaction takes one "bone material" and HARDENS it to make "hardened bone material"

last reaction takes 2 "hardened bone material" and makes 1 "composite bone material"

I will attach my reaction file so far, nothing interesting with the new ITEM_TOOL I made and the materials are just the same as common bone for now, only new names.

Spoiler (click to show/hide)
--- Code: ---reaction_adventurer

[OBJECT:REACTION]

[REACTION:BONECARVING_ADV]
[NAME:+-- Bonecarving --+]
[ADVENTURE_MODE_ENABLED]
[SKILL:KNAPPING]

[REACTION:MAKE_PREPARED_BONE_ADV]
[NAME:prepare bone for crafting]
[ADVENTURE_MODE_ENABLED]
[REAGENT:bone:1:NONE:NONE:NONE:NONE]
[USE_BODY_COMPONENT]
[ANY_BONE_MATERIAL]
[PRODUCT:100:1:TOOL:ITEM_HARDEN_BONE:GET_MATERIAL_FROM_REAGENT:bone:NONE]
[SKILL:BONECARVE]

[REACTION:MAKE_HARDENED_BONE_ADV]
[NAME:harden bone]
[ADVENTURE_MODE_ENABLED]
[REAGENT:bone:1:TOOL:ITEM_HARDEN_BONE:NONE:NONE]
[REACTION_CLASS:LEVEL_1]
[HAS_MATERIAL_REACTION_PRODUCT:HARDEN]
[PRODUCT:100:1:TOOL:ITEM_HARDEN_BONE:GET_MATERIAL_FROM_REAGENT:bone:HARDEN]
[SKILL:BONECARVE]

[REACTION:MAKE_COMPOSITE_BONE_ADV]
[NAME:create composite bone]
[ADVENTURE_MODE_ENABLED]
[REAGENT:bone:1:TOOL:ITEM_HARDEN_BONE:NONE:NONE]
[REACTION_CLASS:LEVEL_2]
[HAS_MATERIAL_REACTION_PRODUCT:HARDEN]
[REAGENT:bone2:1:TOOL:ITEM_HARDEN_BONE:NONE:NONE]
[REACTION_CLASS:LEVEL_2]
[HAS_MATERIAL_REACTION_PRODUCT:HARDEN]
[PRODUCT:100:1:TOOL:ITEM_HARDEN_BONE:GET_MATERIAL_FROM_REAGENT:bone:HARDEN]
[SKILL:BONECARVE]
--- End code ---





please check back on the first post whenever something is solved ;3

Nathail:
Well, it seems to be working as expected. You could possibly refer to the ITEM_TOOL form as "cleaned bone pile" or something, and then have "hardened bone pile" and "composite bone pile" for the next two tiers.

Shudokai:
Good point there, the name was a bit weird :D but I think I fixed it pretty good now.

We'll see how I manage that with other stuff like Leather, Scales, Plates, Horns and stuff.



Now I have something else and it troubles me a lot.

I read through the forum and found something interesting about material_definition tokens and as far as i understood only impact and shear values matter for armored / armed combat, the other values are for wrestling, scratching and biting.
So I edited the values for the hardened and composite bones, hardened bone values are x10 and composite x2 compared to the lower tier.

Considering that Armors made of prepared bone should EASILY be penetrated by hardened bone but oddly enough that wont happen ..... slashing gets deflected 100% of the time, stabbing mostly penetrates and bashing feels like 50/50 ..... now I dont know if thats caused by the weapon attributes or by the material :/



Here is what I changed ... I didn't touch torsion, bending etc. because that doesn't seem to affect armor and weapons a lot.
Spoiler (click to show/hide)   This is hardened bone. the numbers behind the token is what it is on the lower tier.
   [IMPACT_YIELD:1000000] -200000
   [IMPACT_FRACTURE:1000000] -200000
   [IMPACT_STRAIN_AT_YIELD:100]
   
   [SHEAR_YIELD:1150000] -115000
   [SHEAR_FRACTURE:1300000] -130000
   [SHEAR_STRAIN_AT_YIELD:100]
   
   [MAX_EDGE:10000] -1000


   Here is composite bone
   [IMPACT_YIELD:2000000] -1000000
   [IMPACT_FRACTURE:2000000] -1000000
   [IMPACT_STRAIN_AT_YIELD:100]

   [SHEAR_YIELD:2300000] -1150000
   [SHEAR_FRACTURE:2600000] -1300000
   [SHEAR_STRAIN_AT_YIELD:100]

   [MAX_EDGE:20000] -10000


Maybe I should change STRAIN_AT_YIELD values :/

Navigation

[0] Message Index

[#] Next page

Go to full version