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

Condefintion 1.0: Now user-configurable!

1748633663

Edited 1751229680
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is a massive overhaul of my Condefinition script. I have rewritten it to make configuration possible from inside the game itself, by editing a handout. It now supports both Classic and Jumpgate, the 2014 and 2024 sheets, and the 2014 and 2024 rulesets regarding conditions.  Now Available through One-Click. [ Demo Video ] Condefinition What it does Condefinition reads incoming roll templates and looks for imposed conditions and saving throws. It display a button(s) in chat that allow you to quickly apply a corresponding token marker, define the condition, track concentration, roll saving throws and/or apply damage from spells or effects that are triggered by saving throws. If the roll template contains a saving throw, it gives a button for the saving throw. Press the button and click on a target to have it roll the appropriate save. If you have  GroupCheck  installed, it will run a groupcheck save. If you have  Apply Damage  installed, it will run through the steps to do a save and apply damage. If the roll template contains an imposed condition, it will create a button to define the condition. If there is a cross reference in the definition of the condition, it  will create an inline link. You can also hover over the button for the text. You can use this button to whisper the text to yourself, or broadcast to the players. You can also toggle that condition on any selected tokens. Assigning token markers requires installing  TokenMod , and for greater facility,  LibTokenMarkers . It comes with the default Status Markers assigned, but the script creates a configuration handout that can be edited to use custom token markers. Instructions are included later in this handout. If you installed this Mod using Roll20 One-Click, it should automatically install  GroupCheck ,  TokenMod , and  LibTokenMarkers  if they are not already present.  Apply Damage  needs to be installed manually if you want its functionality. Besides the official conditions, this also tracks mentions in chat for many common features that benefit from markers, such as raging, using Hunter's Mark, Hexblade's Curse and more. Each of these has buttons to toggle or define the effect. The marker for the Concentrating condition also tracks concentration, and prompts for a Constitution Saving Throw when the token takes damage. See below for details.  This script has been written to work on Classic or Jumpgate, and with the 2014 and/or 2024 sheets for 5e D&D. A dedicated user could probably adapt this for other sheets, but you would need to install the code manually. Contact me for guidance if you need it, but you will need a decent understanding of JavaScript. What it can't do Currently, there are some limitations: This is built for GMs to facilitate running NPCs. Although most of the functions will work with PCs as well, and buttons should display for any player whose actions generate them, not every bit of it is player-accessible The conditions are matched to tokens and their markers, not character sheets. This is the intended behavior as each instance of a goblin (for example) can have its own imposed conditions. I have tried to catch every variation of condition wording, but I have probably missed a few incidences, particularly in products which do not adhere well to the WotC style. In this iteration, all buttons and definitions are whispered to the controller of the NPC, typically the GM. If there is interest, I may change this to obey the whisper settings of the NPC, but I did not want to spam the chat.  Helper Scripts Required:  Token-mod ,  libTokenMarkers Improved by:  GroupCheck ,  Apply Damage Operation Buttons Every time a condition is implied by something in a chat roll template, or if the report function is used on a selected token, the script produces a button. Each button has three parts. The middle, largest part of the button will send a message tot he GM in chat, that defines the condition. Sometimes, this will have links to other conditions that the condition imposes. Such as an  Unconscious  character is also  Incapacitated . The left side of the button has a word balloon graphic. This also send the definition to chat, but in this case, it is visible to all players. The right hand side of the button shows the marker associated with that condition. It will toggle the marker for any and all selected tokens. List All Common Condition Definitions Condefinition can produce a reference palette of all official condition buttons.  Type  !condef-all   to display the report. Note that the script tracks more markers than this, such as "Raging", or "Marked". These are just the official  conditions  defined by the rules. Concentration Condefintion will monitor if the token taking damage has a defined concentration marker on it. If you reduce the hit point bar of a concentrating token, the script will prompt you to make the appropriate Constitution save. Example. "Morrigan" just took 30 hp of damage while concentrating on a spell. The Script notes that the concentration marker was active, calculates the saving throw and produces a button that will cause the selected token to roll a saving throw. Note: In order to make this script work with both the 2014 and 2024 sheets, the  Group Check  mod is required and configured for your sheet(s). If you installed Condefinition via Roll20 One Click, it should have installed all helper scripts automatically. See the first section of this handout for more details.  Report Condefintion also allows you to select any number of tokens and run  !condef-report . The script produces a set of report buttons for each selected token that has a defined condition marker on it. In this case, the sub-buttons that toggle token markers will only affect the respective token, and that token does not need to be selected. Automation of Abilities that Force Saving Throws This feature requires both  Group Check , and the manually installed script   Apply Damage  in order to function. It also requires that the spell or feature of a creature is sent to chat with the Description turned on. In some cases this requires rolling damage or clicking the roll template button that shows the spell description. There are too many sheet variables to account for here, but in short, the keywords needed in order to trigger the script must have been sent to chat.  The button produced is very similar to the concentration check button. In this case, the left half will roll a saving throw for all selected tokens. If you have Apply Damage installed, it will also walk you through the steps necessary to resolve the roll and apply damage accordingly. Note that this function will work on a combination of selected 2014 and 2024 tokens. Configuration Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function. The Condefinitions Handout Type  !condef-help  or  !condef-config  in chat to call up the configuration controls.  Condefinition uses a lot of Regular Expressions (search code) to find and apply token markers and definitions. It reads these from a handout called Condefinitions. You can edit this handout manually. It has all of the code needed to define the conditions wrapped in a code block. You can edit the names, the definitions, the search code and the name of the corresponding token marker. The edited text must be clean plain text wrapped in code tags using the Code style button in the editor. Most users will only need to change the name of the token marker to match their chosen set. If you don't feel comfortable editing the other code, or do so and make a mistake which breaks the handout, you can reset to the default using the buttons in the configuration panel. The script contains defaults for the 2014 and 2024 rule sets, using the default token markers provided by Roll20.  I original wrote this script using my own Marketplace set, so if you have installed my "Easy to Read Token Markers" set, then there are also buttons that set defaults for those. This Marketplace set is honestly for my own convenience, and the script does not require this set in any way. Each Condefintion definition is four lines long, and separated by an empty line. Line 1  is the name of the condition Line 2  is the Regular Expression (REGEX) used to trigger the operation of the script. It's a list of search terms that match condition and effect names. If you are not familiar with REGEX, just leave that line alone and you should be fine. Line 3  is the definition of the condition or effect.. This must all be on one line, and can accept simple html styling. Line 4  is the name of the associated token marker. After editing and saving the configuration document, you must press the "Update Conditions" button in the chat configuration controls. This will apply the conditions immediately. It is strongly advised that if you do make home brew changes, you duplicate the Condefinitions Handout to use as a backup .  the controls can "reset to factory specs", but they cannot undo breaking changes. If you create a configuration that uses a marketplace set of Token Markers that you prefer, feel free to share with others. It can be copied and pasted between games, so long as you are careful to paste clean text only (hold down the shift key while pasting, or copy from a plain text editor), and wrap the whole thing in the "Code" style.
KEITH THIS IS RAD
1748656928
timmaugh
Forum Champion
API Scripter
What the WHAT? This is even more than the more I knew you were more-ing!
1748722476
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have added a   Demo Video  to the top post.
Looking forward to trying the updates. Thanks 
1749140909
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This has been submitted to the Repo. I will post again when it has been merged. Also, I fixed the code link in the top post if anyone wants to try beforehand.
1751229714
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Forgot to post the update. This is in One-Click.
Hi Keith Great API! BTW... I saw that Roll20 added their new 2024 character sheet driven status markers for all of their character conditions. They add a "sheet-" prefix to the condition name followed by the condition. Example: blinded condition = sheet-blinded. There are 8 of these new token markers (see pic below) I tried running condefinition using the new sheet-markers and it doesn't seem to register them. I tried toggling the markers on/off using TokenMod and that didn't work either. Anyway condefinition could get an update to be able to work with these new sheet token markers
1752198305
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hah! How fortuitous! I just submitted a Pull Request for a Condition Sync compliant version of the script. Once you have your configuration handout set up, you can push a button to change the 16* conditions with sheet-specific behavior to compliant token names. As always, back up your configuration handout before trying. I have confirmed behavior with the base set and my own set. Also, for anyone who uses my Easy To Read Marketplace set, they are now updated to include new condition sync compliant markers. They should just update automatically. If you are running your own custom set of markers, you will need to rename the markers in your game to meet the condition Sync requirements: "sheet-blinded" for the blinded condition and so on. * There are 16 condition sync conditions, but Condefinition only handles 15. The 16th is "Custom" which is shared by any sheet condition not universally designated, example "Mage Armor" or "Raging".
Thanks Keith! Just to make sure I understand. Condef will get an update the includes a setup button that now follows the new "sheet-" nomenclature? And this setup will now refernce the new "sheet" markers added by Roll20? OR I can just rename my own markers by adding the "sheet-" prefix to the appropriate markers?
keithcurtis said: Out of the box, this script will support conditions defined by both the 2014 and 2024 rule sets. It also can switch between the default token markers or my own Easy to Read token markers. This latter is entirely for my own convenience, and they are not required in any way for the script to function. Keith's&nbsp; Easy to Read Token Markers are not required, but they are highly. highly recommended! I always replace the default markers with Keith's and wirte all my macros accordingly. <a href="https://marketplace.roll20.net/browse/markerset/5135/easy-to-read-token-markers" rel="nofollow">https://marketplace.roll20.net/browse/markerset/5135/easy-to-read-token-markers</a>
1752247965
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Pak said: Thanks Keith! Just to make sure I understand. Condef will get an update the includes a setup button that now follows the new "sheet-" nomenclature? And this setup will now refernce the new "sheet" markers added by Roll20? OR I can just rename my own markers by adding the "sheet-" prefix to the appropriate markers? The Condition Sync feature requires markers that are labeled sheet-blinded, sheet-restrained, and so on. That is still on the user to do. The API can't alter token marker names. Once you do have token markers in your game with those names, there is a configuration button in Condefinition that will update your configuration handout to use those names: "sheet-blinded", instead of "bleeding-eye" (the presumed default), or whatever you may have previously defined as the token marker for the Blinded condition. If you are not using custom markers, just choose the ruleset you want to use (2014/2024), press the "Use Condition Sync Marker Names" button, Apply Configurations, and you are done. If you have done considerable work on your configuration handout, and are worried that you may not like Condition Sync, but want to give it a try, be sure to make a copy of your configuration handout first.
1752248248
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Reminder: As of this morning, the merge has not yet happened. I will post here as soon as I get word that it is available. If you want to manually install right now , here's a link to the code &nbsp;from my personal repo. But I'd suggest waiting for One Click otherwise, so you automatically receive updates.
1752250119
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
For anyone going through their token markers, here is a checklist: sheet-blinded sheet-charmed sheet-custom sheet-deafened sheet-exhausted sheet-frightened sheet-grappled sheet-incapacitated sheet-invisible sheet-paralyzed sheet-petrified sheet-poisoned sheet-prone sheet-restrained sheet-stunned sheet-unconscious
Thanks Dr DM and Keith! Looking forward to the release of the new code!!!
1752802820
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The latest version was merged this morning, ready for when Condition Sync is restored.
SWEET!!!!!! Thanks Keith!
1753678529

Edited 1753678969
Keith, Question. If I have several custom condition markers in excess of what you have in the condefinitions can I add to the condefinitions, and how would I do that? For example if I wanted to add Bless to the condefinitions or AFK how would i code to get it to recognize these?
1753687689

Edited 1753687751
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi ez2rpg! You would need to edit the handout manually. There are lots of examples of non automatic conditions at the bottom. Or you can create one that is triggered when the bless spell is cast. Non-automatic: Type !condef-config in chat to call up the config interface, and press the "Open Handout " button. Edit the handout. At the end, add a paragraph return followed by something like the following code: Blessed /nonmatching string to prevent accidental triggering/i You may add 1d4 to the attack rolls or saving throws. Name of token marker to use for blessed condition Or for an automatic version one that comes up with any casting of the spell bless (2014 or 2024) Blessed /You bless up to three creatures/i You may add 1d4 to the attack rolls or saving throws. Name of token marker to use for blessed condition This looks for output in chat that contains the string " You bless up to three creatures" and triggers the script. After editing, save the handout, and most importantly—Press the "Apply Configuration" button in the config menu.
Hey Keith i have try adding this to the handout&nbsp; addled /nonmatching string to prevent accidental triggering/i You have Disadvantage on Intelligence, Wisdom, and Charisma attack rolls, ability checks, and saving throws. white-tower but i will not show the botton when i use the skill i have for testing purpurs added the work in the bottom&nbsp; i cant relly seem to find the issue i have checked that i use coding style and have set it op in the same way as you discripe in the post&nbsp; hope you can help :-)
1758572617
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Patrick! If you can give me an actual working case, telling me which sheet, and which skill on the sheet you want to trigger a button, I can better help write this. As displayed in your sample, this button will never show as a result of something being passed to chat: /nonmatching string to prevent accidental triggering/i is a REGEX (search) string that is supposed to match something passed in an approved roll template. The string that is in there is a placeholder that is highly unlikely to ever match anything. Those sorts of strings are there for manual applying and defining of conditions that have no roll attached. An example would be Inspiration. You can apply an inspiration marker to a token, and remove it, and you can use the !condef-report command to help you show the definition. But nothing triggers it, like is the case with something like "poisoned", which looks for various "poison" keywords in spells and attacks that are sent to chat.&nbsp;
Its a NPC 2014 sheet and its for this skill&nbsp; i have allso try this&nbsp; addled /addled/i You have Disadvantage on Intelligence, Wisdom, and Charisma attack rolls, ability checks, and saving throws. white-tower and allso this regex&nbsp;/(?:\b(?:be|is|are|become|becomes|magically)\b\s+addled|\baddled\b|\baddled condition\b)/i&nbsp;
1758582488
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
After you save the handout, are you pressing the Apply Configuration button after editing? Also, if you have cut and pasted, you might be getting some invisible formatting characters in the code. Only paste from a plain text processor, or press clean paste when pasting (shift-ctrl-V). But the best practice is just to type directly in the handout. This code should work. If it doesn't feel free to shoot me an invite through a direct message, and I'd be happy to come into the game and take a peek: addled /(be|and|is|magically|become|becomes) addled|addled condition/i You have Disadvantage on Intelligence, Wisdom, and Charisma attack rolls, ability checks, and saving throws. white-tower
my config menu is looking diffrent do i have the wrong version? i have tried the update conditions but no luck&nbsp;
i can see that i have the latest version