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
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 5)

To me, it would seem like ~C ~J ~L and ~R are detected as the formatting tool to respectively C enter, J ustify, align L eft and align R ight.
Is there anyway to get the PowerCards template to appear first in the chat? I am trying to combine the really cool in-chat token appearance functionality with the 5e Shaped Sheets rolling template, but the Shaped Sheets template always shows up first. I've tried both using macro calls like so %{selected|Power} %{selected|Attack-Lightbringer} and normal functionality like so !power {{ --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|character_name} attacks }} %{-LAog7cWrDX5IilugjHc|repeating_offense_-lb-vrgmtgtc1bai1w5b_roll} These are in the abilities section of the default character options.
Nicolas B. said: To me, it would seem like ~C ~J ~L and ~R are detected as the formatting tool to respectively C enter, J ustify, align L eft and align R ight. If that is the case and those are formatting options, that's fine, but is there a way to circumvent that so I can use my player's Character name? The only reason I ask is my players seem to be having trouble getting a handle on the way the systems function and having them be required to click their character token is an extra step that may cause problems. Yes I'm aware that is a minor thing but I just want to make things easier for my players if I can.
1524911598

Edited 1524913749
Well, we've had the same problem on a game of ours, and the GM simply put a space before the first letter of the name beginning with C, J, L or R.
1524914865
Kurt J.
Pro
API Scripter
Sorry I've been absent for a few days... been very sick. Yes, it does look like the formatting codes are the issue. I'll see if there is a way I can adjust the format string detection to avoid the problem.
1525133613
Kurt J.
Pro
API Scripter
Athena said: Is there anyway to get the PowerCards template to appear first in the chat? I am trying to combine the really cool in-chat token appearance functionality with the 5e Shaped Sheets rolling template, but the Shaped Sheets template always shows up first. I've tried both using macro calls like so %{selected|Power} %{selected|Attack-Lightbringer} and normal functionality like so !power {{ --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|@{selected|character_name} attacks }} %{-LAog7cWrDX5IilugjHc|repeating_offense_-lb-vrgmtgtc1bai1w5b_roll} These are in the abilities section of the default character options. Athena,   I haven't been able to get it to put the emote first, but I think it is because the roll is processed when the whole thing is put into chat, so it actually resolves before PowerCards gets a chance to do anything. It is a weird way to do it, but that appears to be what Roll20 does. It would be possible to essentially duplicate that format inside the power card, though... It would take some customization for different classes of abilities (single damage type vs multiple, etc) but it would certainly be doable without a huge number of variations.
1525134072
Kurt J.
Pro
API Scripter
Russell S. said: Nicolas B. said: To me, it would seem like ~C ~J ~L and ~R are detected as the formatting tool to respectively C enter, J ustify, align L eft and align R ight. If that is the case and those are formatting options, that's fine, but is there a way to circumvent that so I can use my player's Character name? The only reason I ask is my players seem to be having trouble getting a handle on the way the systems function and having them be required to click their character token is an extra step that may cause problems. Yes I'm aware that is a minor thing but I just want to make things easier for my players if I can. Ok, so by the strictest interpretation, PowerCards is correctly interpreting the ~C as center because there are two of them. The third ability comes out OK because there isn't another matching ~C... if there were four abilities, all four would be messed up, but a fifth would be ok. Anyway, there are a couple of ways around this. The simplest would be to split the lines up into their own tags: --Attack:*1| [@{Craigor|repeating_attack_$0_atkname}](~Craigor|repeating_attack_$0_attack) --Attack:*2| [@{Craigor|repeating_attack_$1_atkname}](~Craigor|repeating_attack_$1_attack) --Attack:*3| [@{Craigor|repeating_attack_$2_atkname}](~Craigor|repeating_attack_$2_attack) This will avoid the problem because there is only a single ~C in each tag. The second alternative would be to use Character IDs instead of names. If you select Craigor and enter "@{selected|character_id}" into chat, the returned string is Craigor's character ID. It can be used in place of "Craigor" in the content string and will act identically. Finally, 3.7.3 (which isn't uploaded anywhere yet) will include an --ogl_pc_attack_list tag which will generate this list of buttons for you automatically using character IDs. I've actually got a few updates to these convenience functions in 3.7.3, but I want to test it in my Thursday night game before I push it to the GIST.
Awesome, thanks a lot Kurt, I'll adjust this for now. Can't wait for the attacks listing function, will make things smooth and easy.
Hi, (already sorry for my bad english) i've recently upgrade to PRO and i wanna try some API. i'll use this powercard but i have some truble. !power {{ --name|Execution --leftsub|@{target|token_name} --Attack:|[[ [$Atk] 1D21CS>19+13+@{selected|Atk}]] vs @{target|CA} CA --?? $Atk.base == 1 OR $Atk <= @{target|CA} ?? !Missed|**You missed!** --?? $Atk.base == 1 OR $Atk >= @{target|CA} AND $Atk.base <= 18 ?? soundfx1|_play|Sword --?? $Atk >= @{target|CA} AND $Atk.base <= 18 ?? Hit:|[[ [$Dmg] 2D8+ 1D10 +17+@{selected|Deg}+(10*?{Rage|0})]] damage --?? $Atk >= @{target|CA} AND $Atk.base <= 18 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] --?? $Atk.base >= 19 ?? Critical Hit:|[[ [$CritDmg] 4D8+2D10+34+(2*@{selected|Deg})+(20*?{Rage|0})]] damage --?? $Atk.base >= 19 ?? alterbar12|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] }} /fx splatter-blood @{target|token_id} @{selected|token_id} !attrib Rage|[[@{selected|Rage}-(?{Rage|0})]] -- @{selected|token_id} this is work some good but "(20*?{Rage|0})" (and other x*y) doesn't work and not calculate:/ There is a otehr way than my option "+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}...." i have a second question but dunno if i'm at good place, maybe you can help me ;) i wanna change attribut for all char but actually i'll only can do with @{target} !attrib Atk|[[@{selected|Atk}+6]] -- @{selected|token_id} !attrib Atk|[[@{Ahlu|Atk}+6]] -- @{target|Ahlu|token_id} !attrib Atk|[[@{Axis|Atk}+6]] -- @{target|Axis|token_id} !attrib Atk|[[@{Tasheki|Atk}+6]] -- @{target|Tasheki|token_id} !attrib Atk|[[@{Victoria|Atk}+6]] -- @{target|Victoria|token_id} !attrib Atk|[[@{Dakeyras|Atk}+6]] -- @{target|Dakeyras|token_id} i'll need to click on all my char in right way and it's busy ^^ i'll try to match a token_id or chararcter_id but never find a good way :( Help me plizzz (sorry again for my english, et si vous voulez/pouvez répondre en français ça m'arrange un peu ^^) Thx for this stuff !
1525215229
Kurt J.
Pro
API Scripter
Broody said: Hi, (already sorry for my bad english) i've recently upgrade to PRO and i wanna try some API. i'll use this powercard but i have some truble. !power {{ --name|Execution --leftsub|@{target|token_name} --Attack:|[[ [$Atk] 1D21CS>19+13+@{selected|Atk}]] vs @{target|CA} CA --?? $Atk.base == 1 OR $Atk <= @{target|CA} ?? !Missed|**You missed!** --?? $Atk.base == 1 OR $Atk >= @{target|CA} AND $Atk.base <= 18 ?? soundfx1|_play|Sword --?? $Atk >= @{target|CA} AND $Atk.base <= 18 ?? Hit:|[[ [$Dmg] 2D8+ 1D10 +17+@{selected|Deg}+(10*?{Rage|0})]] damage --?? $Atk >= @{target|CA} AND $Atk.base <= 18 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] --?? $Atk.base >= 19 ?? Critical Hit:|[[ [$CritDmg] 4D8+2D10+34+(2*@{selected|Deg})+(20*?{Rage|0})]] damage --?? $Atk.base >= 19 ?? alterbar12|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] }} /fx splatter-blood @{target|token_id} @{selected|token_id} !attrib Rage|[[@{selected|Rage}-(?{Rage|0})]] -- @{selected|token_id} this is work some good but "(20*?{Rage|0})" (and other x*y) doesn't work and not calculate:/ There is a otehr way than my option "+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}+?{Rage|0}...." i have a second question but dunno if i'm at good place, maybe you can help me ;) i wanna change attribut for all char but actually i'll only can do with @{target} !attrib Atk|[[@{selected|Atk}+6]] -- @{selected|token_id} !attrib Atk|[[@{Ahlu|Atk}+6]] -- @{target|Ahlu|token_id} !attrib Atk|[[@{Axis|Atk}+6]] -- @{target|Axis|token_id} !attrib Atk|[[@{Tasheki|Atk}+6]] -- @{target|Tasheki|token_id} !attrib Atk|[[@{Victoria|Atk}+6]] -- @{target|Victoria|token_id} !attrib Atk|[[@{Dakeyras|Atk}+6]] -- @{target|Dakeyras|token_id} i'll need to click on all my char in right way and it's busy ^^ i'll try to match a token_id or chararcter_id but never find a good way :( Help me plizzz (sorry again for my english, et si vous voulez/pouvez répondre en français ça m'arrange un peu ^^) Thx for this stuff ! You might be able to do:   + ?{Rage|0} which will pop up a "Rage" box defaulting to zero. You can then enter 20 there an bypass doing the 20 x result. For updating attributes on tokens, check out the chatsetattr API script, but I'm not sure what you are trying to do.
1525244678

Edited 1525473108
Nevermind, my power card work as well (my bad ^^)  thx for answer
1525639942

Edited 1525650268
Kurt J.
Pro
API Scripter
Version 3.7.3 is on the Development GIST I've updated the development gist with version 3.7.3. The biggest change in this version is an update to --npc_action_list and --npc_legendaryaction_list. They should not change the behavior of existing PowerCards (ok, they do a little... They now include their own header, so if you have an existing header line it can be removed and the whole section will be hidden if the block is empty), but they have some additional features if you set some attributes on your character sheets. When these two tags create their buttons, they will look for attributes that match the repeating action numbers for their actions (ie, "action_$0_macro" or "action-l_$2_macro" (the -l is for legendary actions). If a matching attribute exists, one of two things will happen: - If the value of the attribute is "NONE", the button won't be created. - Otherwise the value will be used as the "command" the button executes instead of the standard OGL action. This can be a macro reference by including the # as the first character. So, what does this mean? In my own game, I have some generic macros to parse and execute actions in the $0, $1, $2, $3, and $4 action slots. I've got a few variations on them (some that do two damage types, some that handle multi-attacks, etc). For example, I have a macro called #card-atk0 that will produce a PowerCard for the attack in NPC repeating action slot 0 if it is a single-damage type action. For my zombie, which has a simple "Slam" attack as repeating action $0 that fits nicely with the #card-atk0 macro, I can set an attribute of "action_$0_macro" equal to "#card-atk0" and the button that --npc_action_list produces will use that macro instead of the default OGL attack template. There is one caveat here : there is a bug in the way Roll20 handles repeating actions on NPC after they have been rearranged on the character sheet that causes them to appear in the wrong order. This will throw things off for the --npc_action_list tag (even before these changes), so I avoid rearranging NPC actions whenever I can. --ogl_pc_attack_list is also in, and does essentially the same thing for PC attacks. No attribute-based filtering on this one yet, but that is coming :)
So I was told to ask around in here for help on a script.  What I want to do is simply use the success function in a roll template or power card for roll20 to calculate whether or not an attack hits, or crits and display different information concisely depending on the result. Basically, it's a d100 system, so if 1d100>45 results in a failure or "0" then it should show up as this in the chat: "<attacker> attacks with <weapon> but misses <target>!" If the attack is a success, it should also check for a crit with a second roll (based off of a different success variable).  If it was a successful hit, but not a crit it should show up as: "<attacker> attacks with <weapon> and deals <x> damage to <target>!" And finally if the attack was a hit, and was a crit (both values resulting in 1) then it should show up as this: "<attacker> attacks with <weapon> and crits for <x> damage to <target>!"
1525648392
Kurt J.
Pro
API Scripter
Black.k.9 said: So I was told to ask around in here for help on a script.  What I want to do is simply use the success function in a roll template or power card for roll20 to calculate whether or not an attack hits, or crits and display different information concisely depending on the result. Basically, it's a d100 system, so if 1d100>45 results in a failure or "0" then it should show up as this in the chat: "<attacker> attacks with <weapon> but misses <target>!" If the attack is a success, it should also check for a crit with a second roll (based off of a different success variable).  If it was a successful hit, but not a crit it should show up as: "<attacker> attacks with <weapon> and deals <x> damage to <target>!" And finally if the attack was a hit, and was a crit (both values resulting in 1) then it should show up as this: "<attacker> attacks with <weapon> and crits for <x> damage to <target>!" Not knowing the details of what you are using (system-wise), the following PowerCard will do what you are are describing. The "--Rolls" line is for informational purposes, since all of the rolls are made silently. This assumes 1d100 to hit, 45 or higher needed, 1d100 for crit, 70 or higher for that, and 1d10 for normal damage or 2d10 for crit damage: !power {{ --name|@{selected|character_name} attacks... --hroll|[[ [$Atk] 1d100 ]] [[ [$Crit] 1d100 ]] [[ [$Dmg] 1d10 ]] [[ [$CDmg] 1d10 + 1d10 ]] --Rolls|FYI, rolls were Atk: [^Atk], Crit: [^Crit], Dmg: [^Dmg], CDmg: [^CDmg] --?? $Atk < 45 ?? Miss|@{selected|character_name} attacks @{target|character_name} but misses! --?? $Atk > 45 AND $Crit < 70 ?? Hit|@{selected|character_name} attacks @{target|character_name} and hits for [^Dmg] damage. --?? $Atk > 45 AND $Crit >= 70 ?? Critical|@{selected|character_name} attacks @{target|character_name} and crits for [^CDmg] damage. }}
Kurt J. said: Black.k.9 said: So I was told to ask around in here for help on a script.  What I want to do is simply use the success function in a roll template or power card for roll20 to calculate whether or not an attack hits, or crits and display different information concisely depending on the result. Basically, it's a d100 system, so if 1d100>45 results in a failure or "0" then it should show up as this in the chat: "<attacker> attacks with <weapon> but misses <target>!" If the attack is a success, it should also check for a crit with a second roll (based off of a different success variable).  If it was a successful hit, but not a crit it should show up as: "<attacker> attacks with <weapon> and deals <x> damage to <target>!" And finally if the attack was a hit, and was a crit (both values resulting in 1) then it should show up as this: "<attacker> attacks with <weapon> and crits for <x> damage to <target>!" Not knowing the details of what you are using (system-wise), the following PowerCard will do what you are are describing. The "--Rolls" line is for informational purposes, since all of the rolls are made silently. This assumes 1d100 to hit, 45 or higher needed, 1d100 for crit, 70 or higher for that, and 1d10 for normal damage or 2d10 for crit damage: !power {{ --name|@{selected|character_name} attacks... --hroll|[[ [$Atk] 1d100 ]] [[ [$Crit] 1d100 ]] [[ [$Dmg] 1d10 ]] [[ [$CDmg] 1d10 + 1d10 ]] --Rolls|FYI, rolls were Atk: [^Atk], Crit: [^Crit], Dmg: [^Dmg], CDmg: [^CDmg] --?? $Atk < 45 ?? Miss|@{selected|character_name} attacks @{target|character_name} but misses! --?? $Atk > 45 AND $Crit < 70 ?? Hit|@{selected|character_name} attacks @{target|character_name} and hits for [^Dmg] damage. --?? $Atk > 45 AND $Crit >= 70 ?? Critical|@{selected|character_name} attacks @{target|character_name} and crits for [^CDmg] damage. }} Well the system I'm attempting to replicate is Fire emblem.  The to-hit variable is actually based off of the target you are attacking and the stats you have.  This is a good start and I'll be able to start working with this. It'll be quite a bit more complex than simple dice rolls as the only random die roll done is d100.  Everything else is based off of the stats of the Attacker and the Stats of the Defender.  Thank you very much!
Kurt J. said: Black.k.9 said: So I was told to ask around in here for help on a script.  What I want to do is simply use the success function in a roll template or power card for roll20 to calculate whether or not an attack hits, or crits and display different information concisely depending on the result. Basically, it's a d100 system, so if 1d100>45 results in a failure or "0" then it should show up as this in the chat: "<attacker> attacks with <weapon> but misses <target>!" If the attack is a success, it should also check for a crit with a second roll (based off of a different success variable).  If it was a successful hit, but not a crit it should show up as: "<attacker> attacks with <weapon> and deals <x> damage to <target>!" And finally if the attack was a hit, and was a crit (both values resulting in 1) then it should show up as this: "<attacker> attacks with <weapon> and crits for <x> damage to <target>!" Not knowing the details of what you are using (system-wise), the following PowerCard will do what you are are describing. The "--Rolls" line is for informational purposes, since all of the rolls are made silently. This assumes 1d100 to hit, 45 or higher needed, 1d100 for crit, 70 or higher for that, and 1d10 for normal damage or 2d10 for crit damage: !power {{ --name|@{selected|character_name} attacks... --hroll|[[ [$Atk] 1d100 ]] [[ [$Crit] 1d100 ]] [[ [$Dmg] 1d10 ]] [[ [$CDmg] 1d10 + 1d10 ]] --Rolls|FYI, rolls were Atk: [^Atk], Crit: [^Crit], Dmg: [^Dmg], CDmg: [^CDmg] --?? $Atk < 45 ?? Miss|@{selected|character_name} attacks @{target|character_name} but misses! --?? $Atk > 45 AND $Crit < 70 ?? Hit|@{selected|character_name} attacks @{target|character_name} and hits for [^Dmg] damage. --?? $Atk > 45 AND $Crit >= 70 ?? Critical|@{selected|character_name} attacks @{target|character_name} and crits for [^CDmg] damage. }} Another question I have is... how do I implement the API, or is it already implemented?
I have a script that is somehow changing the value of a variable immediately after setting it. I have played with the output and it shows it occurring on the same line of the script where I'm setting it. Here is the line: --?? [[@{target|is_npc}]] == 1 AND [[@{target|npc_dexterity_save_mod}]] >= [[@{target|npc_strength_save_mod}]] ?? NPC|[[ [$Chk] 1d20 + [[@{target|npc_dexterity_save_mod}]] ]] Dexterity Check ([[@{target|npc_dexterity_save_mod}]] DEX Mod) ([^Chk]) (I have added the output solely so I can see the values - once this is working it will be a hidden roll.) This line will output the following, with the first roll and the value in parenthesis being different every time: As you can see for this example, it is supposed to be setting $Chk to 5, yet when I output the result it gave an 18.  Any ideas why this is happening? By the way, there are no other logic lines after this one, so it can't be bad logic. If you want to see the whole script, here it is: !power {{ --name|Grapple --format|contest --leftsub|Ability Check --rightsub|Contest --target_list|@{target|token_id} --charid|@{selected|character_id} --emote|@{selected|character_name} vs @{target|token_name} --Attack|[[ [$Atk] ?{Attack Type|Standard, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1} + [[@{selected|athletics}]] [Tot Athletics Bonuses] ]] Athletics Check --?? [[@{target|athletics}]] > [[@{target|acrobatics}]] ?? PC|[[ [$Chk] 1d20 + [[@{target|athletics}]] ]] Athletics Check ([[@{target|athletics}]] Total Athletics Bonuses) --?? [[@{target|acrobatics}]] >= [[@{target|athletics}]] ?? PC|[[ [$Chk] 1d20 + [[@{target|acrobatics}]] ]] Acrobatics Check ([[@{target|acrobatics}]] Total Acrobatics Bonuses) --?? [[@{target|is_npc}]] == 1 AND [[@{target|npc_strength_save_mod}]] > [[@{target|npc_dexterity_save_mod}]] ?? NPC|[[ [$Chk] 1d20 + [[@{target|npc_strength_save_mod}]] ]] Strength Check ([[@{target|npc_strength_save_mod}]] STR Mod) --?? [[@{target|is_npc}]] == 1 AND [[@{target|npc_dexterity_save_mod}]] >= [[@{target|npc_strength_save_mod}]] ?? NPC|[[ [$Chk] 1d20 + [[@{target|npc_dexterity_save_mod}]] ]] Dexterity Check ([[@{target|npc_dexterity_save_mod}]] DEX Mod) ([^Chk]) --Result|@{selected|character_name} ([^Atk]) vs @{target|token_name} ([^Chk]) --?? $Atk >= $Chk ?? Success|@{target|token_name} is now grappled! --?? $Atk < $Chk ?? Fail|@{target|token_name} was able to evade your grasp! }} And the complete result is: The PC and NPC lines, as I said above, will be hidden rolls once this bug is worked out. Any insight would be greatly appreciated!
1525727182

Edited 1525728898
Kurt J.
Pro
API Scripter
There are a couple of things going on here: First, the two conditional lines with PC| and the two with NPC| need to use the Same Name tag (PC*1, PC*2, NPC*1, and NPC*2). Duplicating tag names will cause lots of havoc with the way PowerCards evaluates the card. Second, a conditional only determines if the line is displayed or not. The line is still evaluated even if the conditional will end up hiding the line. This means that the last line that is evaluated will set the Roll ID if more than one line set it. Combine this with the internal confusion that will result from duplicated tag names and things will get weird fast. Finally, the whole card is evaluated before the output is created, so you could actually display the value of [^Chk] as the first line of the card, even though it isn't set until later down in the card (and then it is set 4 times - again not accounting for the duplicate tag confusion.) What you could do is make all of the possible rolls and store them in different RollIDs and then use conditionals to only output the relevant roll (ie, roll $ChkPCStr, $ChkPCDex, $ChkNPCStr, and $ChkNPCDex and then use conditionals to decide which one to show.) That will make the conditionals a bit more complicated, but it should allow you to do what you want to do.
1525727224
Kurt J.
Pro
API Scripter
Black.k.9 said: Another question I have is... how do I implement the API, or is it already implemented? PowerCards is available on the API One Click Install page for your game.
Kurt J. said: There are a couple of things going on here: First, the two conditional lines with PC| and the two with NPC| need to use the Same Name tag (PC*1, PC*2, NPC*1, and NPC*2). Duplicating tag names will cause lots of havoc with the way PowerCards evaluates the card. Second, a conditional only determines if the line is displayed or not. The line is still evaluated even if the conditional will end up hiding the line. This means that the last line that is evaluated will set the Roll ID if more than one line set it. Combine this with the internal confusion that will result from duplicated tag names and things will get weird fast. Finally, the whole card is evaluated before the output is created, so you could actually display the value of [^Chk] as the first line of the card, even though it isn't set until later down in the card (and then it is set 4 times - again not accounting for the duplicate tag confusion.) What you could do is make all of the possible rolls and store them in different RollIDs and then use conditionals to only output the relevant roll (ie, roll $ChkPCStr, $ChkPCDex, $ChkNPCStr, and $ChkNPCDex and then use conditionals to decide which one to show.) That will make the conditionals a bit more complicated, but it should allow you to do what you want to do. I changed the PC and NPC lines to be unique now, but it had no effect on the result as I would expect. As far as the rest... I can't find the reference in the forums, but it was my understanding that if a conditional evaluates false then the entire line is skipped. Meaning that any rolls or output for that line are not processed. However, that doesn't even matter since the last conditional line for setting my $Chk variable is the one that evaluates true. No matter how many times $Chk is set previously, that last line will be the one setting it last and that's the value that will be used. Also, it is obvious that the value set the previous time (in the PC line above) doesn't match the later value either. You can see from my example that this is the case, yet the $Chk variable is still showing a different value than when it is set on either line. This is a random, magical value that literally comes out of nowhere! I will give the more complicated version you suggest a go and see what happens.
Ben L. said: Kurt J. said: There are a couple of things going on here: First, the two conditional lines with PC| and the two with NPC| need to use the Same Name tag (PC*1, PC*2, NPC*1, and NPC*2). Duplicating tag names will cause lots of havoc with the way PowerCards evaluates the card. Second, a conditional only determines if the line is displayed or not. The line is still evaluated even if the conditional will end up hiding the line. This means that the last line that is evaluated will set the Roll ID if more than one line set it. Combine this with the internal confusion that will result from duplicated tag names and things will get weird fast. Finally, the whole card is evaluated before the output is created, so you could actually display the value of [^Chk] as the first line of the card, even though it isn't set until later down in the card (and then it is set 4 times - again not accounting for the duplicate tag confusion.) What you could do is make all of the possible rolls and store them in different RollIDs and then use conditionals to only output the relevant roll (ie, roll $ChkPCStr, $ChkPCDex, $ChkNPCStr, and $ChkNPCDex and then use conditionals to decide which one to show.) That will make the conditionals a bit more complicated, but it should allow you to do what you want to do. I changed the PC and NPC lines to be unique now, but it had no effect on the result as I would expect. As far as the rest... I can't find the reference in the forums, but it was my understanding that if a conditional evaluates false then the entire line is skipped. Meaning that any rolls or output for that line are not processed. However, that doesn't even matter since the last conditional line for setting my $Chk variable is the one that evaluates true. No matter how many times $Chk is set previously, that last line will be the one setting it last and that's the value that will be used. Also, it is obvious that the value set the previous time (in the PC line above) doesn't match the later value either. You can see from my example that this is the case, yet the $Chk variable is still showing a different value than when it is set on either line. This is a random, magical value that literally comes out of nowhere! I will give the more complicated version you suggest a go and see what happens. Ok, I got it about as strung out as I can get. There are places where you just have to set a variable twice, but that part was never the problem. The new problem is trying to use the placeholder variables in a roll to get the correct calculation.In every instance where I try to use a previously set variable it just ignores it other than displaying it in the chat. In other words, it doesn't really act like a true variable. Here's the new code: !power {{ --name|Grapple --format|contest --leftsub|Ability Check --rightsub|Contest --target_list|@{target|token_id} --charid|@{selected|character_id} --emote|@{selected|character_name} vs @{target|token_name} --Attack|[[ [$Atk] ?{Attack Type|Standard, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1} + [[@{selected|athletics}]] [Tot Athletics Bonuses] ]] Athletics Check --?? [[@{target|athletics}]] > [[@{target|acrobatics}]] ?? PC1|[[ [$ChkPCAth] 0d0 + [[@{target|athletics}]] ]] Athletics (ChkPCAth [^ChkPCAth] mod) --?? [[@{target|acrobatics}]] >= [[@{target|athletics}]] ?? PC2|[[ [$ChkPCAcr] 0d0 + [[@{target|acrobatics}]] ]] Acrobatics (ChkPCAcr [^ChkPCAcr] mod) --?? [[@{target|npc_strength_save_mod}]] > [[@{target|npc_dexterity_save_mod}]] ?? NPC1|[[ [$ChkNPCStr] 0d0 + [[@{target|npc_strength_save_mod}]] ]] Strength (ChkNPCStr [^ChkNPCStr] mod) --?? [[@{target|npc_dexterity_save_mod}]] >= [[@{target|npc_strength_save_mod}]] ?? NPC2|[[ [$ChkNPCDex] 0d0 + [[@{target|npc_dexterity_save_mod}]] ]] Dexterity (ChkNPCDex [^ChkNPCDex] mod) --SetVar1|[[ [$ChkPC] 0d0 + $ChkPCAth ]] Using PC Athletics (ChkPCAth [^ChkPCAth]) (ChkPC [^ChkPC]) --?? $ChkPCAcr > $ChkPCAth ?? SetVar2|[[ [$ChkPC] 0d0 + $ChkPCAcr ]] Using PC Acrobatics (ChkPCAcr [^ChkPCAcr]) (ChkPC [^ChkPC]) --SetVar3|[[ [$ChkNPC] 0d0 + $ChkNPCStr ]] Using NPC Strength mod (ChkNPCStr [^ChkNPCStr]) (ChkNPC [^ChkNPC]) --?? $ChkNPCDex > $ChkNPCStr ?? SetVar4|[[ [$ChkNPC] 0d0 + $ChkNPCDex ]] Using NPC Dexterity (ChkNPCDex [^ChkNPCDex]) (ChkNPC [^ChkNPC]) --SetVar5|[[ [$Chk] 1d20 + $ChkPC ]] Set result to PC roll value (Chk [^Chk]) (ChkPC[^ChkPC]) --?? [[@{target|is_npc}]] == 1 ?? SetVar6|[[ [$Chk] 1d20 + $ChkNPC ]] Set result to NPC roll value (Chk [^Chk]) (ChkNPC [^ChkNPC]) --Result|@{selected|character_name} (Atk [^Atk]) vs @{target|token_name} (Chk [^Chk]) --?? $Atk >= $Chk ?? Success|@{target|token_name} is now grappled! --?? $Atk < $Chk ?? Fail|@{target|token_name} was able to evade your grasp! }} I have tried using ^VarName, [^VarName], ($VarName) and [[$VarName]], the last of which broke the code. I have also tried using the .base and .total suffixes hoping that would force an evaluation. No dice. As you can see from the screenshot below, Those variables hold the information, but when you try to include them in setting another variable they seem to equal 0 or nothing at all. (Screenshot shows results before the last couple of lines the the code above were added BTW.) So, in trying to circumvent the previous problem I have discovered another. I can't believe I'm the first one to try and use these variables in this way, so where is the solution to this? I'm completely stumped!
1525743288
Kurt J.
Pro
API Scripter
Ben L. said: So, in trying to circumvent the previous problem I have discovered another. I can't believe I'm the first one to try and use these variables in this way, so where is the solution to this? I'm completely stumped! It is important to keep in mind that Roll IDs are NOT variables... When a card is processed, each tag's rolls are computed and stored in Roll IDs early on in the process before much else happens, and existing RollIDs in a roll are not parsed (they will just be treated as extraneous text). Roll IDs only have two uses: comparing in conditionals and outputting their values when the card is displayed. You can't include a Roll ID as a value in another roll because they aren't defined at the point the rolls are calculated. (I know this is something people are interested in being able to do, but I would need to do a lot of code examination and testing before I'd be comfortable saying that it will work properly). When I say make all of the rolls ahead of time, I mean leave off all of the conditionals for the rolls... You can drop a $ in front of the tags after you've got it working to hide the line completely. Roll as if it is a PC using Strength and store it, then as a PC using Dex and store that, etc. You end up with four Roll IDs that you can then check conditionals against, so: IF target is a PC AND target str > target dex AND AttackRoll >= ChkPCStr show success message IF target is a PC AND target str > target dex AND AttackRoll < ChkPCStr show failure message IF target is a PC AND target str < target dex AND AttackRoll >= ChkPCDex show success message IF target is a PC AND target str < target dex AND AttackRoll < ChkPCDex show failure message etc...
Kurt J. said: Ben L. said: So, in trying to circumvent the previous problem I have discovered another. I can't believe I'm the first one to try and use these variables in this way, so where is the solution to this? I'm completely stumped! It is important to keep in mind that Roll IDs are NOT variables... When a card is processed, each tag's rolls are computed and stored in Roll IDs early on in the process before much else happens, and existing RollIDs in a roll are not parsed (they will just be treated as extraneous text). Roll IDs only have two uses: comparing in conditionals and outputting their values when the card is displayed. You can't include a Roll ID as a value in another roll because they aren't defined at the point the rolls are calculated. (I know this is something people are interested in being able to do, but I would need to do a lot of code examination and testing before I'd be comfortable saying that it will work properly). When I say make all of the rolls ahead of time, I mean leave off all of the conditionals for the rolls... You can drop a $ in front of the tags after you've got it working to hide the line completely. Roll as if it is a PC using Strength and store it, then as a PC using Dex and store that, etc. You end up with four Roll IDs that you can then check conditionals against, so: IF target is a PC AND target str > target dex AND AttackRoll >= ChkPCStr show success message IF target is a PC AND target str > target dex AND AttackRoll < ChkPCStr show failure message IF target is a PC AND target str < target dex AND AttackRoll >= ChkPCDex show success message IF target is a PC AND target str < target dex AND AttackRoll < ChkPCDex show failure message etc... Yeah, I guess I figured that out without realizing it. My script worked once I gave up making it work for both NPCs and PCs. That eliminated the chance of getting 2 conditionals to be true. Thanks for the clarification!
Is there a way to whisper to multiple players and/or the GM? I thought I saw a thread saying it was possible, but not only does a direct search turn up nothing, but my attempts to make it work fail miserably. I'm just trying to have a a basic skills check that whispers to the GM but the actual player can't see the result. If I try to add them to the whisper command I get no output at all for anyone. I've tried using --whisper|self,GM and --whisper|@{selected|character_name},GM but neither one works. Any thoughts?
1525851898

Edited 1525851944
I'm not 100% sure how to even Implement the power cards script.  I've posted what I need to do, but am completely at a lost as to how to get it to work.  I'm completely a first timer. I'm an idiot when it comes to doing this kind of stuff.  I can easily write HTML character sheets and program macros fairly well, but when it comes to this stuff I'm completely high and dry.  Like I don't even know where to begin, or even where to type out the scripting text.
1525869017
Kurt J.
Pro
API Scripter
Black.k.9 said: I'm not 100% sure how to even Implement the power cards script.  I've posted what I need to do, but am completely at a lost as to how to get it to work.  I'm completely a first timer. I'm an idiot when it comes to doing this kind of stuff.  I can easily write HTML character sheets and program macros fairly well, but when it comes to this stuff I'm completely high and dry.  Like I don't even know where to begin, or even where to type out the scripting text. You'll want to either enter it into a macro on the macro's tab or into an ability on a character sheet. In both cases, they can be marked as Token Actions, meaning they will show a button at the top of the Roll20 window when a token is selected.
1525869087
Kurt J.
Pro
API Scripter
Ben L. said: Is there a way to whisper to multiple players and/or the GM? I thought I saw a thread saying it was possible, but not only does a direct search turn up nothing, but my attempts to make it work fail miserably. I'm just trying to have a a basic skills check that whispers to the GM but the actual player can't see the result. If I try to add them to the whisper command I get no output at all for anyone. I've tried using --whisper|self,GM and --whisper|@{selected|character_name},GM but neither one works. Any thoughts? I'll do some experimenting. Reading through the code, the --whisper|self,GM looks like it SHOULD work, but maybe I'm missing something.
I love this script!! Two questions: 1. What's the syntax for --titlefontsize| ? (I can't seem to get numbers to work here) 2. Is there any way to set subtitle colors different from the title color?
1525894152
Kurt J.
Pro
API Scripter
Dave Rake said: I love this script!! Two questions: 1. What's the syntax for --titlefontsize| ? (I can't seem to get numbers to work here) 2. Is there any way to set subtitle colors different from the title color? 1 - The default in the code is:   PowerCard.titlefontsize = "1.2em; line-height: 1.2em";   So it would be a CSS specifier. 2 - There is currently not a built-in way to make the subtitle colors different from the title colors. It might be possible, to inject a color CSS specifier into subtitlefont or subtitlevariant to accomplish that. Here is the line that builds the subtitle style: var SubTitleStyle = "" + "font-family: " + PowerCard.subtitlefont + "; " + "font-size: " + PowerCard.subtitlefontsize + "; " + "font-weight: normal; font-style: normal; " + "font-variant: " + PowerCard.subtitlefontvariant + "; " + "letter-spacing: 1px;";
I'm trying to create an easy way to handle barbarian rage in the  DnD 5e character sheet , and I have everything working except for getting a status marker on the token to show the barbarian in rage mode. To avoid any other errors, I've eliminated all processing except for the desired effect here: !power {{ --name|@{selected|classactionname1} --format|skillatt --charid|@{selected|character_id} --emote|@{selected|character_name} --api_token-mod|_ids @{selected|token_id} _set statusmarkers|red --!What|Is there a red token marker? }} This code does nothing to the token. Making the same token-mod call outside of the PowerCards script works as it should, so there is something about how PowerCards is processing the api call to the other script. Ultimately, there will be a conditional on the api_token-mod line to prevent the status marker from being changed if the character has used up their rages for the day, so I can't accomplish what I want outside of PowerCards. Is this a bug, or is there something I'm missing?
1525981086
Kurt J.
Pro
API Scripter
Ben L. said: I'm trying to create an easy way to handle barbarian rage in the  DnD 5e character sheet , and I have everything working except for getting a status marker on the token to show the barbarian in rage mode. To avoid any other errors, I've eliminated all processing except for the desired effect here: !power {{ --name|@{selected|classactionname1} --format|skillatt --charid|@{selected|character_id} --emote|@{selected|character_name} --api_token-mod|_ids @{selected|token_id} _set statusmarkers|red --!What|Is there a red token marker? }} This code does nothing to the token. Making the same token-mod call outside of the PowerCards script works as it should, so there is something about how PowerCards is processing the api call to the other script. Ultimately, there will be a conditional on the api_token-mod line to prevent the status marker from being changed if the character has used up their rages for the day, so I can't accomplish what I want outside of PowerCards. Is this a bug, or is there something I'm missing? I do something very similar in my own macros... I found I needed to include ignore-selected as a parameter to token-mod, though I'm not sure why: --api_token-mod|_ids @{selected|token_id} _ignore-selected _set statusmarkers|stopwatch
Hello kurt. I am trying to get the vfx_opt|@{target|token_id} explosion-slime to work but is not happening. It seems it dont register explosion as a fx. Any intake on this?
1525992597
Kurt J.
Pro
API Scripter
Danny C. said: Hello kurt. I am trying to get the vfx_opt|@{target|token_id} explosion-slime to work but is not happening. It seems it dont register explosion as a fx. Any intake on this? I think it is explode and not explosion, but I'm not somewhere I can test it right now.
updating to the new test version and getting this error.
1526031752
Kurt J.
Pro
API Scripter
Anthony V. said: updating to the new test version and getting this error. I can't duplicate that error... is this from One Click or from the development gist?
Hi guys. I have a little bit of trouble trying to figure out how to make this work. I have a weapon that does 2d10 + 12 damage, but when any dice is equal to 10 I roll another d10.  When is only 1 dice is not a problem as i would just write ?? $Dmg.base == 10 ?? Roll [[1d10]] But now with two dices that have the possibility to roll a 10 I dont know how i would be able to do it as ?? $Dmg.base == 20 ?? Roll [[1d10]] would mean both would need to roll a 10 and is not really that what i am looking for. any help? Danny
Kurt J. said: Anthony V. said: updating to the new test version and getting this error. I can't duplicate that error... is this from One Click or from the development gist? Development gist 
1526089267

Edited 1526089307
Is it possible to recall a number with something like [^Tag1] within another field that's being stored with a [$Tag2]? All I'm getting is a blank spot where [^Tag1] is being output, which screws up the calculations. My setup looks like this (with the rest of the code cut out of course): [[ [$Tag1] 1d0+?{question|no,@{attribute1} |yes,0 }]] [[ [$Tag2] 1d0+@{attribute2}+@{attribute3}+@{attribute4}+@{attribute5}-[^Tag1.total] ]] The 1d0 is there because it wouldn't work without a roll involved. The whole thing was working fine until I separated the query into a different line and tried to import its RollID.
1526121754
Kurt J.
Pro
API Scripter
Jesster said: Is it possible to recall a number with something like [^Tag1] within another field that's being stored with a [$Tag2]? All I'm getting is a blank spot where [^Tag1] is being output, which screws up the calculations. My setup looks like this (with the rest of the code cut out of course): [[ [$Tag1] 1d0+?{question|no,@{attribute1} |yes,0 }]] [[ [$Tag2] 1d0+@{attribute2}+@{attribute3}+@{attribute4}+@{attribute5}-[^Tag1.total] ]] The 1d0 is there because it wouldn't work without a roll involved. The whole thing was working fine until I separated the query into a different line and tried to import its RollID. It is not currently possible. Rolls are processed as a first pass through the tags, so the value of ^Tag1 is not available when the roll is calculated. Roll IDs can only be used for conditional comparisons or to display their value as output, and not as part of another roll.
Hi Kurt, Can you help me with my powercard ? ;) I'll try to use you "--api_" but i'll can't find a good way, maybe you can tell me why (maybe it's impossible) this is my macro : !power {{fullattackflag=[[d1]]}} {{ --tokenid|@{selected|Token_Id} --bgcolor|#fdff62 --emote|**@{selected|token_name}** enfonce ses lames dans @{target|target|token_name} --target_list|@{target|target|token_id} --name|Double croc --leftsub|Attaque Global --rightsub|10 Combo --Attack:|[[ [$Atk1] 1D20+@{selected|Atk}-2]] vs @{target|CA} CA --?? $Atk1.base == 1 OR $Atk1 < @{target|CA} ?? !Missed|**You missed!** --?? $Atk1 >= @{target|CA} AND $Atk1.base <= 19 ?? Hit1:|[[ [$Dmg1] 3*?{ Embuscade ?|Non, 1|Oui, 2}*@{selected|Mod3}*(1D4+@{selected|Deg}-2)]] damage --?? $Atk1 >= @{target|CA} AND $Atk1.base <= 19 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg1] --?? $Atk1.base >= 20 ?? Critical Hit1:|[[ [$CritDmg1] 3*?{ Embuscade ?|Non, 1|Oui, 2}*2*@{selected|Mod3}*(1D4+@{selected|Deg}-2))]] damage --?? $Atk1.base >= 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg1] --Attack2:|[[ [$Atk2] 1D20+@{selected|Atk}-5]] vs @{target|CA} CA --?? $Atk2.base == 1 OR $Atk2 < @{target|CA} ?? !Missed|**You missed!** --?? $Atk2 >= @{target|CA} AND $Atk2.base <= 19 ?? Hit2:|[[ [$Dmg2] 3*?{ Embuscade ?|Non, 1|Oui, 2}*@{selected|Mod4}*(1D4+@{selected|Deg}-3)]] damage --?? $Atk2 >= @{target|CA} AND $Atk2.base <= 19 ?? alterbar3|_target|@{target|token_id} _bar|1 _amount|-[^Dmg2] --?? $Atk2.base >= 20 ?? Critical Hit2:|[[ [$CritDmg2] 3*?{ Embuscade ?|Non, 1|Oui, 2}*2*@{selected|Mod4}*(1D4+@{selected|Deg}-3)]] damage --?? $Atk2.base >= 20 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg2] --?? $Atk1 >= @{target|CA} ?? !Poison|**@{target|token_name} souffre du Poison!** --?? $Atk2 >= @{target|CA} AND $Atk1 < @{target|CA} ?? !Poison|**@{target|token_name} souffre du Poison!** --?? ?{ Sneak ?|Non,0|Oui, 1} == 1 ?? Sneak:|[[ [$Dmg3] ?{ Embuscade ?|Non, 1|Oui, 2}*4D6]] Damage --?? $Atk1 >= @{target|CA} AND?{ Sneak ?|Non,0|Oui, 1} == 1 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-[^Dmg3] --?? $Atk1 < @{target|CA} AND $Atk2 >= @{target|CA} AND?{ Sneak ?|Non,0|Oui, 1} == 1 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-[^Dmg3] --Bonus:|+1 combo sur une cible en péril --api_attrib Combo|[[@{selected|Combo}+2]] }} /fx burn-blood @{target|token_id} @{selected|token_id} Tjis is work, only need help with last part: !attrib Combo|[[@{selected|Combo}+2]], add "Combo" value by 2. how can i implant to my macro ? perfect way with "?? $Atk1 <= @{target|CA} OR $Atk2 >= @{target|CA} ??" Thx for looking
1526141935
Kurt J.
Pro
API Scripter
CqLou said: Hi Kurt, Can you help me with my powercard ? ;) I'll try to use you "--api_" but i'll can't find a good way, maybe you can tell me why (maybe it's impossible) this is my macro : ... Tjis is work, only need help with last part: !attrib Combo|[[@{selected|Combo}+2]], add "Combo" value by 2. how can i implant to my macro ? perfect way with "?? $Atk1 <= @{target|CA} OR $Atk2 >= @{target|CA} ??" Thx for looking The 3.7.3 and earlier versions of PowerCards actually can't do this because of the way the --api_ tag is processed. However, I just updated the development gist to 3.7.4 which includes processing of inline formatting for the --api_ tag. This means you can use RollIDs in the content (but not rolls themselves). This now works for me with the chatsetattr script (I've never used the !attrib API script before, but I imagine it could be set up similarly): !power {{   --name|Test SetAttr   --currentCombo|@{selected|Combo}   --hroll|[[ [$NewCombo] 1d0 + @{selected|Combo} + 2 ]]   --api_setattr|_charid @{selected|character_id} _Combo|[^NewCombo] _silent }} If you wanted to do it conditionally, you would still make the "roll" (which doesn't roll anything, but really just adds 2 to @{selected|Combo} with the hroll line and store it in [$NewCombo], like this: !power {{   --name|Test SetAttr   --currentCombo|@{selected|Combo}   --hroll|[[ [$NewCombo] 1d0 + @{selected|Combo} + 2 ]]   --?? $Atk1 <= @{target|CA} OR $Atk2 >= @{target|CA} ?? api_setattr|_charid @{selected|character_id} _Combo|[^NewCombo] _silent }} Again, you would need to updated to the current 3.7.4 on the development gist for this to work.
1526142151
Kurt J.
Pro
API Scripter
Anthony V. said: Kurt J. said: Anthony V. said: updating to the new test version and getting this error. I can't duplicate that error... is this from One Click or from the development gist? Development gist  How are you updating your API script? I go to the GIST, hit the "raw" button, hit Control-A to select all, Control-C to copy, switch over to the Roll20 API section for my game, click in the code window for PoweCards, hit Control-A, Control-V and click save. I'm not running into any issues with the development version when doing it that way.
1526150269

Edited 1526160532
Kurt J. said: CqLou said: Hi Kurt, Can you help me with my powercard ? ;) I'll try to use you "--api_" but i'll can't find a good way, maybe you can tell me why (maybe it's impossible) this is my macro : ... Tjis is work, only need help with last part: !attrib Combo|[[@{selected|Combo}+2]], add "Combo" value by 2. how can i implant to my macro ? perfect way with "?? $Atk1 <= @{target|CA} OR $Atk2 >= @{target|CA} ??" Thx for looking The 3.7.3 and earlier versions of PowerCards actually can't do this because of the way the --api_ tag is processed. However, I just updated the development gist to 3.7.4 which includes processing of inline formatting for the --api_ tag. This means you can use RollIDs in the content (but not rolls themselves). This now works for me with the chatsetattr script (I've never used the !attrib API script before, but I imagine it could be set up similarly): !power {{   --name|Test SetAttr   --currentCombo|@{selected|Combo}   --hroll|[[ [$NewCombo] 1d0 + @{selected|Combo} + 2 ]]   --api_setattr|_charid @{selected|character_id} _Combo|[^NewCombo] _silent }} If you wanted to do it conditionally, you would still make the "roll" (which doesn't roll anything, but really just adds 2 to @{selected|Combo} with the hroll line and store it in [$NewCombo], like this: !power {{   --name|Test SetAttr   --currentCombo|@{selected|Combo}   --hroll|[[ [$NewCombo] 1d0 + @{selected|Combo} + 2 ]]   --?? $Atk1 <= @{target|CA} OR $Atk2 >= @{target|CA} ?? api_setattr|_charid @{selected|character_id} _Combo|[^NewCombo] _silent }} Again, you would need to updated to the current 3.7.4 on the development gist for this to work. Hi again, Tyvm, that help me a lots ! (effectively, it's better when i'll take 3.7.4)
 Having an issue with the PC action list it was rolling the wrong attack when you click the button in the chat but my API error has gone away so that’s good.  Kurt J. said: Anthony V. said: Kurt J. said: Anthony V. said: updating to the new test version and getting this error. I can't duplicate that error... is this from One Click or from the development gist? Development gist  How are you updating your API script? I go to the GIST, hit the "raw" button, hit Control-A to select all, Control-C to copy, switch over to the Roll20 API section for my game, click in the code window for PoweCards, hit Control-A, Control-V and click save. I'm not running into any issues with the development version when doing it that way.
Hello everyone, I continue to improve my macros and I am on double attacks. The double attack works very well, the problem is at the level of the alterbar. Indeed, when both attacks deal damage only the first one reduces the health of the target. How to inflict damages twice? !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** tente de trancher dans le lard de @{target|character_name} --name|Épée longue --leftsub|Action --rightsub|Cac 1.5m --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|Echec. --?? $Atk < @{target|AC} ?? soundfx|_play|miss --?? $Atk >= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk.total >= @{target|AC} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Dégâts :|[[ [$Dmg] 1d8 + 3]] Dommage Tranchant --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Coup critique :|[[ [$CritDmg] 2d8 +3]] Dommage Tranchant --?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --Attack *2|[[ [$Atk2] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk2.base == 1 OR $Atk2.total < @{target|AC}?? !Miss:|Echec. --?? $Atk2 < @{target|AC} ?? soundfx|_play|miss --?? $Atk2 >= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk2.total >= @{target|AC} AND $Atk2.base <> 1 AND $Atk2.base <> 20 ?? Dégâts *2:|[[ [$Dmg2] 1d8 + 3]] Dommage Tranchant --?? $Atk2 >= @{target|AC} AND $Atk2.base <> 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk2.base == 20 ?? Coup critique *2:|[[ [$CritDmg2] 2d8 +3]] Dommage Tranchant --?? $Atk2.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg2] _show|all }}
Anthony V. said:  Having an issue with the PC action list it was rolling the wrong attack when you click the button in the chat but my API error has gone away so that’s good.  Kurt J. said: Anthony V. said: Kurt J. said: Anthony V. said: updating to the new test version and getting this error. I can't duplicate that error... is this from One Click or from the development gist? Development gist  How are you updating your API script? I go to the GIST, hit the "raw" button, hit Control-A to select all, Control-C to copy, switch over to the Roll20 API section for my game, click in the code window for PoweCards, hit Control-A, Control-V and click save. I'm not running into any issues with the development version when doing it that way. Anyone else having this problem with the PC Action list?
1526343373

Edited 1526343424
Kurt J.
Pro
API Scripter
Ziterman S. said: !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** tente de trancher dans le lard de @{target|character_name} --name|Épée longue --leftsub|Action --rightsub|Cac 1.5m --Attack|[[ [$Atk] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|Echec. --?? $Atk < @{target|AC} ?? soundfx|_play|miss --?? $Atk >= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk.total >= @{target|AC} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Dégâts :|[[ [$Dmg] 1d8 + 3]] Dommage Tranchant --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar1 |_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? Coup critique :|[[ [$CritDmg] 2d8 +3]] Dommage Tranchant --?? $Atk.base == 20 ?? alterbar2 |_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all --Attack *2|[[ [$Atk2] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk2.base == 1 OR $Atk2.total < @{target|AC}?? !Miss:|Echec. --?? $Atk2 < @{target|AC} ?? soundfx|_play|miss --?? $Atk2 >= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk2.total >= @{target|AC} AND $Atk2.base <> 1 AND $Atk2.base <> 20 ?? Dégâts *2:|[[ [$Dmg2] 1d8 + 3]] Dommage Tranchant --?? $Atk2 >= @{target|AC} AND $Atk2.base <> 20 ?? alterbar1 |_target|@{target|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk2.base == 20 ?? Coup critique *2:|[[ [$CritDmg2] 2d8 +3]] Dommage Tranchant --?? $Atk2.base == 20 ?? alterbar2 |_target|@{target|token_id} _bar|1 _amount|-[^CritDmg2] _show|all }} I've bolded the calls to alterbar above. They use duplicated tag names. They need to be alterbar*1, alterbar*2, alterbar*3, alterbar*4, etc. The same tag name can't be repeated anywhere in a card, conditional or not. (there are other instances of that here as well (soundfx and Miss).
1526343520
Kurt J.
Pro
API Scripter
Anthony V. said: Anyone else having this problem with the PC Action list? This seems to happen on repeating items if the order of the items gets rearranges at ANY time. Once the items have been rearranged, they get permanently messed up (if you check your API log, there will be a misspelled error from the UI about finding an existing order). This is a bug in Roll20 itself. I've been trying to find a way around the problem, but haven't gotten anything pinned down yet.
I'm creating a character stats readout using PowerCards for the  DnD5e Character Sheet , and I'm trying to use some logic to determine whether to display magic info or not. Here's the script (with most irrelevant code removed): !power {{ --name|@{selected|character_name} Stats --format|statsgm --whisper|GM --leftsub|@{selected|gender} @{selected|race} --rightsub|Level [[ [TXT] 0d0 + [[@{selected|level}]] ]] @{selected|class}** --hroll|[[ [$SpellCaster] 0d0 + 1 ]] --?? @{selected|bard_level} == 0 AND @{selected|cleric_level} == 0 AND @{selected|druid_level} == 0 AND @{selected|monk_level} == 0 AND @{selected|paladin_level} == 0 AND @{selected|ranger_level} == 0 AND @{selected|sorcerer_level} == 0 AND @{selected|warlock_level} == 0 AND @{selected|wizard_level} == 0 ?? hroll|[[ [$SpellCaster] 0d0 + 0 ]] --?? $SpellCaster == 0 ?? Spellcaster? *1|No ($SpellCaster = [^SpellCaster]) --?? $SpellCaster == 1 ?? Spellcaster? *2|Yes ($SpellCaster = [^SpellCaster]) --Levels:|Bard: [[@{selected|bard_level}]] Cleric: [[@{selected|cleric_level}]] Druid: [[@{selected|druid_level}]] Monk: [[@{selected|monk_level}]] Paladin: [[@{selected|paladin_level}]] Ranger: [[@{selected|ranger_level}]] Sorcerer: [[@{selected|sorcerer_level}]] Warlock: [[@{selected|warlock_level}]] Wizard: [[@{selected|wizard_level}]] }} The output is giving me this info: Maybe I'm missing something, but shouldn't this logic be giving me $Spellcaster = 1 where the character's sorcerer_level=1 ? This is simple logic: If the character doesn't have levels in any of the magic-using classes, the $SpellCaster value should be set to 0. Yet it's clearly not doing that when it should be.