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

[Script] CRL Help -- Listen for keyword "Malfunction"

Hello Gurus I am able to get CRL to react to some output from player actions but not others. What I am having difficulty with is I wish to invoke a rollable table when a player roll result has the word "Malfunction!" in it. CRL will not react when players' actions cause it to appear in chat, but it will activate when I copy and paste from the generated text into chat. (see image below) !crl \\create,name=RollFirearmMalf,text=Malfunction! \\/roll 1t[Firearm_Malf_Gun_B407] It is unusual as I am able to get it to react to keywords placed manually in roll results. Thanks!
1653576926
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi GM Aurelien! What is the name of the sheet you are using, and the name of the roll template you are listening for?
1653618699

Edited 1653619699
Hello kiethcurtis The character sheet I am using is GURPS / "GURPS". How do I find out the name of the roll template? To get there I click on "Character Sheet, Combat, Ranged" tabs, then I click the "to hit" dice button. For CRLif I do not specify any template in the listener should it not react to any instance of the keyword(s) in the chat? Edit: To be honest I'd be fine if it reacts to every instance of "Malfunction!" appearing in chat, but it is not doing that at the moment. Thanks!
1653666322
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
CRL-specific questions should likely go to Scott, the creator. I'll see if I can get his attention here. To get the roll template name, click the button like you are, then click in the chat input area and pres the up arrow key. that will page up through the previous inputs. You should be able to get the roll template code from there: &{template:template_name} 
1653693016

Edited 1653693250
Many thanks for the patience and help, keithcurtis. I have used that up arrow to debug some script parameters, so I am learning new uses for this. Hmm, your asking the question prompted me to create a new entry in the character sheet with no user fields in except the TOHIT and Malfunction values: @{TG Elend|roll}&amp;{template:skillRoll} {{sheetStyle=@{TG Elend|sheetstyle}}} {{type=Ranged Attack}} {{rangedAttack=[[1]]}} {{selected=@{TG Elend|selected_token_macro}}} {{target1=@{TG Elend|target_token_macro}}} {{activeDefense=[[0]]}} {{isSkillRoll=[[1]]}} {{showHitLabel=[[1]]}} {{characterName=@{TG Elend|character_name}}} {{skillName=TestGun}} {{rollResult=[[3d6]]}} {{effectiveSkill=[[{14 + @{TG Elend|modifier} + @{TG Elend|ranged_roll_modifier}, @{TG Elend|ranged_roll_max_nine_value} }kl1]]}} {{useModToll=[[1]]}} {{maxNine=[[@{TG Elend|ranged_roll_max_nine}]]}} {{rollModifier=[[@{TG Elend|ranged_roll_modifier}]]}} {{rollModifierSummary=@{TG Elend|ranged_roll_modifier_summary}}} {{rollTraitSummary=@{TG Elend|ranged_roll_trait_summary}}} {{hitLocation=@{TG Elend|ranged_roll_hit_location}}} {{maneuver=@{TG Elend|ranged_roll_maneuver}}} {{allOutAttack=@{TG Elend|ranged_roll_allout_attack}}} {{notes=}} {{showNotes=[[1]]}} {{rof=}} {{recoil=}} {{useCriticalPlusTen=[[@{TG Elend|use_critical_plus_10}]]}} {{useMalfunction=[[@{TG Elend|use_malfunction}]]}} {{malfunction=[[3]]}} {{verifyMalfunction=[[ 0 ]]}} {{veryReliable=[[ 0 ]]}} {{customSuccessNote=}} {{customCriticalSuccessNote=}} {{customFailNote=}} {{customCriticalFailNote=}} {{showRawDefenseNotes=[[@{TG Elend|show_raw_defensive_notes}]]}} {{rawSuccessNote=@{TG Elend|raw_hit_notes}}} {{rawCriticalSuccessNote=@{TG Elend|raw_critical_hit_notes}}} {{rawFailNote=@{TG Elend|raw_miss_notes}}} {{rawCriticalFailNote=@{TG Elend|raw_critical_miss_notes}}} From a technical point of view the GURPS Malfunction mechanic is parallel with a normal "to hit" roll. You can technically aim correctly but if the die roll is above or equal to the MALF rating the gun fails to function correctly. (e.g., TOHIT target 16, MALF 14. If you roll a 15, the shot can technicall work but the gun will malfunction (which is not always failing to fire...)). The party is currently in the desert so MALF is worsened by 1... <a href="https://gurps.fandom.com/wiki/Malfunction" rel="nofollow">https://gurps.fandom.com/wiki/Malfunction</a> EDIT: It occurs to me that I could make a separate "MALF CHECK" weapon line so each time the player attacks it they immediately click that as well and I can check the Pass/fail boxes on that. I do not want to double the player workload if there is something simple we could code, mind you. Cheers!
1653883509
Victor B.
Pro
Sheet Author
API Scripter
Is there an API to interpret "Malfunction"?&nbsp; if you're rolling a Roll20 Char sheet chances are you aren't
1653888170
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
OP is using Critical Roll Listener.