Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: please help with definition of specific reagents for reactions  (Read 879 times)

Urist McGoombaBrother

  • Bay Watcher
  • Trust the plump helmet! ♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠
    • View Profile

How to define following ingredients within reactions, when you want to use 1 of each kind?

1) body parts - for bone there exists the token [ANY_BONE_MATERIAL], same for shell, tooth, horn, pearl. For blood you can use this token: [HAS_MATERIAL_REACTION_PRODUCT:BLOOD_MAT]. A similar one exists for fat. But is there the possiblity to define other body parts as well without having to forbid the other types covered within [USE_BODY_COMPONENT]? Those are especially:
cartilage
feather, scale, chitin, and nail
hair
hooves
ivory
scale
skull
any missing?

2) What's the exact difference between CORPSE and CORPSEPIECE? Has corpsepiece subtokens, which might help with the issue in point 1 like CORPSEPIECE:HAIR?

3) item must be rotten - maybe some sort of counterpart to the [UNROTTEN] token exists, e.g. for defining rotten food or rotten skull

4) instrument piece - not a specific one, reaction shall use anyone of the available instrument pieces

5) Do there exist sub-categories of boxes? Like must-be-bag or must-be-chest or something like that? Or is the only possiblity to restrict the ingredient to chest via the raw material restrictions ([ANY_PLANT_MATERIAL])?

Bearskie

  • Bay Watcher
  • Nyam nyam
    • View Profile
Re: please help with definition of specific reagents for reactions
« Reply #1 on: March 05, 2016, 09:54:30 pm »

Will try to answer these questions to the best of my abilities.

1) One way is to add reaction classes to the vanilla templates, and call for those reaction classes in the reaction. Eg, [REACTION_CLASS:HAIR] to the hair material template.

2) Corpse is for 'corpses', whether mangled or mutilated. Corpse pieces are like heads or teeth or arms that have been chopped/lopped/dismembered from the main corpse.

3) Probably not.

4) You're likely limited to just accepting all tools.

5) Different material boxes have different names afterall, so its a simple matter of targeting the right material.

Urist McGoombaBrother

  • Bay Watcher
  • Trust the plump helmet! ♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠
    • View Profile
Re: please help with definition of specific reagents for reactions
« Reply #2 on: March 07, 2016, 01:19:38 pm »

Many thx for your answers.

1) Works perfectly so far with those reaction classes. Many thx.

2) So corpse refers to the main body of the corpse and everything still attached to it and corpse piece to all other parts scattered around everywhere. Correct?

3+4) Feared so.

5) Unfortunately the token [ANY_PLANT_MATERIAL] does not only refer to wooden chests but also to bags made of certain plant materials. So it seems like currently you can not fully distinguish between bags and chests.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: please help with definition of specific reagents for reactions
« Reply #3 on: March 08, 2016, 09:54:28 am »

You can differentiate bags from other boxes with a hardcoded tag:

[REAGENT:B:1:BOX:NONE:NONE:NONE][EMPTY][BAG][PRESERVE_REAGENT]

Getting any more specific may require reaction classes.
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

Urist McGoombaBrother

  • Bay Watcher
  • Trust the plump helmet! ♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠♠
    • View Profile
Re: please help with definition of specific reagents for reactions
« Reply #4 on: March 10, 2016, 01:44:18 am »

Ok, thx. And for chest only? Will the token [ANY_PLANT_MATERIAL] in combination with the token [HARD_ITEM_MATERIAL] work?

What's the definition of skulls? They aren't mentioned within the file material_template_default.txt and there seems not to exist a material token for them.

Bogus

  • Bay Watcher
    • View Profile
Re: please help with definition of specific reagents for reactions
« Reply #5 on: March 10, 2016, 04:28:11 am »

i dont think there is a working reaction token for skulls. the only reaction that uses skulls is the harcoded totem making reaction afaik.

there is however an internal flag for reaction reagents called "totemable" which likely is what you are looking for. the way to make this work is to "patch" the reaction you want this to use at runtime, by setting the appropriate flag for that reagent. this needs to be done once each time the game/world is loaded.

i wrote a dfhack script that a while ago that does just that: it reads "fake" tokens from reaction files and patches the reactions that use them when the world is loaded. in your case, a simple [TOTEMABLE] token + loading the script through your dfhack.init would suffice. however, i didnt test it with the new game version, so maybe it just doesnt work anymore.

http://www.bay12forums.com/smf/index.php?topic=153371.0
Logged