Bay 12 Games Forum

Please login or register.

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

Author Topic: Making wood into a different wood  (Read 2301 times)

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Making wood into a different wood
« on: August 16, 2011, 04:37:44 pm »

Hi, all.

  I'm having trouble with a reaction, which is supposed to take wooden spears and convert them to fire-hardened wood spears. It inputs nicely enough, but my output is "spears" with no visible material type at all.

Spoiler (click to show/hide)
And as I understand it, I need a new plant type for the fire-hardened wood material.

Spoiler (click to show/hide)

Anyone see where I've gone wrong?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Making wood into a different wood
« Reply #1 on: August 16, 2011, 04:48:25 pm »

You need a plant called FIRE_HARDENED_WOOD, I'm pretty sure.

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: Making wood into a different wood
« Reply #2 on: August 16, 2011, 05:19:34 pm »

Bah! There's typo number 1! Thanks! Now the spears are simply disappearing.
Logged

JediaKyrol

  • Bay Watcher
  • I have no idea what I am doing...
    • View Profile
Re: Making wood into a different wood
« Reply #3 on: August 16, 2011, 05:23:21 pm »

I think in the product instead of "PLANT_MAT" you should have "NONE"
Logged

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: Making wood into a different wood
« Reply #4 on: August 16, 2011, 05:34:58 pm »



[PRODUCT:100:5:WEAPON:ITEM_WEAPON_SPEAR:PLANT_MAT:FIRE_HARDENED:WOOD]


Note that these spears are not actually any harder than regular wood unless you edit the material properties in the plant definition.

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: Making wood into a different wood
« Reply #5 on: August 16, 2011, 08:46:08 pm »

Well, the spears are back, but they still have no material type. Here's the raws again.
Spoiler (click to show/hide)
And the plant def.
Spoiler (click to show/hide)
Thanks all!
Logged

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Making wood into a different wood
« Reply #6 on: August 16, 2011, 09:09:09 pm »

I'd advise changing the fire-hardened wood to be ~copper-bronze (?) equivalent. Copy-paste the tags from the metal after adding a (few?) tag(s?) to tell the game that you want to fiddle with the wood material for the tree.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: Making wood into a different wood
« Reply #7 on: August 17, 2011, 02:36:38 am »

Well, I still have to get the material to change from one thing to another. The actual qualities of the material is currently... immaterial.

Oh. I forgot to add [OBJECT:PLANT] to the top of the plant file as well. Everything is working now, thanks all!
Logged

Nidokoenig

  • Bay Watcher
    • View Profile
Re: Making wood into a different wood
« Reply #8 on: August 17, 2011, 03:16:46 am »

You don't actually need a new plant, just a new material definition under that plant. Here's an example from My Little Fortress:

Code: [Select]
[REACTION:PONY_PAINT_WOOD_BLACK_BASIC]
   [NAME:paint wood black]
   [BUILDING:PONY_WOOD_PAINT:CUSTOM_SHIFT_K]
   [REAGENT:wood:1:WOOD:NO_SUBTYPE:NONE:LOCAL_PLANT_MAT:WOOD]
[HAS_MATERIAL_REACTION_PRODUCT:PAINT_MAT_BLACK_BASIC]
   [REAGENT:dye:100:NONE:NONE:NONE:NONE][REACTION_CLASS:PAINT_MAT_BLACK_BASIC_DYE]
   [REAGENT:dye bag:1:NONE:NONE:NONE:NONE]
[CONTAINS:dye]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
   [PRODUCT:100:1:WOOD:NO_SUBTYPE:GET_MATERIAL_FROM_REAGENT:wood:PAINT_MAT_BLACK_BASIC]
   [SKILL:DYER]

And here's the black paint definition for a random plant, though there's barely anything going on with it:

Code: [Select]
[USE_MATERIAL_TEMPLATE:BLACK_WOOD:WOOD_TEMPLATE]
[STATE_NAME:ALL_SOLID:black painted conjured plump helmet]
[STATE_ADJ:ALL_SOLID:black painted conjured plump helmet]
[PREFIX:NONE]
[STATE_COLOR:ALL_SOLID:BLACK]
[DISPLAY_COLOR:0:0:0]
[MATERIAL_VALUE:2]

So what I'd do is make a fire-hardened wood template, then add it to each type of wood individually, rename it and give the main wood material [MATERIAL_REACTION_PRODUCT:FIRE_HARD_WOOD] or whatever you call the material. Then your reaction should be:

Code: [Select]
[REACTION:FIRE_SPEARS]

[NAME:bake fire-hardened spears]

[BUILDING:KILN:NONE]

[REAGENT:WOODSPEAR:5:WEAPON:ITEM_WEAPON_SPEAR:WOOD:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:FIRE_HARD_WOOD]

[REAGENT:FUEL:1:WOOD:NONE:NONE:NONE]

[PRODUCT:100:5:WEAPON:ITEM_WEAPON_SPEAR:GET_MATERIAL_FROM_REAGENT:WOODSPEAR:FIRE_HARD_WOOD]

[SKILL:WOOD_BURNING]
Logged

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: Making wood into a different wood
« Reply #9 on: August 17, 2011, 04:31:16 am »

I see, I see. That is a good way to do it; it would even prevent fire hardened spears being used as reagents, as they would lack the [HAS_MATERIAL_REACTION_PRODUCT:FIRE_HARD_WOOD] tag. I'll definitely need to puzzle out this method.
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Making wood into a different wood
« Reply #10 on: August 17, 2011, 12:13:37 pm »

Spoiler (click to show/hide)

Well, there's one problem right away - SOLID_DENSITY and MAX_EDGE are material tokens, but they aren't located within the WOOD submaterial definition (once the raw parser sees a token that doesn't belong to a material, it "closes" the material and parses all subsequent tokens as if they were for the plant itself).

Check your errorlog.txt (delete it, then run the game again and test the error condition) - it's bound to tell you what's wrong.
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.

BigFatStupidHead

  • Bay Watcher
  • obscure to the point of being cryptic
    • View Profile
Re: Making wood into a different wood
« Reply #11 on: August 17, 2011, 04:39:24 pm »

So, SOLID_DENSITY and MAX_EDGE should go after the [USE_MATERIAL_TEMPLATE:WOOD:WOOD_TEMPLATE] and before the [TREE:LOCAL_PLANT_MAT:WOOD] tags in the indented section, right? I haven't yet researched materials raw anatomy too extensively. And thanks for the reminder about the errorlog.txt, it's pointed out a couple of mistakes I would have otherwise overlooked. [ HUNTER] is absolutely not the same as [HUNTER].
Logged

nil

  • Bay Watcher
  • whoa
    • View Profile
Making wood into MEAT
« Reply #12 on: August 17, 2011, 07:20:28 pm »

So I have a similar problem.  I'm trying to create a custom workshop capible of turning wood into "woodmeal," an edible food. Largely by reading this thread, I think I've gotten everything working up until the end.  The "termiteman" with the proper labor enabled will grab logs, bring them to the workshop, and turn them into globs (globs being the item token I could find that was closest to what I wanted).  However, said globs appear to be totally generic; they are named just "glob," the 'k' description says only that "This is a glob" and it doesn't affect any of the food totals in the z-screen.  I have tried to swap "glob" out for "meat," which creates generic chunks of meat that do show up in the z-screen but don't get stockpiled.  Still testing as to whether they're edible (edit: they will eat the mystery meat), but even if they are I'd really like them to be properly labeled and stocked.

reaction:
Spoiler (click to show/hide)
An alternative attempt at the product field created the same result:
Spoiler (click to show/hide)

Here's the material template entry for "woodmeal" (it's mostly just a copy-paste of the muscle entry)
Spoiler (click to show/hide)
and here's the section of the plant entry I stuck into all the trees:
Spoiler (click to show/hide)

Any takers?  I have a feeling I'm missing something really simple and obvious...
« Last Edit: August 17, 2011, 07:25:32 pm by nil »
Logged

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: Making wood into a different wood
« Reply #13 on: August 17, 2011, 07:32:22 pm »

[REACTION:PROCESS_WOOD_INTO_WOODMEAL]
   [NAME:process wood into woodmeal]
   [BUILDING:WOOD_PROCESSING:CUSTOM_P]
   [REAGENT:wood:1:WOOD:NO_SUBTYPE:NONE:NONE]
   [PRODUCT:100:1:GLOB:NO_SUBTYPE:GET_MATERIAL_FROM_REGENT:wood:CREATE_WOODMEAL]
   [SKILL:PROCESSPLANTS]

The bold part needs to just be WOODMEAL because that's what you named it in the plant entries.


Explanation:

 [USE_MATERIAL_TEMPLATE:WOODMEAL:WOODMEAL_TEMPLATE]

The second field in this token is the local material name.  It can be anything from WOODMEAL to PEZDISPENSERS, it doesn't matter, it's a local variable.

[PRODUCT:100:1:GLOB:NO_SUBTYPE:GET_MATERIAL_FROM_REAGENT:(reagent ID):(reagent local material)] (if applicable, else NONE)

The last field needs to match whatever you called the material in the USE_MATERIAL_TEMPLATE token for the plant.  The template itself is just a saved list of material properties that you can load up with the USE_MATERIAL_TEMPLATE token, assign a name to, and then modify as necessary.
« Last Edit: August 17, 2011, 07:39:15 pm by narhiril »
Logged

nil

  • Bay Watcher
  • whoa
    • View Profile
Re: Making wood into a different wood
« Reply #14 on: August 17, 2011, 08:06:02 pm »

Well, that's certainly a start--according to the screen you can get to from the workshop when there is no wood available, there is now a reaction that duly converts logs into "WOODMEAL Glob"s, but apparently the mistake you caught wasn't the only one: the product is still an unlabeled, unstockpilable and inedible "a glob."  I can solve the last part by using meat instead of globs, but I'd still like to get the label and stockpiling in...
Pages: [1] 2