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

CombatMaster 2.0

A question re conditions. I see that you can use CombatMaster to place conditions on a token, and can set duration and countdown/up with Override. What I am wondering is if the condition and duration can be placed via another API with the CombatMaster 'taking' over as far as count down etc.  I ask this as I am playing a WH40k system which has conditions with variable duration, usually based on degrees of success or failure on a roll. I have scripts for weapons fire etc which can place the status marker and duration but what I've seen is that CombatMaster overrides the duration with whatever is set as the default. So a "Stunned for 9 rounds" becomes Stunned for the default #. Just trying to automate things a bit and cut out the step of manually adding the condition to the token using Combat Master. Is there a setting I am missing? Thanks
@Don, what macros/commands are you using for this?
@Victor, I just noticed that if a condition has a Removal call and is set to targeted, the removal call happens to the target every round instead of at the end of the duration. This doesn't happen with non-targeted conditions; in those cases, the removal call happens only at the end of the duration as it should. For example, I have a targeted condition that sets an attribute on the target to 2 when added and then sets it to 0 when removed. The attribute is being set to 0 after the first round instead, even if there are several rounds remaining. Meanwhile, I have a non-targeted condition that works correctly: it sets an attribute to 1 when added and then 0 when removed, at the end of the duration.
To place the status markers, it's happening within my own custom scripts. So I'll have a Javascript command such as  targettoken.set("statusmarkers","168876");   which places a flame marker on the token indicating they're on fire. If the condition has a duration I'd have that in the targettoken.set line also. In 40K most condition durations vary with the results of a some test (such as a Toughness Test for a stun grenade).  I use a number of scripts that do things like calculate range, different fire modes etc as well as for weapons like flame throwers or grenades it figures arcs, tokens under the area etc.  Lots of math in the game which I needed to write scripts to do to make it more playable. I have the scripts output results (damage etc) to Powercards for display in chat. And integrated sounds and visual f/x with Powercards/Kaboom etc.  So I have status markers (like  being on fire, concussed, prone etc) that the scripts will place on a token to indicate what has happened, but then I was hoping to have Combat Master 'take over' the role of tracking # of rounds left say on concussion etc. So far Ive been doing it manually as each token's turn comes up, which is a pain. CM works if there's no duration - say Flames or Prone, but CM overrides a duration that is placed by the script (such as Concussed) with whatever the duration is set in the CM menu. 
1606969383

Edited 1606969423
Victor B.
Pro
Sheet Author
API Scripter
I need to add an observer in order to detect.  However, best thing you can do to get CM to be aware of what's going on is to insure combat master has active combat (whether rolling init outside of CM or not), and then issue your own command to CM, i.e., !cmaster --add,condition=<whatever>,duration=<whatever>,direction=<whatever>.  You can do this via sendchat if needed.  Don't expect CM to be magically aware of what your APIs are doing because APIs don't trigger Roll20 events.   It's on the plan to add an observer to CM so I can detect changes to the token via APIs and then auto-add conditions.  Until I do that, issue your own command.  
Thanks Victor for the answer, as well as for this awesome script and continuing to develop and support it! 
1607133945
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Has anyone had success setting conditions with CM2.0 on the pathfinder 1e roll20 sheet? I can do them with a macro but not with a macro in CM2.0
SᵃᵛᵃǤᵉ said: Has anyone had success setting conditions with CM2.0 on the pathfinder 1e roll20 sheet? I can do them with a macro but not with a macro in CM2.0 Do you mean using something like ChatSetAttr to toggle the conditions in the sheet? Or something else?
1607694787
Surok
Roll20 Production Team
Long time user and lurker. Just want to say love this API and it's been perfectly stable as of late. Great work!
Is there any word on when the one-click version will be fixed? It's weird having that version permanently broken, and it probably scares off potential adopters of this great script.
1607792944
Victor B.
Pro
Sheet Author
API Scripter
Not yet.  I'll reach out to Roll20.  
@Victor, have you had a chance to look into this bug yet? <a href="https://app.roll20.net/forum/permalink/9559621/" rel="nofollow">https://app.roll20.net/forum/permalink/9559621/</a> My last couple sessions, I had to manually re-add targeted conditions each round because the Removal calls are happening on the first round
1607820435
Victor B.
Pro
Sheet Author
API Scripter
Didn't we fix that once already?
1607822756

Edited 1607822806
I thought so, but maybe the change didn't get carried over to the latest version for some reason? I tested 2.38 and 2.35 and the bug happens in both versions.
Or I think the ones you fixed last time were: Removal calls happened too early on origin token, non-targeted API calls happened to both origin token and target token But this is Removal calls happening too early on a target token. You'd think the other two fixes would've covered that.
1607844031
Victor B.
Pro
Sheet Author
API Scripter
Alright, let's fix this again....I'll reach out tomorrow.&nbsp;&nbsp;
1608009521
Victor B.
Pro
Sheet Author
API Scripter
BTW One Click is working now.&nbsp; Don't know why.&nbsp; Don't care.&nbsp; It's working
Is there a setting to not erase all conditions on tokens when combat is stopped ? Also , " clear token statuses" would be useful if it didn't cleared the red X for dead tokens.
@Loupaile, There's a setting that keeps the token markers but doesn't save the statuses themselves, or you could instead Hold combat to save the statuses. You can't see them while combat is held, but resuming it will replace the statuses each token had.
1608668699
Andreas J.
Forum Champion
Sheet Author
Translator
The one-click version have been updated to v0.38(which vic release a month ago). Made the update not that the one-click version is supposed to be working.
Hi Victor, thanks for this really helpful API. Without this it is difficult to keep track of a fight! Here is my question: I would like to hear a bell sound [SBELL2] at the beginning of each round. I entered the following in the &nbsp; Turnorder Setup -&nbsp; Beginning of Each Round &nbsp;- Roll20AM field:&nbsp; {{!roll20AM {{--audio,play|SBELL2}}}} At the beginning of the first round you can hear the sound, but not on the following rounds. If I put the command in the&nbsp; Turnorder Setup -&nbsp; Beginning of Each Turn &nbsp; -&nbsp; Roll20AM&nbsp; field, it works. -&nbsp;You can hear the sound at beginning of each turn. What can I do / change here? Tanks a lot! Greetings from Germany - Rappa
1608692673
Victor B.
Pro
Sheet Author
API Scripter
Hmm, sounds like a bug in CM.&nbsp; I'll check it out.&nbsp;&nbsp;
1608725087

Edited 1608725284
Sounds great. You may also check the following: My players can delete the conditions themselves. The Symbol is shown in the conditions announcement for everyone. Although in the settings Player Allowed Changes is false . Is there a possibility that the , with this setting, is only displayed to the GM? Greetings from Germany - Rappa
1608757229
Victor B.
Pro
Sheet Author
API Scripter
Player allowed changes is for another purpose.&nbsp; I don't have anything to prevent that other than telling the players hands off.&nbsp;&nbsp;
Just testing out combat master 2.38.&nbsp; &nbsp;Downloaded the script for the Api Library - ran my game - no change !cmaster --main did nothing.&nbsp; Go back into the APi Library and discover the following error message: Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your script's code and click the "Save Script" button. We will then attempt to start running the scripts again.&nbsp; More info... &nbsp;If this script was installed from the Script Library, you might find help in the Community API Forum. For reference, the error message generated was:&nbsp; RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at Function.each (/home/node/d20-api-server/node_modules/underscore/underscore.js:188:9) at processMultiOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:804:7) at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:1128:4) at sendChat (/home/node/d20-api-server/api.js:1815:16) at makeAndSendMenu (apiscript.js:5709:9) at nextRound (apiscript.js:5465:13) at doTurnorderChange (apiscript.js:5305:17) at nextTurn (apiscript.js:5439:9) at nextRound (apiscript.js:5475:13) at doTurnorderChange (apiscript.js:5305:17) &nbsp;As I am new to using APIs I have no idea what any of that means nor how to fix it.&nbsp; Any ideas most welcome!&nbsp; &nbsp;
1608875135

Edited 1608875385
Victor B.
Pro
Sheet Author
API Scripter
crap, one click was working now it isn't again.&nbsp; It's a roll20 thing.&nbsp; Not sure why it's happening.&nbsp; And Roll20 is too busy to give it any time.&nbsp;&nbsp; Go here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> &nbsp;and open the combatmaster.js file, click the raw button and control-a/control-c to copy everything.&nbsp; Create a new script in game and control-v to paste into your new script.&nbsp; Name the script whatever you want and all is good to go.&nbsp; Let me know if problem persists.&nbsp;&nbsp; Make sure to delete your one-click install.&nbsp;&nbsp;
Hi Victor, I've noticed a bug related to exporting/importing setup for CM.&nbsp; I have some conditions where the description includes a quote - it imports just fine when the entity is encoded (e.g. &amp;quot;).&nbsp; When the config is later exported, the entity is not encoded, which makes the resultant JSON string invalid and cannot be imported again later. Adding ampersand (&amp;) to the escaped entities list for the HE function ~~line 3200 seems to fix this for me.&nbsp; I've submitted a PR to the repository.
1608945670
Victor B.
Pro
Sheet Author
API Scripter
Change was merged
1608990477

Edited 1608991073
I'll be honest:&nbsp;&nbsp;I am getting really confused by this. I have disable and installed the Roll 20 CM - it's gone.&nbsp; Grabbed the GitHub Verson as a New Script. Check. I've respun up the sandbox called up !cmaster --main and I get the dialogue in the chat window with stop combat halt, pause timer and so on. I've set up a mock fight with some enemies and player tokens in initiative order. And if I cycle through each turn I get a round 2 round 3 announcement. so it appears to be working. What I don't see is any indication in chat that combat has started, whose turn is up first, or next nor any End of Turn option in the chat nor is that any indication of which token's turn is up by centring the map with an icon. If I give a token a status it does not post it in chat.&nbsp; However I thought I had configured those options correctly in the settings.&nbsp; (See Screenshots.)&nbsp; What I would dearly love is a youtube "how to configure CM2.0"&nbsp; or a&nbsp; "What does this button do?" type video or some sort of FAQ. If I view the "Help" article it shows me what I should be seeing (which is helpful) but doesn't explain what to do if I don't. or put it another way - what I see in the help article is what I want to achieve but I'm not getting that and I don't understand what I might be doing wrong.&nbsp; I've tried casting concentration spells from player tokens and get a pop up in chat Do I want to add this spell to CM or do I want to ignore it?" I'm not sure if I do or not. Despite all the efforts put forth in this thread and others it does not appear to be a plug and play API I can just install and use.&nbsp; I'd hope to "upgrade" my game over my Christmas break and the very last thing I want to do is to give my players a bad experience with an API I don't fully understand how to operate correctly. Screenshots of what I am seeing +plus my configurations.&nbsp; If anyone can spot some error of mine I'll gladly fix it. And Thanks Victor for all the help you've given out so far.&nbsp; Other APIs I've installed in case of conflicts.&nbsp; "CM New" is the new script version taken from Github.
1608992988
Victor B.
Pro
Sheet Author
API Scripter
Each one of those white circular icons with a black "I' in the upper right corner is help.&nbsp; When you start CM a menu shows in chat with a green background (stopped).&nbsp; When you click the Arrow icon and have icons selected it will roll initiative, display turnorder and the menu is shown again this time with a red background (started).&nbsp; The arrow icon is now replaced with a box icon (standard icons for playing and stopping music).&nbsp;&nbsp; Each menu in CM has it's own help file.&nbsp; Just click on the information icon.&nbsp; Would be nice to have it in one spot, but CM is simply too big for that.&nbsp;&nbsp;
Thanks Victor - I am red/green colourblind.&nbsp; I may not be able to tell the difference between the backgrounds but will take a look.&nbsp;&nbsp; So just to be clear do I need to run "!cmaster --main" before each fight, and would it be worth building a macro to enable me to do this with a button press? Also does this work with Group Initiative API?
Hi Victor.&nbsp; Thanks for your help with pointing out the coloured background differences with the active/deactive status. I had thought the Square "Stop" symbol meant I wanted to "stop running" Combat Master rather than to "run" it.&nbsp; I would consider reversing the symbols for the Red lopsided triangle (active) and the Green square "deactive" as a button implies "push to activate" as the other buttons do where the functionality in this is reversed.&nbsp; As for announcements I have reviewed the help article and am still puzzled as to why the announcments are not showing in my chat as the help article implies they should.&nbsp; I think I have configured it correctly - this is what I see in my game when I attack with a player token. &nbsp;&nbsp; This is what I see in chat when I click on a weapon on a PC's character sheet and roll to attack.&nbsp; This is what the Help article implies I should see.&nbsp; Options to delay/end a turn and active statuses.&nbsp;&nbsp; I do not see that - but I don't understand why I am not seeing that.&nbsp; I feel like I ought to be able to but for some reason I can't figure out it isn't appearing.&nbsp; Any help - much appreciated!&nbsp; Thanks.&nbsp;&nbsp;
Do you have the Player ribbon on the page you're testing combat on? There are known issues if you try to launch CM and run combat on a page without the Player ribbon.
Also, have you added your monsters to combat? If you just launch CM (clicking the play button), it still needs to have creatures in the turn order. You can use CM's built-in method for handling initiative, or have CM use GroupInitiative (which is what I do). When you add anyone to initiative using GroupInit, CM will automatically launch (assuming you've set your CM prefs to use GroupInit).
1609011940
Victor B.
Pro
Sheet Author
API Scripter
Sorry I put it backwards.&nbsp; Red is stop.&nbsp; Green is go.&nbsp; Red means combat not started.&nbsp; Green means combat started.&nbsp; As Jay said.&nbsp; Select tokens you want to have in combat.&nbsp; Start combat (bar shows green).&nbsp; Then highlight token, add a condition using the main menu (plus sign next to condition).&nbsp; You'll see the condition icon show on the token.&nbsp; Then step through and you'll see the player condition announced in chat.&nbsp;&nbsp; Also, to see the token markers move, you'll need to have your player ribbon on the page you are testing on.&nbsp;&nbsp;
1609016989

Edited 1609017061
Victor B.
Pro
Sheet Author
API Scripter
Oh.&nbsp; I think I understand the gap here.&nbsp; CM tracks conditions or spells against tokens.&nbsp; It doesn't track attacks unless the attack causes a condition on the target.&nbsp; In order to assign a condition to a token, you need to select the token and add a condition (blindness for example) to the token.&nbsp; Each condition or spell has a duration (in terms of rounds) and direction.&nbsp; Typically a condition/spell lasts 10 rounds (1 minute).&nbsp; Direction is set to -1 and after 10 rounds CM removes the condition from token.&nbsp;&nbsp;This can be done by using the CM menus, a macro calling CM, etc.&nbsp; CM also supports API calls to other scripts such as token-mod or charsetattr.&nbsp;&nbsp;
Thanks guys!&nbsp; The Ribbon trick worked!&nbsp; &nbsp;Yes that explains why I wasn't getting the announcments correctly!&nbsp; Phew!&nbsp; I had set up a blank grid to test out a combat on but acting as the DM I didn't move the player ribbon from the map they are currently fighting in. You are Superstars for helping me figure it out.&nbsp; :-D&nbsp;
//have CM use GroupInitiative// Is that under "turn order setup" or "Macro/API?" in the settings menu?&nbsp;
1609066250

Edited 1609066371
Final Question I've been puzzling over (though figuring out the announcements was more urgent).&nbsp;&nbsp; I have purchased an alternate set of Token statuses that aren't the obscure "stunned" = fist. When I look in the "Conditions set up" settings menu I can assign alternate token images to each of the statuses - which is great -&nbsp; however the drop down list that appears only shows the default token statuses for me to choose from as well as the coloured orbs.&nbsp;&nbsp; Is there a way for me to configure CM to draw the statuses from the alternate market place set I have installed? Thanks!&nbsp;
1609072429

Edited 1609072515
(DM) RH said: Is there a way for me to configure CM to draw the statuses from the alternate market place set I have installed? This one is fairly straightforward. Go into Conditions setup with this command: !cmaster --show,view,value=conditions You can also use "all", "spells", or "favourites" instead of "conditions". Click the cog for the condition you want to edit, so it opens something like this: Then change Icon Type to Token Marker, and select the symbol you want from the list that appears. It should list all available status markers for you to choose from, including your own marketplace ones as long as you have them installed in the game. I actually removed the default status markers from mine because I prefer the ones I bought from the Marketplace, and they were just getting in the way.
Scarper said: (DM) RH said: Is there a way for me to configure CM to draw the statuses from the alternate market place set I have installed? This one is fairly straightforward. Go into Conditions setup with this command: !cmaster --show,view,value=conditions You can also use "all", "spells", or "favourites" instead of "conditions". Click the cog for the condition you want to edit, so it opens something like this: Then change Icon Type to Token Marker, and select the symbol you want from the list that appears. It should list all available status markers for you to choose from, including your own marketplace ones as long as you have them installed in the game. I actually removed the default status markers from mine because I prefer the ones I bought from the Marketplace, and they were just getting in the way. It should be noted though, that you need to have the Token Marker Script from TheAaron installed for this to work correctly.&nbsp; I don't remember if it's in the DDM or only on TheAaron's hub though ...
Good catch - I forgot about Aaron's script. You can find it here , but it should also be available under the 1-click system as libTokenMarkers.
Yeah, you need lib Token Markers for it to work with CM. Should be available from the one-click.
(DM) RH said: Thanks guys!&nbsp; The Ribbon trick worked!&nbsp; &nbsp;Yes that explains why I wasn't getting the announcments correctly!&nbsp; Phew!&nbsp; I had set up a blank grid to test out a combat on but acting as the DM I didn't move the player ribbon from the map they are currently fighting in. You are Superstars for helping me figure it out.&nbsp; :-D&nbsp; No problem. It is absolutely a rite of passage when first using this script. We've all made that same mistake. :)
1609104740

Edited 1609107360
Thank you Scarper, Wolf Thunderspirit &amp; Jay for helping me to understand how to make CM interact with those other scripts and getting the staus icons to work.&nbsp;&nbsp; Are there any other script interactions with CM that make it better? Cheers.
(DM) RH said: Thank you Scarper, Wolf Thunderspit &amp; Jay for helping me to understand how to make CM interact with those other scripts and getting the staus icons to work.&nbsp;&nbsp; Are there any other script interactions with CM that make it better? Cheers. Can't speak for anyone else, but since I started using EncounterHelper (available from the one click) my combat starts have been a breeze. Here's my basic sequence: Ask all players to roll initiative. (I don't use Group Init for this because some players have advantage on their rolls, and also they prefer to roll themselves. So I have a basic macro for them available as a token action. After the heroes are in initiative, from EncounterHelper, I click the dice icon, which sends all monsters for the encounter into initiative using GroupInit (EncounterHelper integrates with GroupInit). This action starts Combat Master. If necessary, sort the turn order in CM in case someone isn't where they're supposed to be in inish order. Once you're more familiar with CM, you may want to start using its Concentration and auto-add spells features, which are super handy but also a bit fiddly to get going. Post if you have questions. :)
Thanks Jay, I've not used EncounterHelper before (I am a new DM and this is my first Roll 20 Campaign)&nbsp; - what does it do exactly? I was already using an API called Concentration - that announced if a concentration spell was cast and called for Con saves if attacked and added the stopwatch icon to the token status.&nbsp; Does CM's concentration feature work similarly (and/or) conflict with this other API? I tried casting Heroism from a PC's spell sheet - and it asked me if i wanted to add it to CM or to ignore it.&nbsp; I had no idea what that meant, is there a neat explanation for when either action is appropriate? &nbsp;
(DM) RH said: Thanks Jay, I've not used EncounterHelper before (I am a new DM and this is my first Roll 20 Campaign)&nbsp; - what does it do exactly? I was already using an API called Concentration - that announced if a concentration spell was cast and called for Con saves if attacked and added the stopwatch icon to the token status.&nbsp; Does CM's concentration feature work similarly (and/or) conflict with this other API? I tried casting Heroism from a PC's spell sheet - and it asked me if i wanted to add it to CM or to ignore it.&nbsp; I had no idea what that meant, is there a neat explanation for when either action is appropriate? &nbsp; EncounterHelper allows you to define groups of monsters as encounters ahead of time, and then show/hide them (move from object layer to GM layer or vice-versa) or add them to initiative with a click. It may not sound like much, but it's a big time-saver. Say you have an encounter where some of your monsters are hidden and others are visible, and they're spread out over a large portion of the map. And maybe even a "second wave" of monsters that you want to add to combat in, let's say, round two. Selecting them all to add to initiative is kind of a pain, and time-consuming at a point when you just want combat to start rolling. With EncounterHelper, you could create two "encounters" for that map: one for the round 1 monsters, and one for wave 2. Then, when you want to add them, you bring up EH's encounter list, select the encounter you want, and all monsters in that encountered are added to initiative (which activates Combat Master). If you're using the old Concentration script, that's great. I switched to Combat Master for it, because the old one stopped auto-rolling the save damage and hasn't been updated in a long time. (its creator has been absent from Roll20 for a while.) If you have auto-add on, it asks you whether you want to add a spell to CM when it's first cast. Use it for spells that require concentration (to have the Con marker auto-add to the caster, with timed duration) and/or for spells with multiple, persistent targets (such as Bless or Haste). For spell you add to CM in this way, edit its settings in CM (the same place where you edit conditions). You can specify duration, message, concentration or not, and whether it affects targets beyond the caster. This is one area of CM that I wish had a dedicated, procedural help page, because it is not intuitive.
1609167963
Kai
Sheet Author
Hey there, great script. I am trying to set up Concentration with Combat Master. Is there a setting so I do not get the "choose origin" message? As far as I have it now there is a lot of clicking to get concentration on the caster. Is it possible to get the concentration condition on the caster of a spell without having to choose origin, caster and targets? (I know how to set target to false, but it keeps asking for an origin.) Thanks in advance.
1609168613

Edited 1609193757
Victor B.
Pro
Sheet Author
API Scripter
Use CM Concentration.&nbsp; Once you setup the spell and set the spell to concentration, it will either auto-assign the concentration icon to the caster if CM can detect the concentration spell by the caster (some spells are very difficult to detect in Roll20 OGL).&nbsp; Or if you assign the spell to targets it will ask for you to select the caster token and auto-assign concentration.&nbsp; &nbsp;The old concentration script hasn't been supported in years and does not allow for using custom status icon sets.&nbsp;&nbsp; If you set the spell to targeted, it will ask an additional question to select the target tokens and then count down the duration based on the caster.&nbsp; This is good for spells like bless or hypnotic gaze, spells that drive off the caster.&nbsp; To save time, set the auto add spells to true on the status menu and when CM detects a spell is cast it will ask you to add this spell to CM.&nbsp; It's a quick way to get spells into CM.&nbsp;&nbsp;