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

1579626366
The Aaron
Roll20 Production Team
API Scripter
That's exactly what OnMyTurn's function does—substitutions on existing syntax. 
1579627012

Edited 1579627026
Victor B.
Pro
Sheet Author
API Scripter
Hmmm, let me check out OnMyTurn.  
1579627911
Victor B.
Pro
Sheet Author
API Scripter
Thanks Scott.  I may implement that.  I want to look at OnMyTurn as I'd rather use something else that does it better rather than recreate a wheel and have to support it.  
1579629078

Edited 1579629131
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep I'd do that as well. My explanation of the logic was more so you could see how it should be applied. A good third of my scripts are just bits I've ripped out of Aaron's scripts, ground up, and then stuffed in a nice sausage casing to make it seem like I wrote them ;) EDIT: I also got the sausage casing from Aaron
Would assigning a macro by name alone make any difference ('#macro-name' or '%Character Name|ability-name) or would its contents still need to be processed through CM?
1579631218

Edited 1579631306
Victor B.
Pro
Sheet Author
API Scripter
Yep,  From my documentation I'm writing up for CombatMaster The largest change of combat master is it now integrates with ·          Group Init (The Aaron) ·          Token Mod (The Aaron) ·          Token Marker (The Aaron) ·          Token Conditions (surprise, The Aaron) ·          Roll20 Audio Master (Not The Aaron…this one is mine)       So I guess I'll add:        OnMyTurn (Do I even need to say?)
1579631418
Victor B.
Pro
Sheet Author
API Scripter
You'll want a global macro because that's what will be invoked every time.  If that macro is tied to a character (requires a character name, etc) then that's where OnMyTurn will step in to replace a generic character name with the actual character name for the person whose turn it is
1579634560

Edited 1579637781
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Scott C. said: A good third of my scripts are just bits I've ripped out of Aaron's scripts, ground up, and then stuffed in a nice sausage casing to make it seem like I wrote them ;) EDIT: I also got the sausage casing from Aaron I "wrote" a really nice customized gmnotes script with this method...
Victor B. said: 1) Do you use any end of round macros or api calls (prior to going to round 2, round 3 etc)? 2) Do you run anything at start of combat or end of combat?  1) Absolutly, sometimes I have encounters where the terrain change at the start of each round. 2) Not so much.
Victor B. said 1) Do you use any end of round macros or api calls (prior to going to round 2, round 3 etc)? 2) Do you run anything at start of combat or end of combat?  I don't normally, but those features would open up a lot of possibilities for future encounters. I'd definitely find a use for them, but they aren't something my current combats would have a use for.
1579657773
Victor B.
Pro
Sheet Author
API Scripter
Status Update I'm unit testing the base functionality.  Start/Stop combat.  Adding/removing Conditions.  Session State maintenance.  I'm creating a user guide that I'll convert to PDF.  Hopefully I can put a link to it in CombatMaster and upload the PDF to Roll20 and we'll see if it can be displayed.  I don't like Wikis and I can't upload pics which are needed for this API. Have a plan for macros and The Aaron is going to help again with OnMyTurn, which should provide functionality to have global macros that can be tied to the current player.  Another MACRO question.  Do you have macros that apply to all characters on the map, including NPCs or only player characters?  I need to figure out if there has to be finer control over the macro execution.    
1579664334

Edited 1579666879
Many of my macros are for PCs only. Other global macros work for both PC and NPC. I have very few for NPCs only. Doesn't OnMyTurn only use character ability macros? That's what I used it for, same as the CT_TURN feature—for macros unique to each character that run at the start of their turn. That's why the example I gave for that kind of macro used a specific character name; the script launches it only at the start of that character's turn and it's only intended to affect that character. Are you still gonna look into assigning global macros to condition add/remove? Edit: probably worth noting that most of my ChatSetAttr macros for conditions are only intended for PCs (the NPCs don't have the built in condition attributes), so maybe an option to only run the macro when adding to/removing from a player controlled character would be useful, if that's what your question was referring to.
Other than using Macro for PC, I think for GM's most of the time the token might be linked to character sheet and set as the default token but the bars are not link essentially its still a mook at that point. Setting conditions on NPC's while it would be nice seem impractable due to the sheer amount of separate sheets in the game thus causing performance issues along the way. So long as the condition can be tracked in status in the combat manager for NPC/mosters adjusting for condition can be done on the fly. I would agree that for macros on characters there are good use cases where that can be useful but only for players 
1579709910

Edited 1579709982
Victor B.
Pro
Sheet Author
API Scripter
Ok, I have macros in now.  For the moment, I've just copied over the resolver from The Aaron's OnMyTurn script because OnMyTurn operates against changes in the turn order automatically.  It requires a char sheet called OnMyTurn and ability macros assigned to the sheet.  It resolves the ability macros to the character in the turn order.  Works great and of course his code is light years ahead of mine, but I have 3 other use cases, a new turn, adding a condition and removing a condition where OnMyTurn won't work.  Also I already have the macro name, so the OnMyTurn char sheet isn't needed.  I'll pose this to him today and see what he comes up with.  Probably something new based on OnMyTurn.   I have a final question for turn based macros.  To be as flexible as possible, it's looking like character specific and possibly all tokens on map (weather affects, etc).  Are their NPC only for beginning of turn and this macro needs to run each and every turn?  
There are things like recharging dragons breath or a alley npc needs to make saves again an effect. Not sure if they fall each and every turn unless it something with in a dungeon or area. i.e. your get effect by something and you and your alley(Npc) need to make a wis save or go mad.
I'm pretty sure the way OnMyTurn works similar to the CT_TURN feature: At the start of a character's turn it looks for an ability macro on that character called OnMyTurn (contents can be different for each character) and runs it. If the character doesn't have an ability macro called OnMyTurn, then it does nothing. That way you don't have to worry about comparing each ability macro to each character; the macro is already on the character. I've never had to set up a character called OnMyTurn when using that script.
1579722040
Victor B.
Pro
Sheet Author
API Scripter
Kilter, the api calls (to tokenmod/macro) are for things you want to automatically invoke each and every turn, round or when a condition is added or removed.  Situational things like a recharging breath are things you'll do outside of CM.   Yes Persephone.  The reason why a OnMyTurn char sheet is needed is so The Aaron can differentiate macros that you want to run each round when a player's turn comes up vs. all other macros you have.  So the OnMyTurn has an ability and in the ability are the macros you want to run each round.  It's very similar to what CT is doing with CT_TURN.  Only The Aaron's code is nicer.   I've decided to maintain a Char Macro and All Macro that are invoked the beginning of each turn.  Remember you only want to use these if you are consistently running the same macro at the beginning of each turn or round.  Skip these if what you run each turn/round is situational.   Here's how turnorder is shaping up
Looking good so far. Really excited to use it in my games, and let the players put the conditions and free me of some extra work haha.
Looking forward to this, so many things... so many things..
1579735992

Edited 1579736087
Oh so it's for macros that are run when ANY player's turn starts or when the round starts. That makes sense to me now. Sorry for my confusion, I thought you were still talking about running macros for specific characters still. Victor B. said: [...] Yes Persephone.  The reason why a OnMyTurn char sheet is needed is so The Aaron can differentiate macros that you want to run each round when a player's turn comes up vs. all other macros you have.  So the OnMyTurn has an ability and in the ability are the macros you want to run each round.  It's very similar to what CT is doing with CT_TURN.  Only The Aaron's code is nicer. [...] Are any of these being combined directly into CombatMaster, or will each of these scripts need to be installed separately in order to work in conjunction with it? I have most of them already, so I'm curious which ones I should or shouldn't carry over when I test out CM. Victor B. said: From my documentation I'm writing up for CombatMaster The largest change of combat master is it now integrates with ·          Group Init (The Aaron) ·          Token Mod (The Aaron) ·          Token Marker (The Aaron) ·          Token Conditions (surprise, The Aaron) ·          Roll20 Audio Master (Not The Aaron…this one is mine)       So I guess I'll add:        OnMyTurn (Do I even need to say?)
1579738954
Victor B.
Pro
Sheet Author
API Scripter
Each script will need it's own install.   Description of Macro launch Beginning of Turn - Will launch characters macro or all macro.  This will do whatever that macro does against the player tokens/character sheets and/or all tokens/character sheets on map.   Beginning of Round - Will launch a macro against the token/character sheet.  It will be a global macro, and the character name will be replaced, so a single global macro WILL operate against the player character currently active in the turn order Adding condition - Will launch a macro against the token/character sheet when a condition is assigned Removing condition - Will launch a macro against the token/character when a condition is removed.  The same applies for tokenmod.  It may be invoked to do whatever.  
@Victor B Hey, I've been reading this post from like, page 6, and I keep looking for a link to see your script in action and every link I've clicked on so far has been 404'd. Did I miss something? 
This was mention on page 17 but TLDR; Victor is getting ready to release beta for Combat Manager that combines a ton of stuff while preserving robins one click version. When Victor is ready a new thread will be created for the newer script but the older versions have been taken down for now. GKDM said: @Victor B Hey, I've been reading this post from like, page 6, and I keep looking for a link to see your script in action and every link I've clicked on so far has been 404'd. Did I miss something? 
1579792106

Edited 1579792166
Victor B.
Pro
Sheet Author
API Scripter
Yes, I combined combat tracker and status info.  But I've removed the link but this combined version won't be supported by me.  There is combat tracker/status info, separate scripts on Roll20 Github if you want to use them.  I'm working with The Aaron right now to finish up before I put up a beta version and then I'll publish to Roll29.  The Aaron is making lots of changes to provide api interfaces so other APIs can call his APIs.  
Wow, cannot wait for this! (I also love the new name, Combat Master)
1580088364

Edited 1580089373
Victor B.
Pro
Sheet Author
API Scripter
Update:  The Aaron continues to make changes so I can integrate with his programs.  I just found out that the way original Combat Tracker was managing status icon had been deprecated (who knew) and it doesn't work anymore.  So I'm having to redo the assignment removal of status markers.  In doing this I'm trying to preserve those that are using older Combat Trackers, so you can import conditions and not have to change much.  Also I'm about 1/2 way done with help, which will be in game handouts.   Again, The Aaron's libTokenMarker will be needed for any custom icons uploaded.   The approach I'm taking is that Combat Master will be self sufficient as is.  Then if you wish the additional, and better, functionality of Group Init, Token Condition, Token Marker, On My Turn, Token Mod, you can configure Combat Master to use these and install the APIs.  
1580095325
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thank you for taking the time and effort to do this, Victor.
I check this thread every day. I'm so excited for Combat Master. Thank you The Aaron and Vic SO much.
Victor B. said: Update:  The Aaron continues to make changes so I can integrate with his programs.  I just found out that the way original Combat Tracker was managing status icon had been deprecated (who knew) and it doesn't work anymore.  So I'm having to redo the assignment removal of status markers.  In doing this I'm trying to preserve those that are using older Combat Trackers, so you can import conditions and not have to change much.  Also I'm about 1/2 way done with help, which will be in game handouts.   Again, The Aaron's libTokenMarker will be needed for any custom icons uploaded.   The approach I'm taking is that Combat Master will be self sufficient as is.  Then if you wish the additional, and better, functionality of Group Init, Token Condition, Token Marker, On My Turn, Token Mod, you can configure Combat Master to use these and install the APIs.   Very excited to see this!
1580255826
Mik Holmes
Pro
Marketplace Creator
So hype for the beta. Thank you Victor! 
I'm excited for this as well, but am curious if CombatTracker stays?  Will it be dumped in favor of the new API?
Shane B. said: I'm excited for this as well, but am curious if CombatTracker stays?  Will it be dumped in favor of the new API? The CombatTracker in One-Click will be staying as well as Status Info, as far as I know. Those two can run together, but CombatMaster will be its own thing.
Hello ! is there on option to take off the "done" button in the chat log ? I don't want my player to use it.
1580912031
Victor B.
Pro
Sheet Author
API Scripter
You want to see the player announcement but don't want the done or delay buttons?  
Do you have an ETA on CombatMaster?
1581118552
Victor B.
Pro
Sheet Author
API Scripter
Not yet, The Aaron has been very busy and hasn't had time to put in api interfaces yet.  
1581237022

Edited 1581238175
J
Pro
Is there a way to see the modifiers to the initiative rolls on combat tracker? All I ever see is the end result, I want to be able to see if the modifiers are correct.
1581345442
Victor B.
Pro
Sheet Author
API Scripter
hmmm, I could add an option for that
J said: Is there a way to see the modifiers to the initiative rolls on combat tracker? All I ever see is the end result, I want to be able to see if the modifiers are correct. Seconding this request!
Hey Victor, would it be simple enough to add a setting for turn announcements that only whispers non-player-controlled character's turns? That way my players can still see each other's announcements and active conditions, but they won't see the names of NPCs and monsters that they haven't identified yet.
1581383226
Victor B.
Pro
Sheet Author
API Scripter
@persephone, I won't add an option, I'll add functionality in that whispers player announcements to GM if the char sheet doesn't have controlled by set.   I'm not a macro user.  Can someone provide a sample of a macro that does something against the char sheet?  
1581386204
Mik Holmes
Pro
Marketplace Creator
I'm always excited when I see a post in this thread. I can hardly wait for CombatMaster, but in the meantime, does anyone know how to patch in the new custom status markers into an existing version of CombatTracker? Even if it isn't accessible through the menu interface; I can manually enter my conditions. 
@ Mik Holmes - that's exactly the functionality I'm looking for! CombatTracker is good, but when you don't even have the standard icons in the game it's really not using the power it could have (which is one of the reasons I'm very impatiently awaiting CombatMaster!!)
@Victor I'm not sure what you mean by 'against' the sheet. If you mean pulling info from the sheet, you can do it through the token linked to the sheet using @{selected|attribute} or @{target|attribute}. If you don't want to depend on the token, you can use the name on the character sheet like @{Character Name|attribute}.
1581513853

Edited 1581514558
Victor B.
Pro
Sheet Author
API Scripter
Status Update: CombatMaster has been a virtual rewrite.  The mechanics of managing combat are pretty solid.  Group Init is integrated.  TokenMarkers are integrated using The Aarons libTokenMarker API.  I've added logic to invoke API/Roll20AM/Macros.  If you want to invokve a Macro or API or Roll20AM, there are 4 timing points for these calls, beginning of round (or start of combat), beginning of turn (using the token of the player currently active in turn order), when adding a condition to a token(s) when removing a condition from a token(s). External objects (macros/apis) will be invoked by entering the full API command string into CombatMaster or the name of the Macro.  The API must be able to support receiving a token id, character id or character name.  A string ("charid1" for example) of your choice will be added into the API/Macro command string where the token id, character id, character name usually goes and you'll tell Combat Master that this string is a token id, character id or character name.  During execution, Combat Master will look for this string (or strings, you may have multiple substitution strings to support different APIs) and whether it's a token id, character id or character name and substitute in the correct value before sending the command to chat.   For start of combat or round, Combat Master will loop through turn order and apply all "Character" based macros/apis to all "player controlled" characters using the substitutions defined above.  CM will apply the "All" based macro/apis to all characters and NPCs within the turnorder.   The hope here is that by using user defined substitution strings, Combat Master can support a wide range of APIs and Macros.   Send me some sample API calls, Macro Calls, Abilities that you are constantly having to invoke so I can test out some of them and verify this will work.  
Victor B. said: Status Update: CombatMaster has been a virtual rewrite.  The mechanics of managing combat are pretty solid.  Group Init is integrated.  TokenMarkers are integrated using The Aarons libTokenMarker API.  I've added logic to invoke API/Roll20AM/Macros.  If you want to invokve a Macro or API or Roll20AM, there are 4 timing points for these calls, beginning of round (or start of combat), beginning of turn (using the token of the player currently active in turn order), when adding a condition to a token(s) when removing a condition from a token(s). External objects (macros/apis) will be invoked by entering the full API command string into CombatMaster or the name of the Macro.  The API must be able to support receiving a token id, character id or character name.  A string ("charid1" for example) of your choice will be added into the API/Macro command string where the token id, character id, character name usually goes and you'll tell Combat Master that this string is a token id, character id or character name.  During execution, Combat Master will look for this string (or strings, you may have multiple substitution strings to support different APIs) and whether it's a token id, character id or character name and substitute in the correct value before sending the command to chat.   For start of combat or round, Combat Master will loop through turn order and apply all "Character" based macros/apis to all "player controlled" characters using the substitutions defined above.  CM will apply the "All" based macro/apis to all characters and NPCs within the turnorder.   The hope here is that by using user defined substitution strings, Combat Master can support a wide range of APIs and Macros.   Send me some sample API calls, Macro Calls, Abilities that you are constantly having to invoke so I can test out some of them and verify this will work.   Awesome, I can't wait to try this!
Me every time I have a notification for this thread: *YAYYYYYYYYYYYYY* Me every time I realize CM isn't actually out yet: *-_____-*
1581530995
Victor B.
Pro
Sheet Author
API Scripter
I need sample APIs/Macros that people will want CM to execute so I can test this out.  Then I'm about ready to publish.  TokenCondition isn't integrated yet, but everything else can go into Beta.  
1581532196
Kraynic
Pro
Sheet Author
For my palladium fantasy games, I needed a way for there to be multiple instances of a character to be in the initiative tracker.&nbsp; In that system, everyone handles their first action in order, then anyone with a second action handles that going through the same order, and so on until everyone has run out of actions.&nbsp; The Aaron wrote a script for me to do that a while ago (which can be found here:&nbsp; <a href="https://app.roll20.net/forum/permalink/6817748/" rel="nofollow">https://app.roll20.net/forum/permalink/6817748/</a> &nbsp;).&nbsp; While I have been using this as a query, I could have a default setup that uses the number of melee attacks they have and then just override that as needed manually with the query for spell casters or ranged weapons which may allow a different number of actions than melee.&nbsp; To run combat according to the publisher recommendations, Group Initiative (unless you are building something similar into CM) and this custom script would run at the beginning of each combat round forcing the flow of combat to change round by round.&nbsp; I know this is a custom thing, so may not be worth your time to test, but since you asked... I can't think of anything else right off the top of my head that I would run this way in my games.&nbsp; Everything else would be interaction with TokenMod as conditions are applied and removed as an encounter progresses.&nbsp;