I decided to post this here rather then make a seperate thread for it. Someone asked me to expain reactions and some more complex stuff about them, So I made this up for them. I hope this helps any that finds Reactions a hassle.
[REACTION:XXXX]
[NAME:xxxx xxxx xxxx]
[BUILDING:<building id>:CUSTOM_<letter, SHIFT_ + letter, ALT_ + letter, I think there is a CTRL_ + letter>] --- remember all caps, or use NONE for the hotkey
[REAGENT:<custom id>:###:<item_id>:<item_subtype>:<material_id>:<material_subtype>] --- if CREATURE_MAT,PLANT_MAT is used there are two <mat_subs>
[PRODUCT:%%%:###:<item_id>:<item_subtype>:<material_id>:<material_subtype>]
[SKILL:<skill_id>]
some reagents can go like this:
[REAGENT:A:1:WOOD:NONE] heck you might be able to get away with [REAGENT:A:1:WOOD] just to grab any wood, now me being old fasion always make my reagents look like this: [REAGENT:log:1:WOOD:NONE:NONE:NONE]
now since the reagent is very general about what it takes it is usefull in two ways.
1. you just need any wooden log for the reaction, just to make it seem needed for an output/product
2. make something that is wood and acts like the carpenters workshop
for 2. you need a Product line like this:
[PRODUCT:100:1:SLAB:NONE:GET_MATERIAL_FROM_REAGENT:log:NONE] --- points to the above mentioned reagent's custom_id, also like reagents you might be able to leave out that last "NONE" but I leave it in cause it's not hurtin anyone.
But someting a bit more complex:
This is my advanced brewing (thanks to Stronghammer for educating me on RL brewing) now allow me to chop it down to size
[REACTION:BREW_GOOD_1]
[NAME:brew aged dwarven wine]
[BUILDING:BREW_REGEN:NONE]
[REAGENT:plants:10:PLANT:NONE:PLANT_MAT:MUSHROOM_HELMET_PLUMP:STRUCTURAL]
[REAGENT:sweetener:1:NONE:NONE:NONE:NONE][REACTION_CLASS:SWEET]
[REAGENT:sweet container:1:NONE:NONE:NONE:NONE]
[CONTAINS:sweetener]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:tallow:1:GLOB:NONE:NONE:NONE][REACTION_CLASS:TALLOW][UNROTTEN]
[REAGENT:barrel/pot1:1:NONE:NONE:NONE:NONE]
[EMPTY][FOOD_STORAGE_CONTAINER][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:5:DRINK:NONE:PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK2][PRODUCT_TO_CONTAINER:barrel/pot1]
[PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:plants:SEED_MAT]
[SKILL:BREWING]
This was a very big reaction, and trust me I had to make a custom program that it's sole purpose was to make these reactions... Anyways
the reaction is a perfect mix of what can go wrong if you don't know what you are doing.
[REAGENT:sweetener:1:NONE:NONE:NONE:NONE][REACTION_CLASS:SWEET]
[REAGENT:sweet container:1:NONE:NONE:NONE:NONE]
[CONTAINS:sweetener]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
This here looks for any item made from a material with a REACTION_CLASS of SWEET which in Regen is "Dwarven Suger" and "Dwarven Syrup"
But not only that it looks for this item+class inside a container (be it Bag, chest, barrel, or Jug) since I know the item i'm looking for must be
stored in a bag or barrel
[REAGENT:barrel/pot1:1:NONE:NONE:NONE:NONE]
[EMPTY][FOOD_STORAGE_CONTAINER][PRESERVE_REAGENT][DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
Kindof explains it'self but this acually will grab anything that can hold food (which is anything that has a EDIBLE I believe)
[PRODUCT:100:5:DRINK:NONE:PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK2][PRODUCT_TO_CONTAINER:barrel/pot1]
Now in the plump helmet plant, I added a new drink that has more value and a boost for being drank. And it places the product "DRINK"
in the food container I requested above
[PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:plants:SEED_MAT]
Now this one is a bit harder, and then again not. When I was making these reactions I made a "generic brew" so to do so
I used alot of MATERIAL_REACTION_PRODUCT which in the end looks like I didn't need it, which is a lie I have it for my
tree processing reactions.
Anyways in the STRUCTUAL_TEMPLATE that all plants use I dropped [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED] so now every plant has this.
Now since I'm just taking the SEED_MAT from Plump Helmets because I know they have it. But if I wanted to generically grab an item to make a generic related other item
I would use
[REAGENT:A:1:NONE:NONE:NONE:NONE][HAS_MATERIAL_REACTION_PRODUCT:SEED_MAT]
[PRODUCT:100:1:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:A:SEED_MAT]
this will grab basically any plant (due to my addition to the template) which means even seedless plants will be taken, and not just PLANT anything that is made from the STRUCTUAL_TEMPLATE will fall victum. and if a seedless plant item is taken, un-useable seeds will be made.
About [REACTION_CLASS:xxxx] I use this for very simple things, normally I place this nifty tag on 'inorganics' or single material types
Lets say I wanted a reaction that took any wooden chair just a chair that is made from wood
but this doesn't work
[REAGENT:chair:1:CHAIR:NONE:PLANT_MAT:NONE:WOOD]
Well now I am stumped, I want chairs, that are wooden, and don't want to make a reaction for each and every type of wooden chair.
So I add [REACTION_CLASS:GET_WOOD] on the WOOD_TEMPLATE. Ha now anything that is wooden is now classed as GET_WOOD
now I can do this:
[REAGENT:chair:1:CHAIR:NONE:NONE:NONE][REACTION_CLASS:GET_WOOD]
Bam now metal,stone,cloth,etc.. Chairs are ignored and only my desired wooden chairs are choosen,
or anything that is wood if I wanted:
[REAGENT:wood:1:NONE:NONE:NONE:NONE][REACTION_CLASS:GET_WOOD]
Now anything that is made from a material that is classed as GET_WOOD will be choosen doesn't matter if it is a 'log' or a chair, or splint, or block. It will just grab 1 wooden item.
I can even add [REACTION_CLASS:COIN_METAL] on SILVER, GOLD, and COPPER
then use
[REAGENT:bar:150:NONE:NONE:NONE][REACTION_CLASS:COIN_METAL]
[PRODUCT:100:500:COIN:NONE:GET_MATERIAL_FROM_REAGENT:bar:NONE]
now the reaction will take any SILVER,GOLD,COPPER bar and make 500 coins from whatever taken metal.
[MATERIAL_REACTION_PRODUCT:<custom_id>:<material_id>:<material_subtype>] is related to [REACTION_CLASS:xxxx] only it has more functions.
REACTION_CLASS is like the little brother to MATERIAL_REACTION_PRODUCT because REACTION_CLASS can only do one thing and that is class a material as something.
MATERIAL_REACTION_PRODUCT can not only class, but also reach out to another material
A good example is tanning
the SKIN_TEMPLATE has
[MATERIAL_REACTION_PRODUCT:TAN_MAT:LOCAL_CREATURE_MAT:LEATHER]
which means anything made from SKIN is classed as TAN_MAT and if so desired a material LEATHER can be used (hard to word right)
to help clear up what I mean this example will help (I hope)
[REAGENT:skin:1:NONE:NONE:NONE:NONE] --- let us say this grabs a unrotten piece of dog skin
[USE_BODY_COMPONENT] --- another way to use CORPSEPIECE I guess, may include other bodyparts too
[UNROTTEN] --- right on the tin, has to be fresh
[HAS_MATERIAL_REACTION_PRODUCT:TAN_MAT] --- now this is another thing that sets it apart from REACTION_CLASS is the "HAS_" when it is called in a reaction
[PRODUCT:100:1:SLAB:NONE:GET_MATERIAL_FROM_REAGENT:skin:NONE] --- this will make a "dog skin slab"
[PRODUCT:100:1:SLAB:NONE:GET_MATERIAL_FROM_REAGENT:skin:TAN_MAT] --- this will make a "dog leather slab"
Now another cool thing is when you really play with it.
I help with Kobold Camp, not only for Regen but for Lago (man incharge of Kobold Camp)
I wanted a way to make crude metal stuff, and the easiest way to do that is make new metals
So now I have crude copper/iron/bronze/silver/steel but I only want this metal when a weapon/armor is broken down to chunks
Remember MATERIAL_REACTION_PRODUCT is related to REACTION_CLASS they can both class things.
So to IRON/COPPER/SILVER/BRONZE/STEEL I added these:
[MATERIAL_REACTION_CLASS:CRUDE_TARGET:INORGANIC:IRON_CRUDE]
[MATERIAL_REACTION_CLASS:CRUDE_TARGET:INORGANIC:COPPER_CRUDE]
[MATERIAL_REACTION_CLASS:CRUDE_TARGET:INORGANIC:SILVER_CRUDE]
[MATERIAL_REACTION_CLASS:CRUDE_TARGET:INORGANIC:BRONZE_CRUDE]
[MATERIAL_REACTION_CLASS:CRUDE_TARGET:INORGANIC:STEEL_CRUDE]
Now all 5 true metals are classed as CRUDE_TARGET and have their crude and weaker versions related to them
I can now make a reaction like this:
[REAGENT:weapon:1:WEAPON:NONE:NONE:NONE] --- I just want any weapon
[HAS_MATERIAL_REACTION_PRODUCT:CRUDE_TARGET] --- now I want any WEAPON that is made from my 5 classed metals
[PRODUCT:100:150:BAR:NONE:GET_MATERIAL_FROM_REAGENT:weapon:CRUDE_TARGET]
now if this reaction grabbed a "iron long sword" I would get a "crude iron bar" in which I can use to forge other "crude iron" items at a forge or I can go farther and add
[REACTION_CLASS:CRUDE_METAL] to all the crude metals so I can use a cold-hammer reaction to take a bar of "crude" metal and make something from that.
You can stack/layer these things, or chain them all together. A material can have many REACTION_CLASSes or MATERIAL_REACTION_PRODUCTs just as long as their <custom_id>s are not the same
But you may wonder about my method of the crude metal, well I could have said take any IRON WEAPON and make a IRON_CRUDE BAR and had that reaction for all the true metals and crudes. But I knew I had break armor, break helm, break pants, break shoes, etc..
Now will I have each one 5 times? Or will I make break war-grade xxxx to get it's child "crude xxxx"
I chose the lazy path I don't like cluttering up a workshop with a huge list of reactions, when I can have a "do it all" reaction.
I hope there are not too many typos, or confusing issues. I typed this up late at night.