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

Can't Call Upon Powercard Macro From Global Macros - Works Fine From Abilities Tab?

Hi, I've just started messing around with Powercards today and have had luck creating a Powercard that lists a character's actions in text as a group of pink action buttons. I also followed a tutorial on Youtube that helped me to create a Macro/Powercard for a Fire Bolt spell.  (Souped Up Macros Tutorial) . I want it to work like this: I click the pink action button for "Fire Bolt" and instead of it rolling from the character sheet like it usually does, I'd like it to run my Fire Bolt macro which utilizes the Powercard format. According to the Powercards Wiki page I can use  --ogl_pc_attack_list &  action_$0_macro in the character sheet attributes to call upon a macro. However.. When I do this for the Fire Bolt macro I've created I get the error " TypeError: Cannot read property 'substring' of undefined". I have the exact same Fire Bolt macro working perfectly as an Ability on my Wizard's character sheet. The issue only occurs when I call it from the Global Macros. Tried renaming it too, to no avail. I can have the action_$0_macro function call up an Initiative macro from my global macro no problems! Seems as though it only spits out an error when I call upon a macro using Powercards.. Any idea whats going on here? Firebolt Macro in question... !power {{  --name|Fire Bolt  --Caster:|@{selected|character_name}  --format|bigbad  --leftsub|Ranged Spell Attack  --rightsub|120 ft Range  --Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{spell_attack_bonus} ]] vs AC @{target|AC}  --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? Damage:|[[ [$Dmg] 1d10 ]] Fire damage!  --?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d10 ]]  --Target:|@{target|token_name}  --vfx_opt|@{target|token_id} burst-fire  --soundfx|_audio,play,nomenu|Firebolt  --?? $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   }}
1615886397
Ziechael
Forum Champion
Sheet Author
API Scripter
When using a macro as part of the collections tab you need to tell it who to take attributes from, your @{target calls are fine as they prompt the user but all of the others will need to either be @{selected|... or @{<charactername>|... or even @{target|player|... and then update the other target ones to be @{target|target|...
Ziechael said: When using a macro as part of the collections tab you need to tell it who to take attributes from, your @{target calls are fine as they prompt the user but all of the others will need to either be @{selected|... or @{<charactername>|... or even @{target|player|... and then update the other target ones to be @{target|target|... Thank you so much! That fixed it for me! Now I understand why it wasn't working... I changed  @{spell_attack_bonus} to @{ selected |spell_attack_bonus} and now it works perfectly!!
1615972763
Ziechael
Forum Champion
Sheet Author
API Scripter
Awesome, glad you got it working :) Happy rolling!