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 .
×

Need debug help on tiny piece of code.

Hi there. I am not a programmer yet I feel ashamed cos I cannot figure this one out. I have two powercard attacks (using alterbar ) on a character. The first one below crashes the API.. The second doesn't. And I can't find out why. [CRASH ONE] !power {{ --name|@{selected|token_name}'s shortbow   -- leftsub|Ranged (piercing)   -- rightsub|80/320   -- Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|dexterity_mod} [Dexterity] + {selected|PB}]] vs AC @{target|AC}   --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? Damage:|[[ [$Dmg] 1d6+ @{selected|dexterity_mod} ]]   --?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d6+ @{selected|dexterity_mod} ]]   --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all   --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] _show|all }} [NOT CRASH ONE] !power {{ --name|@{selected|token_name}'s dagger  -- leftsub|Melee attack (piercing)   --rightsub|5 ft range -- Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|Dexterity_mod} [Dexterity] + @{selected|PB}]] vs AC @{target|AC}  --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? Damage:|[[ [$Dmg] 1d4+@{selected|dexterity_mod} ]]   --?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d6+@{selected|dexterity_mod} ]]  --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all  --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] _show|all }} Can someone pls pls pls help me with this one. //Tekk
1612100595
Kurt J.
Pro
API Scripter
In your first macro, on this line:  -- Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{selected|dexterity_mod} [Dexterity] + {selected|PB} ]] vs AC @{target|AC}  the @ is missing in front of {selected|PB}, meaning that the actual text {selected|PB} is trying to be evaluated instead of the value of the attribute.
Ahaa!! Many many thanks!!!