Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Plant leather  (Read 1009 times)

Pickerel

  • Bay Watcher
    • View Profile
Plant leather
« on: December 06, 2010, 12:32:28 am »

My apologies for the brevity of this question, but I think I should be direct.

I have modded in a plant.  I want this specific plant to produce 'leather', or a material that acts like leather for all intensive purposes.  Is there a way to easily simply make it so it is automatically 'tanned' into leather, similar to the way 'plant powders' and such are handled, often specifying 'MILL' as the target building?  Can one target LEATHER_WORKING or something for the task?  Is this feasible at all?

I realize there's probably several ways to do it, but I have yet to figure out - and get working - one of my own, so all possible suggestions are welcome.

Thanks all!
Logged

Assassinfox

  • Bay Watcher
  • [FANCIFUL]
    • View Profile
    • Raging at the Box
Re: Plant leather
« Reply #1 on: December 06, 2010, 02:22:25 am »

Try adding this code to the plant's raw:

Code: [Select]
[MATERIAL_REACTION_PRODUCT:TAN_MAT:LOCAL_PLANT_MAT:NONE]

Pickerel

  • Bay Watcher
    • View Profile
Re: Plant leather
« Reply #2 on: December 07, 2010, 07:22:16 pm »

I tried this: it did not allow the item to be immediately used as a reagent for tanning.  Perhaps something I need to add to the tanning reaction that will allow it to handle this, or something that I can add to the plant to make it count as an animal for tanning purposes?  In other words, it obviously is not quite so simple as a single line/tag on the plant...  But maybe there is just a little more that will do it?

Anyone know?

Any other suggestions?

Once I know, I will be able to extrapolate to other things, including plant products and oils being renderable...  though I think I can also do this one already and am testing that out.
Logged

Hyndis

  • Bay Watcher
    • View Profile
Re: Plant leather
« Reply #3 on: December 07, 2010, 07:33:03 pm »

You may need to create a dummy creature, one that live in no biome and so does not appear normally.

Then create a reaction at a custom building that turns the plant into leather of that creature type. Also have the reaction produce a few plant seeds to ensure you have seeds to plant for the next crop.

I find that producing 2 seeds per reaction balances out well, so even if a dabbling farmer wastes a seed you're still okay.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Plant leather
« Reply #4 on: December 07, 2010, 08:56:36 pm »

The existing custom reaction for tanning has [USE_BODY_COMPONENT], which plants obviously are not. It'd probably be simple enough to just add a second custom reaction to the tanner's shop that takes your plant and outputs the SKIN_TANNED object along with your seeds:

Code: [Select]
[REACTION:TAN_A_PLANT]
[NAME:tan a plant]
[BUILDING:TANNER:CUSTOM_P]
[REAGENT:A:1:PLANT:NONE:NONE:NONE][UNROTTEN]
[HAS_MATERIAL_REACTION_PRODUCT:TAN_MAT]
[PRODUCT:100:1:SKIN_TANNED:NONE:GET_MATERIAL_FROM_REAGENT:A:TAN_MAT]
[PRODUCT:100:2:SEEDS:NONE:GET_MATERIAL_FROM_REAGENT:A:SEED_MAT]
[SKILL:TANNER]

Within the plant itself, add [USE_MATERIAL_TEMPLATE:LEATHER:LEATHER_TEMPLATE] and define any special properties it might need, then put [MATERIAL_REACTION_PRODUCT:TAN_MAT:LOCAL_PLANT_MAT:LEATHER] and [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED] in the plant's STRUCTURAL material definition. If you had a seedless plant that produced leather, you'd probably need a separate reaction that doesn't try to produce seeds (since they'd be made from a nonexistent material).
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.

Aramco

  • Bay Watcher
    • View Profile
Re: Plant leather
« Reply #5 on: December 07, 2010, 09:53:12 pm »

You may need to the [AUTOMATIC] tag from the 'tan a hide' reaction.
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Plant leather
« Reply #6 on: December 07, 2010, 09:59:13 pm »

You may need to the [AUTOMATIC] tag from the 'tan a hide' reaction.
No, you'd only want that if you want said plants to be automatically tanned - given that stockpiled plants don't rot (and that you generally produce plants in large quantities), there's really no need to make it automatic.
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.

Aramco

  • Bay Watcher
    • View Profile
Re: Plant leather
« Reply #7 on: December 07, 2010, 10:01:52 pm »

You may need to the [AUTOMATIC] tag from the 'tan a hide' reaction.
No, you'd only want that if you want said plants to be automatically tanned - given that stockpiled plants don't rot (and that you generally produce plants in large quantities), there's really no need to make it automatic.

I meant to remove the tag, just a typo there.
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

kwd1968

  • Bay Watcher
    • View Profile
Re: Plant leather
« Reply #8 on: December 07, 2010, 11:42:44 pm »

I can see that following procedure/convention is all good but there's an easier way to do trhe reactions without having to go nuts on your plant_mats.  You can ask for the reagent by specific name as well, thus negating the need for all the material_reaction stuff like so (if  the plant was named "LEATHERLEAF")

Code: [Select]
[REAGENT:A:1:PLANT:NONE:PLANT_MAT:LEATHERLEAF:PLANT]
[PRODUCT:100:1:SKIN_TANNED:NONE:GET_MATERIAL_FROM_REAGENT:A:NONE]
[PRODUCT:100:2:SEEDS:NONE:PLANT_MAT:LEATHERLEAF:SEED]

Since it's a one off reaction it's actually a little easier/less time consuming to just use the specific plant names for the reaction but the above method works just as well and if you throw in a second type of leatherable plant, is much more efficient.

As far as the whole SEED_MAT thing tho, I think you can always just use SEED in that instance since the variable is set for the plant already.

But I havent done a regular DF mod in a while so I may be totally wrong... and not for the first time either >:P