One of more of these would be great for organizing reactions, or having far fewer, making the actual referencing of a reaction more similar to the randomization in many hard-coded things.
1. Boolean Referencing:
One thing that could greatly reduce the number of reactions needing to be separately made when a general task is in order, is Boolean references. It would actually implement similar to the Caste system. For example, if there's ten things to be created, or 31 different ones as in glassworking, instead of multiple separate reactions, one could have one reaction, and variants. I will quickly work up an example for glazes. Currently, there are our reactions to glaze crafts, jugs, pots, and statues. This is just copied and pasted from the raws:
[REACTION:GLAZE_JUG]
[NAME:glaze clay/stone jug]
[BUILDING:KILN:CUSTOM_G]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[REAGENT:jug:1:TOOL:ITEM_TOOL_JUG:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:jug:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
[REACTION:GLAZE_STATUE]
[NAME:glaze clay/stone statue]
[BUILDING:KILN:CUSTOM_SHIFT_G]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[REAGENT:statue:1:STATUE:NONE:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:statue:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
[REACTION:GLAZE_LARGE_POT]
[NAME:glaze large clay/stone pot]
[BUILDING:KILN:CUSTOM_ALT_G]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[REAGENT:large pot:1:TOOL:ITEM_TOOL_LARGE_POT:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:large pot:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
[REACTION:GLAZE_CRAFT]
[NAME:glaze clay/stone craft]
[BUILDING:KILN:CUSTOM_SHIFT_C]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[REAGENT:craft:1:ANY_CRAFT:NONE:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:craft:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
However if you implemented the AND/OR function, it could be just one reaction:
[REACTION:GLAZE_FINISHED_ITEM]
[NAME:glaze clay/stone finished item]
[BUILDING:KILN:CUSTOM_G]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[AND]
[REAGENT:item:1:TOOL:ITEM_TOOL_JUG:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[OR]
[REAGENT:item:1:STATUE:NONE:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[OR]
[REAGENT:item:1:TOOL:ITEM_TOOL_LARGE_POT:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[OR]
[REAGENT:item:1:ANY_CRAFT:NONE:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:item:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
What this is basically telling it is to use any glaze (due to the AND) and then to use one of the other options (statue, craft, ect.). This would show up in the kiln as one reaction, and the person would have no control over what it used other than the usual control over placement nearer the kiln, of course, but the thing to point out is then it would be more like a lot of hardcoded things, like gem-decorating, and all sorts of other 'decorate with' tasks, as well as milling and dyeing: they choose an item of the proper material, but one normally has no control over what it is. Sometimes, that's actually a good thing, because it cuts down on micromanaging, in this case of glazing.
2. Another way something similar could be done is with the ability to define one's own terms. This would work similar to your definitions like ANY_RAW_MATERIAL. For example, if I wanted to have one reaction that referred to all four of the above items, I could have, at the top of the raw, something like:
[DEFINE_GROUP:GLAZEABLE_FINISHED_PRODUCTS]
[COMPONENT:TOOL:ITEM_TOOL_LARGE_POT:NONE:NONE]
[COMPONENT:TOOL:ITEM_TOOL_JUG:NONE:NONE]
[COMPONENT:STATUE:NONE:NONE:NONE]
[COMPONENT:CRAFTS:NONE:NONE:NONE]
And then the reaction could be as short as...
[REACTION:GLAZE_FINISHED_ITEM]
[NAME:glaze large clay/stone finished item]
[BUILDING:KILN:CUSTOM_ALT_G]
[REAGENT:glaze:1:ANY_RAW_MATERIAL:NONE:NONE:NONE]
[HAS_MATERIAL_REACTION_PRODUCT:GLAZE_MAT]
[REAGENT:item:1:GLAZEABLE_FINISHED_PRODUCTS:NONE:NONE:NONE]
[REACTION_CLASS:CAN_GLAZE]
[EMPTY]
[NOT_IMPROVED]
[PRESERVE_REAGENT]
[IMPROVEMENT:100:item:GLAZED:GET_MATERIAL_FROM_REAGENT:glaze:GLAZE_MAT]
[FUEL]
[SKILL:GLAZING]
3. Caste-like reactions: This could actually go well with another suggestion I had, which is a way to have categories and subcategories, like how at the loom you first choose your category (cloth type), and then your actual task. Because I am more familiar with it, I will use glass items as an example, though.
For glass:the 31 reactions could be shortened from such a list (pardon, taking this example from my own mod, hence it's not GLASS_GREEN or anything). I will use only 4 of the 31 or so, just to illustrate without spamming.
Currently, to make glass do exactly what I want, I do it as such (though I also had to put it in a different building because we can't mod into the glass building, and it would clutter it up anyway):
[REACTION:MAKE_RED_GLASS_RAW]
[NAME:Make raw ruby glass]
[BUILDING:RED_GLASS_SHOP:CUSTOM_G]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:sandbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[PRODUCT:100:1:ROUGH:NONE:INORGANIC:GLASS_RED]
[FUEL]
[SKILL:GLASSMAKER]
[REACTION:MAKE_RED_GLASS_ARMOR_STAND]
[NAME:Construct ruby glass Armor Stand]
[BUILDING:RED_GLASS_SHOP:CUSTOM_A]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:bag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[PRODUCT:100:1:ARMORSTAND:NONE:INORGANIC:GLASS_RED]
[FUEL]
[SKILL:GLASSMAKER]
[REACTION:MAKE_RED_GLASS_BOX]
[NAME:Construct ruby glass Box]
[BUILDING:RED_GLASS_SHOP:CUSTOM_H]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:bag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[PRODUCT:100:1:BOX:NONE:INORGANIC:GLASS_RED]
[FUEL]
[SKILL:GLASSMAKER]
[REACTION:MAKE_RED_GLASS_CABINET]
[NAME:Construct ruby glass Cabinet]
[BUILDING:RED_GLASS_SHOP:CUSTOM_F]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:bag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[PRODUCT:100:1:CABINET:NONE:INORGANIC:GLASS_RED]
[FUEL]
[SKILL:GLASSMAKER]
But if reactions could be referenced in the raws like castes, this could be shortened to (and the specifics I am making up here...
[REACTION:1:RED_GLASS] (the '1' says this is 'tier one', the category, like at the glass furnace it is 'green glass' vs 'clear glass' vs 'crystal glass'). All traits given to this category are automatically applied to all subcategories.
[NAME:red glass]
[BUILDING:RED_GLASS_SHOP:CUSTOM_R]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:sandbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[FUEL]
[SKILL:GLASSMAKER]
[REACTION:2:MAKE_RAW_RED_GLASS]
[NAME:make raw red glass]
[KEY:CUSTOM_G]
[PRODUCT:100:1:ROUGH:NONE:INORGANIC:GLASS_RED]
[REACTION:2:MAKE_RED_GLASS_ARMOR_STAND]
[NAME:Construct ruby glass Armor Stand]
[KEY:CUSTOM_A]
[PRODUCT:100:1:ARMORSTAND:NONE:INORGANIC:GLASS_RED]
[REACTION:2:MAKE_RED_GLASS_BOX]
[NAME:Construct ruby glass Box]
[KEY:CUSTOM_H]
[PRODUCT:100:1:BOX:NONE:INORGANIC:GLASS_RED]
[REACTION:2:MAKE_RED_GLASS_CABINET]
[NAME:Construct ruby glass Cabinet]
[KEY:CUSTOM_F]
[PRODUCT:100:1:CABINET:NONE:INORGANIC:GLASS_RED]
I am sure you can see how much easier that is both to write (and such a lesser probability of errors) and to look at. Imagine 31 reactions my way, vs the other way.
What the above shows would be the following: you go into the kiln (or in this case, my 'red glass shop'), and have the option to select 'red glass'. This would then go to the next menu, where one selects the exact task they prefer. Later entries precede higher hierarchy ones, but it is assumed that higher ones impose on lower ones (so all the traits of RED_GLASS are imposed on all sub-reactions, except, in this case, those like NAME and KEY, because new values are specified for each, thus replacing those otherwise imposed bu the higher order reaction. This would still be a large number of entries, of course, that one would need to wade through when at the red glass shop in game, but that is how glass currently is anyway, and for a good reason.
Also, while at it, since this would mean subheadings, one could go further and make further layers. For example, I could do the following:
[REACTION:1:RED_GLASS]
[NAME:ruby glass]
[BUILDING:RED_GLASS_SHOP:CUSTOM_R]
[REAGENT:sand:1:NONE:NONE:INORGANIC:NONE]
[REACTION_CLASS:SAND]
[REAGENT:sandbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:sand]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:gold:1:POWDER_MISC:NONE:INORGANIC:GOLD_CHLORIDE]
[REAGENT:goldbag:1:BOX:NONE:NONE:NONE]
[CONTAINS:gold]
[BAG]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:pearlash:150:BAR:NONE:PEARLASH:NONE]
[FUEL]
[SKILL:GLASSMAKER]
[REACTION:2:MAKE_RAW_RED_GLASS]
[NAME:make raw ruby glass]
[KEY:CUSTOM_G]
[PRODUCT:100:1:ROUGH:NONE:INORGANIC:GLASS_RED]
[REACTION:2:CONSTRUCT_RED_GLASS_FURNITURE]
[NAME:furniture]
[KEY:CUSTOM_F]
[REACTION:3:MAKE_RED_GLASS_ARMOR_STAND]
[NAME:Construct ruby glass Armor Stand]
[KEY:CUSTOM_A]
[PRODUCT:100:1:ARMORSTAND:NONE:INORGANIC:GLASS_RED]
[REACTION:3:MAKE_RED_GLASS_BOX]
[NAME:Construct ruby glass Box]
[KEY:CUSTOM_H]
[PRODUCT:100:1:BOX:NONE:INORGANIC:GLASS_RED]
[REACTION:3:MAKE_RED_GLASS_CABINET]
[NAME:Construct ruby glass Cabinet]
[KEY:CUSTOM_F]
[PRODUCT:100:1:CABINET:NONE:INORGANIC:GLASS_RED]
How it would go here is one would choose 'red glass' at the red glass shop (tier 1), then one could either choose 'raw red glass' or 'furniture' (tier 2). Furniture would bring one to further selections (tier 3), where I could choose from armor stands, boxes, and cabinets. Now because these reactions now both have products and have no higher numbered tiers below them, they produce the product and no further menus are needed.
I hope this rant and idea come to some use. Good night all!