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

July 29 (2 years ago)
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

July 29 (2 years ago)
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.   

July 29 (2 years ago)
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.  

August 01 (2 years ago)
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.

August 01 (2 years ago)
DM Anubis
Pro
Marketplace Creator

NVM I fixed it!!

August 06 (2 years ago)

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. 

August 09 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Keep at it.  It will do what you want

August 15 (2 years ago)

Has anyone managed to get the concentration feature working? Is it really a working feature right now? 

August 15 (2 years ago)

Edited August 15 (2 years ago)

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.


 





August 15 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter
This has been asked and answered may times.  Read the rest of the thread. 
August 15 (2 years ago)
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? 
August 19 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter
Plus account can't run APIs.  Pro account is needed
August 19 (2 years ago)

Edited August 19 (2 years ago)

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

August 19 (2 years ago)

Edited August 19 (2 years ago)

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

August 20 (2 years ago)
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 https://i.imgur.com/AgPTTw9.png - 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. 

(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! 

August 22 (2 years ago)

Edited August 22 (2 years ago)

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.

August 22 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I noticed same thing.  It's a bug.  I thought I fixed it, but didn't

August 23 (2 years ago)

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: 

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 <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:804:7)
    at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>: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. 

August 23 (2 years ago)
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: 

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 <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:804:7)
    at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>: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. 

Ah, thank you. I was running into a similar super slowdown for a while and had only started suspecting it might be in CM.

August 26 (2 years ago)

Edited August 26 (2 years ago)


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: 

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 <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>:804:7)
    at Object.d20.textchat.doChatInput (eval at <anonymous> (/home/node/d20-api-server/api.js:172:1), <anonymous>: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. 


I did some debugging and it seems that the "RAM eating" issue was somehow caused by the animation of the current token. 

When I use this config (https://pastebin.com/NVQPMU4G) 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. 

@Brian C. try this workaround. 





August 28 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Someone else added animations.  I haven't removed it but it caused quite a few issues.  Turn it off.  Not worth it.  

August 28 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Even at lowest settings animations seems to cause client based issues for all player client sessions.  They just simply can't keep up

August 28 (2 years ago)

Animations are at a heavy cost in all situations I have found.

August 31 (2 years ago)

Combat Master seems to no longer center on token or use the circles.  It also doesn't count down the token markers.  Did something change?

August 31 (2 years ago)


Justin G. said:

Combat Master seems to no longer center on token or use the circles.  It also doesn't count down the token markers.  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). 



August 31 (2 years ago)

Nope.  Thanks for the quick response.

Jared said:


Justin G. said:

Combat Master seems to no longer center on token or use the circles.  It also doesn't count down the token markers.  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). 






September 13 (2 years ago)


Justin G. said:

Nope.  Thanks for the quick response.

Jared said:


Justin G. said:

Combat Master seems to no longer center on token or use the circles.  It also doesn't count down the token markers.  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). 







Lol - everyone's a first timer once ... We have to be nearing 100 on the "Is player ribbon...?" answers .... lmao

September 13 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I tried to fix, but Roll20 architecture doesn't allow.  So we all have to learn this the hard way

September 14 (2 years ago)


Victor B. said:

I tried to fix, but Roll20 architecture doesn't allow.  So we all have to learn this the hard way


Don't get me started with Roll20 Architecture.  I mean, a post can only be so long before it hits the DR of tl;dr.

September 14 (2 years ago)

Edited September 14 (2 years ago)
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) => {
		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. 

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

September 14 (2 years ago)
The Aaron
Roll20 Production Team
API Scripter


Victor B. said:

I tried to fix, but Roll20 architecture doesn't allow.  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 = () => [...new Set([
  Campaign().get('playerpageid'),
  ...Object.values(Campaign().get('playerspecificpages')),
  ...findObjs({
      type: 'player',
      online: true
    })
    .filter((p)=>playerIsGM(p.id))
    .map((p)=>p.get('lastpage'))
  ])
];

const getPageForPlayer = (playerid) => {
  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) => {
  let pages = {};
  let ribbonPage = Campaign().get('playerpageid');
  let psp = Campaign().get('playerspecificpages');
  findObjs({type:'player'})
    .forEach(p=>{
      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) => findObjs({type:'player'})
  .filter((p)=>playerIsGM(p.id))
  .filter((p)=>undefined === pageid || p.get('lastpage') === pageid)
  .map(p=>p.id)
  ;



September 15 (2 years ago)

Edited September 15 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I used your last clearnImgSrc.  It's in the script.  I'll upgrade it.  

'll try to incorporate.  You may have found a way!!!!  The challenge I saw was changing the initiative page.  That's the critical piece.  Roll20 doesn't track initiative page in a way that can make player ribbon work if you aren't on that page.  I'll see if this can do it

September 15 (2 years ago)

Edited September 15 (2 years ago)

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.

September 15 (2 years ago)

Edited September 15 (2 years ago)

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.

September 16 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Check your version.  The one that isn't working maybe a later version.  

September 17 (2 years ago)

I am trying to figure out what I am doing wrong and if there is a fix for this issue. 

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. 

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 <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)



September 17 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Use the default marker for now.  That will resolve this.  I've got to put in a new version of cleanImgSrc

September 17 (2 years ago)

Edited September 17 (2 years ago)
The Aaron
Roll20 Production Team
API Scripter

Just to mention, I don't know the full extent of how you are using https://i.imgur.com/AgPTTw9.png, but Mods can't use any images for token/avatars which are not in a user library.  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).

September 18 (2 years ago)


Victor B. said:

Check your version.  The one that isn't working maybe a later version.  


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.

September 18 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I have a later version with some of that fixed on my github.  Haven't pushed to Roll20 yet.  2.48.  Another person introduced changes to CM and kinda messed things up.  2.48 fixed some of them.  Remove your Roll20 version, add new script, copy and paste RAW from my github

September 18 (2 years ago)
Victor B.
Pro
Sheet Author
API Scripter

vicberg github on google

September 19 (2 years ago)

Yup that fixed it, thanks!

October 05 (2 years ago)

Edited October 05 (2 years ago)

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} {&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.)