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

Pulling AC from selected Monster tokens

I am trying to work on a macro that will let me roll a basic attack against a selected monster token and report the roll result and the AC of the selected monster. I have found a bad way of doing it, using @{target|bar2} and manually adding the monster ac to the bar2 of its token. The issue with this is it means I would need to manually add the npc_ac attribute to bar2 for every single token. Is there a way to pull the monster's AC just by selecting them? I've seen  @{target|AC} tossed around in very old posts, but every time I try it the system cannot read it.  TypeError: Cannot read properties of undefined (reading 'AC') I am using 2024 D&D 5e character sheets. 
Derfy said: I am using 2024 D&D 5e character sheets.  There's your problem. The @{target|ac} (without capitalization) should work for both player and npc sheets with 2024 sheets (2014 npc sheets use the @{npc_ac} attribute instead), but the 2024 sheet is needlessly finicky and you can't really expect macros to just work with it. The macro bar, for instance, is still broken months after I reported it.
1735719815

Edited 1735719867
Derfy
Plus
"The macro bar, for instance, is still broken months after I reported it." Is that why these arent working for me from macro bar or token action bar? They work just fine from the advanced tools page. /fx missile-fire @{selected|token_id} &{template:default} {{name=@{selected|character_name} is shooting a Firebolt at @{target|token_name}}}  {{Attack:=[[1d20]] vs AC @{target|bar2}}} {{Damage:=[[d8]]}} /fx glow-slime @{target|token_id} &{template:default} {{name=@{target|token_name} is healed for [[2d8+3]] by Elf McWarlock}}