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

1582253776
Victor B.
Pro
Sheet Author
API Scripter
I get that.  I need to look into someone's game to figure out why it's working for me and not others.  
Victor B. said: I get that.  I need to look into someone's game to figure out why it's working for me and not others.   Invite sent
1582254904
Victor B.
Pro
Sheet Author
API Scripter
Alright the issue with the NPC display is fixed.  In Mike's game he's NOT having issues adding/removing custom icons.  Devilish I'm going to jump into your game and find out what's going on
I'm not having issues with adding/removing custom icons either.
Strangest thing. ONE of my conditions adds and removes properly. Invisibility. Every other icon remains even after CM has registered it as removed. I can't seem to figure out why that one condition is different.
Victor B. said: Need More Info -  Rotate Functionality.  I checked older versions of CT and same functionality exists in CM.  I'll need to know exactly what is to be expected by rotating Hi Vic, Just to flesh this out, I'm not seeing the rotate functionality available anywhere in CM...where can I find it? Is there an easily accessible option to turn on/off? It would be nice if this were in the Initiative CM Setup... Thanks! (hope that clarifies my query here)
1582288309

Edited 1582288355
Victor B.
Pro
Sheet Author
API Scripter
@Alexander, What does the rotate functionality do?   @Devilish, please PM me a game invite and promote me to GM once I'm in.  I'll need to figure out what's going on with your game.  
Vic - It rotates the marker around the token
1582291708

Edited 1582295341
Victor B.
Pro
Sheet Author
API Scripter
I have some macro logic working now.  In a specific case, the macro was calling the powercards API.  I tried launching it as is via CM and it didn't substitute the @{character_name}, @{character_id} @(token_id) parameters when sending to chat.  I double checked my code vs. older CT code and I have the exact same code between the two.  I started searching and found this from The Aaron The API can load the list of chat commands from either a macro or a character ability, and issue them to the chat with the sendChat() command.   HOWEVER, there are a few caveats to getting it to work: In the case of a character ability, you would need to parse all the @{} references and replace them with fully qualified versions including the character's name since you won't be executing them in the context of the character.  That looks something like this: let text = ability.get('action').replace(/@\{([^|]*?|[^|]*?\|max|[^|]*?\|current)\}/g, '@{'+(character.get('name'))+'|$1}'); In both cases, @{selected} and @{target} won't work.  You'll either have to make sure those aren't used, or provide some sort of intermediate query to the executing player where by they click a button and are prompted for those things.  @Ken, if you are still watching this thread, you said that CT_TURN launches that !power command and it worked.  I don't see how.  But I added substitutions in CM for @{character_name}, @{character_id} @(token_id) into CM and ran it and it worked.  So I'm really confused as to how the !power command even did anything, especially if you read the above from TheAaron and it didn't work for me at all.  This also means that for APIs you want to launch either via abilities or via macros (with substitutions), launching these things will be dependent upon how the API was coded.  For example, with the PowerCards API, it's way too reliant upon macro syntax (@{whatever}.  Selected tokens are already passed into the API.  From the token, you get the character sheet from the character sheet you get the attributes, so you don't need @{character_name}, @{character_id} @(token_id) @{selected}.  Additionally, a --ids parameter should accept specific token ids and then the API could easily be called by other APIs.  I'm guessing though that you can't get completely away from @{something} due to abilities calling APIs.  However, I would highly suggest sending in @{token_id} only along with the --ids parameter.  The API is then callable from other APIs as well as support abilities or even a macro (with selected tokens).  Then the focus becomes formatting the output and the attributes you want, and/or updating attributes which it seems to do also, all of which can remain as -- parameters or comma delimited list.  Even better, allow the users to define the attributes by name and dynamically process them, kicking out errors if the attribute(s) doesn't exist, making PowerCards usable by any game, not just D&D focused.  
1582294628
Victor B.
Pro
Sheet Author
API Scripter
@alexander, I compared CT to CM and I'm not seeing any rotational logic for the token.  There's no option to rotate.  The marker is there to highlight the active player, why does the marker need to rotate if you rotate the facing of the token?  Reason I ask is that I can add some logic to do it.  I'm trying to understand the need.  
1582296125
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
IIRC, I believe the rotation was for animation purposes, not to follow token rotation.
1582296795
Victor B.
Pro
Sheet Author
API Scripter
There's still a knowledge gap on my part.  I'm still not clear on what is supposed to happen.  The marker constantly rotates around the token?  
Victor B. said: There's still a knowledge gap on my part.  I'm still not clear on what is supposed to happen.  The marker constantly rotates around the token?   Yea, that's about it. To make it stand out more or something.
1582297234

Edited 1582297265
Victor B.
Pro
Sheet Author
API Scripter
On the API/Macro Side, I'm making much progress.  First I tried out PowerCards as an ability.  Then I switched it to being a global macro.  It worked in both cases.  As a global macro it runs against every token in the turnorder.  As an ability it runs again only those tokens with PowerCards assigned as an ability.   This got me thinking if I should allow for a comma delimited list of macro names and process each one.  That way you can some that run against all tokens and some that run against abilities if assigned to the char sheet?   Sample output from PowerCards
1582297399
Victor B.
Pro
Sheet Author
API Scripter
@Ravenknight - thanks @Anthony - CT/CM hasn't done a constant rotation like that in a very long time.  I'd be worried about performance first off.  I've seen FX's but they usually last for a second or 2.  A constant rotation along with a large number of APIs running etc, could have an impact.  I'll consider adding an option and supporting it (though I'm not sure how atm).  
1582299431

Edited 1582299532
Victor B.
Pro
Sheet Author
API Scripter
@persephone, you'll be pleased to know that CharSetAttr is working fine within CM.   I created an exhaustion condition within CM and added this API to it.  Brackets around all '--' commands.  charidentifier is a substitutions variable defined in CM in APIs & Macros.  It will replace charidentifer with the character id when executing it.  For those who don't know CharSetAttr, the --mod increases the attribute so I'm increasing exhaustion by 1 for each time I assigned the condition.  The remove could reset it to 0.  Unfortunately, The OGL char sheet will only populate the affects of exhaustion if you manually toggle the exhaustion level up or down, so the affects aren't showing correctly and nothing I can do about that.  The way around that is to toggle the exhaustion level up 1 and then back down 1 to get OGL to populate the affects properly.   {{!setattr {{--charid charidentifier}} {{--mod}} {{--exhaustion_level|1}}}}  Note: Token mod is currently rejecting calls from CM because it's expecting the player to be GM.  Roll20 automatically populates the player as API when an API calls another API.  So I'm awaiting a fix from TheAaron on this.   And I got this output when assigning the exhausted condition to the token
1582299474
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Victor B. said: @Anthony - CT/CM hasn't done a constant rotation like that in a very long time.  I'd be worried about performance first off.  I've seen FX's but they usually last for a second or 2.  A constant rotation along with a large number of APIs running etc, could have an impact.  I'll consider adding an option and supporting it (though I'm not sure how atm).   My suggestion would be for users to find a nice animated graphic and use the Token Condition option. That functionality is already there. No sense building it all over again.
In combat I generally add a random token on the GM layer to the turn order titled 'Lair Actions' as it goes on initiative count 20, this token is not associated with a character sheet and when the turns goes around the API crashes on this token with the following error: TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined at announcePlayer (apiscript.js:1878:40) at doTurnorderChange (apiscript.js:1584:13) at handleTurnorderChange (apiscript.js:1623:13) 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 TrackedObj.set (/home/node/d20-api-server/api.js:1024:14) at updateLocalCache (/home/node/d20-api-server/api.js:1322:18) at /home/node/d20-api-server/api.js:1612:7 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)
1582300482
Victor B.
Pro
Sheet Author
API Scripter
Apologies for the post bombard.&nbsp; I'm finally smelling blood on this API... Version 1.5 Alpha found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> Fixed: - Showing NPC Conditions to players or GM fixed -&nbsp;Macros/API calls fixed for everything except start of turn Need More Info - I haven't heard anything about those reported issues so I'm removing them until they come up again Not Fixed: - Start of Turn Macros/API .&nbsp; I'm awaiting a few fixes from TheAaron for Token Mod - Export/Import not working&nbsp; - Persistent Macros - Not using the main token marker
1582300545
Victor B.
Pro
Sheet Author
API Scripter
@Mike I'll add that to the list
Victor B. said: @alexander, I compared CT to CM and I'm not seeing any rotational logic for the token.&nbsp; There's no option to rotate.&nbsp; The marker is there to highlight the active player, why does the marker need to rotate if you rotate the facing of the token?&nbsp; Reason I ask is that I can add some logic to do it.&nbsp; I'm trying to understand the need.&nbsp;&nbsp; I think the request is just for attention. There was a similar API named Tracker Jacker that did this well for combat management.
1582302909

Edited 1582303079
Version 1.5 crashes API when trying to remove a custom condition from CM chat menu, adding and removing via token drop down works fine. TypeError: tokenObj.get is not a function TypeError: tokenObj.get is not a function at doRemoveConditionCalls (apiscript.js:2200:56) at selectedTokens.forEach.token (apiscript.js:979:12) at Array.forEach (native) at removeCondition (apiscript.js:976:25) at commandHandler (apiscript.js:340:17) at _.each (apiscript.js:131:21) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at inputHandler (apiscript.js:126:19) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:70:8)
1582305636
Dumbhuman
Pro
Marketplace Creator
Victor B. said: On the API/Macro Side, I'm making much progress.&nbsp; First I tried out PowerCards as an ability.&nbsp; Then I switched it to being a global macro.&nbsp; It worked in both cases.&nbsp; As a global macro it runs against every token in the turnorder.&nbsp; As an ability it runs again only those tokens with PowerCards assigned as an ability.&nbsp;&nbsp; This got me thinking if I should allow for a comma delimited list of macro names and process each one.&nbsp; That way you can some that run against all tokens and some that run against abilities if assigned to the char sheet?&nbsp;&nbsp; Sample output from PowerCards Sorry, I didn't mean to suggest that I ran that exact PowerCard text straight through CombatTracker as I posted it there, but I was just trying to give you the generic format I use before replacing @{selected|character_id} and such with the actual character ID, name, etc.&nbsp; I can't really think of any global macros I'd always want to run for every character on the start of a turn, but I'm sure there are people who will want that functionality you've achieved.&nbsp; I'm personally most interested in the ones that look for a specific ability tied to a character sheet, because I'll want to customize things that way and it's the functionality that CombatTracker currently provides.
Mike said: Version 1.5 crashes API when trying to remove a custom condition from CM chat menu, adding and removing via token drop down works fine. TypeError: tokenObj.get is not a function TypeError: tokenObj.get is not a function at doRemoveConditionCalls (apiscript.js:2200:56) at selectedTokens.forEach.token (apiscript.js:979:12) at Array.forEach (native) at removeCondition (apiscript.js:976:25) at commandHandler (apiscript.js:340:17) at _.each (apiscript.js:131:21) at Function._.each._.forEach (/home/node/d20-api-server/node_modules/underscore/underscore.js:186:9) at inputHandler (apiscript.js:126:19) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:65:16) at Object.publish (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:154:1), &lt;anonymous&gt;:70:8) This seems to be happening for any condition that you try to remove even the default ones.
1582308699

Edited 1582309107
Victor B.
Pro
Sheet Author
API Scripter
Version 1.5.1 Alpha found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> Fixed: - Remove Condition Failure Not Fixed: - Start of Turn Macros/API .&nbsp; I'm awaiting a few fixes from TheAaron for Token Mod - Export/Import not working&nbsp; - Persistent Macros - Not using the main token marker - Enable comma delimited lists of macro/ability names that are executed either globally or again tokens where the name is assigned into the ability
Victor B. said: Version 1.5.1 Alpha found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> Fixed: - Remove Condition Failure Not Fixed: - Start of Turn Macros/API .&nbsp; I'm awaiting a few fixes from TheAaron for Token Mod - Export/Import not working&nbsp; - Persistent Macros - Not using the main token marker - Enable comma delimited lists of macro/ability names that are executed either globally or again tokens where the name is assigned into the ability Working great now! I still can't seem to get this APi macro "!token-mod --flip light_hassight" when applying a condition is that working in the newest version?
1582310818
Victor B.
Pro
Sheet Author
API Scripter
token mod is rejecting the calls.&nbsp; Token mod expects the player to be GM.&nbsp; The player is overridden by Roll20 and set to API and therefore being rejected by token mod.&nbsp; The Aaron is aware of this and will be putting in a fix
Victor B. said: token mod is rejecting the calls.&nbsp; Token mod expects the player to be GM.&nbsp; The player is overridden by Roll20 and set to API and therefore being rejected by token mod.&nbsp; The Aaron is aware of this and will be putting in a fix Sweet!!
1582311204
Victor B.
Pro
Sheet Author
API Scripter
This will be last publish for a bit as I tackle the rest of the remaining items Version 1.6 Alpha found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> New Functionality - Added Persistent Macros Not Fixed: - Start of Turn Macros/API .&nbsp; I'm awaiting a few fixes from TheAaron for Token Mod - Export/Import not working&nbsp; - Not using the main token marker - Enable comma delimited lists of macro/ability names that are executed either globally or again tokens where the name is assigned into the ability
1582311546
Victor B.
Pro
Sheet Author
API Scripter
@persephone, I haven't tested persistent macros because I don't do anything like that.&nbsp; I'm leaving this up to you to test for me.&nbsp;&nbsp;
1582314592

Edited 1582314641
I'm a bit confused about how to properly assign a macro to a condition. Do I enter the whole macro text into the query, and wrap it in brackets? Or do I just enter the macro name like #AddBlinded, and edit the macro's contents to be wrapped in brackets? Do I wrap the macro name in brackets as well? And for macros stored as character abilities, does it matter if I write them as %{macro|AddBlinded} or ~macro|AddBlinded?
1582314797

Edited 1582314869
Victor B.
Pro
Sheet Author
API Scripter
macro name only - no # unless that's how you have the macro name under the macro section in your game.&nbsp; Don't need brackets.&nbsp; Post a sample of what you run.&nbsp; Some of that won't work.&nbsp; &nbsp;
Not sure if I'm doing this correctly when trying to use either the MACRO or FX options. On one condition I have set 'adding condition' MACRO to: test Then created a macro called: test /em test But no chat output when the condition is applied Setting FX to: burn returns the word burn in chat
1582319432

Edited 1582319457
Victor B.
Pro
Sheet Author
API Scripter
This will be last publish for a bit as I tackle the rest of the remaining items Version 1.6.1 Alpha found here:&nbsp; <a href="https://github.com/vicberg/CombatMaster" rel="nofollow">https://github.com/vicberg/CombatMaster</a> Fixed - Persistent Macros Not Fixed: - Start of Turn Macros/API .&nbsp; I'm awaiting a few fixes from TheAaron for Token Mod - Export/Import not working&nbsp; - Not using the main token marker - Enable comma delimited lists of macro/ability names that are executed either globally or again tokens where the name is assigned into the ability - FX calls
1582319576

Edited 1582319747
Victor B.
Pro
Sheet Author
API Scripter
Mike,&nbsp; FX calls aren't in yet.&nbsp; I've added them to the not fixed list.&nbsp;&nbsp; For turn (or condition) based macros, do the following.&nbsp; 1) Create a Macro called EMTEST with (/em test...or whatever) and save it into macros 2) Go to Conditions and for Add Condition Macro, enter EMTEST 3) You can choose persistent or not if you wish 4) When assigning that condition, the EMTEST should fire off.&nbsp; I tested with your /em test and it worked Macro Names are case sensitive
Awesome, it works great! Just an observation, the macro is not firing when condition(s) are added/removed via a tokens drop down though.
1582321582
Victor B.
Pro
Sheet Author
API Scripter
Good point.&nbsp; I'll add logic for that.&nbsp;
I'll test it out more in a few hours then get back to you with macro examples if I'm still having trouble. Will the --sel function of ChatSetAttr work at all in these macros, or does it need to be replaced with --charid charidentifier ?
1582326431

Edited 1582326480
Victor B.
Pro
Sheet Author
API Scripter
No sel will not work &nbsp;Has to change to charid and use a substitution of charidentifier
1582329197

Edited 1582330877
Victor B.
Pro
Sheet Author
API Scripter
Normal macros assume you have a selected token and Roll20 passes that selection info into the macro or api.&nbsp; It converts many of those @{} commands before execution.&nbsp; All done by Roll20.&nbsp; CharsetAttr uses a -sel saying I'm using selected tokens.&nbsp; Token mod you don't even need the --sel as it assumes selected tokens when you launch it.&nbsp; Abilities are launched via a token, so Roll20 already knows the token and assigned character and figures everything out before launching the ability.&nbsp;&nbsp; CharSetAttr uses --charid @{character_id}.&nbsp; Roll20 replaces @{character_id} with the actual character id before launching the API or Macro.&nbsp; However, it won't do that for my poor little API.&nbsp; So you replace @{character_id}&nbsp; with a unique string of your choosing.&nbsp; In CM, go to Macros &amp; APIs, add a substitution, choose Character ID and enter &lt;the unique string of your choosing&gt;.&nbsp; Make it REALLY unique so CM doesn't replace other syntax it shouldn't.&nbsp; When executing the ability or macro, CM takes your unique string and replaces it with the character id associated with the token and OMG, it works.&nbsp; Look at the sample below.&nbsp; When CM executes the API, charidentifier is replaced with the actual character ID and charsetattr works.&nbsp;&nbsp; !charsetattr --charid charidentifier --mod --exhaustion_level|1&nbsp; The above can be placed into a macro or entered directly into CM like this: {{!charsetattr {{--charid charidentifier}} {{--mod}} {{--exhaustion_level|1}}}}&nbsp; Same within the macro syntax...anywhere within the macro, replace&nbsp; @{character_name} with a unique string, for example charactername, within the macro syntax.&nbsp; CM replaces it with the character name @{token_id} with a unique string, for example, tokenidentifier, within the macro.&nbsp; CM replaces it with the token id @{character_id} with a unique string, for example charidentifier, within the macro.&nbsp; CM replaces it with the character id Add the same strings into CM under Macros &amp; APIs and voila it will work.&nbsp;&nbsp; If you see {SELECTED} or {TARGET} then probably keep that out of CM.&nbsp; They aren't supported.&nbsp; There may be a way to rework the syntax such that it uses @{character_name} or @{token_id} or @{character_id} but otherwise it won't work.&nbsp;&nbsp;
1582332625

Edited 1582334687
Okay so I have a condition called Confused. I created a macro called confused-add , containing the following: {{!setattr {{--charid charidentifier}} {{--condition_confused#1}}}} I set up the substitute for Character ID to be charidentifier , then I applied confused-add to the Confused condition, so it runs when the condition is added to a token. When I add it to a token, though, this gets sent to chat: As for Persistent Macro, I'm guessing that was supposed to address the request I made about a macro that runs a macro when a character with that condition starts their turn. As is, though, it only can be set to true or false, and just repeats the macro for adding the condition. What I had in mind was a separate macro. For the Confused condition, I want the above macro to be ran when it's added, but the following macro, called Confused-Effect , to be ran when a character with the Confused condition starts their turn (uses the Recursive Table script): !rt /w gm &amp;{template:npc} {{name=Confused Effect}} {{type=feat}} {{descflag=1}} {{desc=[[1t[confused-effect]]]}} EDIT: Scratch all that, I get how this all works now :p
1582332785
Victor B.
Pro
Sheet Author
API Scripter
HMMM, you've just made a case for two macros. Or can you add the template to the macro?&nbsp;&nbsp;
1582332832
Victor B.
Pro
Sheet Author
API Scripter
Oh, let me copy that command and find out what's going on.&nbsp; Running a game in 7 minutes so it will be tomorrow.&nbsp;&nbsp;
1582332869

Edited 1582332882
Victor B.
Pro
Sheet Author
API Scripter
The {{}} should be removed.&nbsp; You don't need them if you put them in a macro.&nbsp; Only if you want that command as an API in CM
1582333436

Edited 1582335074
Mik Holmes
Pro
Marketplace Creator
I know you're running a game in just a minute, but for later: I've been trying to play around to fix the import, and I found one potentially important thing. For some reason, whenever setDefaults is called by importing, if(!state[combatState].config || typeof state[combatState].config == 'undefined' || reset) { the first two arguments come back true. I by no means understand anything I'm trying to say, but it doesn't seem right to me. EDIT: Near the top of importConditions, where you insert the imported json to the combatState, it doesn't actually include .config. I added it in, and now importing/exporting works (though it DOES throw an error saying the json is invalid. if (json.command == 'cm') { state[combatState].config = json
1582334367

Edited 1582337156
Oh! I was under the impression that the API option in the condition was exclusive to TokenMod. If I can put my ChatSetAttr commands there, then I could use the Macro slot for the persistent macro. That would work perfectly. I'll test this out again. EDIT: it's working exactly as I'd hoped, I just didn't know what I was doing lol. Amazing job, Victor! And thanks for being patient
Does anyone know how to set one of the macro options to None instead of undefined without having to reset the whole thing to defaults?
Another observation, when a condition is removed at the end of its duration, the associated removal API/macros don't run.