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

Token Macros using bar values

1488833914

Edited 1488833993
Hello. I didn't quite find what I was looking for, so I thought I'd ask around. Is it possible to make a token macro that only uses the values from the token bars? (without any use from the character sheets) As in, for all my NPCs, I have their stat blocks written in the GM section of the token. I use the bars to display Attack, HP, AC. What I'm asking is that, how feasible would it be to make a token macro that uses the bar with attack value to make a roll for the selected token? Just a basic (attack) roll, with the token's name and maybe some fluff text. (And if that's possible, how hard would it be to then have a target named in the macro as well? How hard would it be it for the attack to also show the AC value from the target's token bar?) I'm also looking for suggestions on how to make the combat rounds go faster for NPCs (in terms of their attacks and damage rolls). Thanks for any help.
1488835757
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
yep, the attribute calls would be in the format @{barX}, where X is the number of the bar (1,2,or 3). You would of course need to use the selected or target keyword with this. You can access the max value by @{barX|max}; this does require using the full target syntax if you use the target keyword: @{target|TargetName|barX|max}
Thank you for the quick reply. I'm not a native english speaker so maybe I have some difficulty in understanding all the intricacies of these macros, but could you type out a small example macro? Another thing that I'm wondering is if it's possible to somehow copy paste the macro from PF-sheet "attacks" tab to be shown as token-action (that is, so that I can copy paste the macro into the Attributes & Abilities section of specific tokens)? Thank you and sorry for the trouble.
Memm said: Thank you for the quick reply. I'm not a native english speaker so maybe I have some difficulty in understanding all the intricacies of these macros, but could you type out a small example macro? @{selected|token_name} has a bar1 of @{selected|bar1} / @{selected|bar1|max} @{target|Defender|token_name} has a bar2 of @{target|Defender|bar2} / @{target|Defender|bar2|max} Memm said: Another thing that I'm wondering is if it's possible to somehow copy paste the macro from PF-sheet "attacks" tab to be shown as token-action (that is, so that I can copy paste the macro into the Attributes & Abilities section of specific tokens)? You might find this post helpful.
1488838273

Edited 1488838292
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
No problem. So taking your questions in order: [[1d20+@{selected|bar2}]] will roll a d20 and add the value of the selected token's bar 2. You probably don't want to copy and paste the whole macro and there is an easier way. The attacks, spells, and feats sections (and I think a few others) are what are called repeating sections. Repeating sections have a defined syntax (based on the sheet that made them). For the  pathfinder sheet the syntax for calling a PC's attack is %{Keyword||repeating_weapon_$X_Attack}. Keyword can be the character's name, selected, or target. The X after the $ is the row index of the ability (the indexing starts at 0). So, to make a token action to call the attack at the top of the selected character's attack section, you would put %{selected|repeating_weapon_$0_Attack} in an ability on the attributes/abilities tab of the character. Nothing else is needed. All that said, I would highly recommend utilizing the attack and spells chat menus for this as then you don't need an additional token action for every possible attack or spell you might use. Ninja'd by Silvyre :)
1488842447

Edited 1488842493
Awesome stuff, thank you so much! (( Not sure I understand what you mean by "attack / spell chat menu... ? ))
1488842990
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
These, which should be at the top of your sheet: And output a menu like this:
Ah. Well, these macros are not for characters with sheets. These are the generic enemies the PCs face. And they just need a simple attack macro (with the value from the token bar).
1488843211
vÍnce
Pro
Sheet Author
and... there's many more menu buttons added in the new release(submitted today)
1488843290
vÍnce
Pro
Sheet Author
Memm said: Ah. Well, these macros are not for characters with sheets. These are the generic enemies the PCs face. And they just need a simple attack macro (with the value from the token bar). Sheet Authors everywhere silently mourn.   ;-)
1488843323
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Memm said: Ah. Well, these macros are not for characters with sheets. These are the generic enemies the PCs face. And they just need a simple attack macro (with the value from the token bar). Ah, then my suggestion for calling the attack repeating section above won't work. These menus are also made for NPCs though if you fill out the NPC section. I might suggest filling out the NPC section for your mooks. In my experience, it actually takes less time than making custom macros for each enemy.
1488846421

Edited 1488849241
I managed to get the macro working like I wanted. Thank you all for you help! While the macro is more than enough in its current form, I was still wondering if it was possible to make it understand crits? As in, is it possible to add to it a pop-up question which asks for crit range? For instance, a pop-up to which I could type 18 (to signify that crit-range is 18-20) and then should the roll be, e.g 19, it would also roll the crit confirmation roll automatically? This is what the macro looks like atm. &{template:pf_generic} {{character_name=@{selected|token_name}}} {{name=Attack Vs. AC}} {{Attack Roll=[[1d20+@{selected|bar3}]]}} {{Crit Confirm=[[1d20+@{selected|bar3}]]}} {{Iterative Attack=[[1d20-5+@{selected|bar3}]]}} {{Iterative Crit Conf.=[[1d20-5+@{selected|bar3}]]}} {{Defender=@{target|token_name}}} {{Defender AC=@{target|bar2}}} The Crit confirm rolls, if not needed, I'd rather not show up at all. Speaking of queries, what about another pop-up where it asks for number of attacks? (1-4) And then rolls for the iteratives..? (I'm pretty much complete noob when it comes to macros, so my apologies for all these questions. But thank you all for taking your time to help me. It's greatly appreciated!)
Pretty sure you can just move the crit confirm rolls onto a new line in the macro and enclose it within /em [Crit?](!<rolls for crit confirm>)
Yeah, I suppose I Could. It's actually something like that atm. About the pop-up query to click the number of attacks, I was able to get the pop up working, but for some reason I can't figure out how to type the macro to use selected token's bar values after a number of attacks is chosen? If anyone could offer more insight to this, I'd appreciate, ty.
1488919233
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You have access to all of the pathfinder templates. Just use the  pf_attack template which has handling for showing/hiding critical damage.
1488923813
Tetsuo
Forum Champion
As Scott said, change your template to pf_attack, as it has crit functions. For example: &{template:pf_attack} {{character_name=@{William Hockik|character_name}}} {{name=Cestus}} {{attack=[[1d20cs15]]}}{{damage=[[1d8]]}}{{crit_confirm=[[1d20]] }} {{crit_damage=[[1d8]]}} Will roll the attack and damage. If the attack is a 15 or higher, it will also display the crit rolls. This can be edited to include multi attacks as well, just add those on with a corresponding number (attack2, damage2, crit_confirm2, crit_damage2... etc)not actually sure how many iteratives the sheet supports this way.