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

[Script] PowerCards 3 (Thread 6)

1593901083

Edited 1593901117
DAN
Pro
Kurt J. said: #1 thing to check: Make sure all the characters you are trying to use the the macro on is set to Advantage Toggle as their roll mode. That is the exact error message you get when the roll mode is not set that way. This is settable on the character sheet on the first page under the gear. In the rightmost settings column near the top is an item for "Roll Queries". This must be "Advantage Toggle" for any of the PCMHelper macros that make attacks to work. As additional information, the PCA- replacements are generated by this line in the macro: --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} the replacepcattack tag tells PowerCard to create replacement variables for all of the associated properties of the selected attack. They are pulled from the properties of the repeating attack action on the character sheet, and only exist as long as the card is being processed. The "attacklist" property is generated any time the list of attacks on the charactersheet changes. I'll be creating a new thread this weekend for PowerCard sharing (I'll probably also create a repository on my website, but I think most people will come looking here first). I'll share anything I have that is useful :) [ After re-reading the posting guidelines, I'll need to check to see if this is allowed before I create it (specifically the one-thread-per-script rule)] I had a standing Roll20 game, but most of our gaming was in-person until the lockdowns... now we're on here all the time :) Thanks for the explanation and the fix. Both worked, I now get the script supports the parsing/building in that tag for the replace action. Also, yes, classic end user error.  I had set up my chars right in my test game, but then, of course, forgot to finish it in the real game. Look forward to the samples. 
Hi Kurt.  The action buttons are very powerful and make the PC more of a mini char sheet than just a fancy info box. Is the action list extensible? Meaning can we, at the macro/template level, build our own action lists?  Or is that only part of the script itself and require cracking open script development? An example might be to show a PC with action buttons for each ability save, with click-a-bility. Instead of the prompt or one macro per save approach. 
1593903162
Kurt J.
Pro
API Scripter
Ian said: Hi, I'm using the Roll20 Pathfinder character sheet and am trying to, on a successful ranged touch attack, alter the @{target|strength_bonus} by the amount rolled.  Here's what I've got so far but not sure how to structure the last line to make it happen, if it is in fact possible. !power {{  --name|Ray of Enfeeblement  --leftsub|Ranged Spell Attack  --rightsub|25' + 5' per level.  --Attack:|[[ [$Atk] 1d20 + @{selected|dexterity_mod} ]] vs @{target|character_name}'s Touch AC of **@{target|AC_touch}**  --?? $Atk >= @{target|AC_touch} ?? Damage:|[[ [$Drain] 1d6+1 ]]  --vfx_opt|@{selected|token_id} @{target|token_id} beam-magic  --?? $Atk >= @{target|AC_touch} ?? Weakened:|@{target|character_name}'s strength is reduced by [^Drain] points.  --?? $Atk >= @{target|AC_touch} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|strong  --?? $Atk >=@{target|AC_touch} ?? @{target|strength_bonus}-[^Drain] }} It can probably be done with another call to token-mod (api_token-mod*2) but how exactly you set it on that sheet would depend on how the sheet handles it. If the strength_bonus attribute is calculated based on the strength attribute, changing it directly might not do anything (or might break things later on).
1593904077
Kurt J.
Pro
API Scripter
Dan C. said: Hi Kurt.  The action buttons are very powerful and make the PC more of a mini char sheet than just a fancy info box. Is the action list extensible? Meaning can we, at the macro/template level, build our own action lists?  Or is that only part of the script itself and require cracking open script development? An example might be to show a PC with action buttons for each ability save, with click-a-bility. Instead of the prompt or one macro per save approach.  If you mean the ones that are generated by tags like --npc_action_list and the like, you can go into the NPC's character sheet and add actions to the action list there, and they will show up on the cards. You should be able to add additional buttons directly on the PowerCard for things like saves without editing the code (by using the chat notation for creating a button). Adding lists that aren't part of the repeatable sections on the character sheet would require code changes (you would need a source for the ability list, the action to take on each ability, etc.) I have two generic macros/cards I use for saves and ability checks that prompt for the ability and advantage state. I have them as game macros in everyone's ability bar, so it is easy enough for my players to click them.
Kurt J. said: Ian said: Hi, I'm using the Roll20 Pathfinder character sheet and am trying to, on a successful ranged touch attack, alter the @{target|strength_bonus} by the amount rolled.  Here's what I've got so far but not sure how to structure the last line to make it happen, if it is in fact possible. !power {{  --name|Ray of Enfeeblement  --leftsub|Ranged Spell Attack  --rightsub|25' + 5' per level.  --Attack:|[[ [$Atk] 1d20 + @{selected|dexterity_mod} ]] vs @{target|character_name}'s Touch AC of **@{target|AC_touch}**  --?? $Atk >= @{target|AC_touch} ?? Damage:|[[ [$Drain] 1d6+1 ]]  --vfx_opt|@{selected|token_id} @{target|token_id} beam-magic  --?? $Atk >= @{target|AC_touch} ?? Weakened:|@{target|character_name}'s strength is reduced by [^Drain] points.  --?? $Atk >= @{target|AC_touch} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|strong  --?? $Atk >=@{target|AC_touch} ?? @{target|strength_bonus}-[^Drain] }} It can probably be done with another call to token-mod (api_token-mod*2) but how exactly you set it on that sheet would depend on how the sheet handles it. If the strength_bonus attribute is calculated based on the strength attribute, changing it directly might not do anything (or might break things later on). Thanks, I'll have a play around some more.  I'm new to the system and managing to cobble everything together from other peoples descriptions etc. Fingers crossed.
1593950949

Edited 1593951010
Hi all, I've been looking through the various threads trying to find an answer but to no avail, so thought I would throw this out there - apologies if it's already been answered and I missed it. So i'm setting up a Rolemaster game and have a whole bunch of stuff working for me (at last!) and would like to add a weapon table lookup in my powercard script but I cannot work out how to get a call to a rollable table inside a powercard script. Can someone please give an example or let me know if this is just not possible please? Thanks in advance for your help. Manny
Hello everyone, I could use some of your infinite wisdom. I have a Rogue/Vampire in my D&D 5E campaign. I am trying to get a Macro that have him check for whether it is daylight or not (because I removed him all bonuses he has on Attack roll and Damage roll), if he uses Sneak Attack and Advantage/Disadventage roll. I came up, with the helpfull post on this tread to this Macro : !power {{  --format|general  --name|Arc court  --leftsub|Attaque a distance  --rightsub|9/18m.  --hroll|[[ [$Sneak] ?{Sneak Attack|Non, 0|Oui, 1} + 0d0 ]]  --hroll|[[ [$Day] ?{Day Attack|Non, 0|Oui, 1} +0d0]]  --?? $Day == 0 ?? Attack:|[[ [$Atk] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1} + @{selected|dexterity_mod} + @{selected|pb} ]] vs AC  --?? $Day == 1 ?? Attack:|[[ [$Atk] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1}]] vs AC  --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|Rater.  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[1d8 + @{Selected|dexterity_mod}]] Degat perforant  --?? $Atk.base == 20 ?? Critical Hit:|[[2d8 + @{Selected|dexterity_mod}]] Degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Sneak == 1 ?? Hit:|[[1d8 + @{Selected|dexterity_mod} + ((@{level}/2)d6)]] Critique de degat perforant  --?? $Atk.base == 20 AND $Sneak == 1 ?? Critical Hit:|[[2d8 + @{Selected|dexterity_mod} + ((@{level}/2*2)d6)]] Sneak critique de degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Day == 1 ?? Hit:|[[1d8]] Degat perforant  --?? $Atk.base == 20 AND $Day == 1 ?? Critical Hit:|[[2d8]] Degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Sneak == 1 AND $Day == 1 ?? Hit:|[[1d8 + ((@{level}/2)d6)]] Critique de degat perforant  --?? $Atk.base == 20 AND $Sneak == 1 AND $Day == 1 ?? Critical Hit:|[[2d8 + ((@{level}/2*2)d6)]] Sneak critique de degat perforant }} It somehow work, with quite some delay but I usully get a double line when using the Sneak attack I tried to mess a bit with the code but I have no idea why I get this redundancy. It's probably something easy to spot but I have just been going around API since a day or two so am not yet ready to debug. Thanks in advance MY-Shiiro
Kurt J. said: Ian said: Hi, I'm using the Roll20 Pathfinder character sheet and am trying to, on a successful ranged touch attack, alter the @{target|strength_bonus} by the amount rolled.  Here's what I've got so far but not sure how to structure the last line to make it happen, if it is in fact possible. !power {{  --name|Ray of Enfeeblement  --leftsub|Ranged Spell Attack  --rightsub|25' + 5' per level.  --Attack:|[[ [$Atk] 1d20 + @{selected|dexterity_mod} ]] vs @{target|character_name}'s Touch AC of **@{target|AC_touch}**  --?? $Atk >= @{target|AC_touch} ?? Damage:|[[ [$Drain] 1d6+1 ]]  --vfx_opt|@{selected|token_id} @{target|token_id} beam-magic  --?? $Atk >= @{target|AC_touch} ?? Weakened:|@{target|character_name}'s strength is reduced by [^Drain] points.  --?? $Atk >= @{target|AC_touch} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|strong  --?? $Atk >=@{target|AC_touch} ?? @{target|strength_bonus}-[^Drain] }} It can probably be done with another call to token-mod (api_token-mod*2) but how exactly you set it on that sheet would depend on how the sheet handles it. If the strength_bonus attribute is calculated based on the strength attribute, changing it directly might not do anything (or might break things later on). Hi Kurt, I've had a look at can't figure it out.  The strength stat has four elements: @{selected|strength} - The main stat @{selected|strength_mod} - The ability mod of the stat @{selected|strength_bonus} - A bonus you can type something temporary in there @{selected|strength_condition} - A box that appears when you click the cog next to the stat. I think strength_ mod and strength_condition are the ones that you could adjust to get needed stat changes from a spell.  I'm not sure if that's possible with tokenmod or if there's any other scripts that would do that. Any idea?
Hi folks, quick question. Some of my reapeating section attributes are plain text. I use it to describe some rules in the powercard output. Can I use text in the conditionals? Thanks a lot, G
1593986094
Kurt J.
Pro
API Scripter
MY-Shiiro said: Hello everyone, I could use some of your infinite wisdom. I have a Rogue/Vampire in my D&D 5E campaign. I am trying to get a Macro that have him check for whether it is daylight or not (because I removed him all bonuses he has on Attack roll and Damage roll), if he uses Sneak Attack and Advantage/Disadventage roll. I came up, with the helpfull post on this tread to this Macro : !power {{  --format|general  --name|Arc court  --leftsub|Attaque a distance  --rightsub|9/18m.  --hroll|[[ [$Sneak] ?{Sneak Attack|Non, 0|Oui, 1} + 0d0 ]]  --hroll|[[ [$Day] ?{Day Attack|Non, 0|Oui, 1} +0d0]]  --?? $Day == 0 ?? Attack:|[[ [$Atk] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1} + @{selected|dexterity_mod} + @{selected|pb} ]] vs AC  --?? $Day == 1 ?? Attack:|[[ [$Atk] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1}]] vs AC  --?? $Atk.base == 1 OR $Atk.total < @{target|AC}?? !Miss:|Rater.  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[1d8 + @{Selected|dexterity_mod}]] Degat perforant  --?? $Atk.base == 20 ?? Critical Hit:|[[2d8 + @{Selected|dexterity_mod}]] Degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Sneak == 1 ?? Hit:|[[1d8 + @{Selected|dexterity_mod} + ((@{level}/2)d6)]] Critique de degat perforant  --?? $Atk.base == 20 AND $Sneak == 1 ?? Critical Hit:|[[2d8 + @{Selected|dexterity_mod} + ((@{level}/2*2)d6)]] Sneak critique de degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Day == 1 ?? Hit:|[[1d8]] Degat perforant  --?? $Atk.base == 20 AND $Day == 1 ?? Critical Hit:|[[2d8]] Degat perforant  --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 AND $Sneak == 1 AND $Day == 1 ?? Hit:|[[1d8 + ((@{level}/2)d6)]] Critique de degat perforant  --?? $Atk.base == 20 AND $Sneak == 1 AND $Day == 1 ?? Critical Hit:|[[2d8 + ((@{level}/2*2)d6)]] Sneak critique de degat perforant }} It somehow work, with quite some delay but I usully get a double line when using the Sneak attack I tried to mess a bit with the code but I have no idea why I get this redundancy. It's probably something easy to spot but I have just been going around API since a day or two so am not yet ready to debug. Thanks in advance MY-Shiiro There are a number of issues here, the most important being that your tag names aren't unique. Every tag needs to be unique in the card, and if some of them need the same display name (Hit:, for example) they need to be marked with the Same Name modifier (*1, *2, *3, etc.) All rolls on the card happen independent of any conditionals, the two different kinds of attack rolls need to have their own RollIDs, and need to then be checked separately. Here is a card that I think works for your situation: !power {{ --format|general --name|Arc court --leftsub|Attaque a distance --rightsub|9/18m. --hroll|[[ [$Sneak] ?{Sneak Attack|Non, 0|Oui, 1} + 0d0 ]] --hroll|[[ [$Day] ?{Day Attack|Non, 0|Oui, 1} +0d0 ]] --?? $Day == 0 ?? Attack: *1|[[ [$Atk1] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1} + @{selected|dexterity_mod} + @{selected|pb} ]] vs AC --?? $Day <> 0 ?? Attack: *2|[[ [$Atk2] ?{Attack|Standard,1d20|w/Advantage,2d20KH1|w/Disadvantage,2d20KL1} ]] vs AC --?? $Day == 0 AND $Atk1.base == 1 OR $Atk1.total < @{target|npc_ac} ?? !Miss:|Rater. --?? $Day == 0 AND $Sneak <> 1 AND $Atk1.total >= @{target|npc_ac} AND $Atk1.base <> 1 AND $Atk1.base <> 20 ?? Hit: *1|[[ 1d8 + @{Selected|dexterity_mod} ]] Degat perforant --?? $Day == 0 AND $Sneak <> 1 AND $Atk1.base == 20 ?? Critical Hit: *1|[[ 2d8 + @{Selected|dexterity_mod} ]] Degat perforant --?? $Day == 0 AND $Sneak == 1 AND $Atk1.total >= @{target|npc_ac} AND $Atk1.base <> 1 AND $Atk1.base <> 20 ?? Hit: *2|[[1d8 + @{Selected|dexterity_mod} + ((@{selected|level}/2)d6)]] Critique de degat perforant --?? $Day == 0 AND $Sneak == 1 AND $Atk1.base == 20 ?? Critical Hit: *2|[[ 2d8 + @{Selected|dexterity_mod} + ((@{selected|level}/2*2)d6) ]] Sneak critique de degat perforant --?? $Day <> 0 AND $Sneak <> 1 AND $Atk2.total >= @{target|npc_ac} AND $Atk2.base <> 1 AND $Atk2.base <> 20 ?? Hit: *3|[[ 1d8 ]] Degat perforant --?? $Day <> 0 AND $Sneak <> 1 AND $Atk2.base == 20 ?? Critical Hit: *3|[[ 2d8 ]] Degat perforant --?? $Day <> 0 AND $Sneak == 1 AND $Atk2.total >= @{target|npc_ac} AND $Atk2.base <> 1 AND $Atk2.base <> 20 ?? Hit: *4|[[ 1d8 + ((@{selected|level}/2)d6) ]] Critique de degat perforant --?? $Day <> 0 AND $Sneak == 1 AND $Atk2.base == 20 ?? Critical Hit: *4|[[ 2d8 + (@{selected|level}/2*2)d6 ]] Sneak critique de degat perforant }}
1593986366

Edited 1593986612
Kurt J.
Pro
API Scripter
G said: Hi folks, quick question. Some of my reapeating section attributes are plain text. I use it to describe some rules in the powercard output. Can I use text in the conditionals? Thanks a lot, G Yes, you can use text in either normal conditionals or in expanded conditionals, however, the text can't contains spaces and potentially other characters that I haven't thought of in regular conditionals. With expanded conditionals you can surround the text with quotes and it will parse them properly. !power {{ --name|Test --?? Hello == Hello ?? Yep|Sure does! --?? Hello <> Hello ?? Nope|It doesn't! }} This produces "Yep Sure does!" when run. Expanded Conditionals example: !power {{ --name|Test --!? "Hello There" -eq "Hello There" ?! Yep|Sure does! }}
Any chance to get some help !? my issue hasn't been solved yet.... Any volunteer? if yes, everything is on page 6 & 7...
Kurt J. said: !power {{ --name|Test --?? Hello == Hello ?? Yep|Sure does! --?? Hello <> Hello ?? Nope|It doesn't! }} This produces "Yep Sure does!" when run. Expanded Conditionals example: !power {{ --name|Test --!? "Hello There" -eq "Hello There" ?! Yep|Sure does! }} Nice. I've tried to use it and it works great. Thanks for the input. In the same subject, I'm currently trying to wrap my head around this part : --?? @{weapontype} == Shotgun?? $query|[[ [$shotgunmod] [NH] 1d0 + ?{15m and less?|No,0|Yes,1}]] When working through the macro, the systems always ask me if the target is withing 15 meter or less. Even if the weapon is a Stubber or Plasma type, the question stills pop. Is it due to the query? Cause I've tried other type of text conditional and it only pop up when the right weapontype is selected. For exemple : --?? @{weapontype} == Plasma ?? $rollplasma|[[ [$plasmaburn] [NH] 1D10]] --?? $plasmaburn == 1 AND @{weapontype} == Plasma ?? Brûlure:|$$#ff0000|**Drop weapon and can't pick it up for 3 rounds**$$ When going through that part, the system never roll the dice if I'm not firing a plasma type weapon. Am I doing something wrong?
1594008718
Andrew R.
Pro
Sheet Author
In the same subject, I'm currently trying to wrap my head around this part : --?? @{weapontype} == Shotgun?? $query|[[ [$shotgunmod] [NH] 1d0 + ?{15m and less?|No,0|Yes,1}]] When working through the macro, the systems always ask me if the target is withing 15 meter or less. Even if the weapon is a Stubber or Plasma type, the question stills pop. Is it due to the query? Cause I've tried other type of text conditional and it only pop up when the right weapontype is selected. You're missing a space between "Shotgun" and "??".
Thanks Andrew R., It's a typo from a translation though. The sheet does include this needed space.
1594038526
Kurt J.
Pro
API Scripter
G said: Kurt J. said: !power {{ --name|Test --?? Hello == Hello ?? Yep|Sure does! --?? Hello <> Hello ?? Nope|It doesn't! }} This produces "Yep Sure does!" when run. Expanded Conditionals example: !power {{ --name|Test --!? "Hello There" -eq "Hello There" ?! Yep|Sure does! }} Nice. I've tried to use it and it works great. Thanks for the input. In the same subject, I'm currently trying to wrap my head around this part : --?? @{weapontype} == Shotgun?? $query|[[ [$shotgunmod] [NH] 1d0 + ?{15m and less?|No,0|Yes,1}]] When working through the macro, the systems always ask me if the target is withing 15 meter or less. Even if the weapon is a Stubber or Plasma type, the question stills pop. Is it due to the query? Cause I've tried other type of text conditional and it only pop up when the right weapontype is selected. For exemple : --?? @{weapontype} == Plasma ?? $rollplasma|[[ [$plasmaburn] [NH] 1D10]] --?? $plasmaburn == 1 AND @{weapontype} == Plasma ?? Brûlure:|$$#ff0000|**Drop weapon and can't pick it up for 3 rounds**$$ When going through that part, the system never roll the dice if I'm not firing a plasma type weapon. Am I doing something wrong? Roll Queries are always processed  by the chat  server before they are sent to PowerCards, and of course the chat server doesn't know anything about conditionals, etc., so any queries included in the card will always be prompted by the chat server.
Kurt J. said: Roll Queries are always processed  by the chat  server before they are sent to PowerCards, and of course the chat server doesn't know anything about conditionals, etc., so any queries included in the card will always be prompted by the chat server. Ah, that explains it. Thanks for the clarification!
1594164600

Edited 1594165025
Hi, I'm hoping for some help. I'm playing D&D 5e. I have a handy little power menu that people can open when their turn in combat arrives, which displays their key attacks, abilities and spells. I combine it with the abilities tab so and things like chatsetattr spend resources accordingly and stuff, they typically look something like this, and it's set as a 'token action' so the player already has their token selected when the macro runs. !power {{ --whisper|"@{selected|character_name}" --name|What is Maelore doing? --tokenid|@{selected|token_id} --Attacks|^^ [@{selected|repeating_attack_$0_atkname}](~selected|repeating_attack_$0_attack) [Trident Dual (Bonus Action)](~selected|repeating_attack_$0_attack) [@{selected|repeating_attack_$1_atkname}](~selected|repeating_attack_$1_attack) --Abilities|^^ [Second Wind (@{selected|class_resource})](~selected|Second-wind) [Action Surge (@{selected|other_resource})](~selected|Action-surge) --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_list|@{selected|character_id} }} As the DM, I also add myself as a 'controlling player' to their characters, just so I can see them open the menu up (whisper) and ensure it's working ok for them.... It was working perfectly last week, but this time when I try, 2 of the 5 players do not receive the menu (via whisper) anymore. It does work fine if I remove the "--whisper|" line For example, I can type... /w Maelore Hiya! I'm whispering to you! and they'll see it. However, if I use !power {{ --whisper|Maelore --name|Hey, can you see this? }} The player controlling ' Maelore'doesn't see it. The only thing that i think that's related is that these two players, have put their display name the same as their Character name.  I assume, that usually if someone was to whisper to display name 'Bob', the GM would not see it, since it's being sent to a specific user. However, if they whispered it to "Weatherblade", all people with edit access to the character 'Weatherblade' wouldsee the whisper. I have no idea what would happen if you whispered to a name that was BOTH someones character name... AND a different persons DISPLAY NAME. I can only assume both different people would receive it. --- I've asked the player in question to change their 'display name' back to just their normal name (e.g. Lucy) in the hope that this would stop confusing things, but it still isn't working. Does anyone have any ideas? This issue is driving me bonkers. Thanks P.S. To clarify, the powercard is not correctly whispering to a player, even when I change the text in the powercard to say.... --whisper|Maelore (Character name that Lucy controls) or --whisper|Lucy (Players roll20 'display name') or --whisper|"@{selected|character_name}" (Well, this should be the same as typing "Maelore" since that's the character name) However, it does display to me (GM)  if I simply type --whisper|GM
1594167197

Edited 1594208934
-G-
Pro
Forget it,.  Brain fart, found my answer. :)
My brain is ready to explode; maybe it's just because it is late but for the life of me I cannot figure out a way to get a spell with a saving throw to automatically deal the damage with altar bars. I can do melee attacks and ranged spell attacks with soundfx and everything but when it comes to saving throws; I'm useless I just don't fundamentally understand something I suppose. Also I can't really figure out a way to do a Paladins smite as well. Can anyone help me out or point me in the right direction? 
@godthedj see if --whisper|self works... I use it for global macros and the players do not have an issue using it.. If this solves your issue..??
@bilbo thanks. I'll test it shortly. Game kicks off in an hour :)
I have something very similar, power cards that are menus for my players to take actions. Rather than worrying about the 'controlled by", I just use the command -- whisper|self, GM Which sends a whisper to me and a whisper to the player. godthedj said: As the DM, I also add myself as a 'controlling player' to their characters, just so I can see them open the menu up (whisper) and ensure it's working ok for them....
Nevermind; I got it. The half damage on saving throws was throwing me through a loop but alterbars auto rolls down on a /2. Great API btw; real game changer
1594277733

Edited 1594278988
!power {{  --name|A  --leftsub|B  --rightsub|C --Save:|[[ [$Save] ?{Saving Throw is made at|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}+@{target|wisdom_save_bonus} ]] VS @{selected|spell_save_dc}  --?? $Save >= @{selected|spell_save_dc} OR $Save.base == 20 ?? Pass:|[[ [$Pass] 3d8/2 + @{selected|charisma_mod} ]]  --?? $Save < @{selected|spell_save_dc} OR $Save.base == 1 ?? Fail:|[[ [$Fail] 3d8 + @{selected|charisma_mod} ]]  --?? $Save.total < @{selected|spell_save_dc} OR $Save.base == 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Fail] _show|all --?? $Save.total >= @{selected|spell_save_dc} OR $Save.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^Pass] _show|all }} Let me know If this can be tightened up at all. Pretty new at this but it seems to work pretty good. 
Shouldn't  @{selected|charisma_mod}   also be divided by 2 in the case of a passed saving throw? Noodle said: !power {{  --name|A  --leftsub|B  --rightsub|C --Save:|[[ [$Save] ?{Saving Throw is made at|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1}+@{target|wisdom_save_bonus} ]] VS @{selected|spell_save_dc}  --?? $Save >= @{selected|spell_save_dc} OR $Save.base == 20 ?? Pass:|[[ [$Pass] 3d8/2 + @{selected|charisma_mod} ]]  --?? $Save < @{selected|spell_save_dc} OR $Save.base == 1 ?? Fail:|[[ [$Fail] 3d8 + @{selected|charisma_mod} ]]  --?? $Save.total < @{selected|spell_save_dc} OR $Save.base == 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Fail] _show|all --?? $Save.total >= @{selected|spell_save_dc} OR $Save.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^Pass] _show|all }} Let me know If this can be tightened up at all. Pretty new at this but it seems to work pretty good. 
Okay, I got another Question. On the Wiki for  the --spell_list tag it reads (As of version 3.8.3: If you define attributes on the character named "spell_spellname_macro" (replacing spellname with the name of the spell exactly as it is on the character sheet, but replacing spaces with underscores) and specify a macro as the value of the attribute (such as #GuidingBolt) that macro will be used in place of the default character sheet macro for the spell.) am I correct in my testing, that this only works for the --spell_list tag, and not for the PCMHelper Spell selection? I would really love to have that function available there, but from my testing it didn't seem to work, I might have made a stupid mistake, though. The same would be nice from the same function from the --ogl_pc_attack_list tag.
Scott P. said: Shouldn't  @{selected|charisma_mod}   also be divided by 2 in the case of a passed saving throw? Totally would; I think I was just tacking that on out of habit; but yeah thinking about it now would probably have to put in half of that specific characters modifier. Unless someone knows a trick? I was scouring the forums earlier and I saw that Order of Operations is outta the question. 
I think I fixed my issue above. The bugger had left a space after their characters name, which seemed to screw up everything.... e.g. "Maelore ".
1594302145
Kurt J.
Pro
API Scripter
Sven K. said: Okay, I got another Question. On the Wiki for  the --spell_list tag it reads (As of version 3.8.3: If you define attributes on the character named "spell_spellname_macro" (replacing spellname with the name of the spell exactly as it is on the character sheet, but replacing spaces with underscores) and specify a macro as the value of the attribute (such as #GuidingBolt) that macro will be used in place of the default character sheet macro for the spell.) am I correct in my testing, that this only works for the --spell_list tag, and not for the PCMHelper Spell selection? I would really love to have that function available there, but from my testing it didn't seem to work, I might have made a stupid mistake, though. The same would be nice from the same function from the --ogl_pc_attack_list tag. That is correct, this only functions for those particular tags. The PCMHelper scripts build their spell list and use a standardized mechanism for displaying spell casting. Since they are really just very complicated PowerCards and don't have any direct code support within the PowerCards script itself, there isn't a simple way to integrate the options from the "quick character sheet" tags into PCMHelper.
1594314852

Edited 1594314912
Kurt J. said: That is correct, this only functions for those particular tags. The PCMHelper scripts build their spell list and use a standardized mechanism for displaying spell casting. Since they are really just very complicated PowerCards and don't have any direct code support within the PowerCards script itself, there isn't a simple way to integrate the options from the "quick character sheet" tags into PCMHelper. Alright, I thought so, but doesn't hurt to ask, in case I missed something. It would be a nice to have feature for a few spells like Magic Missile or Eldritch Blast, that work different, but I can alway just make seperate macros for those or something. I have 1 Player who enjoys making his own macros with emotes and his own Descriptions etc, and I already converted him to using Powercards, so for him it might have been a really nice thing, but no stress, if that's to difficult to implement atm...:)
1594323283

Edited 1594323574
Question for the community-I spent the day today reading 4-6 of this thread and got some really amazing things out of it from a new DM to roll 20 with like 0 scripting exp besides tweeking macros in video games. Currently i am running a D&D 5e Dark Elf Campaign and had intended to utilize some of the Gambling macros i came across for my characters trips to a evil Las Vegas style setting....But i ran into some issues. The Find the lady and the Slot Machine give me errrors unless i use the TEST MACRO Button Macros   Find the lady    !power {{ --emote|@{selected|token_name} watches closely as the dealer swaps the cards time and time again... --name|Find the Lady --Wager|[[?{How Much?|5} + 0d0]]gp --!blurb|The dealers hands flash through a well practiced routine, with a deep breath you point to the card you believe to be ‘The Lady’ --hrolls|[[ [$res] 1d20 + 0d0 ]] [[ [$tar] 1d20 + 5 ]] --?? $res >= $tar ?? Win!|You find the lady and win [[?{How Much?}*2]]gp --?? $res < $tar ?? Lose|The lady eludes you this time. }} Slot Machine !power {{ --emote|@{selected|token_name} tries their luck on the big slot machine. --name|Zowie Slot Machine --Wager|[[?{How Much?|5} + 0d0]]gp --!stuff|You pull the big handle and stand back as the clockwork ticks away inside. ^^ Eventually the reels stop, one by one: --Result|[[ [$r1] 1d8 ]] | [[ [$r2] 1d8 ]] | [[ [$r3] 1d8 ]] --?? $r1 == 6 AND $r2 == 6 AND $r3 == 1 ?? !win1|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 6 AND $r2 == 1 AND $r3 == 6 ?? !win1a|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 1 AND $r2 == 6 AND $r3 == 6 ?? !win1b|**Ding Ding Ding** ^^ You win [[?{How Much?}*2]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 2 ?? !win2|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 6 AND $r2 == 2 AND $r3 == 6 ?? !win2a|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 2 AND $r2 == 6 AND $r3 == 6 ?? !win2b|**Ding Ding Ding** ^^ You win [[?{How Much?}*4]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 3 ?? !win3|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 6 AND $r2 == 3 AND $r3 == 6 ?? !win3a|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 3 AND $r2 == 6 AND $r3 == 6 ?? !win3b|**Ding Ding Ding** ^^ You win [[?{How Much?}*6]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 4 ?? !win4|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 6 AND $r2 == 4 AND $r3 == 6 ?? !win4a|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 4 AND $r2 == 6 AND $r3 == 6 ?? !win4b|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 5 ?? !win5|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 6 AND $r2 == 5 AND $r3 == 6 ?? !win5a|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 5 AND $r2 == 6 AND $r3 == 6 ?? !win5b|**Ding Ding Ding** ^^ You win [[?{How Much?}*10]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 7 ?? !win6|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 6 AND $r2 == 7 AND $r3 == 6 ?? !win6a|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 7 AND $r2 == 6 AND $r3 == 6 ?? !win6b|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 8 ?? !win7|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 6 AND $r2 == 8 AND $r3 == 6 ?? !win7a|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 8 AND $r2 == 6 AND $r3 == 6 ?? !win7b|**Ding Ding Ding** ^^ You win [[?{How Much?}*15]]gp --?? $r1 == 1 AND $r2 == 1 AND $r3 == 1 ?? !win8|**Ding Ding Ding** ^^ You win [[?{How Much?}*8]]gp --?? $r1 == 2 AND $r2 == 2 AND $r3 == 2 ?? !win9|**Ding Ding Ding** ^^ You win [[?{How Much?}*12]]gp --?? $r1 == 3 AND $r2 == 3 AND $r3 == 3 ?? !win10|**Ding Ding Ding** ^^ You win [[?{How Much?}*14]]gp --?? $r1 == 4 AND $r2 == 4 AND $r3 == 4 ?? !win11|**Ding Ding Ding** ^^ You win [[?{How Much?}*16]]gp --?? $r1 == 5 AND $r2 == 5 AND $r3 == 5 ?? !win12|**Ding Ding Ding** ^^ You win [[?{How Much?}*20]]gp --?? $r1 == 6 AND $r2 == 6 AND $r3 == 6 ?? !win13|**Ding Ding Ding** ^^ You win [[?{How Much?}*24]]gp --?? $r1 == 7 AND $r2 == 7 AND $r3 == 7 ?? !win14|**JACKPOT** ^^ You win [[?{How Much?}*50]]gp --?? $r1 == 8 AND $r2 == 8 AND $r3 == 8 ?? !win15|**ZOWIE!!!** ^^ You win [[?{How Much?}*100]]gp }} I was able to get the roulette and In between to work, But it seems as soon as i saved the macros for the Slot machine and Find the lady will only work if i use the TEST MACRO button...otherwise i get errors like  Dungeon Master (Mark) (GM): #Casino-Find-The Lady #Casino-Slot Machine
Why am I getting this resolution. It is not happening all the time but once it happens on a token, it seems to stay happening.
There are a couple of fixes, the one I use is adding   --titlefontshadow|none to the first line of the macro.  
After discovering PowerCards a little while back (thanks Nick Olivio) I have become a big fan. I've made attacks and cantrips for a lot of the things my players do, but now I'm looking to add spells. I cannot figure out how to get spell slots to decrease based on casting level (like the 5e OGL companion normally does). It seems like a basic thing, but I cannot for the life of me find anything on whether this is even possible. I've included the powercard I have thus far for Cure Wounds. What I have works really well so far, I'd just love to be able to have spell slots deducted automatically. Any thoughts? !power {{ --tokenid|@{selected|token_id} --emote|~C @{selected|character_name} Heals @{target|character_name} ~C --target_list|@{target|token_id} --name|Cure Wounds --leftsub|Healing Spell --rightsub|Touch Range --Healing|[[ [$HLT] ?{What Level?|Level 1,1d8|Level 2,2d8|Level 3,3d8|Level 4,4d8} + @{selected|spellcasting_ability} 0 ]] --alterbar|_target|@{target|token_id} _bar|3 _amount|+[^HLT] _show|all }}
Here is one way you can accomplish this: !power {{ --Healing|[[ [$HLT] ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4}d8 + @{selected|spellcasting_ability} 0 ]] -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 1 ?? Level 1|[[@{selected|lvl1_slots_expended}-1]] of [[@{selected|lvl1_slots_total}]] remaining -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 1 ?? api_modbattr*1|_name @{selected|character_name} _lvl1_slots_expended|-1 _silent -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 2 ?? Level 2|[[@{selected|lvl2_slots_expended}-1]] of [[@{selected|lvl2_slots_total}]] remaining -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 2 ?? api_modbattr*2|_name @{selected|character_name} _lvl2_slots_expended|-1 _silent -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 3 ?? Level 3|[[@{selected|lvl3_slots_expended}-1]] of [[@{selected|lvl3_slots_total}]] remaining -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 3 ?? api_modbattr*3|_name @{selected|character_name} _lvl3_slots_expended|-1 _silent -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 4 ?? Level 4|[[@{selected|lvl4_slots_expended}-1]] of [[@{selected|lvl4_slots_total}]] remaining -- ?? ?{What Level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4} == 4 ?? api_modbattr*4|_name @{selected|character_name} _lvl4_slots_expended|-1 _silent }} Taylor B. said: After discovering PowerCards a little while back (thanks Nick Olivio) I have become a big fan. I've made attacks and cantrips for a lot of the things my players do, but now I'm looking to add spells. I cannot figure out how to get spell slots to decrease based on casting level (like the 5e OGL companion normally does). It seems like a basic thing, but I cannot for the life of me find anything on whether this is even possible. I've included the powercard I have thus far for Cure Wounds. What I have works really well so far, I'd just love to be able to have spell slots deducted automatically. Any thoughts? !power {{ --tokenid|@{selected|token_id} --emote|~C @{selected|character_name} Heals @{target|character_name} ~C --target_list|@{target|token_id} --name|Cure Wounds --leftsub|Healing Spell --rightsub|Touch Range --Healing|[[ [$HLT] ?{What Level?|Level 1,1d8|Level 2,2d8|Level 3,3d8|Level 4,4d8} + @{selected|spellcasting_ability} 0 ]] --alterbar|_target|@{target|token_id} _bar|3 _amount|+[^HLT] _show|all }}
Thank you so much Scott P. I had considered that maybe ChatSetAttr could be a solution, but for some reason I thought maybe PowerCards didn't communicate with that script. Anyways, it works great! Time to add some sound and visual fx. (And also put my players into a position where they might need to heal, lol)
Taylor B. said: Thank you so much Scott P. I had considered that maybe ChatSetAttr could be a solution, but for some reason I thought maybe PowerCards didn't communicate with that script. Anyways, it works great! Time to add some sound and visual fx. (And also put my players into a position where they might need to heal, lol) No problem.  I think PowerCards work with just about any API using the api_ apicommand tag.
1594639861

Edited 1594641288
I'm having a problem with a powercard that has a lot of conditionals that each have an in-line roll.  As is, the powercard can take 15+ seconds to complete.  If I remove all the in-line rolls and replace them with flat text, it completes (nearly) instantaneously.  Is there any way to speed this up? !power {{ --hroll|[[ [$plm] 0d0 + [[round((@{Reed Rudy|level}+@{Waris Wiadon|level}+@{Cantus Cillian|level}+@{Flint Fireforge|level})/4)]]]][[ [$roll] 1d20]] --name|Bandits (Non-Road) --?? $roll.total >= 1 AND $roll.total <= 5 ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|-2 --?? $roll.total >= 6 AND $roll.total <= 10 ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|-1 --?? $roll.total >= 11 AND $roll.total <= 13 ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|0 --?? $roll.total >= 14 AND $roll.total <= 16 ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|0 --?? $roll.total >= 17 AND $roll.total <= 18 ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|1 --?? $roll.total == 19 AND ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|1 --?? $roll.total == 20 AND ?? api_setattr|_name Adventure Record _silent _nocreate _asa_adj|2 --?? $plm.total <= 3 AND $roll.total >= 1 AND $roll.total <= 5 ?? !a *1|4 Bandits attack! --?? $plm.total <= 3 AND $roll.total >= 6 AND $roll.total <= 10 ?? !a *2|6 Bandits attack! --?? $plm.total <= 3 AND $roll.total >= 11 AND $roll.total <= 13 ?? !a *3|8 Bandit attack! --?? $plm.total <= 3 AND $roll.total >= 14 AND $roll.total <= 16 ?? !a *4|[[2d6]] Bandits attack! --?? $plm.total <= 3 AND $roll.total >= 17 AND $roll.total <= 18 ?? !a *5|10 Bandits attack! --?? $plm.total <= 3 AND $roll.total == 19 ?? !a *6|[[3d6]] Bandits attack! --?? $plm.total <= 3 AND $roll.total == 20 ?? !a *7|[[2d20]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total >= 1 AND $roll.total <= 5 ?? !a *8|[[1d6+4]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total >= 6 AND $roll.total <= 10 ?? !a *9|[[1d6+6]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total >= 11 AND $roll.total <= 13 ?? !a *10|[[1d6+8]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total >= 14 AND $roll.total <= 16 ?? !a *11|[[1d6+2d6]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total >= 17 AND $roll.total <= 18 ?? !a *12|[[1d6+10]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total == 19 ?? !a *13|[[3d6+4]] Bandits attack! --?? $plm.total >=4 AND $plm.total <=5 AND $roll.total == 20 ?? !a *14|[[1d6+2d20]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total >= 1 AND $roll.total <= 5 ?? !a *15|[[2d6+4]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total >= 6 AND $roll.total <= 10 ?? !a *16|[[2d6+6]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total >= 11 AND $roll.total <= 13 ?? !a *17|[[2d6+8]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total >= 14 AND $roll.total <= 16 ?? !a *18|[[2d6+2d6]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total >= 17 AND $roll.total <= 18 ?? !a *19|[[2d6+10]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total == 19 ?? !a *20|[[2d6+3d6]] Bandits attack! --?? $plm.total >=6 AND $plm.total <=7 AND $roll.total == 20 ?? !a *21|[[2d6+2d20]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total >= 1 AND $roll.total <= 5 ?? !a *22|[[3d6+4]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total >= 6 AND $roll.total <= 10 ?? !a *23|[[3d6+6]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total >= 11 AND $roll.total <= 13 ?? !a *24|[[3d6+8]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total >= 14 AND $roll.total <= 16 ?? !a *25|[[3d6+2d6]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total >= 17 AND $roll.total <= 18 ?? !a *26|[[3d6+10]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total == 19 ?? !a *27|[[3d6+3d6]] Bandits attack! --?? $plm.total >=8 AND $plm.total <=9 AND $roll.total == 20 ?? !a *28|[[3d6+2d20]] Bandits attack! --?? $plm.total >=10 AND $roll.total >= 1 AND $roll.total <= 5 ?? !a *29|[[4d6+4]] Bandits attack! --?? $plm.total >=10 AND $roll.total >= 6 AND $roll.total <= 10 ?? !a *30|[[4d6+6]] Bandits attack! --?? $plm.total >=10 AND $roll.total >= 11 AND $roll.total <= 1 ?? !a *31|[[4d6+8]] Bandits attack! --?? $plm.total >=10 AND $roll.total >= 14 AND $roll.total <= 16 ?? !a *32|[[4d6+2d6]] Bandits attack! --?? $plm.total >=10 AND $roll.total >= 17 AND $roll.total <= 18 ?? !a *33|[[4d6+10]] Bandits attack! --?? $plm.total >=10 AND $roll.total == 19 ?? !a *34|[[4d6+3d6]] Bandits attack! --?? $plm.total >=10 AND $roll.total == 20 ?? !a *35|[[4d6+2d20]] Bandits attack! }} **EDIT** Nevermind, looks like using replacements for [[ and ]] skip the chat server inline roll parsing and allow just the inline roll to be expanded that matches the conditional, making it tons faster.
I have a template that looks like this: SkillCheck:--name|~0! --leftsub|~1! ([[ [$mod] [TXT] ~7!]]) --rightsub|DC ~2! --~5!|[[ [$roll] ~6! + [[ [$modi] [TXT] ~7!]]]] --?? $roll >= ~2! ?? Success|~3! --?? $roll < ~2! ?? Failure|~4! It doesn't work because the $roll rolIId doesn't seem to be accessible in the conditionals (if I add a --!z|[^roll] I get >ROLL ID NOT FOUND<).  If I convert the inline roll to an hroll, then it all works as expected.  However, I'd prefer to see the calculations that hroll is hiding. As an aside, originally I only had [$roll].  I added [$mod] and [$modi] after seeing the section of the docs that said in a template, all inline rolls need a rollId. The arguments are defined as: 0 = Title 1 = Type (Acrobatics, Animal Handling, Arcana, Athletics, Deception, History, Insight, Intimidation, Investigation, Medicine, Nature, Perception, Performance, Persuasion, Religion, Sleight of Hand, Stealth, Survival) 2 = DC (i.e. 15) 3 = Success text 4 = Failure text 5 = @{selected|token_name} 6 = rolled value (i.e. 1d20) 7 = modifier total Here's the version using hroll that works as expected: SkillCheck:--hroll||[[ [$roll] ~6! + [[ [$modi] ~7!]]]] --name|~0! --leftsub|~1! ([[ [$mod] [TXT] ~7!]]) --rightsub|DC ~2! --~5!|[^roll] --?? $roll >= ~2! ?? Success|~3! --?? $roll < ~2! ?? Failure|~4! I figure I must have interpreted something wrong in the docs, but I don't see what it is.
I have this template, line breaks added for readability: ChangeRanks: --hroll|[[ [TXT] [$r3] 0d0 + ~3!]][[ [TXT] [$r7] 0d0 + ~7!]][[ [TXT] [$r11] 0d0 + ~11!]] --name|~0! --!a|~13! --?? "~1!" <> "" AND "~5!" == "" AND "~9!" == "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] --?? "~1!" <> "" AND "~5!" <> "" AND "~9!" == "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] _~8!|[^r7] --?? "~1!" <> "" AND "~5!" <> "" AND "~9!" <> "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] _~8!|[^r7] _~12!|[^r11] --?? "~1!" <> "" AND ~2! == 0 ?? ~1! *1|reset to ~2! --?? "~1!" <> "" AND ~2! < 0 ?? ~1! *2|decreased by ~2! ([[ [TXT] 0d0 + ~3!]]) --?? "~1!" <> "" AND ~2! > 0 ?? ~1! *3|increased by ~2! ([[ [TXT] 0d0 + ~3!]]) --?? "~5!" <> "" AND ~6! == 0 ?? ~5! *1|reset to ~6! --?? "~5!" <> "" AND ~6! < 0 ?? ~5! *2|decreased by ~6! ([[ [TXT] 0d0 + ~7!]]) --?? "~5!" <> "" AND ~6! > 0 ?? ~5! *3|increased by ~6! ([[ [TXT] 0d0 + ~7!]]) --?? "~9!" <> "" AND ~10! == 0 ?? ~9! *1|reset to ~10! --?? "~9!" <> "" AND ~10! < 0 ?? ~9! *2|decreased by ~10! ([[ [TXT] 0d0 + ~11!]]) --?? "~9!" <> "" AND ~10! > 0 ?? ~9! *3|increased by ~10! ([[ [TXT] 0d0 + ~11!]]) If I call it with an argument 1, 5 or 9 that contains a space, the conditionals all evaluate as false.  If the argument contains no space, it works as intended. Working template invocation: !power {{--template|ChangeRanks|Dwarven Stead;Notoriety;2;@{Adventure Record|asa_notoriety}+2;asa_notoriety;StoneFolk;0;0;asa_stone_folk;;;;;You defeat the dwaves but earn the enmity of all dwarves throughout the realm.}} Failing template invocation: !power {{--template|ChangeRanks|Dwarven Stead;Notoriety;2;@{Adventure Record|asa_notoriety}+2;asa_notoriety;Stone Folk;0;0;asa_stone_folk;;;;;You defeat the dwaves but earn the enmity of all dwarves throughout the realm.}} As you can see, the only difference between the calls is it works when ~5! is StoneFolk and fails when it is StoneFolk.  Interestingly, if I add this to the template:  --?? "~5!" <> "" ?? !z|notblank --?? "~5!" == "" ?? !zz|blank When ~5! is StoneFolk it reports notblank.  When it is Stone Folk it reports nothing.
1594728305
Kurt J.
Pro
API Scripter
kgsodie said: I have this template, line breaks added for readability: ChangeRanks: --hroll|[[ [TXT] [$r3] 0d0 + ~3!]][[ [TXT] [$r7] 0d0 + ~7!]][[ [TXT] [$r11] 0d0 + ~11!]] --name|~0! --!a|~13! --?? "~1!" &lt;&gt; "" AND "~5!" == "" AND "~9!" == "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] --?? "~1!" &lt;&gt; "" AND "~5!" &lt;&gt; "" AND "~9!" == "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] _~8!|[^r7] --?? "~1!" &lt;&gt; "" AND "~5!" &lt;&gt; "" AND "~9!" &lt;&gt; "" ?? api_setattr|_name Adventure Record _silent _nocreate _~4!|[^r3] _~8!|[^r7] _~12!|[^r11] --?? "~1!" &lt;&gt; "" AND ~2! == 0 ?? ~1! *1|reset to ~2! --?? "~1!" &lt;&gt; "" AND ~2! &lt; 0 ?? ~1! *2|decreased by ~2! ([[ [TXT] 0d0 + ~3!]]) --?? "~1!" &lt;&gt; "" AND ~2! &gt; 0 ?? ~1! *3|increased by ~2! ([[ [TXT] 0d0 + ~3!]]) --?? "~5!" &lt;&gt; "" AND ~6! == 0 ?? ~5! *1|reset to ~6! --?? "~5!" &lt;&gt; "" AND ~6! &lt; 0 ?? ~5! *2|decreased by ~6! ([[ [TXT] 0d0 + ~7!]]) --?? "~5!" &lt;&gt; "" AND ~6! &gt; 0 ?? ~5! *3|increased by ~6! ([[ [TXT] 0d0 + ~7!]]) --?? "~9!" &lt;&gt; "" AND ~10! == 0 ?? ~9! *1|reset to ~10! --?? "~9!" &lt;&gt; "" AND ~10! &lt; 0 ?? ~9! *2|decreased by ~10! ([[ [TXT] 0d0 + ~11!]]) --?? "~9!" &lt;&gt; "" AND ~10! &gt; 0 ?? ~9! *3|increased by ~10! ([[ [TXT] 0d0 + ~11!]]) If I call it with an argument 1, 5 or 9 that contains a space, the conditionals all evaluate as false.&nbsp; If the argument contains no space, it works as intended. Working template invocation: !power {{--template|ChangeRanks|Dwarven Stead;Notoriety;2;@{Adventure Record|asa_notoriety}+2;asa_notoriety;StoneFolk;0;0;asa_stone_folk;;;;;You defeat the dwaves but earn the enmity of all dwarves throughout the realm.}} Failing template invocation: !power {{--template|ChangeRanks|Dwarven Stead;Notoriety;2;@{Adventure Record|asa_notoriety}+2;asa_notoriety;Stone Folk;0;0;asa_stone_folk;;;;;You defeat the dwaves but earn the enmity of all dwarves throughout the realm.}} As you can see, the only difference between the calls is it works when ~5! is StoneFolk and fails when it is StoneFolk.&nbsp; Interestingly, if I add this to the template: &nbsp;--?? "~5!" &lt;&gt; "" ?? !z|notblank --?? "~5!" == "" ?? !zz|blank When ~5! is StoneFolk it reports notblank.&nbsp; When it is Stone Folk it reports nothing. In the original conditionals for PowerCards, a space is a separator between pieces of the conditional, so I don't believe they can be included when using a ??..?? conditional. You might try an expanded conditional (?! .. ?!) but there are some alterations that need to be made (like using -ne instead of &lt;&gt; for not equals). They are evaluated completely differently internally and surrounding things with spaces in them with quotes should work for expanded conditionals. See the wiki entry here :&nbsp;&nbsp; <a href="https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals</a>
I'll try that Kurt, good suggestion.&nbsp; Technically though, isn't the $5! bit that's not working part of the tag definition and not part of the conditional?&nbsp; The "~5!" &lt;&gt; "" is quoted, so I didn't think the space would matter?&nbsp; Or are the " removed as part of the parsing?
1594734580
Kurt J.
Pro
API Scripter
kgsodie said: I'll try that Kurt, good suggestion.&nbsp; Technically though, isn't the $5! bit that's not working part of the tag definition and not part of the conditional?&nbsp; The "~5!" &lt;&gt; "" is quoted, so I didn't think the space would matter?&nbsp; Or are the " removed as part of the parsing? For normal conditionals, the string is essentially split on spaces and the script attempts to use the parts, so "The String" becomes "The as the first part and String" as the second part, but it doesn't know what to do with them. Quotes aren't taken into account for normal conditionals.
This simplified example prints nothing: !power --name|test --?? "Stone Folk" &lt;&gt; "" ?? desc *1|notblank --?? "Stone Folk" == "" ?? desc *2|blank This simplified example crashes the script: !power --name|test --?! "Stone Folk" -ne "" ?! desc|notblank For reference, the error message generated was:&nbsp; TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at apiscript.js:2383:48 at Array.forEach (&lt;anonymous&gt;) at apiscript.js:2378:10 at checkFinishedOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:757:7) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:837:8) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:825:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)
Copy that, Kurt. I'll remove spaces from my callers.
1594737038
Kurt J.
Pro
API Scripter
kgsodie said: This simplified example prints nothing: !power --name|test --?? "Stone Folk" &lt;&gt; "" ?? desc *1|notblank --?? "Stone Folk" == "" ?? desc *2|blank This simplified example crashes the script: !power --name|test --?! "Stone Folk" -ne "" ?! desc|notblank For reference, the error message generated was:&nbsp; TypeError: Cannot read property '0' of null TypeError: Cannot read property '0' of null at apiscript.js:2383:48 at Array.forEach (&lt;anonymous&gt;) at apiscript.js:2378:10 at checkFinishedOps (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:757:7) at eval (eval at &lt;anonymous&gt; (/home/node/d20-api-server/api.js:158:1), &lt;anonymous&gt;:837:8) at Timeout._onTimeout (/home/node/d20-api-server/node_modules/underscore/underscore.js:825:19) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7) Your extended conditional end marker needs to&nbsp; be reversed... The markers are ?! and !? (you have ?! and ?!)
Doh.&nbsp; I'll roll that in and verify it works.&nbsp; Thanks! Any thought and the previous post?
1594939647

Edited 1594943257
Is it possible to have a powercard that calls a template where an argument to the template is a chat button that calls a macro: !power {{ --name|Elven Patrol --template|CheckRanksAny|Elven Patrol;Elven Friend;@{Adventure Record|asa_elven_friend};1;Silver Riders;@{Adventure Record|asa_silver_riders};1;;;;success;failure [Check Reaction](!&amp;#13;#ElvenPatrol02)}} The&nbsp; issue is that the required HTML entity for a carriage return (&amp;#13;) contains a semicolon, which the template call seems to interpret as an argument separator.&nbsp; Is there any way around this? **UPDATE** I found a workaround. From a powercard script that&nbsp; does not call a template if I use !&amp;#13;#macro then I get the normal chat&nbsp; button and the macro call works. From a powercard that calls a template, if I use an argument of `#macro then it also works, although graphically it looks like a link instead of a button. Note that `#macro does not work from a powercard outside of a template argument, and !&amp;#13;#macro doesn't work from a powercard template argument.
After using the macro on the wiki page for displaying NPC info, (modified slightly to display speed and AC/type): &nbsp;!power {{ --name|@{selected|character_name} --whisper|GM --format|badguys --emote| --tokenid|@{selected|token_id} --npc_attribute_summary|@{selected|character_id} --npc_qualities_summary|@{selected|character_id} --npc_skills_summary|@{selected|character_id} --!Actions|**Available Actions** --npc_action_list|@{selected|character_id} --!Reactions|**Available Reactions** --npc_reaction_list|@{selected|character_id} --!LA|**Legendary Actions** --npc_legendaryaction_list|@{selected|character_id} --!TR|**@{selected|character_name} Traits** --npc_trait_list|@{selected|character_id} }} But sometimes the traits show up with the description, sometimes just the name of the trait. It is consistent within the same monster, i.e. a zombie's traits always show up, but a grimlock's don't. And it doesn't seem to be dependent on the name of the trait, i.e. Devil's Sight and Magic Resistance show up for a Bone Devil, but not for a Horned Devil.&nbsp; Any idea how I could make the trait descriptions show up every time?