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

5e OGL API Script and Macros

Hi all, I am new to Pro, but reasonably seasoned in macro usage. I just started the 5th Edition OGL Companion API Script for it's obvious benefits. I do have a question about ammo tracking with it. I have a bard who would like to track Bardic Inspiration with ammo tracking. This seemed easy, as I could make an attack, uncheck all of the rolls add the details into the description with the "Inspiration Die" resource marked as the ammo.That looks like this (Also that calculation puts out the type of die used based on level, 1d4@lvl1, 1d8@lvl5, 1d10@lvl10 and 1d12@lvl15) Now this works fine and technically does what I want, but it looks gross when rolled. See here: I cant figure out how to parse out the ammo tracking to paste it into something more put together, like a trait block. There doesn't seem to be documentation on what is required for it to run. Any assistance would be lovely, even if I am SOL it'd be nice not to be lost. Chat code output: @{Bard|wtype}&{template:dmg} {{rname=Bardic Inspiration}} 0 {{range=60 ft}} 0 {{desc=Gives @{selected|character_name} 1d[[{(floor(@{Bard|base_level}/5)*2)+4,12}kl1]] Inspiration Die}} {{spelllevel=}} {{innate=}} ammo=Inspiration Die|-Lm43tqDuaSoJ0rpfMUE @{Bard|charname_output} Thank you
1565621024

Edited 1565621103
I don't have the complete answer here, but one way I've got around these is to do it a slightly different way. - Instead of this ugly attack macro, I use the API called 'Chatsetattr'.... I create a 'skill' in the right hand side of my character sheet, where it normally shows things like darkvision, or bardic inspiration... Name: Inspiration I play my banjo and inspire @{target|target|character_name}! [Spend an inspiration point!](~MyName|Spend_Inspiration) This way, when I click the ability, it prompts me to point at the person I'm inspiring. - then gives me a button to click to 'spend' the inspiration point accordingly. Then I'll make an 'ability' called 'Spend_Inspiration' that looks something like this: - This reduces the first left most 'resource' in the character sheet by one, each time it's clicked. !modattr {{ --sel --class_resource|-1 --fb-public --fb-from inspiration --fb-header --fb-content _CUR0_ Inspiration points left. }}