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

[Script] CombatTracker

i am having a minor problem with the combat tracker script if you wouldn't mind helping every time I try to run combat this happens
1562144108
Mik Holmes
Pro
Marketplace Creator
If this is a place for feature requests (or help with workarounds), I'd like a way to have a condition tick down on a different person's turn. I have a lot of characters with effects that last until the caster's next turn, which disappear on the target's next turn. The condition would have a "count from caster" checkbox, which would add a select token query and count down from there; the target would have, say, "Blind (from Kobold)" on its turn message. This feature obviously wouldn't be easy to implement, especially since you have larger issues to deal with, but it seems like there's a lot of effects that could use it. Alternatively, does anyone know a good automatic workaround I can use? (A second, much easier but much less important feature would be multi word conditions, say within quotes, allowing "Arcane Ward" instead of "Arcane-Ward")
Mik Holmes said: If this is a place for feature requests (or help with workarounds), I'd like a way to have a condition tick down on a different person's turn. I have a lot of characters with effects that last until the caster's next turn, which disappear on the target's next turn. The condition would have a "count from caster" checkbox, which would add a select token query and count down from there; the target would have, say, "Blind (from Kobold)" on its turn message. This feature obviously wouldn't be easy to implement, especially since you have larger issues to deal with, but it seems like there's a lot of effects that could use it. Alternatively, does anyone know a good automatic workaround I can use? (A second, much easier but much less important feature would be multi word conditions, say within quotes, allowing "Arcane Ward" instead of "Arcane-Ward") I often add an additional round of duration when dealing with effects that follow another characters timing. It does not work for all events, but the rest i deal with manually. NB: Adding an additional round is also a workaround for conditions running out, without the character having a chance to "delay" their turn (a Pathfinder feature, that might be relevant to other systems).
1562157450

Edited 1562157464
Victor B.
Pro
Sheet Author
API Scripter
@Phillt, make sure your tokens are linked to character sheets.  That's mandatory.  If they are, invite me to game and promote me to GM so I can figure out what's going on.   @Mik Holmes, you'r going to have to find a work around similar to what @Anders suggested.  Combattracker is based on the token, the condition and the length of that condition and a count down or count up.  That's it.  It's not tracking who caused the condition to use as the basis count down (or count up) or where the "who" token sits in the turnorder.  In order to make something like that work, the entire concept of Combattracker would have to be reworked, tracking who caused the condition, when the "who" comes up in the turnorder, all the tokens the "who" affected and counting those down.  Then if would have to differentiate conditions caused by the "who" vs conditions that have nothing to do with the "who", such as ablaze (on fire) or stunned (once stunned, nothing to do with the "who" token), etc.  
1562182075
Victor B.
Pro
Sheet Author
API Scripter
Alright, here's were I'm going with this.  
See you added access to setup menu anyways, and is going with a favorite solution. That is super nice. All in all I think the presentation is simple and clear and the small buttons convey their function via their icon. Great job!
1562184542
Victor B.
Pro
Sheet Author
API Scripter
And how condition setup menu comes into play.  When assigning a condition to a token, you can specify defaults for the condition.  These defaults will display when adding that condition.  If the defaults will never changes, then set override to false and when you add the condition, no additional questions are asked...a one click add
1562193461
Victor B.
Pro
Sheet Author
API Scripter
And the announce turn.  Checkbox is done.  Down arrow is delay.  Now the hard part.  Manipulating the turnorder object. 
1562193601

Edited 1562193685
Victor B.
Pro
Sheet Author
API Scripter
I'm smelling blood now.  Finally have my arms around what Robin is doing.  Still a lot of code to go through and issues with next image marker that needs some love.  I'm reaching out to Robin and Ammo (who seems to help manage Robin's stuff).  I'm not going to post this to roll20 github or update wiki with changes until I have the ok.  Until then and when I have this beta test ready, I'll post to my site and you'll need to download from there.  
1562201632
Victor B.
Pro
Sheet Author
API Scripter
Who here is running concentration script with status info?  If anyone responds, I'll put support in for concentration
I do, along with deathtracker another of Robins Scripts.
1562208134
Victor B.
Pro
Sheet Author
API Scripter
Ok, I'll put support in for them.  OMG if you don't set your initiative attribute correctly the entire script dies on everything.  Talk about brittle.  Putting in edits for that.  
1562208201
Victor B.
Pro
Sheet Author
API Scripter
@kilter, what other scripts.  We've got a spiderweb of brittle scripts working barely together.  What scripts exactly are you using and I'll make sure they hold up.  
1562208365
Victor B.
Pro
Sheet Author
API Scripter
And please don't get me wrong, he's brilliant from what I've seen in his code.  He never bothered to throw in edits to verify that you've the data correct.  A bit frustrating; 
From robins scripts it is just CT, DeathTrack, Status info, & concentration. If playing with xp I might add in lazy experience.
1562208744
Victor B.
Pro
Sheet Author
API Scripter
lazy xp should have no impact (i think).  You'll be my test bunny for that piece.  The rest I'll make sure work.  
Will we be able to import custom conditions we have for Status Info to your script, or will they need to be added manually?
1562209697

Edited 1562209721
Victor B.
Pro
Sheet Author
API Scripter
Yes, import functionality will continue
1562213065

Edited 1562213108
Ravenknight
KS Backer
+1 for both Concentration and Import. 
Regarding the "announce turn" box and delay - I am guessing that the conditions "tick" when it is shown, the same as the current implementation. Does delay then reverse those ticks, and re-add conditions that ran out? Or is the check mark to confirm turn start before ticking?
1562243246
Victor B.
Pro
Sheet Author
API Scripter
I'm going to adjust the countdown so it happens at the end of the round.  That's the way it should happen anyway if it already isn't.  I'm stunned for one round.  When my turn comes up, I should be stunned until the end of my turn.  So delay won't affect countdown.  It will adjust the turnorder so the person delaying comes after the next person in line.  
1562247869
GiGs
Pro
Sheet Author
API Scripter
Victor B. said: I'm going to adjust the countdown so it happens at the end of the round.  That's the way it should happen anyway if it already isn't.  I'm stunned for one round.  When my turn comes up, I should be stunned until the end of my turn.  So delay won't affect countdown.  It will adjust the turnorder so the person delaying comes after the next person in line.   This varies on the system. There are plenty of systems where you are stunned until your next turn, and recover at your place in the initiative sequence, for example.
1562250002

Edited 1562250041
Victor B.
Pro
Sheet Author
API Scripter
True.  I'll have to work that out.  If I keep it as is, which countdown occurs at start of your turn, then I'll have to adjust that back up if you delay.  Not a big deal.   After looking at @Phill T.'s game, he was running a very old version of CT and I upgraded but for reasons why I haven't figure out yet, it was completely failing on everything.  Start, stop, graphic movement, you name it, until I fixed his initiative attribute, then it worked.  I'm going to put a verifySetup at the start of combat.  It's going to check that 1) token is assigned to character sheet, 2) initiative attribute is correct and exists on character sheet, 3) anything else I find that needs verifying (TBD).  So the question to those following this thread are: I have to stop on an invalid initiative attribute, that's clear.  But do you want me to 1) stop on tokens not assigned to character sheet, 2) include them anyway in turn order (what it is currently doing) or 3) simply ignore them?  In any event, I'm going to kick a message to chat to notify you that tokens were found without character sheets.   
I could see a few instances where a token would not be linked to a sheet. Such as an evil alter dealing damage once per turn, or a row of torches going out one by one. So i'll recommend option two.
I've been messing around with Combat Tracker and in my 5e game I have a character who gets +5 initiative from a feat. The script is rolling impossible initiative results for him (like a 2). It looks like the initiative is coming  from the right spot on the sheet but I can't see the rolls at all to figure out what is going on.
1562504893
Victor B.
Pro
Sheet Author
API Scripter
Click show initiative to on.  That will show the rolls and possibly help you figure out what's going on. 
1562506669

Edited 1562506705
Victor B.
Pro
Sheet Author
API Scripter
Folks, I have a beta version ready for use.&nbsp; I use the word "ready" loosely.&nbsp; &nbsp;I haven't fully battle tested it yet but I'm going to make it available so I can start getting feedback.&nbsp; I would NOT use this in your real campaigns yet.&nbsp; I have the older versions under 0.3.0 directory.&nbsp;&nbsp; BTW, I checked deathtracker, inspirationtracker, concentration and none of them use statusinfo.&nbsp; They are all doing their own token setting etc..&nbsp; I don't run 5e, so see how they work together.&nbsp; &nbsp;&nbsp; <a href="https://github.com/vicberg/Combattracker" rel="nofollow">https://github.com/vicberg/Combattracker</a>
Victor B. said: Folks, I have a beta version ready for use.&nbsp; I use the word "ready" loosely.&nbsp; &nbsp;I haven't fully battle tested it yet but I'm going to make it available so I can start getting feedback.&nbsp; I would NOT use this in your real campaigns yet.&nbsp; I have the older versions under 0.3.0 directory.&nbsp;&nbsp; BTW, I checked deathtracker, inspirationtracker, concentration and none of them use statusinfo.&nbsp; They are all doing their own token setting etc..&nbsp; I don't run 5e, so see how they work together.&nbsp; &nbsp;&nbsp; <a href="https://github.com/vicberg/Combattracker" rel="nofollow">https://github.com/vicberg/Combattracker</a> Taking a look at it this evening. Nice, fast work. Looking forward to playing around with it. I am going to disable the old tracker and info, without deleting them from my test campaign, and just give this one another name like "tracker2".&nbsp; Please respond if there is any problem with this approach.
1562515149
Victor B.
Pro
Sheet Author
API Scripter
No, it *should* be backward compatible.&nbsp; Robin checks for existence of each field individually in session state and then sets a default if one doesn't exist.&nbsp; So you shouldn't have to reset your combattracker.&nbsp; What you're doing should work
First test with two tokens, one linked to character sheet and one linked to npc sheet (pathfinder). I'll just give a short rundown of unexpected behavior i experienced. Please let me know if I need to elaborate, or the behavior is correct (and I need to adjust). Sorry for spelling, but I am in a hurry and english is not my main language. All conditions have their options all set to "undefined". This is a one-time correction, when setting up the conditions. They DO have their desription. Clicking "overwrite" on condition setup, does not change it away from false once it is set to false. It does change it awau from undefined and true. Looking at the macro in chat, it does seem that the macro is wrong. It is possible to edit teh macro in chat, to set "overwrite" to true. The token with highest initiative is "activated" twice when its turn comes up (in rapid succession), resulting in its conditions ticking twice. The condition icon does not show when remaining duration is 10+. If this is because the number tag by the icon only goes to 9, I would prefere to have the icon always show, so players and I can easely see who is affeced by what, without having to check manually. TrackerJacker was able to add the number tag to the icon once duration was 9-, while the icon showed at any duration. Using the delay function does not change initiative. At least for pathfinder is should, as you now act later in the following turns, and if you spend your turn increasing your initiative (by 20), it should be from your new, lower initiative. Also, I would like to keep the option of sorting each turn on, but it does only work for pathfinder if delay reduces initiative. I suggest that initiative is set at 0.1 lower than the next token. The interface works great, and all buttons make sense (and even have mouseover hints). I love that I only need the !ct command to access it all. Great work. Only thing that I personally would like added, is a command/button to access the selected/target tokens conditions, for easy reference to description and deletion of condtions. A button on the turn anouncement panel for the active token to access this menu (even if the active token is not selected), would also be nice. Is there a way that I am missing to access the information of conditions on a specific token?
1562519081
Victor B.
Pro
Sheet Author
API Scripter
@anders do you mind inviting me to game (and promote me to GM) so I can see what's going on?&nbsp;&nbsp;
Victor B. said: @anders do you mind inviting me to game (and promote me to GM) so I can see what's going on?&nbsp;&nbsp; Link send to PM
1562542524

Edited 1562543626
Victor B.
Pro
Sheet Author
API Scripter
Alright, so we are at 1.0.3 Beta now 1) The true/false setting issue on Condition Menu has been fixed 2) The token display when having a duration &gt; 9 (double digit) has been fixed 3) Delay was incorrectly modifying the duration.&nbsp; That's fixed also Being worked 1) There's cases where the change event is triggering a turnorder change is being invoked twice.&nbsp; Though the icons only move once onto the next the in line, the durations are getting double modified.&nbsp;&nbsp;
1562548569

Edited 1562558768
The new script worked great for me and calculated the initiative bonuses correctly. The only thing that was odd was that the first token to act has their "Done" button appear before the combat tracker menu in the chat. The others appear below the menu.
1562549969

Edited 1562550220
Testing it out right now, love the interface. Some of the issues I've noticed so far: I did get this message on start up, not sure if this is intended The descriptions for the default conditions have a small text issue Import doesn't seem to be working, either. I tried importing the conditions from my main game, but no changes were made When I try starting combat with any number of tokens selected, the API gives me this error message
I still run in to some problems (running 1.0.3). In the campaign that you have access to, duration does not tick down on a tokens turn, and the token at the top of the turn-order is activated twice (getting two announcement boxes in chat). I started a new, clean campaign with only this mod, but the API fails with the following messages:
1562587480

Edited 1562587748
Victor B.
Pro
Sheet Author
API Scripter
Thank you all.&nbsp; I'd suggest staying away from it for a bit.&nbsp; I was probably a bit pre-mature putting it out there.&nbsp; There's definitely some glitches in processing.&nbsp; 1) I've seen the lack of countdown on the numbers displayed.&nbsp; Intermittent.&nbsp; Sometimes works, sometimes doesn't.&nbsp;&nbsp; 2) Sometimes it holds on a token and does the turn twice for that token 3) I haven't removed that "Install Status Info" message because it tells me when the script has saved.&nbsp; It will be removed 4) Import/Export I haven't tested yet.&nbsp; I'll look at it.&nbsp;&nbsp; 5) I selected a bunchs of token and one of them was a "text" and not "graphic".&nbsp; No clue what I picked up, but I have to put in edits for that.&nbsp; Seph, you may have encountered the same issue.&nbsp; The script will crash on "text" tokens. No clue how you'd even have a "text" token but possible that it's simply a text box and that's how Roll20 manages text entries on the browser.&nbsp; I'll post new updates when I have these items fixed.&nbsp;&nbsp; 6) Seph, I may asked to join a copy of your game and you promote me to GM so I can see what's causing that text display issue.&nbsp; I'm not getting that.&nbsp;&nbsp;
Thank you for the update. I'll be looking forward to the next update, either on the script or just a progress report. Unless you ask me not to, I will remove you from my campaign in a few days. I like to keep a clean ship, but feel free to request access any time.
I've been playing with 1.0.3 on a new 5e campaign I'm prepping and it looks great. I couldn't get it to work at all until I disabled auto-initiative though (ReferenceError: initiativeAdv2 is not defined). This campaign doesn't start for a couple of weeks, so I'm happy to test it out as I prep.
1562784680
Victor B.
Pro
Sheet Author
API Scripter
Version 1.0.8 Beta is available at&nbsp; <a href="https://github.com/vicberg/Combattracker" rel="nofollow">https://github.com/vicberg/Combattracker</a> Import/export still not functional&nbsp; Much more stable than initial release I'm still expecting issues/problems, so let me know.&nbsp;&nbsp;
This new version errors out as soon as I try to load it @Victor B. TypeError: Cannot read property 'config' of undefined TypeError: Cannot read property 'config' of undefined at setDefaults (apiscript.js:4861:31) at Object.checkInstall [as CheckInstall] (apiscript.js:4322:9) at apiscript.js:4909:19 at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:70:8) at checkForReady (/home/node/d20-api-server/api.js:1438:12) at /home/node/d20-api-server/api.js:1518:9 at c (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:14:64) at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
1562798114

Edited 1562798315
Thank you again for all this work. I got this error after changing some settings and again after reloading the script with default settings. &nbsp; ReferenceError: initiativeAdv2 is not defined ReferenceError: initiativeAdv2 is not defined at selectedTokens.forEach.token (apiscript.js:626:40) at Array.forEach (native) at rollInitiative (apiscript.js:604:24) at startCombat (apiscript.js:453:13) at handleInput (apiscript.js:164:6) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1634:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147)
1562799819
Victor B.
Pro
Sheet Author
API Scripter
Dunphen, try again.&nbsp; Professor Badger, I had a typo in variable declaration.&nbsp; Fixed.&nbsp; New release 1.0.9 -&nbsp; <a href="https://github.com/vicberg/Combattracker" rel="nofollow">https://github.com/vicberg/Combattracker</a>
1562810509

Edited 1562810847
Appreciate all your effort in this, Victor. I'm still getting the error I was getting before. I select tokens, bring up the !ct menu, and click start. Here's the error and the API output log: EDIT: I have no other scripts enabled, these are the current settings: After resetting to default, the script works fine. I'm not sure what in the settings caused the error.
1562810813
Victor B.
Pro
Sheet Author
API Scripter
Seph please invite me to you game and then promote me to GM.&nbsp; I need to see what's getting selected
Victor B. said: Seph please invite me to you game and then promote me to GM.&nbsp; I need to see what's getting selected Sent :)
1562813243

Edited 1562815832
The error seems to happen when I try to start combat with Show Initiative set to True. I also noticed that the menu for editing a condition is not whispered, and the following buttons are both labeled Pause Timer:
After some quick testing of 1.0.9, it seems to be a lot more stable, and behaving as expected. A few points: Delay double-ticks duration. A token have all its conditions "tick" when activated, decreasing duration of your typical condition. If the token then delay its turn, its conditions will "tick" again on the same turn. Currently, the workaround I see is to&nbsp; reapply it with the correct duration. However, this seems a bit to much considering how often (my players at least) players will delay. I suggest, if possible, that delaying will reverse "tick" all conditions once. This still leaves the cases where a condition reach a duration of zero, and as such is removed from the token. As this is much rare, having to add it again is a fair workaround, but of-course even better would be that conditions at duration zero, is only removed when the token passes its turn. Please consider adding this as an option. When delaying, the initiative is not adjusted. Earlier, I suggested this be done automatically, but I have now come to the conclusion that manually editing initiative in the Turn Order window works fine. However, if you would add a dialog box when pressing delay, asking for the tokens new initiative, it would be nice... but not required. In the older version of CombatTracker (0.2.7) and StatusInfo (0.3.11), there was a command called !ct show, that would give information on the selected token like this: Pressing the "Eye" would show the description of the condition, while the "Bin" would remove it. This was a great way of checking what an Icon on the token meant, if a player (or GM) was in doubt. I very much hope that you plan to re-implement this feature. An improvement to this, would be the ability to change the remaining duration of the condition on that token, and to edit the description for that token only. Having individual descriptions for each token, would allow us to indicate just how much bleed damage a character suffers each turn, or something similar. Please keep up the good work, and thank you so much for improving upon this script. PS: I have tested this in both a fresh campaign, as well as the one you (still) have access to. And it works fine in both.
Tried it again, I got this error when I tried to start combat: RangeError: Maximum call stack size exceeded RangeError: Maximum call stack size exceeded at RegExp.exec (&lt;anonymous&gt;) at RegExp.test (native) at ac (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:71) at $b (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:36:239) at mc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:40:370) at $a.t.remove (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:26:44) at $a.t.remove (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:26:133) at $a.t.remove (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:26:133) at $a.t.remove (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:26:133) at $a.t.remove (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:26:133) I deleted the script and tried fresh just in case and this time it generated this error when I attempted to start combat: &nbsp; TypeError: state[combatState].conditions.forEach is not a function TypeError: state[combatState].conditions.forEach is not a function at getAnnounceConditions (apiscript.js:880:39) at announcePlayer (apiscript.js:855:23) at doTurnorderChange (apiscript.js:748:17) at startCombat (apiscript.js:446:9) at handleInput (apiscript.js:153:6) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:151:1), &lt;anonymous&gt;:70:8) at /home/node/d20-api-server/api.js:1634:12 at /home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:93:560 at hc (/home/node/d20-api-server/node_modules/firebase/lib/firebase-node.js:39:147 Of course it had to be two different errors instead of being something simple.
1562885200
Victor B.
Pro
Sheet Author
API Scripter
Professor, I'm going to have to get into your game (or copy of) and promoted to gm to take a look.&nbsp; Seph, trying to get into your game, but Roll20 is acting strange right now around PMs