Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Why do these reactions accept any plants?  (Read 1071 times)

katana

  • Bay Watcher
  • EVERY TIME I POST PEOPLE RUN AWAY
    • View Profile
Why do these reactions accept any plants?
« on: June 23, 2011, 05:49:07 pm »

REACTION:FORM_PURPLE_CAP_WOOD]
   [NAME:make dwarf cap wood from plants]
   [BUILDING:CRAFTSMAN:CUSTOM_SHIFT_S]
   [REAGENT:dwarf caps:5:PLANT:PURPLE_CAP_PLANT_SL:NONE:NONE][UNROTTEN]
   [PRODUCT:100:1:WOOD:NO_SUBTYPE:PLANT_MAT:PURPLE_CAP_SL:WOOD]

   [SKILL:HERBALISM]

[REACTION:FORM_IRON_CAP_METAL]
   [NAME:make iron cap metal from plants]
   [BUILDING:CRAFTSMAN:CUSTOM_SHIFT_S]
   [REAGENT:dwarf caps:10:PLANT:PURPLE_CAP_PLANT_SL:NONE:NONE]
   [REAGENT:iron cap:20:PLANT:IRON_CAP_SL:NONE:NONE][UNROTTEN]
   [PRODUCT:100:1:BAR:NO_SUBTYPE:METAL:CAP_IRON]
   [SKILL:HERBALISM]

Instead of iron_cap_sl and purple_cap_plant_sl being used, any available plant is used instead. Could somebody tell me the problem?
Logged
AND IF THIS FAILS MY IDENTICAL TWIN BROTHER WHO WILL APPEAR IN THE MIGRANT WAVE THAT ARRIVES AFTER MY DEMISE WILL REPLACE ME.
(Tldr: THERE IS NO SUCH THING AS FRIENDLY FIRE SALT)

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #1 on: June 23, 2011, 06:07:11 pm »

Edit: Oops, disregard this. I wasn't thinking straight when I read your post. Poster below me has it right.
« Last Edit: June 23, 2011, 06:10:20 pm by thatkid »
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #2 on: June 23, 2011, 06:08:17 pm »

You're using an item subtype where it doesn't belong. Try [REAGENT:dwarf caps:5:PLANT:NONE:PLANT_MAT:PURPLE_CAP_PLANT_SL:STRUCTURAL][UNROTTEN] for the first reaction and modify for the second.

EDIT: -snip- Poster above retracted info

EDIT2: To explain better what is happening - the game sees it needs a PLANT type item (and ignores the subtype since PLANT doesn't take a subtype) then looks to see what restrictions it has on the material for the plant item: NONE:NONE. Sweet, it can grab any plant it wants!

With the modification, the game sees it needs a PLANT type item (and ignores the subtype since PLANT doesn't take a subtype) then looks to see what restrictions it has on the material for the plant item: PLANT_MAT:PURPLE_CAP_PLANT_SL:STRUCTURAL. Okay, it needs to pick plant items that are made out of purple cap structural material - which (if your purple caps raws are similar to the default plant raws) means harvested purple caps.
« Last Edit: June 23, 2011, 06:17:22 pm by Kweri »
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Why do these reactions accept any plants?
« Reply #3 on: June 23, 2011, 08:23:27 pm »

Specifically, the plant submaterial should be whatever the plant uses for its [BASIC_MAT] - for example, since plump helmets have [BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL], you would use PLANT_MAT:MUSHROOM_HELMET_PLUMP:STRUCTURAL (since, within a plant definition, the string "LOCAL_PLANT_MAT" is an alias for "PLANT_MAT:CURRENT_PLANT_OBJECT_ID" - the same is true for "LOCAL_CREATURE_MAT" and "CREATURE_MAT:CURRENT_CREATURE_OBJECT_ID").
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.

katana

  • Bay Watcher
  • EVERY TIME I POST PEOPLE RUN AWAY
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #4 on: June 24, 2011, 04:05:31 am »

Thanks. So if I'm understanding correctly,
[PRODUCT:seeds:1:SEEDS:NONE:PURPLE_CAP_PLANT_SL:SEED]
would produce a purple cap plant seed?
Logged
AND IF THIS FAILS MY IDENTICAL TWIN BROTHER WHO WILL APPEAR IN THE MIGRANT WAVE THAT ARRIVES AFTER MY DEMISE WILL REPLACE ME.
(Tldr: THERE IS NO SUCH THING AS FRIENDLY FIRE SALT)

katana

  • Bay Watcher
  • EVERY TIME I POST PEOPLE RUN AWAY
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #5 on: June 24, 2011, 05:28:23 am »

Oh no D:! When I use what you wrote, I get:
Code: [Select]

*** Error(s) finalizing the reaction FORM_PURPLE_CAP_WOOD
FORM_PURPLE_CAP_WOOD:Unrecognized Material Token: PURPLE_CAP_PLANT_SL
*** Error(s) finalizing the reaction FORM_PURPLE_CAP_WOOD
FORM_PURPLE_CAP_WOOD:Unrecognized Material Token: PURPLE_CAP_PLANT_SL
*** Error(s) finalizing the reaction FORM_PURPLE_CAP_WOOD
FORM_PURPLE_CAP_WOOD:Unrecognized Material Token: PURPLE_CAP_PLANT_SL
*** Error(s) finalizing the reaction FORM_PURPLE_CAP_WOOD
FORM_PURPLE_CAP_WOOD:Unrecognized Material Token: PURPLE_CAP_PLANT_SL

The reaction:
Code: [Select]
[REACTION:FORM_PURPLE_CAP_WOOD]
[NAME:make dwarf cap wood from plants]
[BUILDING:CRAFTSMAN:CUSTOM_SHIFT_S]
[REAGENT:dwarf caps:5:PLANT:NONE:PLANT_MAT:PURPLE_CAP_PLANT_SL:STRUCTURAL][UNROTTEN]
[PRODUCT:100:1:WOOD:NO_SUBTYPE:PLANT_MAT:PURPLE_CAP_SL:WOOD]
[SKILL:HERBALISM]

The plant:
Code: [Select]

[PLANT:PURPLE_CAP_PLANT_SL]
   [NAME:dwarf cap][NAME_PLURAL:dwarf caps][ADJ:dwarf cap]
   [USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
      [MATERIAL_VALUE:2]
      [EDIBLE_RAW]
      [EDIBLE_COOKED]
   [BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
   [PICKED_TILE:6][PICKED_COLOR:5:0:0]
   [GROWDUR:3000][VALUE:2]
   [USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
      The material template is just called "alcohol" so we need to give it a proper name.
      [STATE_NAME_ADJ:ALL_SOLID:frozen cap wine]
      [STATE_NAME_ADJ:LIQUID:cap wine]
      [STATE_NAME_ADJ:GAS:boiling cap wine]
      We also set a few more numbers to distinguish the alcohol from the template.
      [MATERIAL_VALUE:2]
      [DISPLAY_COLOR:5:0:0]
      [EDIBLE_RAW]
      [EDIBLE_COOKED]
      [PREFIX:NONE]
   [DRINK:LOCAL_PLANT_MAT:DRINK]
   [USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
      [MATERIAL_VALUE:1]
      [EDIBLE_VERMIN]
      [EDIBLE_COOKED]
   [SEED:dwarf cap spawn:dwarf cap spawn:4:0:1:LOCAL_PLANT_MAT:SEED]
   [SPRING][SUMMER][AUTUMN][WINTER]
   [FREQUENCY:100]
   [CLUSTERSIZE:2]
   [PREFSTRING:great size]
   [WET][DRY]
   [BIOME:SUBTERRANEAN_WATER]
   [UNDERGROUND_DEPTH:1:3]
   [SHRUB_TILE:58]
   [DEAD_SHRUB_TILE:58]
   [SHRUB_COLOR:5:0:0]
   [DEAD_SHRUB_COLOR:0:0:1]
(in plant standard)
Logged
AND IF THIS FAILS MY IDENTICAL TWIN BROTHER WHO WILL APPEAR IN THE MIGRANT WAVE THAT ARRIVES AFTER MY DEMISE WILL REPLACE ME.
(Tldr: THERE IS NO SUCH THING AS FRIENDLY FIRE SALT)

Kweri

  • Bay Watcher
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #6 on: June 24, 2011, 11:21:34 am »

Thanks. So if I'm understanding correctly,
[PRODUCT:seeds:1:SEEDS:NONE:PURPLE_CAP_PLANT_SL:SEED]
would produce a purple cap plant seed?

SEEDS:NONE:PLANT_MAT:PURPLE_CAP_PLANT_SL:SEED

Quote
*** Error(s) finalizing the reaction FORM_PURPLE_CAP_WOOD
FORM_PURPLE_CAP_WOOD:Unrecognized Material Token: PURPLE_CAP_PLANT_SL
Hrm, weird. Looking into this now.

EDIT: Put this into my game and no errors. Try clearing your errorlog and trying again - they may have been old errors. I also tested the reaction (had to make my own PURPLE_CAP_SL since you didn't include raws but I don't think there are issues there) and everything worked fine (make sure to add PERMITTED_REACTION:FORM_PURPLE_CAP_WOOD to your entity before genning a new world!)
« Last Edit: June 24, 2011, 11:32:14 am by Kweri »
Logged

katana

  • Bay Watcher
  • EVERY TIME I POST PEOPLE RUN AWAY
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #7 on: June 24, 2011, 11:52:22 am »

That works, but
   [PRODUCT:SEEDS:NONE:PLANT_MAT:PURPLE_CAP_PLANT_SL:SEED]
Produces no seeds. I swear I'm doing something wrong now.
Logged
AND IF THIS FAILS MY IDENTICAL TWIN BROTHER WHO WILL APPEAR IN THE MIGRANT WAVE THAT ARRIVES AFTER MY DEMISE WILL REPLACE ME.
(Tldr: THERE IS NO SUCH THING AS FRIENDLY FIRE SALT)

Kweri

  • Bay Watcher
    • View Profile
Re: Why do these reactions accept any plants?
« Reply #8 on: June 24, 2011, 01:03:38 pm »

The format on your product tag is likely incorrect -
[PRODUCT:<probability>:<quantity>:<item token>:<material token>]

So [PRODUCT:100:1:SEEDS:NONE:PLANT_MAT:PURPLE_CAP_PLANT_SL:SEED]
Logged