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 .
×
Advertisement Create a free account

power card scripting

1618950983
i made a card up for guiding bolt and it works pretty good aside from i can't get the vfx to work or work right for some strange reason and i would like to know if theres a way to creat a pop up window to select spell level apon cast like i have set up for advantage ?    heres the script i have  !power {{  --emote|@{selected|token_name} shoots a bolt of light at @{target|token_name}  --name|Guiding Bolt  --leftsub|ranged spell attack  --rightsub|120 ft range  --attack| [[ [$atk] ?{attack|standard,1d20|advantage,2d20kh1|disadvantage,2d20hl1}+6 ]] vs @{target|AC}  --?? $atk >= @{target|AC} and $atk.base <> 20 ?? damage:| [[ [$dmg] 4d6 ]]  --?? $atk.base == 20 ?? Critical Hit|[[ [$critdmg] 8d6 ]]  --?? $atk < @{target|AC} ??Miss| [[ 1t[taunts] ]]  --soundfx|_audio,play,nomenu|laser  --vfx_opt|@{selected|token_id} @{target|token_id} Beam-Holy  --?? $atk >= @{target|AC} ?? advantage|next attack has advantage  --?? $atk >= @{target|AC} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|archery-target  --?? :$atk >= @{target|AC} ?? api_act|-1 1 _advantage  --?? $atk >= @{target|AC} and $atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^dmg] _show|all  --?? $atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^critdmg] _show|all }} if anyone has any ideas they would be welcome
Just a quick question. Are you testing it on the page with the player tab on it?
1618965998
yes and no   one game i'm the gm the other i'm a player but using the same scripts i wrote
1619054927

Edited 1619055258
the easiest way to change it would be to have another query for the damage. replace 4d6 with (3 + ?{Spell Level|1|2|3|4|5|6|7|8|9})d6 for crit you can just add another parenthesis and double it before it gets rolled (2*(3 + ?{Spell Level|1|2|3|4|5|6|7|8|9}))d6 you should probably label what level the spell was cast at somewhere in the macro. i like to use either rightsub or leftsub and have something like this --rightsub|Level ?{Spell Level|1|2|3|4|5|6|7|8|9} its important to keep the same query and dont change it. if the same query appears multiple times in a macro, it will only pop up once for the player, but if you change it at all, there will be multiple pop ups and you dont want to make a messy macro. also, i usually dont let the macro alter the hp of tokens because its impossible to tell if the enemy is resistant or vulnerable to that damage type. i use a separate macro to easily deal damage to NPCs, which can be modified to your liking: !power {{ --tokenid|@{target|token_id} --emote|Target takes ?{Amount} damage --alterbar|_target|@{target|token_id} _bar|1 _amount|-?{Amount} _show|none }}
1619065076
thanks that was exactly what i was looking for, however for some reason it's not seeing the tokens ac anymore it's like its stuck on ten as a default and i one last thing i'm the dm and i wrote a couple of macros for my players including this one and they can't seem to use them   the get to the advantage disadvantage pop up and clicl on that then nothing happens like it doesn't activate      any ideas ?   have guiding bold below !power {{  --emote|@{selected|token_name} shoots a bolt of light at @{target|token_name}  --name|Guiding Bolt  --leftsub|120 ft ranged spell  --rightsub|Level ?{Spell Level|1|2|3|4|5|6|7|8|9}  --attack| [[ [$atk] ?{attack|standard,1d20|advantage,2d20kh1|disadvantage,2d20hl1}+6 ]] vs @{target|AC}  --?? $atk >= @{target|AC} and $atk.base <> 20 ?? damage:| [[ [$dmg] (?{Spell Level|1|2|3|4|5|6|7|8|9})d6 ]]  --?? $atk.base == 20 ?? Critical Hit|[[ [$critdmg] (2*(?{Spell Level|1|2|3|4|5|6|7|8|9}))d6 ]]  --?? $atk < @{target|AC} ??You Miss| [[ 1t[taunts] ]]  --soundfx|_audio,play,nomenu|laser  --vfx_opt|@{selected|token_id} @{target|token_id} Beam-Holy  --?? $atk >= @{target|AC} ?? advantage|next attack has advantage  --?? $atk >= @{target|AC} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|archery-target  --?? $atk >= @{target|AC} ?? api_act|-1 1 _advantage  --?? $atk >= @{target|AC} and $atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^dmg] _show|all  --?? $atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^critdmg] _show|all }} any insight is greatly appreciated
1619065893

Edited 1619094425
timmaugh
Pro
API Scripter
You're using selected tokens and target calls in the same chat command line? Typically if a message includes a targeting command, it doesn't have an array of selected tokens -- that's a Roll20 limitation. That could explain the FX problem, among other things. If that's what you're running into, you can use a second targeting call in place of the @{selected...}, or you can use the SelectManager script to inject a selected token into the powercard macro message virtually. EDIT: Shouldn't post at 1 in the morning. What you're doing should work.That was my mistake.
1619099511
no worries i've done the same my self and the fx   i get explosion of fire not beam of holy for some weird reason