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.

Cannot reference Initiative Attribute via sheets or macro & Unable to add tokens to turn tracker?

October 02 (6 years ago)

Hi everybody,


I was hoping for a bit of help on a bug that appears to have manifested itself recently with my campaign. I've had a poke about and figured out what I think might be wrong, but am struggling to find a way to resolve it at present.


Recently, myself and my players have become unable to roll initiative for our characters whilst tokens are selected, and thus been unable to add them to the turn tracker. This has certainly made running combat a little more difficult than before!


The error began whilst playing yesterday, and was not something we'd had any issues with before. To begin with, we were unable to roll initiative from our character sheets whatsoever (using the D&D 5e by Roll20 sheet). I had initially had "ADD DEX TIEBREAKER TO INITIATIVE" enabled in the game settings, but then prior to the session had decided to disable it as I did not like the clutter of the tiebreakers in the turn tracker. Before this, I had no issues with initiative and had been able to access it via character sheets, referenced in a macro, and also through API using CombatTracker.


Since playing without this in the sessions, I have found that no existing or new character sheets were able to roll initiative with or without tokens selected. Re-enabling the "ADD DEX TIEBREAKER TO INITIATIVE" in the game settings has meant that you can now roll initiative with a character sheet, but not with a token selected.This again applies to new or existing characters/tokens.

I thought to start with that CombatTracker may be the issue, as it was throwing up an error when I attempted to use it. However, even with this script disabled the issue still persists. Re-enabling it and looking at the error leads to me believe that perhaps, Roll20 is having difficulty finding the initiative stat of the character sheet associated with a token. To test this, I tried linking and unlinking tokens to character sheets, and creating new unrelated tokens- in every instance, whilst I had a token selected, I was unable to roll initiative whatsoever.

For ref, here is the API error when attempting to roll initiative through CombatTracker:

TypeError: Cannot read property 'id' of null
TypeError: Cannot read property 'id' of null
    at turnorder.forEach.turn (apiscript.js:12057:20)
    at Array.forEach (native)
    at checkMarkerturn (apiscript.js:12056:19)
    at getOrCreateMarker (apiscript.js:12026:9)
    at resetMarker (apiscript.js:11773:22)
    at startCombat (apiscript.js:11723:9)
    at handleInput (apiscript.js:11406:17)
    at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:65:16)
    at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:151:1), <anonymous>:70:8)
    at /home/node/d20-api-server/api.js:1634:12


When selecting a token in game and using the following: @{selected|initiative}to roll a tokens initiative, the following error is thrown up:

No attribute was found for @{selected|initiative} 

As well as this, I also had an error along the lines of "C is undefined" whilst attempting this.


I'm currently using Firefox 62.0.2 (64 bit), on Windows 10 (64-bit), with Javascript enabled, Avira Antivirus and the browser addons: Avira Browser Safety, Honey & Reddit Enchancement Suite. (I have also tried disabling all of these addons, clearing my browser cache and the problem still persisted).


If anybody could shed any light on the issue I'm experiencing, and guide me towards a possible solution, that would be massively appreciated. If there is any further information needed to look into this, I'd be happy to share that also.

Thanks guys!

October 02 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I'm looking into the rest of your issue, but the thing that sprung out at me is that your initiative macro should be:

%{selected|initiative} 

Since it is an ability, not an attribute.

October 03 (6 years ago)

Thanks for spotting that, and my apology that was an error on my part whilst typing up the post- my macro does indeed use the correct format you describe above to reference it, but still does not function when a token is selected.


Is there any further information I could provide that might be of use to identify this issue?

October 03 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I have pinged a dev to see if we can find an underlying issue. In the meantime, could you please carefully finish working through these steps of our guide to Solving Technical Issues? It might give the devs more insight as to what is going on.


If none of the above succeeds, please thoroughly work through Step 4. (Don't forget the complete Console Log!)

Thank you!
October 03 (6 years ago)

In doing some further testing this afternoon, it looks like the issue might in fact be associated with the adding of the tokens to the tracker, as opposed to initiative rolling itself.


With the 'code' taken directly from clicking on Initiative inside of the character sheet, I've fiddled with it in a separate ability and narrowed it down to "&{tracker}" which when present, stops this from functioning or outputting in any way. However- it does go through to roll20 in some way, as I was able to get the 'code' for the Initiative roll by pressing the up arrow in chat after I had clicked the button- so it is being sent, it just seems that for whatever reason the &{tracker} component is preventing it from working.

...And halfway through writing this post, with a bit of added fiddling, I have uncovered the issue here.

It appears that for whatever reason, the turn tracker thought it had 'entries' for lack of a better word in it, but was showing totally blank. I think it got confused in some manner as to what was in it, and what it was doing- perhaps as a result of me leaving tokens in it in an 'unusual way' as a result of playing around with CombatTracker. Once I noticed that the turn order window was blank, but wasn't showing the usual text saying there were no tokens present- I simply cleared the Turn Order using "Remove All tokens (Clear List)" which seems to have reset it. Upon rolling for initiative again as usual via the Character sheets, my macro, using %{selected|init} and CombatTracker- they all functioned exactly as normal.

Thought I'd post my solution here in case anyone else runs into a similar issue, with a bit of the info surrounding it.


This can be closed as it's now resolved. I appreciate your help Keith.




October 03 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

As soon as I started reading your latest post, I kicked myself, because that's happened to me, too. Glad you resolved it. I'll add that to my arsenal of "things to suggest first."

Closing and resolving.