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

Alterbar (Shaped 5E) applying damage

Okay, I want to put a BUTTON in the weapon or spell macro on the 5E Shaped Sheet. When I press the attack button, I select my target and it shows the regular attack vs that target's ac and then the damage appears below. Then there is the new BUTTON with a macro like this: !alter --target|@{target|token_id} --bar|3 --amount|-?{Damage Dealt|0} But I would like the query instead to grab the amount of damage that shows in the chat already and then apply it to that same target's bar3.  Basically, you click your attack, click your target, and then if it hits you click your damage button and it reduces the bar3 of that opponent.    Will this work like I envision it?  If so, what does my macro need to say in order to make that happen?
Won't work without writing an API script to listen for a template with a damage roll to appear in chat and then send the button to chat with the damage value and such that it found. I wrote such a script for the OGL 5e sheet and even had it automatically applying damage without anyone clicking anything, just as a test to see if it could be done. There are too many variables though and different types of attacks to make an automatic damage script work properly with templates. Adding a button to apply damage using the API however is quite doable and my script would be a good place to start.
I made a macro button token action, "Dmg to Enemy", that the players can use.  It just seemed cooler to have it appear in their spell or attack window and then click from there.  Not the end of the world I guess.
I created a Sheet called macros and then I built a macro using what you have above: !alter --target|@{target|token_id} --bar|1 --amount|-?{Damage Taken|0} Then on the character sheet I made an attacher called damage and I made another macro that I put in freetext box that I then checked attacks and spells. [Damage Dealt](~Macros|Damage-Target)
Sheet Author
API Scripter
This is something that we're looking to add in the future. Possibly with integration from Jakob's work with group ability checks as well. For now you'll have to set it up manually.