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 Targeting Macro and Target's AC

Hello, i'm new to posting a topic here. I just want to ask, or rather suggest that D&D 5e Roll20's character sheet's AC can be the same as NPC's AC. I realize that when we're using a sheet as PC and NPC using the toggle button, the content would be different. If i have fill in the form (names, AC, etc) and toggle it to NPC, the content would be gone. This would affect how token targeting macro would behave, since when i use a macro to target NPC's token controlled by DM, they would work out fine, but if the DM would use the sheet and target me and other's tokens on the map, the macro would be showing error (or rather considering the tokens having AC 10 instead).
1575991001
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The official sheet is filled with parallel attributes that make simple tasks like this very difficult. My assumption is that it makes data entry easier for the compendiums. NPC sheets require no real calculation with this method and can blindly accept whatever value is given. This does make some sense  given that he designers of the game occasionally use arbitrary values. The Shaped Sheet accomplishes this somehow, so it must be possible. In the meantime, without looking at your macro, you could try something like this whenever calling for AC: [[ceil(@{target|ac}),@{target|npc_ac}]] The square brackets make it an inline roll, so you can use it in a larger macro. The ceil() function causes it to pick the higher of two values listed. Generally, if one is at default, the higher value is correct. Very few things have an AC less than 10 (the default). I've only done a little bit of testing, so you may want to try it out on several sample tokens.
Ah, thanks for the insight. I'll try using it with the one i have and see if that can answer the need.
1576001636

Edited 1576001859
I tried it, and it seems that this macro would work on NPCs using this format: [[ {ceil(@{target|ac}), @{target|npc_ac}}kh1 ]] But i also found out, that for sheets that never toggled into NPC and has any value in the AC form, it would produce error message either. It worked for the NPCs because the value was found (the abilities already mirroring the NPC ones).
Now if only the NPC style sheets produce auto fill AC like the PC style ones, this macro would work beautifully.
1576002513
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try including "& {noerror}" after the rest of the macro code, but part of the same command. That should suppress error warnings. Also, if you are using "kh1", the ceil() command is probably superfluous.
I tried that, and turned out without the "kh1", the result would be addition value of the two. While with the "kh1", the value turns out right by choosing the higher one. The "& {noerror}" only suppresses the warning, but still not showing result due to no value found. Is there any command to disregard no value?
1576005191

Edited 1576005227
OK, i tried it again just in case. Here's the result (something seems to have changed): 1. Using "[[ceil(@{target|ac}),@{target|npc_ac}]]" now works on PC token without NPC AC value. But when i targeted NPC token, it chooses the first value and disregarding the second value (npc_ac). 2. If i try to switch the values, becoming "[[ceil(@{target|npc_ac}),@{target|ac}]]" it now works on the NPC token, but on the PC token it shows error message. I still don't know where to put the "& {noerror}" in the macro because it seems to be not working.
1576006183
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'll have to do testing later for the roll functionality. And no, I don't think you can suppress no value found. Things like this are what make the Roll20 sheet needlessly difficult for the user.
Thanks for your help anyway, i did learn some things about macro today :)