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

Alterbars help to fix an issue

If the token ID has a _ or - the api says its not a valid id. Can anyone help fix this I don't think sky is around anymore.
1512842388
The Aaron
Pro
API Scripter
If you link to the latest version of the script I can maybe figure out a fix for it.
<a href="https://gist.github.com/Sky-Captain-13/a503c359146" rel="nofollow">https://gist.github.com/Sky-Captain-13/a503c359146</a>...
1512855824
The Aaron
Pro
API Scripter
What's the command you're running?&nbsp; Can you PM me an invite, will be easier to debug in your game where you are seeing this issue with tokens you know have the right sorts of ids.
Thanks if your around today and have some time i have an example setup I will send you a private message for invite to my game an discord if you have it.
Here is an example of a Power Card with Alterbars that errors if the token has a - or _ in it. !power {{ --titlefontshadow|none --tokenid|@{selected|token_id} --format|atwill --corners|10 --name|Darius --leftsub|Melee Attack --rightsub|Greataxe --Range| 5' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target||npc_ac}]] --?? $Atk &lt; @{target||npc_ac} ?? !Missed|**You missed!** --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? Hit:|[[ [$Dmg] 1d12 + [[@{selected|strength_mod}]] ]] strength damage --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|3 _amount|-[^Dmg]/2 _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d12+[[@{selected|dexterity_mod}]] ]] piercing damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|3 _amount|-[^CritDmg]/2 _show|all --?? $Atk.base == 1 ?? !|**Fumble:** }}
Theodore S. said: Here is an example of a Power Card with Alterbars that errors if the token has a - or _ in it. !power {{ --titlefontshadow|none --tokenid|@{selected|token_id} --format|atwill --corners|10 --name|Darius --leftsub|Melee Attack --rightsub|Greataxe --Range| 5' --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]] | Advantage, 2d20KH1 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]] | Disadvantage, 2d20KL1 + [[@{selected|strength_mod}]] [STR] + [[@{selected|pb}]] [PROF]]} ]] vs **AC** [[@{target||npc_ac}]] --?? $Atk &lt; @{target||npc_ac} ?? !Missed|**You missed!** --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? Hit:|[[ [$Dmg] 1d12 + [[@{selected|strength_mod}]] ]] strength damage --?? $Atk &gt;= @{target||npc_ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|3 _amount|-[^Dmg]/2 _show|all --?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d12+[[@{selected|dexterity_mod}]] ]] piercing damage --?? $Atk.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|3 _amount|-[^CritDmg]/2 _show|all --?? $Atk.base == 1 ?? !|**Fumble:** }} Its not the macro its the API and the target-ID having a _ or - . Sky is working on a fix thanks to The Aaron and thanks to Sky for the script.
1513006200

Edited 1513006934
The Aaron
Pro
API Scripter
Here's the fixed version of PowerCards:&nbsp; &nbsp; <a href="https://gist.github.com/Sky-Captain-13/452330a3d926b32da49c" rel="nofollow">https://gist.github.com/Sky-Captain-13/452330a3d926b32da49c</a> I'll update the PowerCards Thread as well. There.. ready....
Is this a power card issue? or Alterbar?
1513024947
The Aaron
Pro
API Scripter
Powercard.&nbsp; It has to do with how it preprocessed the arguments and passed them on to alter bars.
Awesome, your the best thanks so much for helping get this done.
1513026032
The Aaron
Pro
API Scripter
No worries. Mostly Sky at work. =D&nbsp; I'm just the intermediary.&nbsp;&nbsp;
In Alter Bar, is there any way for it to reduce the max value (ie, bar1_max)?