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

February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

The alpha version of combat master can be found here.  https://github.com/vicberg/CombatMaster/tree/master

This thread now supersedes Combat Tracker.  At this point, my Combat Tracker versions will not be supported. 

Combat Master manages a combat by rolling initiative (optional), stepping through the turn order, assigning conditions that have a set amount of rounds they last for, removing those conditions when that amount of rounds have passed.  It provides a configurable timer.  It allows for API and Macro calls at various timing points (beginning of each round, beginning of each turn, when a condition is assigned, when a condition is removed).  It's menu driven, so conditions may be assigned/removed via a click.  You can configure conditions so that if they have a variable length, you set that length when you assign the condition.  If the condition length is fixed, then you can configure the condition so that with a simple one click, the condition is assigned.  The Player Turn can be announced in chat along with options for the player to delay his turn or end it.  

Help file will be created in game.  Put them into a folder.  I can't create folders in Roll20.  The help files will need work. 

EXPECT BUGS.  I haven't tested all functionality yet.  I'm putting this up now due to a request for alpha testing.  

Have fun with this.  

Getting a 404 error when clicking the link

February 13 (4 years ago)

Problem fixing and re-uploading as this was the error i got on install.


Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info...

For reference, the error message generated was: SyntaxError: Unexpected token }

February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Hold a sec, I've taken it down for a bit.  I've got a few more bugs to work through.  

February 13 (4 years ago)

Edited February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I had some java syntax errors.  I just have been tired when I logged off.  Those have been fixed.  I added an ascending sort of the conditions and I fixed the favorite/all button.  

New version, alpha 1.2 is available here.  It's now public again.  https://github.com/vicberg/CombatMaster

!cm --tracker isn't doing anything for me. Is that the right macro?

February 13 (4 years ago)

!cm --show,setup
Worked for me.

February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

!cm -main

February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

I'm going to have to review the help pages.  

February 13 (4 years ago)

Edited February 13 (4 years ago)

Conditions don't seem to be adding when using main menu to apply conditions.

Getting this error:

Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info...

For reference, the error message generated was: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at doAddConditionCalls (apiscript.js:24348:51) at selectedTokens.forEach.token (apiscript.js:23116:12) at Array.forEach (native) at addCondition (apiscript.js:23113:25) at commandHandler (apiscript.js:22499:17) at _.each (apiscript.js:22355:21) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at inputHandler (apiscript.js:22350:19) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8)

February 13 (4 years ago)

Edited February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Check the condition that your trying to use.  Edit that condition and verify that all the API/Macro stuff is set to None.  That's a problem with the new API logic.   If it's set to something else, please let me know.  That means my session state upgrade logic has a bug.  


Victor B. said:

Check the condition that your trying to use.  Edit that condition and verify that all the API/Macro stuff is set to None.  That's a problem with the new API logic.   If it's set to something else, please let me know.  That means my session state upgrade logic has a bug.  


I was trying it with all of the default conditions, and got the same error.

February 13 (4 years ago)

Edited February 13 (4 years ago)
Mik Holmes
Pro
Marketplace Creator

Can confirm that the default add/rem options are all set to None, and getting the "get undefined" error.

Also: This is so exciting! I'm so happy that this is out!! 

I also noticed that reroll initiative on each round is not working

February 13 (4 years ago)

I am having the same issues mentioned above. When trying to apply the condition it crashes the API. 

<3 im so stoked about this.

February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter
I'm able to recreate.  I'll get this fixed soon
February 13 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Bug fixed.  New version here https://github.com/vicberg/CombatMaster


February 13 (4 years ago)

Trying to start or advance to the next token I am getting this error.

API Output Console

Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info...

For reference, the error message generated was: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at doRoundCalls (apiscript.js:25726:51) at doTurnorderChange (apiscript.js:25122:13) at nextTurn (apiscript.js:25240:9) at commandHandler (apiscript.js:23859:17) at _.each (apiscript.js:23783:21) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at inputHandler (apiscript.js:23778:19) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1638:12


Kilter said:

Trying to start or advance to the next token I am getting this error.

API Output Console

Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info...

For reference, the error message generated was: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at doRoundCalls (apiscript.js:25726:51) at doTurnorderChange (apiscript.js:25122:13) at nextTurn (apiscript.js:25240:9) at commandHandler (apiscript.js:23859:17) at _.each (apiscript.js:23783:21) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at inputHandler (apiscript.js:23778:19) at eval (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:65:16) at Object.publish (eval at <anonymous> (/home/node/d20-api-server/api.js:154:1), <anonymous>:70:8) at /home/node/d20-api-server/api.js:1638:12


Can confirm I am getting the same error when moving turns.

February 13 (4 years ago)

Edited February 13 (4 years ago)

I am also having a weird issue where applying multiple statuses, deletes the previous status.

Edit: The description shows up but the Icon does not appear on the token.

February 14 (4 years ago)

I believe I have just hit the same wall as Anthony. I have the condition setup and it is recognizing the correct custom marker but when the condition is applied the marker does not show up. However, the description, with the correct marker image, pops up in chat. 

February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Alright, I haven't fully run through the new API logic (obviously).  Let me do that and I'll get it fixed and post a new version.  

Super excited! I love the UI. Haven't had any crashes yet, but I'm unable to set any custom markers to any conditions. I changed 'Icon Type' to Token Marker

But when changing the icon, it still only shows the default marker names in the drop-down query. Manually replacing the drop-down query with the name of one of my custom markers only gets rid of the condition's icon altogether.

Is there more setup required that I overlooked?

February 14 (4 years ago)


Persephone said:

Super excited! I love the UI. Haven't had any crashes yet, but I'm unable to set any custom markers to any conditions. I changed 'Icon Type' to Token Marker

But when changing the icon, it still only shows the default marker names in the drop-down query. Manually replacing the drop-down query with the name of one of my custom markers only gets rid of the condition's icon altogether.

Is there more setup required that I overlooked?


Be sure you have libTokenMarkers installed as well. I hit the same wall.

Oh yeah, should've mentioned I already have libTokenMarkers as well.

Are there any other script that need to be installed? I am having trouble getting any conditions to add to tokens.

February 14 (4 years ago)


Anthony V. said:

Are there any other script that need to be installed? I am having trouble getting any conditions to add to tokens.

I am also at the point where the marker will not apply to any tokens, but if i !cm --show,assigned it lists the correct conditions for the character. 

February 14 (4 years ago)

Edited February 14 (4 years ago)

Also getting this error when starting combat using CombatMaster

And this error when going to the next turn using the default roll20 tracker

February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

All of this related to the API logic.  


February 14 (4 years ago)

Super excited....will do some testing soon.

February 14 (4 years ago)

same error generated here...

February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter
Fixed.  It's stepping through turnorder without an error.  New version here: https://github.com/vicberg/CombatMaster
February 14 (4 years ago)

Edited February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

And apologies for rushing this out.  I added the API logic but didn't go through my usual battery of tests.  This API has become HUGE. 3300 lines, though I'm sure The Aaron could reduce that code down to maybe 10 lines :)

February 14 (4 years ago)
Ravenknight
KS Backer

It's a daunting task building such a large API so no sweat. Haven't had time to delve into testing myself yet, but I will give it a go this evening.

February 14 (4 years ago)

Edited February 14 (4 years ago)
Kraynic
Pro
Sheet Author

I just tried running this script and can't seem to get the configuration to come up.  I tried a double and single hyphen in front of "tracker" as well as copy/pasting out of the handout (which seems to give a slightly different length character).  I tried it with and without a token selected.  API console output:

Spinning up new sandbox...
"Starting webworker script..."
"Loading 683 translation strings to worker..."
"Starting webworker script..."
"-=> Universal Chat Menu v0.2.4 <=-   [Sun May 26 2019 06:25:12 GMT+0000 (UTC)]"
"-=> TokenNameNumber v0.5.12 <=-  [Tue Jul 25 2017 15:01:48 GMT+0000 (UTC)]"
"-=> TokenMod v0.8.48 <=-  [Mon Dec 16 2019 05:20:41 GMT+0000 (UTC)]"
"������������ Initialized Welcome Package ������������"
"-=> Ammo v0.3.8 <=-  [Tue Jul 31 2018 12:42:46 GMT+0000 (UTC)]"
"-=> DoorKnocker v1.14 <=-  [Fri Jan 24 2020 21:02:43 GMT+0000 (UTC)]"
"Set Defaults"
"Combat Master Handout Found"
"Combat Master Setup Handout Found"
"Combat Master Initiative Handout Found"
"Combat Master Turnorder Handout Found"
"Combat Master Timer Handout Found"
"Combat Master Announce Handout Found"
"Combat Master Status Handout Found"
"Combat Master Conditions Handout Found"
"Combat Master Condition Handout Found"
"CombatMaster Ready! Command: !cm"
"-=> ChatSetAttr v1.9 <=-"
{"content":"!cm --tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","type":"api","who":"Kraynic (GM)"}
{"details":{"tracker":"tracker"},"action":null}
"Command Handler"
{"content":"!cm –tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","type":"api","who":"Kraynic (GM)"}
{"content":"!cm -tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","type":"api","who":"Kraynic (GM)"}
{"content":"!cm --tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","selected":[{"_id":"-M-u89vi8ur6kM187zpn","_type":"graphic"}],"type":"api","who":"Kraynic (GM)"}
{"details":{"tracker":"tracker"},"action":null}
"Command Handler"
{"content":"!cm –tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","selected":[{"_id":"-M-u89vi8ur6kM187zpn","_type":"graphic"}],"type":"api","who":"Kraynic (GM)"}
{"content":"!cm -tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","selected":[{"_id":"-M-u89vi8ur6kM187zpn","_type":"graphic"}],"type":"api","who":"Kraynic (GM)"}

I also created a new game, and put this script in by itself.  Tried a couple commands and the menu still won't pop for me.  Api console from that game:

Spinning up new sandbox...
"Starting webworker script..."
"Loading 683 translation strings to worker..."
"Starting webworker script..."
"Set Defaults"
"Creating Combat Master Handout"
"Creating Combat Master Setup Handout"
"Creating Combat Master Initiative Handout"
"Creating Combat Master Turnorder Handout"
"Creating Combat Master Timer Handout"
"Creating Combat Master Announce Handout"
"Combat Master Announce Handout Found"
"Creating Combat Master Status Handout"
"Creating Combat Master Conditions Handout"
"Creating Combat Master Condition Handout"
"CombatMaster Ready! Command: !cm"
{"content":"!cm","playerid":"-LoSPavXQIPEp8gLfJ9n","type":"api","who":"Kraynic (GM)"}
{"content":"!cm –tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","type":"api","who":"Kraynic (GM)"}
"Handle Graphic Movement"
"Handle Graphic Movement"
{"content":"!cm","playerid":"-LoSPavXQIPEp8gLfJ9n","selected":[{"_id":"-M03YhMObq0YVozmSmut","_type":"graphic"}],"type":"api","who":"Kraynic (GM)"}
{"content":"!cm –tracker","playerid":"-LoSPavXQIPEp8gLfJ9n","selected":[{"_id":"-M03YhMObq0YVozmSmut","_type":"graphic"}],"type":"api","who":"Kraynic (GM)"}

Not sure if all that is informative or not.  Let me know if I need to try something else in either game.

Edit: To be clear, nothing happens in chat when I try these commands.

February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

!cm - main (for main menu)


February 14 (4 years ago)
Kraynic
Pro
Sheet Author

Ok, might want to change the wording on the "Combat Master" handout then.

To start configuring Combat Master, type !cm –tracker in chat and click the cog icon at the top.

I was only trying to follow the instructions!  :p  
Yes, main works much better.

February 14 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter


Victor B. said:

!cm - main (for main menu)


I need to look closer. I was trying !cm -main (no space), and !cm --main (Just in case of a typo).


February 14 (4 years ago)

It has to be !cm --main with two dashes. Based on my testing.

February 14 (4 years ago)

Not bad been testing in a new game bare bones. No other scripts. Couple of things I noticed. For custom sheets or no character sheets if the init bonus is not set the script does respond it goes back to the menu !cm --main menu. Some logic might be put in warning users if the init stat is not found.  The next person up in the turn order is a nice touch but I can see where in some games thats going get confusing. It might be nice to have the ability to disable those features. One thing I notice if someone makes a mistake entering a blank url for an image it will cause the api to crash. Might be a good idea to compensate for this kind of misahp. Note this is testing bare bones without group init, tokenmod or any other script.

February 14 (4 years ago)

Edited February 14 (4 years ago)

Wow this is awesome! Working great so far the only thing I have run into is the Initative does not re-roll each round when set to that, and if you set up a macro on applying or removing a condition it seems to crash the system. I am trying to use this on the Blinded condition !token-mod --flip light_hassight

Edit: Also if you set a condition for 10 rounds, as most conditions are a 1min. The condition does not appear till that creatures next turn when it drops to a 9.

Edit Edit: Also the show conditions button at the top does not seem to do anything at the moment.

Sorry for all the things, hope this helps when building :)

February 14 (4 years ago)

Edited February 14 (4 years ago)
Dumbhuman
Pro
Marketplace Creator

I realize you've got other fires to put out right now, but in the other thread you were asking for examples of macros that people would run when a character's turn comes up.  I haven't installed Combat Master yet to see how it functions, but I just wanted to give you a few examples that I currently use with CombatTracker's CT_TURN macro function.  It's primarily used for NPCs to make my life as a DM easier.

Whenever I have an NPC with a recharge power (such as a dragon's breath weapon), I create an ability on their character sheet named CT_TURN and put in something like this (actually I reference this macro on a character sheet dedicated to macros, but it equates to the same thing):

/w gm &{template:simple} {{rname=Ability Recharge}} {{mod=5-6}} {{r1=[[1d6cf<4cs>5]]}} {{normal=1}} 

That way, every time that particular monster's turn comes up, CombatTracker automatically whispers me with a d6 roll and colors the result green if the power has recharged (in the above case on 5 or 6) or red if it hasn't (4 or lower).  It's literally the first thing I should be doing for that monster in combat anyway, so automating it with CombatTracker (or CombatMaster) makes total sense.

Occasionally when I'm playing a complicated monster that I don't have memorized well just yet, I'll set its CT_TURN ability macro to whisper a little Powercard cheat sheet to myself to remind myself of its stats, traits, and available actions:

!power {{
--name|@{selected|character_name}
--titlefontshadow|none
--whisper|GM
--format|badguys
--tokenid|@{selected|token_id}
--npc_attribute_summary|@{selected|character_id}
--Speed:|@{selected|npc_speed}
--npc_qualities_summary|@{selected|character_id}
--npc_skills_summary|@{selected|character_id}
--!Actions|
--npc_action_list|@{selected|character_id}
--!Reactions|
--npc_reaction_list|@{selected|character_id}
--!LA|
--npc_legendaryaction_list|@{selected|character_id}
--!TR|
--npc_trait_list|@{selected|character_id}
--Spell Attack Bonus:|@{selected|spell_attack_bonus}
--Spell Save DC:|@{selected|spell_save_dc}
--spell_slots|@{selected|character_id}
--spell_list|@{selected|character_id}
}}

For things like trolls or vampires that regenerate at the beginning of the turn, I use their ability named CT_TURN to provide a little reminder prompt with an API button called "Regenerate " in the title bar that links to another ability macro on my dedicated macro character sheet to add the hit points via TokenMod.  So my troll NPCs effectively have an ability on their character sheet named CT_TURN which looks like this:

/w gm &{template:default} {{name=[Regenerate](~M|regen10)}} {{Unless fire or acid damage taken last round.}}

If I had some sort of complicated monster with a recharging attack, regeneration, and lots of traits/actions/spells, I might very well make the CT_TURN macro on its specific character sheet include versions of all three of the above.  The basic idea is just getting an automatic action at the beginning of an NPCs turn for those specific things that I'd want to do at the beginning of its turn anyway, but what those specific things are will vary from NPC to NPC and many won't have any CT_TURN ability defined at all.  The only functionality that Combat Master would need to carry over from Combat Tracker in order to achieve this is just the option at the start of each turn to trigger an ability with a specific name (such as "CT_TURN") if such an ability exists on  the character sheet controlled by the token whose turn has just begun.  What's contained within that ability shouldn't matter to Combat Master at all, because many characters won't even have the ability and those that do will have it tailored to their particular needs, whether it's recharging a breath weapon, regenerating, changing the token to a random color, pulling a random battle cry from a rollable table, or whatever else the CT_TURN ability macro contains.

I hope that explanation of how I use the CT_TURN functionality is helpful to you.

February 14 (4 years ago)

Edited February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Good to hear is woriking at a basic level functionality

@Kraynic - I need to update that help file. 

@everyone, double dashes for commands and you can stack commands if you want --add,condition=prone,duration=1,direction=1 --add,condition=ouchmybackhurts,duration=1,direction=0

@Mark, good idea.  I'll add a message in chat if init attribute not set

@Anthony, I'll use that very same command and try it out again blinded.  I'll see what's happening there.  I'll look into the reroll init logic.  That had to change due to group-init.  Roll20 doesn't support adding double digit numbers to these status icons.  I think tracker jacker has something that can do it.  So as long as the duration is 9 or less it will show on the icon.  Anything over that and I don't show anything.  However, the duration shows during player announcements if you turn that on. 

@KC, thank you.  I'll try out those and verify if they are working. 

February 14 (4 years ago)

So to add a custom icon to the token when you add the condition do you have to add it with TokenMod or is it suppose to do it automatically? 
Also is the condition suppose to add when you mainly add the icon because it doesn't seem to do so like before?

February 14 (4 years ago)

Edited February 14 (4 years ago)

It's working a lot smoother now minus a few things you already know about. Just one sorta cosmetic thing I noticed is that when a character has more than one condition on them with a message it gets spit into the chat all wonky. The character below is supposed to have the Protection and Prone conditions on them but only the first one comes out in the card. The rest will just go into regular char with no template around it. (I know I can fix the whole '’' thing im just being lazy.)


February 14 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

@devilish, that's a bug.  The white box should go all the way down.  There's an extra div lurking around  cutting off the box.  

@Kilter, you need libTokenMarker found here (unless The Aaron has already published to Roll20).  https://github.com/shdwjk/Roll20API

If you've loaded custom icons into Roll20 and added them to your game, when you set the icon type to Token Marker, you'll get a full list of both Roll20 Default Icons and the custom ones you uploaded.  


February 14 (4 years ago)

Did that but it doesn't seem to add the icon to the token. It has the icon in the list and for the condition but nothing is added to the token.

February 15 (4 years ago)

Edited February 15 (4 years ago)

First look - this seems great :-)

Few issues/questions;

1) I tried to delete a condition (Inspiration), and nothing happens, and I get this in the API window;

2) I've also changed my icons to custom Token Markers, changed the defaults to my custom tokens but they don't seem to apply to the token, though the condition does. Is this something I'm doing or a script error? (I also have lib TokenMarker running and see the icons no problem).

3) In CombatTracker there was an ability to have the turn icon rotate - is that an option in CombatMaster and where would it be configured?

Thanks for your work on this!

February 15 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Kilter you're seeing the icon, so that good and means that it's correctly being pulled.  I'll check why it's not being added.  I may have broken that logic.  It was working.  

February 15 (4 years ago)
Victor B.
Pro
Sheet Author
API Scripter

Alexander, there is rotate functionality still in CM.  How was it being used?