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

D&D 3.5 Character Sheet with Power Cards api...

I'm trying to enhance the game experience for my players using some extra api's.  The first one I'm doing is a simple token action for an ranged attack.  I've got this much working... !power {{  --name|Light Crossbow  --leftsub|Masterwork  --rightsub|50' Range  --Attack:|[[ [$ATK] 1d20 + @{bab}[BAB] + @{dex-mod}[DEX] + @{sizemodrab}[Size] + 1[Masterwork] ]] }} That part works perfectly.  I'm trying to incorporate conditional statements in it like if the $ATK roll is greater than the AC of the target roll damage.  If it's less than the target's AC display a message that "You missed!" I know the syntax of an if/then statement.  That's not the problem.  My problem is I cannot seem to read the AC of the Target. If I enter @{target|armorclass} I get an error.  When you hover over the AC in the sheet it clearly shows the name as armorclass.  I've tried to define an Attribute in the sheet since there isn't one by default (of course why would there be when you have armorclass already defined) but that isn't working either. Again, my issue isn't with Power Cards it's getting the info out of the Character sheet which should be the easy part.
1668361808

Edited 1668362119
The issue is that the "armorclass" attribute is a calculated value. If you wrap it like this "[[ @{Selected|armorclass} ]]" (without the quotes) it should be converted to a number and work fine. You can test it by selecting a map token linked to a character sheet and typing "@{Selected|armorclass}" (without the quotes) and you'll see what I mean. For example, I get this: (10+((0 (0) +0 (0) +0 0 +0 0 +0 0 +0 0))+(1 (ceil(((ceil((2 -20 (100-99 0))/10000000000) 20 - floor((2 -20 (100-99 0)-1)/10000000000) 2 )-floor(abs(9/(0.1))))/10000000000) floor(abs(9/(0.1))) - floor(((ceil((2 -20 (100-99 0))/10000000000) 20 - floor((2 -20 (100-99 0)-1)/10000000000) 2 )-floor(abs(9/(0.1)))-1)/10000000000) (ceil((2 -20 (100-99 0))/10000000000) 20 - floor((2 -20 (100-99 0)-1)/10000000000) 2 )) +0 (0 (ceil(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1))))/10000000000) floor(abs(9/(0.1))) - floor(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1)))-1)/10000000000) (ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )) + (1-0) 0) +0 (0 (ceil(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1))))/10000000000) floor(abs(9/(0.1))) - floor(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1)))-1)/10000000000) (ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )) + (1-0) 0) +0 (0 (ceil(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1))))/10000000000) floor(abs(9/(0.1))) - floor(((ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )-floor(abs(9/(0.1)))-1)/10000000000) (ceil((0 -20 (100-99 0))/10000000000) 20 - floor((0 -20 (100-99 0)-1)/10000000000) 0 )) + (1-0) 0))+-2+(1 0 +0 0 +0 0 +0 0)+(1 0 +1 +10 +0 0 +0 0)+(1 0 +0 0 +0 0 +0 0)+(1 1 0 1 +0 1 0 +0 1 0 +0 1 0 +0 1 0 +0 1*0))
Yes!  That's what I was getting.  OMG!  Thank you so much for helping with this.
That solved it.  You're my savior!
Very glad to have been of help, good luck with your macros! :-)