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 .
×

Condefinition API Question

Hi Keith, Is there a way condefinitions can react to a message sent to chat from a scriptcard. I have scriptcards sending messages which includes things like DC13 Dexterity or be knocked prone but condefinitions isn't picking it up. Thanks 
1778015787
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Probably? I'd need to know more about script cards. Condefinition specifically looks for patterns in Rolltemplates, or a message containing a string specific to 2024 sheet output (at least the last time I investigated. I havenot been in the GM chair for months and I'm the only GM in my group to use the 2024 sheet). This is the line that monitors chat.         if((undefined !== msg.rolltemplate && msg.rolltemplate.match(/npcfullatk|npcdmg|default|npcaction|traits|atkdmg|spell|condefinitions|spelloutput|noecho/g)) || (msg.content.match(/dnd-2024/g))) If the match conditions could be made to match a string unique to ScriptCards' output, then... probably? If you can get Kurt's attention, I can make whatever modification they might recommend and put it into the next merge.
Keith, Thanks for the response. I also posted this to the scriptcards forum but no response yet
1778179413
Kurt J.
Pro
API Scripter
Since the user is in 100% control of what gets output by ScriptCards, it is likely this is possible by altering the line Keith indicated above in Condefinition, but there isn't anything like a standard roll template in ScriptCards. You would have to consistently format your output to have a match in your ScriptCard for Condefinition to pick it up.
Kurt, I consistently use one of Keith's template overrides in all my scriptcards such as --#overridetemplate|dark55 (which by the way Keith looks really good !!) Is this the kind of thing you're thinking off ? and what would need to go into Keith's line above ?
1778185524
Kurt J.
Pro
API Scripter
FFR said: Kurt, I consistently use one of Keith's template overrides in all my scriptcards such as --#overridetemplate|dark55 (which by the way Keith looks really good !!) Is this the kind of thing you're thinking off ? and what would need to go into Keith's line above ? No, the templates are purely visual and replace the normal styling of the ScriptCards output, but using --+ commands, you can output just about anything you want, so output for any script would need to be tailored so that Condefinition could pick it up. This is certainly possible - and could probable even be "hidden" in the ScriptCards output by using comment commands (--/) to include the condefinition trigger words/phrases or setting the font size temporally to 0 pixels, you would still need to match what Condefinition is looking for. Alternatively, you could simply include GM output (--*) in your ScriptCards code to show the GM the buttons condefinition would generate.
Kurt, Apologies as my coding skills are non existent. Would you be able to give me an example line using the GM Output
1778187175

Edited 1778194123
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If a comment goes to chat, but does not print, you could try putting "dnd-2024" in a comment. The display of specific conditions is handled by the config handout. The text trigger just clues Condefinition to spring into action. It's worth a shot, and wouldn't require an update to either script. A couple years back, Kurt requested I expose the template definitions to the api general namespace. That's why ScriptCards can access them.
Keith / Kurt Created a whispered gm line   --=*|dnd-2024 in the scriptcard and this calls up the condefinition buttons. So amazing to have both great scripts working together. Thanks to both of you for all your help  
Great question FFR and I agree, it is amazing to get both condefinitions and scriptcards working together! Just curious, what does your chat result look like? My condefinition buttons keep showing before the scriptcard box shows. Is yours doing the same? It would be even better if I could get the condef buttons to fire after the scriptcard chat message shows in the chat Code used: !script{{ --+|The target has the Frightened condition until the end of the creatures next turn.  --+|it is cursed --/|dnd-2024  --X| }} Result:
Pak, My buttons also show first. I thought because mine are being whispered to the GM. I agree appearing after the message would be good so if you do find away to do this please let me know.
1778357240
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
First: Cool and easy solution! Thanks to Kurt for the suggestion and FFR for the test. Second: The timing issue sounds like it could be getting into the weeds of artificially throttling one for the other.  I'm not sure of a good solution here.