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
This post has been closed. You can still view previous posts, but you can't post any new replies.

CombatMaster Alpha

I've been getting a lot of CombatMaster errors the past couple days, both before and after moving from 2.32 to 2.33. When I add a token marker, I get this: For reference, the error message generated was:&nbsp; TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at apiscript.js:12166:35 at Array.forEach (&lt;anonymous&gt;) at checkMarkerturn (apiscript.js:12165:19) at getOrCreateMarker (apiscript.js:12150:19) at verifyCondition (apiscript.js:11478:22) at addConditionToToken (apiscript.js:11532:13) at apiscript.js:12257:29 at Array.forEach (&lt;anonymous&gt;) at handleStatusMarkerChange (apiscript.js:12253:38) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) I also see in the API console: "ERROR: You must include the query string in your URL. For example, use '<a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678</a>', not '<a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png</a>'" Any idea what could be going on? Thanks!
Victor B. said: Version 2.33 of Combat Master found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> Fixed - Multiple issues surround API calls and targeted spells - Ad Hoc conditions&nbsp; - The One Click was messed up because there's two versions of Combat Master in Roll20 Github.&nbsp; The one under 2.0 directory had 1.8 Alpha.&nbsp; So to be safe I've updated both versions and notified Roll20.&nbsp;&nbsp; - Revamped the token status logic.&nbsp; It's now counting down correct from 10 down to 1 New Functionality - Two new condition options to specify if the spell includes the caster or is only against targets and if an API call is needed against caster and or targets.&nbsp; Awesome news on the New Functionality &amp; Fixes! Ezra said: I've been getting a lot of CombatMaster errors the past couple days, both before and after moving from 2.32 to 2.33. When I add a token marker, I get this: For reference, the error message generated was:&nbsp; TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at apiscript.js:12166:35 at Array.forEach (&lt;anonymous&gt;) at checkMarkerturn (apiscript.js:12165:19) at getOrCreateMarker (apiscript.js:12150:19) at verifyCondition (apiscript.js:11478:22) at addConditionToToken (apiscript.js:11532:13) at apiscript.js:12257:29 at Array.forEach (&lt;anonymous&gt;) at handleStatusMarkerChange (apiscript.js:12253:38) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) I also see in the API console: "ERROR: You must include the query string in your URL. For example, use ' <a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678</a> ', not ' <a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png</a> '" Any idea what could be going on? Thanks! Waiting on the bugs to be shaked out b4 install.&nbsp; Will stay at 2.32 for right now. Make sure you've checked against API conflicts by cycling through, disabling one at a time. I recently had an old API (Door Knocker) that needed to be updated (Manually) ...it was murdering my game any time I moved a token.&nbsp; I thought it was another one I like to use, because I found it when I moved the AoETemplate tokens, and secured Bast's help - he's a great help btw - and found out it was Steven's Door Knocker that was way out of date through that simple process. Sometimes you need to go through your github-drawn APIs and update manually - I'd suggest making the name you use for the New Script include the name and install date - and check it at least every 2 months for any updates, updating to the new date if there was one done.
1601384005
Victor B.
Pro
Sheet Author
API Scripter
I may remove custom token markers.&nbsp; It seems to be a challenge to get the URL correct.&nbsp; I'll take a lot at that functionality, finally, and see if I can put something more foolproof in or otherwise I'm going to have to remove custom token marker functionality.&nbsp;&nbsp; The work around is to use the default.&nbsp;&nbsp;
Actually I am using default token markers. Also to make sure it wasn't some weird interaction, I disabled every API script except CombatMaster and still hit the error. Turning everything else off did seem to remove the URL-related error that showed up in the console (so maybe that bit was coming from another API script?), but the error that is killing the sandbox still remains.
Ezra said: Actually I am using default token markers. Also to make sure it wasn't some weird interaction, I disabled every API script except CombatMaster and still hit the error. Turning everything else off did seem to remove the URL-related error that showed up in the console (so maybe that bit was coming from another API script?), but the error that is killing the sandbox still remains. Question: do you have the player ribbon on the page you're getting this behavior on? It's known to cause issues if you don't.
1601400321
Victor B.
Pro
Sheet Author
API Scripter
Not being on the player ribbon page prevents the token marker from working.&nbsp; It doesn't generated a failure
Just tried again, making sure to have the ribbon on the same page, same error unfortunately.
1601436667

Edited 1601436827
Hey @Victor, I'm getting this error if I use the Conditions Announce command on a token with an ad-hoc that doesn't have the message parameter. Here's the command for a special ad-hoc I was using: !cmaster --add,condition=Life Boost—?{Ally|Name},duration=4,direction=-1 If I use this on a token, then use Condition Announce on that same token, I get the above error, but I have no problems if I change the command to this: !cmaster --add,condition=Life Boost—?{Ally|Name},duration=4,direction=-1,message=- I don't mind making sure the Message parameter is tacked on to all my ad-hoc macros, just thought it'd be worth noting for everyone that it's required for ad-hoc statuses to work properly at the moment.
Hey, I love the API, but every time I create a custom Item and advance the TO the script crashes. Any tips? My only workaround so far is to add the custom item I want as a "condition" but in some cases like "countdown-clocks" for new events during the fights it is just not practical. I also searched the options for a "allow custom items" section because I remember the old combat script I used had this and required to enable it before working properly. Hope some1 can help me with this.
1601478248
Victor B.
Pro
Sheet Author
API Scripter
@persephone, I'll fix that.&nbsp; @cley I'll take a look
1601479011
Victor B.
Pro
Sheet Author
API Scripter
@cley, what version are you running?&nbsp; The most recent is here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> @Persephone, I added a fix for the message issue.&nbsp;&nbsp;
Thanks, Vic!
@Victor B.&nbsp; I am running the "latest" Version via roll20 API Manager. I will although disable it and try out the most recent u linked to see if it works or if I can replicate the error.
@Victor B. I did testing on this with the 2.3.4 Version. It didn't crash this time :) Although I am creating a "Custom Item" with a round divider of -1 I now have the issue that as soon as I click the end turn button under a combatant it just skips the custom item without counting down -1 and afterwards reorganizing it to fit the right "initiative" (although it is a sort of count and not init). Any Ideas on how to solve that?&nbsp; What I did try is to turn off the "sort turnorder" setting. It is working but again the divider is not working for a custom Item. Since I'm not a native speaker Idk if what I describe to you makes perfect sense. I can provide u with further screenshots of what u need to know if u want to tackle this issue.
1601657188
Victor B.
Pro
Sheet Author
API Scripter
I'm looking at the custom token marker code.&nbsp; It's been an issue for a while.&nbsp;&nbsp;
I think cleybaR is talking about a custom item in the turn order
1601684987

Edited 1601685024
Victor B.
Pro
Sheet Author
API Scripter
Oh I may have taken that code completely out because it *was* there but I had no clue what it did.&nbsp; And there seemed to be few people using it.&nbsp;&nbsp;
Victor B. said: Oh I may have taken that code completely out because it *was* there but I had no clue what it did.&nbsp; And there seemed to be few people using it.&nbsp;&nbsp; /* Footnotes are your friend */ &nbsp; ... lol
1601733038
Victor B.
Pro
Sheet Author
API Scripter
Someone want to explain what that does?&nbsp; I can go back to original combat tracker code and put that code back in
It adds custom turn in the tracker. So if lair action goes off on initiative of 30 and 15 you can add in the custom tracker without it being tied to a token.
Yeah, it's not a function of the old CombatTracker, it's in the Turn Order's settings. But CombatMaster seems to affect how those custom items behave, though.
1601767676

Edited 1601820857
Victor B.
Pro
Sheet Author
API Scripter
Yes CM will affect how anything added into the turnorder behaves.&nbsp; I don't think CT ever supported that.&nbsp; &nbsp;I can say re-reading @Clays post that CM already adds a -1 turn divider and the icon is the token marker.&nbsp; So two -1 items will probably create some issues.&nbsp; &nbsp;
1601821083
Victor B.
Pro
Sheet Author
API Scripter
CT had some code to alter the initiative roll based those fields.&nbsp; But that was it.&nbsp;&nbsp;
@Victor B. yeah I was referring to what @Persephone posted. The custom item in the turn tracker option. These Items crash the Script as soon as their initiative number goes down by -1 when I advance combat via CM. I use these custom markers to keep track of lair actions or reinforcement counters. Is there any way to make it work?
1601822585
Victor B.
Pro
Sheet Author
API Scripter
Sure, but I need you to capture the failure and post here so I know where to look
1601822665
Victor B.
Pro
Sheet Author
API Scripter
I also need to see what you are invoking via Add Custom Item.&nbsp; If it's a macro, then I need to see what the macro is doing
1601837877
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Is there a way to set the initiative to where it does not roll a die but still pulls a stat to put characters in turn order based on that stat?
1601839449
Victor B.
Pro
Sheet Author
API Scripter
that sounds like a job for group-init.&nbsp; Check out that API and configure accordingly.&nbsp; Then set CM to use group init for initiative
Here is one script that add to turntracker without token.&nbsp; <a href="https://app.roll20.net/forum/post/7689156/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/7689156/slug%7D</a> &nbsp; You can also do it manually as shown above.
1601904536

Edited 1601904832
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Thanks, I found a workaround. I set the initiative die to .0001, which produced the results I wanted since the tracker only has two decimal places. I can now use this for my GURPS games without modification or another script.
1601969311
Victor B.
Pro
Sheet Author
API Scripter
Ingenious
1601986784

Edited 1601986825
So I was playing around and made an error, now I don't know how to fix it. The error was trying to make a button to appear every time it was someone's turn (from the Turnorder menu, in Macros) It didn't work, so I just hit the up arrow and cleared it by typing "None" where I had programmed a link button.&nbsp; NDB, yeah?&nbsp; The Turnorder settings look exactly like they did when I started fooling around. Well ... you'd think that, but no.&nbsp; Apparently the changes were saved to state, "None" is not the actual state for default, and now keep throwing the following error into the API logs. "Announce Player" "Announce Condition" "Send Main Menu" {"who":"error","type":"error","content":"Unable to find a player or character with name: None"} They don't crash the API, so it's not huge; until maybe one day when it is?&nbsp; The problem lies in that there is no way, without wiping the entire thing clean (and maybe even not then) that once you start fooling around with the hidden statuses it can return them to defaults.&nbsp; You can keep changing them (if your in the same play session and can hit the up arrow to get the command to resend), but you can't restore them as individual lines.&nbsp; Putting a trash icon (resetting the state to default) for each and every command in the API would be an enormously unwelcome experience, I'm sure.&nbsp; But I wish there was a way around the 'all or nothing' method of resetting the API back to factory defaults.&nbsp; Especially since the state could STILL be saved, and you've accomplished little, if anything. I guess this is one of those life lessons of "Backup your game before you go tinkering around ...."
1601995816

Edited 1601995855
Victor B.
Pro
Sheet Author
API Scripter
Devilish did it.&nbsp; Please ping her.&nbsp; She got a button displaying in chat when the player came up
1601995991
Victor B.
Pro
Sheet Author
API Scripter
Ignore the None error.&nbsp; I haven't cleaned that up yet.&nbsp; I get it too
Got some weird error, anyone else?
1602013869

Edited 1602013916
Victor B.
Pro
Sheet Author
API Scripter
They've got CM messed up on Roll20.&nbsp; That's coming out of Roll20 Github.&nbsp; @Ravenknight can you pop that screenshot over to Roll20.&nbsp;&nbsp;
Hi Victor - is it possible you can set a End Turn button on the chat for players or make it macroable like -EoT?
!cmaster --turn,next
ty ty
Hey Victor, how do you feel about exposing more of the CombatMaster API to other scripts? It doesn't seem to be currently possible to add/remove conditions with another script, since I can't set the `msg.selected` prop. I made a very small PR here to expose `addConditionToToken`/`removeConditionFromToken` <a href="https://github.com/vicberg/CombatMaster/pull/5" rel="nofollow">https://github.com/vicberg/CombatMaster/pull/5</a>
Victor B. said: They've got CM messed up on Roll20.&nbsp; That's coming out of Roll20 Github.&nbsp; @Ravenknight can you pop that screenshot over to Roll20.&nbsp;&nbsp; Thanks, will do!
1602097715

Edited 1602097930
Victor B.
Pro
Sheet Author
API Scripter
@Ian, on the Turn or Round (APIs can get invoked for players and/or all tokens in the turnorder at the beginning of each round OR for each active token in the turnorder) then you all you need to do is advance the turnorder manually or via&nbsp; !cmaster --turn,next and the APIs will get invoked.&nbsp; msg.selected isn't used.&nbsp; There's no way around selecting tokens for add/remove condition that I can think of.&nbsp; How would you know what token to put a condition on?&nbsp;&nbsp;
@Victor if you're talking about chat commands, what I do in most of my scripts that target a token is have an optional `--id` arg, which takes precedence over `msg.selected`. This lets users have a little more fine control of how to use the command (you could to `--id=@{selected|token_id}` or `--id=@{target|token_id}`, etc), and also lets other scripts sort of indirectly hook into your script via chat buttons. But I think exposing the functions directly is more useful for other scripts. My specific use case is I am writing a script to track encumbrance according to some special rules. When a character becomes encumbered, I look for the first token representing it on the current page and add a condition to it: `CombatMaster.addConditionToToken(token, 'encumbered', 1, 0)`
Ravenknight said: Got some weird error, anyone else? I have reached to Support and asked them to look into it as I'm getting the same error using both Chrome and Firefox.
1602339113
Victor B.
Pro
Sheet Author
API Scripter
@Ian, I'll add an -id parameter
1602345699
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
iamk2, how did you install the sheet? It should not be looking for a js file. Did you use the One Click install or a manual install? If manual, did you copy the code from the Raw page?
Victor B. said: Devilish did it.&nbsp; Please ping her.&nbsp; She got a button displaying in chat when the player came up **rolls out of dnd hibernation**&nbsp; Who disturbs my slumber? Wha happened?
1602389974
Victor B.
Pro
Sheet Author
API Scripter
Hibernation?&nbsp; You?&nbsp; Seriously?&nbsp; Someone was asking how to get buttons displayed with APIs in chat.&nbsp; That's your forte
I am also getting the error in Sandbox of "No such file or directory" for the .JS file.
1602423799
Andreas J.
Forum Champion
Sheet Author
Translator
Victor B. said: They've got CM messed up on Roll20.&nbsp; That's coming out of Roll20 Github.&nbsp; @Ravenknight can you pop that screenshot over to Roll20.&nbsp;&nbsp; Yeah, seems Combat Tracker 2.0 form the one-click install isn't working, I just installed the latest in two separate games, and it doesn't react in any way to !cmaster or !cmaster --help . Looking at the repo, I'd assume it's because the older API versions doesn't exist (in their separate folders like for other API that have multiple versions), or something to do with other things like the script being maned "v 2.0" or that it's still showing "v.2.14" in the readme section. When I install the v.3.4 from your repo I managed to make the !cmaster --main command to work. The help handout says v2.20, so no idea how accurate it is.