Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: reaction-trigger help  (Read 3166 times)

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
reaction-trigger help
« on: January 07, 2015, 08:49:13 pm »

I'm ready to use reaction-trigger instead of autosyndrome now. But I cant find a readme anywhere. Searching the dfhack thread for reaction-trigger doesnt show any examples, the dfhack readme only has 2 lines on it, modtools/reaction-trigger -help doesnt show anyhing useful, and I dont know which mods might use it to copy examples from.

Could anyone care to elaborate the use?

I read through all of this: http://www.bay12forums.com/smf/index.php?topic=139781.0 but it really doesnt help.

Edit: Here an example:
Code: [Select]
[REACTION:STUDY_LIBRARY_POTASH_MAKING]
[NAME:Study Potash Making - Lvl 5]
[BUILDING:LIBRARY_OF_MIND_AND_BODY:CUSTOM_NONE]
[PRODUCT:0:1:BOULDER:NONE:INORGANIC:LIBRARY_POTASH_MAKING][SKILL:KNOWLEDGE_ACQUISITION]

Code: [Select]
[INORGANIC:LIBRARY_POTASH_MAKING]
[USE_MATERIAL_TEMPLATE:STONE_VAPOR_TEMPLATE]
[STATE_NAME_ADJ:ALL:Knowledge]
[MATERIAL_VALUE:0]
[SYNDROME]
[SYN_CLASS:\AUTO_SYNDROME]
[SYN_CLASS:\COMMAND]
[SYN_CLASS:librarytrain4] => script name. I got one for each level, 1-15.
[SYN_CLASS:\WORKER_ID]
[SYN_CLASS:POTASH_MAKING]
[SYN_CLASS:4]

How would that look in registration?

I'm getting this far:

Reaction:
Code: [Select]
[REACTION:STUDY_LIBRARY_POTASH_MAKING]
[NAME:Study Potash Making - Lvl 5]
[BUILDING:LIBRARY_OF_MIND_AND_BODY:CUSTOM_NONE]

No Inorganic.

Create a onLoad.init in DwarfFortress/Raw folder.

Add this line to onLoad.init:
Code: [Select]
modtools/reaction-trigger -reactionName STUDY_LIBRARY_POTASH_MAKING -command librarytrain4 POTASH_MAKING 4 -target \WORKER_ID ??? Where do I put the usual commands? or is it
Code: [Select]
modtools/reaction-trigger -reactionName STUDY_LIBRARY_POTASH_MAKING -command librarytrain4  -target \WORKER_ID POTASH_MAKING 4 ?

Edit: Just to make myself abundantly clear: This. This is the reason I have stopped modding for 6 months. The lack of AutoSyndrome, SyndromeTrigger and ProbabilitySyndrome. Not the vanilla DF updates.
« Last Edit: January 07, 2015, 09:10:03 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: reaction-trigger help
« Reply #1 on: January 07, 2015, 10:46:52 pm »

You are missing [ ].

Code: [Select]
modtools/reaction-trigger -reactionName STUDY_LIBRARY_POTASH_MAKING -command [ what goes in here is what you would put on a command line ]
So for your example.
Code: [Select]
modtools/reaction-trigger -reactionName STUDY_LIBRARY_POTASH_MAKING -command [ librarytrain4 \\WORKER_ID POTASH_MAKING 4 ] Note the spaces inbetween the [ and ]

EDIT: Just like how the autosyndrome \COMMAND tells DfHack that the next SYN_CLASSes should be interpreted as command line entries.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: reaction-trigger help
« Reply #2 on: January 08, 2015, 04:30:28 am »

Ah, thanks. :)

Expwnent also mentioned something about things needing a unique syndrome name? Or that I have to add a syn name to all things I want triggered like that?

EDIT: Muahahah, it works. (the example above, posted by Roses. Yeah. :) )
« Last Edit: January 08, 2015, 05:20:15 am by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Roses

  • Bay Watcher
    • View Profile
Re: reaction-trigger help
« Reply #3 on: January 08, 2015, 11:16:32 am »

Well you have two options for syndromes. You can use the reaction-trigger with a command [ modtools/add-syndrome ], but reaction-trigger also has it's own built-in add-syndrome so that if you are wanting to just add a syndrome to a creature doing a reaction you can use
Code: [Select]
modtools/reaction-trigger -reaction YOUR_REACTION -syndrome SYNDROME_NAMEAnd yes, all syndromes need to have a unique [SYN_NAME] since that is how the new scripts add and remove syndromes (although you can also remove syndromes through SYN_CLASS tokens, but not add them that way)
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: reaction-trigger help
« Reply #4 on: January 08, 2015, 12:36:11 pm »

Well you have two options for syndromes. You can use the reaction-trigger with a command [ modtools/add-syndrome ], but reaction-trigger also has it's own built-in add-syndrome so that if you are wanting to just add a syndrome to a creature doing a reaction you can use
Code: [Select]
modtools/reaction-trigger -reaction YOUR_REACTION -syndrome SYNDROME_NAMEAnd yes, all syndromes need to have a unique [SYN_NAME] since that is how the new scripts add and remove syndromes (although you can also remove syndromes through SYN_CLASS tokens, but not add them that way)
I definitely recommend the -syndrome option, since it has fewer dependencies.  So in my mod I have 24 pairs of reaction-triggers such as

Code: [Select]
modtools/reaction-trigger -reactionName TRIBUTE_TO_GRANITE -syndrome "granite favor"
modtools/reaction-trigger -reactionName TRIBUTE_TO_GRANITE2 -syndrome "granite favor"

and a single inorganic that has all twenty-four syndromes attached to it.  Obviously, that stone isn't actually used anywhere.

I would recommend having some product for the reaction, otherwise I'm told that the reaction occurs instantly and conveys no experience.  Even if the script is adding experience directly, it should take some game time to read the library books.  In my case, I have a "poof" stone that evaporates harmlessly with blue mist to make the reactions seem more impressive.

Spoiler (click to show/hide)
(In my case, the SYN_CLASS is the operative part.  The Material multiplier is just to give it a permanent symptom that keeps the SYN_CLASS attached to the dwarf.)
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

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: reaction-trigger help
« Reply #5 on: January 08, 2015, 12:39:50 pm »

Thanks Dirst. :)

Quote
In my case, I have a "poof" stone that evaporates harmlessly with blue mist to make the reactions seem more impressive.
I wanted to avoid those in future (I have tons and tons of them in Masterwork), because they dont work with TEMPERATURE:OFF. I was hoping that the mod could run even without temperature, for the added FPS gain.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: reaction-trigger help
« Reply #6 on: January 08, 2015, 01:34:52 pm »

Thanks Dirst. :)

Quote
In my case, I have a "poof" stone that evaporates harmlessly with blue mist to make the reactions seem more impressive.
I wanted to avoid those in future (I have tons and tons of them in Masterwork), because they dont work with TEMPERATURE:OFF. I was hoping that the mod could run even without temperature, for the added FPS gain.
Hadn't thought of that because the warpstone-like features of my mod wouldn't work with temperature turned off either.  Come to think of it, I should document that my mod requires temperature to be turned on.  Added a note to the technical details documenting that the mod only works with temperature turned on.
« Last Edit: January 08, 2015, 01:40:56 pm by Dirst »
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

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: reaction-trigger help
« Reply #7 on: January 09, 2015, 12:42:28 pm »

I have been using reaction with no products for some time, and they work fine (just with no experience gain).
Having a little script that awards some exp takes care of that problem nicely :)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Boltgun

  • Bay Watcher
  • [UTTERANCES]
    • View Profile
Re: reaction-trigger help
« Reply #8 on: January 16, 2015, 04:46:34 am »

Is there a way to make reaction take longer however besides giving it a product?
Logged