Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Request] Output message to chat on NPC critical hit

I use the Companion System from the DM's Guild, which means that any time my PCs take a critical hit, their companions need to take on injury. We constantly forget to do this. So, I just need a script that will output /desc Critical hit! Companions take one injury! to the chat every time an NPC scores a critical hit.
1528250294
Ziechael
Forum Champion
Sheet Author
API Scripter
You could write a universal  powercard for NPC attacks (as a pro subscriber) with that added as a conditional :)
Other idea would be using Scott C.'s Customizable Roll Listener script. It listens to every roll that is made and can react according to what you define in the configuration. The Script can be found in the OneClick Library. I believe to remember you were playing 5e. If so you could setup a listener that listens for critical hits. The command to do this with the Shaped Sheet for 5e would be: !crl \\create,name=crit,template=5e-shaped,text={{attack1=##}},roll=critical \\/desc Critical Hit!
1528289234
Ziechael
Forum Champion
Sheet Author
API Scripter
Florian B. said: Other idea would be using Scott C.'s Customizable Roll Listener script. It listens to every roll that is made and can react according to what you define in the configuration. The Script can be found in the OneClick Library. I believe to remember you were playing 5e. If so you could setup a listener that listens for critical hits. The command to do this with the Shaped Sheet for 5e would be: !crl \\create,name=crit,template=5e-shaped,text={{attack1=##}},roll=critical \\/desc Critical Hit! Nice, great option... forgot all about that little gem of a script!
1528403152

Edited 1528403209
Florian B. said: Other idea would be using Scott C.'s Customizable Roll Listener script. It listens to every roll that is made and can react according to what you define in the configuration. The Script can be found in the OneClick Library. I believe to remember you were playing 5e. If so you could setup a listener that listens for critical hits. The command to do this with the Shaped Sheet for 5e would be: !crl \\create,name=crit,template=5e-shaped,text={{attack1=##}},roll=critical \\/desc Critical Hit! Thanks! I'm actually using the OGL and I tried to use the CRL script but couldn't seem to figure out how to get it to respond to what I wanted (specifically NPC attacks.) I tried this: !crl \\create,name=CritText,template=npcaction,text=r1=##,roll=critical \\/desc Critical hit! Each companion takes one injury!
Ziechael said: You could write a universal  powercard for NPC attacks (as a pro subscriber) with that added as a conditional :) I actually thought about using powercards, but thought that writing macro for each new monster would be time consuming.
Poltergeisha said: Thanks! I'm actually using the OGL and I tried to use the CRL script but couldn't seem to figure out how to get it to respond to what I wanted (specifically NPC attacks.) I tried this: !crl \\create,name=CritText,template=npcaction,text=r1=##,roll=critical \\/desc Critical hit! Each companion takes one injury! Oh this is will unfortunately will be hard to handle if it's possible at all. The problem is that the OGL sheet does not use the count successes roll helper, which the Customizable Roll Listener Script will work on. Unless Scott comes in and corrects me that might be an impasse with the current version of the script. If you'd want this for player attacks, here is an example: !crl \\create,name=CritListener,text=##,roll=critical \\/desc Critical hit! Each companion takes one injury!
1528465770

Edited 1528465815
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Try it removing the /desc command. I'm not sure how gm only chat commands work when sent from the API. Also, gonna have to get my next version of this done since people are suddenly using it.
1528467853
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Scott C. said: Also, gonna have to get my next version of this done since people are suddenly using it. Ah, the pitfalls of success. :)
Scott C. said: Try it removing the /desc command. I'm not sure how gm only chat commands work when sent from the API. Also, gonna have to get my next version of this done since people are suddenly using it. This shouldn't be a problem, the /desc command works without issue when sent from the API. You can create a working critical listener on the OGL sheet for player characters without issue (see my example above). As soon as you change the sheet to the NPC Settings the Listener doesn't fire. I have looked at the macros generated by both modes (Player and NPC Mode) of the sheet and the relevant difference is in fact that the script in player mode uses the cs>N critical point function while the script in NPC mode doesn't use it. If I manually add the Critical Success Point to the roll CRL acts on the critical hit just as planned.
1528722517
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, thanks florian
Florian B. said: If I manually add the Critical Success Point to the roll CRL acts on the critical hit just as planned. So uh.....how do I do that? o.O
Unfortunately I believe this is not possible to do, currently this would I believe require manually changing every macro of every attack your monsters may have. To be fair I have not much knowledge of the 5e OGL sheet and whether the macro could be changed there at all. I'm sorry I got your hopes up, my post was just to illustrate why it is not working for you. What I did was just create an NPC with one attack and change the output in the chat panel. So for completeness you can reproduce my finding like this: Create a new Character  Set it to "NPC" Add an attack Roll previously created attack Go to the chat window, press the up arrow to see the last command Copy, find the relevant places where a d20 is being rolled and add the cs modifier there This way I was able to get a previously configured Roll Listener to react to the NPC roll the same as to a player roll. But again, this was to just prove a point. Without any knowledge of the sheet, I see two options: Check with the authors of the sheet if there's an option to add the critical success point to the roll macros for NPCs that I missed, or if there is none if it could be added. (Does this mean the sheet does not allow for non-standard crit ranges on NPCs? Isn't this a thing in 5e?) A workaround for the time being could be to setup NPCs with full character sheets instead of the smaller NPC variant, but without looking to deep into it this too seems like prohibitively much work.
Well, dangit.