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

Applying damage to token with shaped sheet

Hi all, So i've been going on a tinkering binge adding all sorts of cool api functions to my game to make things run faster. The difference is night and day compared to regular play. However i have had an idea i'm wanting to implement but am struggling with. Namely what i'd be looking for is to add a DM only button that would reference a rolled attack macro from the D&D 5e shaped sheet and apply that damage to the health bar of a selected token, preferably as part of the shaped sheets attack macro itself. Similar in implementation to Jakob's "Apply damage" script. I know this has been discussed before but i'm not really looking for anything more complex than that, no need to check resistances, attack success etc.
Is there reason alterbars would not do what you are asking? As far as i know there is no way directly apply damage from a roll with out the api "listening" and then there maybe limitations. Are you wanting this automated so they click the macro and then target the token and it remove the damage from the bar?
1588633354

Edited 1588633417
I am unaware if Alterbars can do what i'm seeking as it would as you say rely on referencing the api in all likelihood. My ideal steps of operations would be; 1. Attacker makes attack rolls (Say for argument 3 attacks, the first and last hit dealing 4 and 7 damage respectively.) 2. I (DM) select the token that represents the defender 3. I click on "Apply damage" buttons for the first and last macros 4. Damage rolled by those attacks is subtracted from selected token health (In this case removing 4 and then 7 from bar 3). I'd prefer that method as it would usually provide a greater reduction in the number of clicks.
As far as i know this is not possible. You could create a macro to use an api to target the bar you want and enter it manually. That's what Alterbar does and there are other scripts that can do something similar, but even with the api there is no way to click a button and pull the variable/rolled result as that has been already rolled. It essentially boils down to the eventlister has to "listen" rolltime, not after its been rolled. TheAaron, Gig's or even Jakob might be able to give you pointers on how to create such a scrip but again there maybe limitations.
1588639801
The Aaron
Roll20 Production Team
API Scripter
Someone is already doing almost the same thing here:&nbsp; <a href="https://app.roll20.net/forum/post/8608444/want-to-learn-coding-programming-an-applydamage-button" rel="nofollow">https://app.roll20.net/forum/post/8608444/want-to-learn-coding-programming-an-applydamage-button</a>
Thanks for the point out. I'll keep an eye on that thread.
1588645557
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It might be able to be done with off the shelf components using Customizable Roll Listener and Token-mod.