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

1659105045
Victor B.
Pro
Sheet Author
API Scripter
Reset the character sheet.  Even if it's showing OGL, do it again.  Auto add then detects most spells and will add them
1659105211
Victor B.
Pro
Sheet Author
API Scripter
Auto add doesn't set everything.  For concentration spells, you want to set duration to 10, direction to -1, override to false and concentration to true.  Then when bless is cast, CM detects it, asks you for the recipients.  You select them on map and click a check box above the message and it auto adds bless to the selected tokens and tracks down the duration of the spell.  It auto adds a concentration to the caster.   
1659105298
Victor B.
Pro
Sheet Author
API Scripter
Also make sure the concentration condition in CM is NOT set to concentrate = true.   That condition is required to add concentration to casters.  
1659372141
DM Anubis
Pro
Marketplace Creator
I imported the settings from one game to another and the Conditions all show up but there is no status marker for them and it won't let me change them @victor B.
1659372361
DM Anubis
Pro
Marketplace Creator
NVM I fixed it!!
How do I turn off the red/green markers??? !cmaster --main  I clicked on the cog, I clicked on turn order, I turned off marker but it keeps showing up. I am trying to use CM with Turnorder1 as I like the look of turnorder1 but want to use CM for conditions status order and timer. I also enjoy Turnorder1 marker as well. 
1660015765
Victor B.
Pro
Sheet Author
API Scripter
Keep at it.  It will do what you want
Has anyone managed to get the concentration feature working? Is it really a working feature right now? 
1660527024

Edited 1660527496
When I try to apply a spell condition, it also marks the caster as well. And doesn't add the concentration marker. Hitting the caster doesn't provoke the concentration check... Even if I add the concentration marker manually, the concentration check doesn't happen... Tested both on 2.47 and 2.48. Nothing works.  
1660544262
Victor B.
Pro
Sheet Author
API Scripter
This has been asked and answered may times.  Read the rest of the thread. 
1660603354
Victor B.
Pro
Sheet Author
API Scripter
Set override to false and concentration to true.  Also make sure the concentration spell itself has concentration set to false.  
Hello! SO, I just added plus account and this was the first thing I tried to get to work. But I can't. I keep getting this error message.  TypeError: Cannot read property 'match' of undefined TypeError: Cannot read property 'match' of undefined     at getCleanImgsrc (apiscript.js:1348:28)     at getOrCreateMarker (apiscript.js:1825:121)     at verifyCondition (apiscript.js:1184:22)     at addConditionToToken (apiscript.js:1237:13)     at apiscript.js:1201:12     at Array.forEach (<anonymous>)     at addCondition (apiscript.js:1199:25)     at commandHandler (apiscript.js:383:17)     at apiscript.js:166:25     at Function.each (/home/node/d20-api-server/node_modules/underscore/underscore-node-f.cjs:1323:7) I can't get rid of it! What am I doing wrong? 
1660887723
Victor B.
Pro
Sheet Author
API Scripter
Plus account can't run APIs.  Pro account is needed
1660894001

Edited 1660906962
Sorry, I see I wrote a 'Plus' account in error.  The script however still is the problem.
1660895251

Edited 1660895874
Alright, I think this is because I wanted to change the picture used in the next and current turn indicator. How should I change the images, if an external URL doesn't work? It should work, nothing prevents from reaching that picture and it does load small version of the image in the menu, but it doesn't work when combat starts...
I tried to change the external URL to token marker (libTokenMarkers is also added) but I got another error.  TypeError: Cannot read property 'match' of null TypeError: Cannot read property 'match' of null at getCleanImgsrc (apiscript.js:1348:28) at getOrCreateMarker (apiscript.js:1825:121) at doTurnorderChange (apiscript.js:2008:27) at handleTurnorderChange (apiscript.js:2080:13) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:168:1), <anonymous>:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1078:14) at updateLocalCache (/home/node/d20-api-server/api.js:1421:18) at /home/node/d20-api-server/api.js:1713:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
1660954058
Victor B.
Pro
Sheet Author
API Scripter
Hnmmmm, the external URLs is another tricky thing to setup.  Can you show me the URL you have to your image?  
I tried something like this&nbsp; <a href="https://i.imgur.com/AgPTTw9.png" rel="nofollow">https://i.imgur.com/AgPTTw9.png</a> &nbsp;- I re-uploaded these since I sort of gave up. If I'd gotten even one to work, I could've made and upload the 'next' -image. I tried to host the image on google documents (shared openly with a link), and I think some random image hosting site that doesn't require an account, too.&nbsp;
(I changed to initiative tracker plus which I got to work - I'd perhaps like to in some point also test combat master and see which one I like better. But being able to customize the appearance of things is important to me - also I want to use a custom token marker set which I didn't manage to do with combat master either. :( Otherwise it seemed great in many ways!&nbsp;
1661153668

Edited 1661153798
i have a question. i have looked through this thread and other older threads for an answer in case someone has already ran into this issue but i either missed it or it wasnt there. during my pathfinder games i have used combat master to keep track of turns, rounds and conditions. but halfway through a fight, the turn marker will no longer show up and players cant end their turns unless i do it for them. any known fixes for this? i do have my initiative on the map with the player ribbon. made sure all players are there and it happens sporadically. Edit: i meant that the turns just stopped being announced. sorry.
1661206765
Victor B.
Pro
Sheet Author
API Scripter
I noticed same thing.&nbsp; It's a bug.&nbsp; I thought I fixed it, but didn't
Hi @Victor. We are using the latest 2.48 script and it seems that there is some kind of a "memory leak" or "infinite loop" or something like that... When we start the combat with CM, all of our player computer's RAM gets "eaten" in less than a couple of minutes. Everything becomes super slow and laggy. Roll20 starts to crash (the "oh snap!" page). Then roll20 stops all the scripts and shows this error message:&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-node-f.cjs:1323:7) at processMultiOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:804:7) at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:1128:4) at sendChat (/home/node/d20-api-server/api.js:1897:16) at makeAndSendMenu (apiscript.js:24199:9) at nextRound (apiscript.js:23946:13) at doTurnorderChange (apiscript.js:23781:17) at nextTurn (apiscript.js:23920:9) at nextRound (apiscript.js:23956:13) at doTurnorderChange (apiscript.js:23781:17) Hopefully this would help to fix the issue. If we could somehow help with the logs or something - please let us know.&nbsp;
1661283150
Brian C.
Pro
Marketplace Creator
Compendium Curator
Vas said: Hi @Victor. We are using the latest 2.48 script and it seems that there is some kind of a "memory leak" or "infinite loop" or something like that... When we start the combat with CM, all of our player computer's RAM gets "eaten" in less than a couple of minutes. Everything becomes super slow and laggy. Roll20 starts to crash (the "oh snap!" page). Then roll20 stops all the scripts and shows this error message:&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-node-f.cjs:1323:7) at processMultiOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:804:7) at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:1128:4) at sendChat (/home/node/d20-api-server/api.js:1897:16) at makeAndSendMenu (apiscript.js:24199:9) at nextRound (apiscript.js:23946:13) at doTurnorderChange (apiscript.js:23781:17) at nextTurn (apiscript.js:23920:9) at nextRound (apiscript.js:23956:13) at doTurnorderChange (apiscript.js:23781:17) Hopefully this would help to fix the issue. If we could somehow help with the logs or something - please let us know.&nbsp; Ah, thank you. I was running into a similar super slowdown for a while and had only started suspecting it might be in CM.
1661540598

Edited 1661540678
Vas said: Hi @Victor. We are using the latest 2.48 script and it seems that there is some kind of a "memory leak" or "infinite loop" or something like that... When we start the combat with CM, all of our player computer's RAM gets "eaten" in less than a couple of minutes. Everything becomes super slow and laggy. Roll20 starts to crash (the "oh snap!" page). Then roll20 stops all the scripts and shows this error message:&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-node-f.cjs:1323:7) at processMultiOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:804:7) at Object.d20.textchat.doChatInput (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:172:1), &lt;anonymous&gt;:1128:4) at sendChat (/home/node/d20-api-server/api.js:1897:16) at makeAndSendMenu (apiscript.js:24199:9) at nextRound (apiscript.js:23946:13) at doTurnorderChange (apiscript.js:23781:17) at nextTurn (apiscript.js:23920:9) at nextRound (apiscript.js:23956:13) at doTurnorderChange (apiscript.js:23781:17) Hopefully this would help to fix the issue. If we could somehow help with the logs or something - please let us know.&nbsp; I did some debugging and it seems that the "RAM eating" issue was somehow caused by the animation of the current token.&nbsp; When I use this config ( <a href="https://pastebin.com/NVQPMU4G" rel="nofollow">https://pastebin.com/NVQPMU4G</a> ) and start a battle with CM 2.48, I get a huge spike in RAM consumed by Chrome, from 2.7BG to 9GB, easily in 60 seconds: But if I turn off the current turn token animation option, everything works well.&nbsp; @Brian C. try this workaround.&nbsp;
1661659918
Victor B.
Pro
Sheet Author
API Scripter
Someone else added animations.&nbsp; I haven't removed it but it caused quite a few issues.&nbsp; Turn it off.&nbsp; Not worth it.&nbsp;&nbsp;
1661659982
Victor B.
Pro
Sheet Author
API Scripter
Even at lowest settings animations seems to cause client based issues for all player client sessions.&nbsp; They just simply can't keep up
Animations are at a heavy cost in all situations I have found.
Combat Master seems to no longer center on token or use the circles.&nbsp; It also doesn't count down the token markers.&nbsp; Did something change?
Justin G. said: Combat Master seems to no longer center on token or use the circles.&nbsp; It also doesn't count down the token markers.&nbsp; Did something change? Do you have the player ribbon on the correct page? A mistake every combat master user makes at least once (in my case several).&nbsp;
Nope.&nbsp; Thanks for the quick response. Jared said: Justin G. said: Combat Master seems to no longer center on token or use the circles.&nbsp; It also doesn't count down the token markers.&nbsp; Did something change? Do you have the player ribbon on the correct page? A mistake every combat master user makes at least once (in my case several).&nbsp;
Justin G. said: Nope.&nbsp; Thanks for the quick response. Jared said: Justin G. said: Combat Master seems to no longer center on token or use the circles.&nbsp; It also doesn't count down the token markers.&nbsp; Did something change? Do you have the player ribbon on the correct page? A mistake every combat master user makes at least once (in my case several).&nbsp; Lol - everyone's a first timer once ... We have to be nearing 100 on the "Is player ribbon...?" answers .... lmao
1663049332
Victor B.
Pro
Sheet Author
API Scripter
I tried to fix, but Roll20 architecture doesn't allow.&nbsp; So we all have to learn this the hard way
Victor B. said: I tried to fix, but Roll20 architecture doesn't allow.&nbsp; So we all have to learn this the hard way Don't get me started with Roll20 Architecture.&nbsp; I mean, a post can only be so long before it hits the DR of tl;dr.
1663167865

Edited 1663167881
The Aaron
Roll20 Production Team
API Scripter
Victor, here's a version of getCleanImgsrc() that won't crash for that sort of bad input: const getCleanImgsrc = (imgsrc) =&gt; { let parts = (imgsrc||'').match(/(.*\/images\/.*)(thumb|med|original|max)([^?]*)(\?[^?]+)?$/); if(parts) { return parts[1]+'thumb'+parts[3]+(parts[4]?parts[4]:`?${Math.round(Math.random()*9999999)}`); } return; }; Kewnoe said: I tried to change the external URL to token marker (libTokenMarkers is also added) but I got another error.&nbsp; TypeError: Cannot read property 'match' of null TypeError: Cannot read property 'match' of null at getCleanImgsrc (apiscript.js:1348:28) at getOrCreateMarker (apiscript.js:1825:121) at doTurnorderChange (apiscript.js:2008:27) at handleTurnorderChange (apiscript.js:2080:13) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8) at TrackedObj.set (/home/node/d20-api-server/api.js:1078:14) at updateLocalCache (/home/node/d20-api-server/api.js:1421:18) at /home/node/d20-api-server/api.js:1713:7 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560
1663168784
The Aaron
Roll20 Production Team
API Scripter
Victor B. said: I tried to fix, but Roll20 architecture doesn't allow.&nbsp; So we all have to learn this the hard way I have these functions for dealing with where players are, and what players are what: const getActivePages = () =&gt; [...new Set([ Campaign().get('playerpageid'), ...Object.values(Campaign().get('playerspecificpages')), ...findObjs({ type: 'player', online: true }) .filter((p)=&gt;playerIsGM(p.id)) .map((p)=&gt;p.get('lastpage')) ]) ]; const getPageForPlayer = (playerid) =&gt; { let player = getObj('player',playerid); if(playerIsGM(playerid)){ return player.get('lastpage') || Campaign().get('playerpageid'); } let psp = Campaign().get('playerspecificpages'); if(psp[playerid]){ return psp[playerid]; } return Campaign().get('playerpageid'); }; const getPlayersOnPage = (pageid) =&gt; { let pages = {}; let ribbonPage = Campaign().get('playerpageid'); let psp = Campaign().get('playerspecificpages'); findObjs({type:'player'}) .forEach(p=&gt;{ if(playerIsGM(p.id)){ const lp = p.get('lastpage') || Campaign().get('playerpageid'); pages[lp]=pages[lp]||[]; pages[lp].push(p.id); } else if(psp.hasOwnProperty(p.id)){ pages[psp[p.id]]=pages[psp[p.id]]||[]; pages[psp[p.id]].push(p.id); } else { pages[ribbonPage]=pages[ribbonPage]||[]; pages[ribbonPage].push(p.id); } }); if(pageid){ return pages[pageid]||[]; } return pages; }; const getGMPlayers = (pageid) =&gt; findObjs({type:'player'}) .filter((p)=&gt;playerIsGM(p.id)) .filter((p)=&gt;undefined === pageid || p.get('lastpage') === pageid) .map(p=&gt;p.id) ;
1663201301

Edited 1663202299
Victor B.
Pro
Sheet Author
API Scripter
I used your last clearnImgSrc.&nbsp; It's in the script.&nbsp; I'll upgrade it.&nbsp;&nbsp; 'll try to incorporate.&nbsp; You may have found a way!!!!&nbsp; The challenge I saw was changing the initiative page.&nbsp; That's the critical piece.&nbsp; Roll20 doesn't track initiative page in a way that can make player ribbon work if you aren't on that page.&nbsp; I'll see if this can do it
1663250838

Edited 1663250852
I'm having an issue where some of my games Combat Master works fine and some of my other games it doesnt track tokens during turn order or update to reroll them at the next turn.
1663252004

Edited 1663252023
Something else I noticed is that for the game where it works as intended there is a turn marker in the Turn Order named Round, but in the games where it doesn't work that part is missing so I'm guessing I need to add that but I'm not sure how.
1663359597
Victor B.
Pro
Sheet Author
API Scripter
Check your version.&nbsp; The one that isn't working maybe a later version.&nbsp;&nbsp;
I am trying to figure out what I am doing wrong and if there is a fix for this issue.&nbsp; I am getting a bunch of error codes and I can't seem to find a fix on here. I have turned off all of my other API scripts and I am using version 2.48.&nbsp; TypeError: Cannot read property 'match' of null TypeError: Cannot read property 'match' of null at getCleanImgsrc (apiscript.js:1542:28) at getOrCreateMarker (apiscript.js:2019:121) at removeMarkers (apiscript.js:2065:9) at stopCombat (apiscript.js:1760:9) at commandHandler (apiscript.js:506:17) at apiscript.js:360:25 at Function.each (/home/node/d20-api-server/node_modules/underscore/underscore-node-f.cjs:1323:7) at inputHandler (apiscript.js:355:23) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:168:1), &lt;anonymous&gt;:70:8)
1663434433
Victor B.
Pro
Sheet Author
API Scripter
Use the default marker for now.&nbsp; That will resolve this.&nbsp; I've got to put in a new version of cleanImgSrc
1663441040

Edited 1663441104
The Aaron
Roll20 Production Team
API Scripter
Just to mention, I don't know the full extent of how you are using&nbsp; <a href="https://i.imgur.com/AgPTTw9.png" rel="nofollow">https://i.imgur.com/AgPTTw9.png</a> , but Mods can't use any images for token/avatars which are not in a user library.&nbsp; Something on imgur could be output to chat, or possibly embedded in the text of a handout, character sheet bio, or roll template output, but will cause errors like the one above if needed in other contexts. If you wanted to use that image as a graphic on the table top, you'd need to upload it to your user library, then get the URL from it (probably by selecting it, hitting Z, and right click-copy image url).
Victor B. said: Check your version.&nbsp; The one that isn't working maybe a later version.&nbsp;&nbsp; Should the latest version be working? Because the game that doesnt have a "Round" turn and doesnt reroll initiatives is that is the "Latest-2.47" version.
1663476518
Victor B.
Pro
Sheet Author
API Scripter
I have a later version with some of that fixed on my github.&nbsp; Haven't pushed to Roll20 yet.&nbsp; 2.48.&nbsp; Another person introduced changes to CM and kinda messed things up.&nbsp; 2.48 fixed some of them.&nbsp; Remove your Roll20 version, add new script, copy and paste RAW from my github
1663476577
Victor B.
Pro
Sheet Author
API Scripter
vicberg github on google
Yup that fixed it, thanks!
1664929997

Edited 1665006157
I'm looking back at this reply that says I can use SelectManager to post Chat Menus that will let my players apply Combat Master markers to enemies. The example shows: !cmaster --add,condition=concentration,duration=?{Duration|1},direction=?{Direction|0} {&amp;select @{target|token_id}} That works great for the GM! However, it doesn't work for the players. Nothing happens when they execute the command, the GM just sees a notification from Combat Master saying "No tokens were selected". Advice appreciated! (EDIT: I'm using 2.48) (EDIT2: It works for players when I give them control of the token, but that's not the behavior I'm hoping for.)