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

Where's the ApplyDamage script?

This is probably a very silly question with a very obvious answer, but I'm at a loss here. I've already added the GroupCheck script and it works like a charm, but I can't for the life of me find the ApplyDamage script, which, if I understand correctly, is needed for the "Apply Damage" button to work. Can anyone tell me what I'm missing?
1677047937
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Raquel! Apply Damage only exists in a Forum post to my knowledge. Here you go .
1677083147

Edited 1677085730
Thanks for your reply! I ran the macro exactly how it's on Jakob's post, but the ApplyDamage button is a link and not a button, and it doesn't work, so I figured maybe I'm still missing something. The link/button does work if I replace the code related to ApplyDamage with another script though. As in, this does nothing when I click on "ApplyDamage": !group-check {{ --Dexterity Save --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) }} But this calls the TokenNameNumber script when I click on "ApplyDamage": !group-check {{ --Dexterity Save --process --subheader vs DC ?{DC} --button ApplyDamage !tnn ~renumber }}
1677114072
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
After you click on apply damage (link or button, it's the same thing, just styled differently), click in the chat input area and press the up cursor key. You should be able to read what the button sent to chat, which might give some insight as to what is going on.
I got this: !apply-damage --dmg [[5]] --type half --DC 15 --saves 22,6 --ids -NOXOdyWBbFHKTk5XRmR,-NObid61JyacQQbXO09O It looks correct to me. I even checked the ids and they match the ids of the tokens to which the saving throws were rolled.
1677123996
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Where is that macro with "!tnn" coming from? I can't find that in the contents of either script.
!tnn is for the TokenNameNumber script. I’ll bet if that is removed then it’ll work. 
I ran the macro exactly how it appears on Jakob's post (copy/pasted the code into the macro window). When I clicked on the ApplyDamage button and nothing happened, though, I wanted to make sure that the button itself was working: didn't want to waste time going over apply-damage and its parameters only to find out later that there was actually something wrong with the button. So I temporarily replaced the part of the code that calls apply-damage with other code calling a different script (tnn aka TokenNameNumber) and ran the macro just to check whether the button would work. It did, so now I know that whatever is wrong here, it's not the line "--button ApplyDamage" part. Below is the code I'm trying to run. This is the code that isn't working for me (no !tnn here). !group-check {{ --Dexterity Save --process --subheader vs DC ?{DC} --button ApplyDamage !apply-damage ~dmg [[?{Damage}]] ~type ?{Damage on Save|Half,half|None,none} ~DC ?{DC} ~saves RESULTS(,) ~ids IDS(,) }}
Have you manually loaded the ApplyDamage script? Can you show a screenshot of your Mod console where ApplyDamage is loaded?
No, I haven't. That's why I originally came here, to ask where I would find the ApplyDamage script, because I can't find it.
1677134517

Edited 1677134629
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That post I linked has a link to a repository of the code. Click on that link, go to the code, and click on the "Raw" button. That will give you just the text of the Apply Damage script. Here is a video that gives you an intro on how to load a manual script. How to Install Roll20 API Scripts By coincidence, at the 55 second mark, Nick shows the method, using the Apply Damage script as an example.
Thanks! Everything is working now.