Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Help with some simple reactions  (Read 3479 times)

Jtedwards670

  • Bay Watcher
    • View Profile
Help with some simple reactions
« on: July 17, 2012, 03:42:52 pm »

I am extremely new to this modding thing as it will soon become painfully obviously. I have read over all the guides that I could but still am extremely lost. For just practice I created two simple new workshops and some simple reactions that will reduce the need for animals to help with my FPS problems. (Barnyard and Bee Farm) This is what I have so far:

Spoiler (click to show/hide)

I am lost trying to make eggs collectable. I would like to be able to have a single reaction called "Collect Poultry Eggs" that will have the possibility to collect chicken, turkey and peahen eggs. I know I am doing something wrong since all I end up with is a generic "Egg" that are not cookable. I tried for hours last night at work with little success with what I thought would have been a simple reaction. I appreciate any and all that could help me out.  ;D

P.S. If it matters I am tinkering with the wonderful masterwork mod. I hope that's not a problem with the creator.

Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #1 on: July 17, 2012, 07:42:53 pm »

Download the wiki in my sig, I have a guide to Reactions.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Help with some simple reactions
« Reply #2 on: July 17, 2012, 08:49:57 pm »

It is not possible to properly create eggs using custom reactions, just as it is also not possible to create vermin (tamed or not), remains, or fish (raw or prepared) - you would need to specify a Caste, but the game doesn't actually parse the caste so you end up with an invalid item.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #3 on: July 18, 2012, 02:11:42 am »

Thanks for the help. The guide is very helpful and provides an abundance of excellent information, although extremely daunting. I have no idea how any of you were able to learn this stuff!! Would you recommend I start with a clean vanilla version of DF to play around with?

Honestly, it is worth it to continue trying if I have very little knowledge of programming?
« Last Edit: July 18, 2012, 07:16:06 am by Jtedwards670 »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #4 on: July 18, 2012, 11:09:45 am »

Trail and error for me.

Programming helps a little, but Modding DF can help Programming.
It's all about "Order of Operations" and basically databases/classes

It's all how you wrap your mind around things to better help you understands.

I recommend playing around with a clean DF adding altering, etc. before you try to alter anyother mod. As every modder (like every programmer) has their own style of modding. So it takes time to see "What did they do?" before you can alter any raws.
Logged

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #5 on: July 18, 2012, 02:26:44 pm »

As much as I hate to ask it, how do you test if your reactions work? I have been regenerating world(depending on what I did), striking the earth, building the workshop and testing the reaction.


I love your wiki Hugo, many thanks.
« Last Edit: July 18, 2012, 02:28:15 pm by Jtedwards670 »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #6 on: July 18, 2012, 05:20:00 pm »

you can make them adv. mode enabled, and test them in arena mode. BTW make sure you enable reactions in the entity, and make cheat reactions to porduce the reagents aswell.

Thank you :P altho I can only take thanks on putting it together, all the info is from the real wiki :P altho the "Reactions and You" is my own guide. And the one above that is Putnam's Accents.

Logged

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #7 on: July 19, 2012, 05:33:06 am »

So after a long time of putzing around I have five reactions I like but one that needs help. I also have a few questions if someone doesn't mind helping me with.

 
Spoiler (click to show/hide)

Compost meal does not work at all like I want. I know it is not right because if you look at the reaction in game it states that it only needs any "item" so it grabs any old thing, even the potash from the previous reaction which is kinda entertaining.

Why does "[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]" act differently between a barrel with (5) Plump helmet wine and (5) Jaguar intestines or (5) Pig Tails that get taken from a barrel and brought over in a stack? I had to either drastically reduce the probability of the two or stick on that reaction token on them.

I know that there is a "[UNROTTEN]" token but is there any way for a "[Rotten]" to be used? I would like a reaction that "Composts Rotting Material."

Finally, my compost Drink reaction refers to only drinks made from plants. If I put NONE in where the PLANT_MAT is then would that include mead and what not??

As always, many thanks.

(That booze reaction took me FOREVER)
« Last Edit: July 19, 2012, 05:47:36 am by Jtedwards670 »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #8 on: July 19, 2012, 11:40:27 am »

for BOOZE I'm sure you just need that

DRINK:NONE:NONE:NONE

as for FOOD/prepared meals those are currently a bugged ITEM type
Logged

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #9 on: July 21, 2012, 07:12:51 am »

So I have actually made quite a bit of progress but there is one thing at the this moment I can't wrap my feeble lil mind around. Can someone explain to me what is the difference between [REACTION_CLASS] and [MATERIAL_REACTION_PRODUCT]? Yes I have read the wiki and Hugo's explanation NUMEROUS times. I just don't understand when to use the second choice when I can just add a reaction class to the item.

EXAMPLE:
I decided to be able to process certain plants into a generic Vegetable oil. So I simply added [USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE] and [REACTION_CLASS:VEGETABLE_OIL_PLANT] to the plants I wanted. Then in the reaction just called for plants with that reaction class.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Help with some simple reactions
« Reply #10 on: July 21, 2012, 07:22:56 am »

REACTION_CLASS and MATERIAL_REACTION_PRODUCT are mostly the same purpose - the only difference is that REACTION_CLASS does not specify what the material becomes, just what it's used for. It helps to know that REACTION_CLASS dates back to 40d and earlier (and used solely for flux stones when making pig iron and steel), while MATERIAL_REACTION_PRODUCT was introduced in version 0.31. You generally don't need to use both of them - one will suffice.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #11 on: July 21, 2012, 07:53:30 am »

So lets say I used [MATERIAL_REACTION_CLASS:VEGETABLE_OIL_PLANT] instead of what I did. Does that mean that the vegetable oil that is the result will be class as that?

[REACTION:PROCESS_OIL]
   [NAME:Process Plants into Oil]
   [BUILDING:PLANT_PROCESS:CUSTOM_O]
   [REAGENT:A:5:PLANT:NONE:NONE:NONE]
      [REACTION_CLASS:VEGETABLE_OIL_PLANT] <--[HAS_MATERIAL_REACTION_CLASS:VEGETABLE_OIL_PLANT]
      [UNROTTEN]

So...

[REAGENT:A:1:NONE:NONE:NONE:NONE]
[REACTION_CLASS:VEGETABLE_OIL_PLANT]

would call on the plants with that AND any products that were made from them?
« Last Edit: July 21, 2012, 08:07:13 am by Jtedwards670 »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #12 on: July 21, 2012, 11:11:55 am »

Well like Quietust said, and I even explain in my tutorial is that

REACTION_CLASS
only classes a material

Material Reaction Product
Classes and Defines a case in which it can be turned into another material (pre-exsisting)

So are you turing vegtable oil into another material or what?
your uncertany of which method to use means you need to step back and rethink
Logged

Jtedwards670

  • Bay Watcher
    • View Profile
Re: Help with some simple reactions
« Reply #13 on: July 21, 2012, 02:19:35 pm »

Spoiler (click to show/hide)
Nevermind that part, I'm a moron...

Also how do I pull a single item out of a stack to be used instead of using 5 plump helmets when I only call for 1? This still applies though.
« Last Edit: July 21, 2012, 06:09:39 pm by Jtedwards670 »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Help with some simple reactions
« Reply #14 on: July 21, 2012, 08:08:50 pm »

Saddly.... Impossible, since custom reactions atm just eat a whole stack no matter what. You can do the Ratio trick which I think I mentioned in the "Reactions and You" if not REACTION_CLASS and HMRP both allow for ratios if the PRODUCT gets it's material from that reagent.

EDIT: only clunky workaround is using the ratio trick to make a non-stackable item like a WEAPON or TOOL or BOULDER.
Logged
Pages: [1] 2