Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How do I force some reactions to fail?  (Read 1274 times)

YAHG

  • Bay Watcher
    • View Profile
How do I force some reactions to fail?
« on: August 17, 2014, 06:55:24 pm »

I am trying to redo some of the farming reactions but am having trouble making reactions like process plants fail for specific plants. I have a semi working custom reaction for getting thread from pigtails etc. and I have editing the pigtail raw to try to make it work for my custom reaction yet not work for the built in one.

My pigtail raw (I tried renaming it too make it wasn't just hardcorded to the structure with a given plant name)

Spoiler (click to show/hide)

Current working Custom Thread for reference:

Spoiler (click to show/hide)
I basically got away with adding the X to MILL when messing with cave wheat and sweet pods to get them both to fail an order to mill plants at a quern (I assume it will also fail a millstone).

What can I do to the raw so that the base plant will not fulfill a process plants order?

I suppose the custom thread one can be reworked to whatever makes it process plants proof afterwards.


edit: Process Plants is forcing the thread, and the forced thread is coming out as pig tail chests when it is used in the order "construct cloth bag", so either diverting through carding or yarn might work still to kill it unless anyone had a better trick :)) (The custom thread is working fine)
« Last Edit: August 17, 2014, 08:09:02 pm by YAHG »
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: How do I force some reactions to fail?
« Reply #1 on: August 18, 2014, 12:11:05 pm »

I am not sure but i think you use your threadx in several places where it is bad syntax.  Item tokens for example come strictly from this list.


http://dwarffortresswiki.org/index.php/40d:Item_token


See ,"plant tokens" too.  THREAD is specifically a valid token at top level in a plant definition.  You can,t just swap in THREADX and expect the parser to understand.
« Last Edit: August 18, 2014, 12:21:17 pm by smakemupagus »
Logged

YAHG

  • Bay Watcher
    • View Profile
Re: How do I force some reactions to fail?
« Reply #2 on: August 18, 2014, 03:37:02 pm »

Spoiler (click to show/hide)

It does though. I am not having a problem with the custom reaction working, its making cloth that makes bags (that work correctly as far as I can tell with seeds and flour/sugar). It seems like the default reaction seeming to have problems while it 'half fails' or something, I don't really know what the vanilla reaction is as far as tags go or if it even uses tags.

The issue I am having is trying to make the vanilla reaction on the farmers workshop "Process Plants" (thresher) fail to take my custom clone pigtails, while also making them via custom reaction into plant threads. The goal is to be able to replace the default farming reactions with custom ones that can be modded, etc.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: How do I force some reactions to fail?
« Reply #3 on: August 18, 2014, 04:29:35 pm »

Take a look at your errorlog.txt, and you will probably see some "Invalid plant token: THREADX" messages.

Specifying [THREAD:LOCAL_PLANT_MAT:whatever] is what allows the plant to be processed at a Farmer's workshop, so if you omit that token, you'll only be able to process it using your custom reactions.
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.

YAHG

  • Bay Watcher
    • View Profile
Re: How do I force some reactions to fail?
« Reply #4 on: August 18, 2014, 11:29:32 pm »

Spoiler (click to show/hide)

Worked perfectly, thank you.

Chevaleresse

  • Bay Watcher
  • A knight, returned from a journey weary and long
    • View Profile
    • Patreon
Re: How do I force some reactions to fail?
« Reply #5 on: August 18, 2014, 11:34:23 pm »

It's worth noting that stuff that is produced by a permitted reaction isn't usable by your civ during worldgen.
Logged
GM of Trespassers V2.
If you like my work, consider becoming a patron. (Since apparently people think this is a requirement: no, my game(s) are free to play and always will be.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: How do I force some reactions to fail?
« Reply #6 on: August 19, 2014, 06:24:27 am »

It's worth noting that stuff that is produced by a permitted reaction isn't usable by your civ during worldgen.
Actually, some things are - specifically, it examines available reactions in order to determine what types of leather your civilization can make (when it iterates across creature materials, it looks for reactions that take those materials and produce SKIN_TANNED).
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.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: How do I force some reactions to fail?
« Reply #7 on: August 19, 2014, 10:34:35 am »

It's worth noting that stuff that is produced by a permitted reaction isn't usable by your civ during worldgen.
Actually, some things are - specifically, it examines available reactions in order to determine what types of leather your civilization can make (when it iterates across creature materials, it looks for reactions that take those materials and produce SKIN_TANNED).
The famous example of this is steelmaking.  All Dwarven civs have access to steel in worldgen, and you can always bring along a steel anvil on your embark.  Even if the civ has no iron (and no iron anvils).
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

YAHG

  • Bay Watcher
    • View Profile
Re: How do I force some reactions to fail?
« Reply #8 on: August 19, 2014, 10:48:13 am »

Spoiler (click to show/hide)

This should make it possible to add embark items that cannot be made in fortress mode by the use of reactions with no building or for buildings not enabled to that entity?

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: How do I force some reactions to fail?
« Reply #9 on: August 19, 2014, 12:14:59 pm »

Not necessarily - the examples listed above are specific instances where the Entity initialization code checks for custom reactions. While you could use that to add types of metals, it would not be possible to add types of cloth.

For those interested, here is a full list of places where custom reactions can grant materials to civilizations, as of version 0.34.11 (0.40.xx has not yet been checked, but they are likely to be the same):

* Nearby minerals (based on geology near sites) with [SOIL]/[SOIL_SAND]/[SOIL_OCEAN] and [MATERIAL_REACTION_PRODUCT:FIRED_MAT:something] will add said soil material as a type of Clay available for trade. This also applies to the site finder.
* Creature materials (based on nearby wildlife) with [MATERIAL_REACTION_PRODUCT:some_mat:something], such that permitted reaction contains the token [PRODUCT:any_probability:any_number:SKIN_TANNED:NONE:GET_MATERIAL_FROM_REAGENT:any_reagent:some_mat], will add "something" as a type of Leather available foe trade (in case the leather material itself doesn't have the [LEATHER] token).
* Creature materials (based on nearby wildlife) with [MATERIAL_REACTION_PRODUCT:CHEESE_MAT:something] will add "something" as a type of Cheese available for trade.
* Custom reactions which produce BAR items made of specific metals (inorganic materials with [IS_METAL] but not [SPECIAL]/[DEEP_SURFACE]/[DEEP_SPECIAL]) will add that material as a type of Metal available for trade and general use (i.e. they'll sell bars of it and use it to make finished goods)
* Custom reactions which produce BAR items made of specific non-INORGANIC materials (i.e. Coke and Pearlash) will add those specific items as Miscellaneous Processed Wood items available for trade (under the "Other" section).
* Custom reactions which produce POWDER_MISC items of any specific material (i.e. Gypsum Plaster) will add those specific materials as types of Powders available for trade (along with plant mill products).

For a full list of everything an entity can use for trade, see here (the source of the above list, again only confirmed for version 0.34.11).
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.