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)

1604589783

Edited 1604589926
Kurt J.
Pro
API Scripter
Kenneth N. said: Hello All, First thank you for all the awesome contributions. New to Roll20 and just got into API use.   I'm having and issue with a combat macro of powercard I've built. Basically trying to replicate the combat modifiers provided in the character sheet macro. Once I get it working properly plan to add some of the bells and whistles ike sounds and effects based upon different wepaons tyes used. Works fine from the character sheet (Using 3.5 Diana) But when I try and copy it out to a macro for the table to use I'm getting the following error:  TypeError: Cannot read property 'substring' of undefined   that keeps repeating. Do I need to do something different to make it work in a table macro?  Here is the code:     !power {{ --name|@{selected|character_name} Swings his @{selected|weapon1name} at @{target|character_name} --Attack:|[[ [$Atk] 1d20 @{weapon1attackcalc} + ?{Flanking|0} - ?{Power Attack|0} + ?{Additional Attack Modifier|0}]] vs **AC** @{target|bar2} --?? $Atk >= @{target|bar2} ?? Damage:|[[ [$Dmg] @{weapon1damage} + ?{Power Attack Damage}]] --?? $Atk >= @{target|bar2} AND $Atk.base >= @{weapon1critmin} ??  Confirm Crit:|[[ [$Crt] 1d20 @{weapon1attackcalc}]] vs **AC** @{target|bar2}  --?? $Crt >= @{target|bar2} AND $Atk.base >= @{weapon1critmin}  ?? Crit Damage:|[[ [$CDmg] @{weapon1damage} +?{Power Attack Damage}]] --?? $Atk >= @{target|bar2} AND $Crt < @{target|bar2} ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Crt >= @{target|bar2} AND $Atk.base >= @{weapon1critmin} ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^Dmg]+[^CDmg] _show|all }} When not run from an attribute, Roll20 won't know what character to use to look up the attributes you are referencing (like @{weapon1critmin}, for example. When run from a character sheet, it is assumed that they belong to that character, but when run from somewhere else it doesn't know what sheet to look on. You can probably fix this by adding "selected|" in front of all of them (ie, @{selected|weapon1critmin} instead of @{weapon1critmin}) so that the character reference can be resolved.
I managed to get Alterbars to work by making different conditionals for each kind of damage.  The way I had it before seemed to be re-rolling the damage roll instead of referencing the RollID.  This is the script I came up with that finally worked to automatically deal damage to Bar3: !power {{   --name|Maul Attack   --leftsub|Melee Attack   --rightsub|Range = 5   --emote|@{selected|token_name} attacks @{target|token_name}   --charid|@{selected|character_id}   --target_list|@{target|token_id}   --Attack:|You rolled a [[ [$Atk] 1d20 + [[@{selected|strength_mod}]] + [[@{selected|pb} ]] vs **AC** [[@{target||npc_ac}]]   --?? $Atk < @{target|npc_ac} ?? !Miss|**Whiff!**   --?? $Atk < @{target|npc_ac} ?? soundfx|_audio,play,nomenu|Miss   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 2d6 + @{selected|strength_mod} ]] bludgeoning damage   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? alterbar1 *1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? soundfx*2|_audio,play,nomenu|Punch   --?? #Atk.base = 1 ?? !Fumble|**You Suck!!!**   --?? #Atk.base = 1 ?? soundfx*3|_audio,play,nomenu|Fumble   --?? #Atk.base = 20 ?? !Critical|You bring the PAIN! Critical hit dealing [[ [$CritDmg] 4d6 + @{selected|strength_mod} ]]   --?? #Atk.base = 20 ?? soundfx*4|_audio,play,nomenu|Crit   --?? #Atk.base = 20 ?? alterbar1*2|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] }} Works every time!  Now I am trying to layer in the Advantage replacement. I have taken some care and time using Chatsetattr macros to one-button toggle Advantage, and I really like that setup, so I would like to not have to choose advantage with a roll query.  I know PCMacro Helper provides the Advantage Replacement handout, but I can't seem to get it to work.  What do I write in place of the 1d20 to trigger the replacement?  I have tried ~{{query=1}}$ and ~{{normal=1}} {{r2=[[0d20 but both of those break the inline roll. ??
For instance, !power {{   --replacement|Advantage   --name|Maul Attack   --leftsub|Melee Attack   --rightsub|Range = 5   --emote|@{selected|token_name} attacks @{target|token_name}   --charid|@{selected|character_id}   --target_list|@{target|token_id}   --Attack:|You rolled a [[ [$Atk] { WHAT DO I PUT HERE } + [[@{selected|strength_mod}]] + [[@{selected|pb} ]] vs **AC** [[@{target||npc_ac}]]   --?? $Atk < @{target|npc_ac} ?? !Miss|**Whiff!**   --?? $Atk < @{target|npc_ac} ?? soundfx|_audio,play,nomenu|Miss   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 2d6 + @{selected|strength_mod} ]] bludgeoning damage   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? alterbar1 *1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? soundfx*2|_audio,play,nomenu|Punch   --?? #Atk.base = 1 ?? !Fumble|**You Suck!!!**   --?? #Atk.base = 1 ?? soundfx*3|_audio,play,nomenu|Fumble   --?? #Atk.base = 20 ?? !Critical|You bring the PAIN! Critical hit dealing [[ [$CritDmg] 4d6 + @{selected|strength_mod} ]]   --?? #Atk.base = 20 ?? soundfx*4|_audio,play,nomenu|Crit   --?? #Atk.base = 20 ?? alterbar1*2|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] }} Why no worky?
1604622457
Kurt J.
Pro
API Scripter
CatSwann said: For instance, !power {{   --replacement|Advantage   --name|Maul Attack   --leftsub|Melee Attack   --rightsub|Range = 5   --emote|@{selected|token_name} attacks @{target|token_name}   --charid|@{selected|character_id}   --target_list|@{target|token_id}   --Attack:|You rolled a [[ [$Atk] { WHAT DO I PUT HERE } + [[@{selected|strength_mod}]] + [[@{selected|pb} ]] vs **AC** [[@{target||npc_ac}]]   --?? $Atk < @{target|npc_ac} ?? !Miss|**Whiff!**   --?? $Atk < @{target|npc_ac} ?? soundfx|_audio,play,nomenu|Miss   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? Hit:|[[ [$Dmg] 2d6 + @{selected|strength_mod} ]] bludgeoning damage   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? alterbar1 *1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all   --?? $Atk.total >= @{target|npc_ac} AND $Atk.base <> 1 AND $Atk.base <> 20 ?? soundfx*2|_audio,play,nomenu|Punch   --?? #Atk.base = 1 ?? !Fumble|**You Suck!!!**   --?? #Atk.base = 1 ?? soundfx*3|_audio,play,nomenu|Fumble   --?? #Atk.base = 20 ?? !Critical|You bring the PAIN! Critical hit dealing [[ [$CritDmg] 4d6 + @{selected|strength_mod} ]]   --?? #Atk.base = 20 ?? soundfx*4|_audio,play,nomenu|Crit   --?? #Atk.base = 20 ?? alterbar1*2|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] }} Why no worky? I believe what you are looking for is ~@{selected|rtype}$ so: --Attack:|You rolled a [[ [$Atk] ~@{selected|rtype}$ + [[@{selected|strength_mod}]] + [[@{selected|pb} ]] vs **AC** [[@{target||npc_ac}]] I know that is a bit weird, but the Advantage replacement creates three replacement values: {{query=1}} {{normal=1}} {{r2=[[0d20 gets replaced with "1d20" {{query=1}} {{advantage=1}} {{r2=[[1d20 gets replaced with "2d20kh1" {{query=1}} {{disadvantage=1}} {{r2=[[1d20 gets replaced with "2d20kl1" This is because the 5E sheet stores one of these values in the rtype  attribute when you select Normal, Advantage, or Disadvantage.
Ah!&nbsp; I see!&nbsp;&nbsp; But when I try that, I get this: <div class="userscript-showtip userscript-tipsy" original-title="PowerCard sent by: TMunny" style="box-sizing: content-box; min-width: 150px; font-variant-numeric: normal; font-variant-east-asian: normal; text-align: center; font-family: &quot;contrail one&quot;; font-size: 1.2em; line-height: 1.2em; letter-spacing: 2px; vertical-align: middle; margin: 0px; padding: 2px 0px 0px; border: 1px solid rgb(0, 0, 0); border-radius: 5px 5px 0px 0px; text-shadow: rgb(255, 255, 255) -1px -1px 0px, rgb(255, 255, 255) 1px -1px 0px, rgb(255, 255, 255) -1px 1px 0px, rgb(255, 255, 255) 1px 1px 0px; background-color: rgb(200, 255, 200); background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));">Maul Attack Melee Attack ♦ Range = 5 Attack &nbsp;You rolled a [[ [$Atk] ~{{query=1}} {{advantage=1}} {{r2=1 vs&nbsp; AC &nbsp; 13 Do I need to put anything other than --replacement|Advantage in the top line?
1604628885

Edited 1604681071
Figured it out, kinda.&nbsp; Just like the Wiki says, if a replacement is in an inline roll, you have to hide that roll for it to work.&nbsp; So the line should read: --Attack|You rolled a [#[ [$Atk] ~@{selected|rtype}$ + @{selected|strength_mod} + @{selected|pb} ]#] vs **AC** [!@{target|npc_ac}!] Which works like a charm for the Advantage replacement.&nbsp; But now Alterbars isn't working at all.&nbsp; No error, no nothing. Here is my Alterbars conditional: --?? $Atk &gt;= @{target|npc_ac} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all I think because it needs to be hidden for the replacement to work, it does not hold on to the RollId for Alterbars to apply. Thoughts? **edit** It doesn't make sense for that hidden line to affect the alterbars conditional, as it references the $Dmg Roll Id, not the $Atk.&nbsp; But just to make sure my syntax was correct, I changed it back to plain 1d20 and alterbars worked great. Something about the replacement messes with how the Roll Id is stored for future rolls, I think. And the other two conditionals I have on that roll work fine.&nbsp; The soundfx fires, as does the damage roll. Frikkin wierd, I tells ya.
So through the process of elimination, I have determined it is the Replacement command that breaks Alterbars.&nbsp; The hidden roll has no effect on the outcome, but as soon as a put in a replacement, it breaks the function of Alterbars.&nbsp; Not sure what is up with that. &nbsp; --!Attack:|You rolled a [[ [$Atk] 1d20 + @{selected|strength_mod} + @{selected|pb} ]] vs @{target|token_name}'s **AC** [!@{target|npc_ac}!] &nbsp; --?? $Atk &gt;= @{target|npc_ac} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all Works like a charm. &nbsp; --!Attack:|You rolled a [#[ [$Atk] 1d20 + @{selected|strength_mod} + @{selected|pb} ]#] vs @{target|token_name}'s **AC** [!@{target|npc_ac}!] &nbsp; --?? $Atk &gt;= @{target|npc_ac} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all Works like a charm. &nbsp; --!Attack:|You rolled a [#[ [$Atk] ~@{selected|rtype}$ + @{selected|strength_mod} + @{selected|pb} ]#] vs @{target|token_name}'s **AC** [!@{target|npc_ac}!] &nbsp; --?? $Atk &gt;= @{target|npc_ac} AND $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all Not works so much. At all.
Hey I'm running into a problem trying to implement different crits in the template provided by the pcm helper and hoping someone can give some insight. I'm using the&nbsp;D&amp;D 5E by Roll20 sheet. I've gotten it to mostly work, however for crits in my game instead of rolling a second die, the second die is maxed (i.e. 1d6+2 is 1d6+8 on a crit). I believe&nbsp;NPCA-DAMAGE references the entire die roll though (1d6+2). Is there a way to just reference the die size (6) built in or is this something I'd need to make my own template to achieve? Or is there a possible workaround? I would appreciate any advice!
Hello, really love using PowerCards and continuously trying to make better ones.&nbsp; I figured out how to make urls work by using the code in gist and turning on allow urls and allow hidden urls, now I'm wondering how to make that a little more seamless. The goal is to use the Syrinscape weblinks I have within a power card instead of using the jukebox as I have all these sound sets created, but balancing what players are asking, NPCs, maps, stories, etc means I often forget to hit the one shots in battle.&nbsp; IE the cleric does a cure wounds and I'd love his power card to call the weblink sound effect so I don't have to remember to do it.&nbsp; A simple example but it can get a lot more powerful if a person keeps building on it. Currently clicking the link in the power card pops up a do you want to go here box and if I hit continue goes to a new tab.&nbsp; Not terrible, but not seamless.&nbsp; Is there anyway to just make it call the weblink and continue without that?
Hello, I'm a new user and I'm loving powercards. So much freedom! I wanted to try PCMacro Helper however, I keep getting the same error: the macros are there but the attributes aren't building, Under the actions drop down it just lists things like "attacklist" and "l9spelllist" but the chat box just displays"attacklist attribute not found. I have uninstalled and reinstalled both script and tried it on multiple campaigns, but the same result. I have the advantage always button checked in all of them. I'm also seeing this: PCMHelper Your PCMHelper macros are outdated Installed Ver Unknown Available Ver 1.0.10 Please consider running&nbsp; !pcmsetup &nbsp;to install the latest version of the macros I've been using the latest on the OneClick and I've tried selecting the 1.0.10 version from the dropdown. The setup command also makes no difference.&nbsp; Can anyone tell me what I'm doing wrong?
1605189748
David M.
Pro
API Scripter
If I want to use powercards to call another api script, I see that the syntax is --api_SomeApiName _arg1 _arg2 However, the api script I want to call has complex formatting requirements for parsing of commands and arguments. Special characters used by the script are double dashes (--), pipes (|), colons (:), and pound signs (#), whew! e.g. this detect magic application of the !Radar script: !radar --id|@{selected|token_id}&nbsp;--range|30ft --wavespacing|35 --wavedelay|50 --wavelife|200 --pinglife|4000 --tokfilter|gmnotes:abjuration#6fa8dc, conjuration#green, divination#ffffff, enchantment#yellow, evocation#red, illusion#ff00ff, necromancy#000000, transmutation#blue --LoS|yes --title|Detect Magic --units|ft Aside from replacing double dashes (--) with underscores (_), how should I handle this? Getting a&nbsp; Cannot read property 'get' of undefined&nbsp; error with just that replacement. I'm sure at least the pipes are causing problems.&nbsp; At first the --replacement command for a template handout looked promising, although it looks like I'm going to get into problems with the special characters.&nbsp; Before spending untold hours figuring this out, is what I'm trying to do even possible?
1605268034
Kurt J.
Pro
API Scripter
David M. said: If I want to use powercards to call another api script, I see that the syntax is --api_SomeApiName _arg1 _arg2 However, the api script I want to call has complex formatting requirements for parsing of commands and arguments. Special characters used by the script are double dashes (--), pipes (|), colons (:), and pound signs (#), whew! e.g. this detect magic application of the !Radar script: !radar --id|@{selected|token_id}&nbsp;--range|30ft --wavespacing|35 --wavedelay|50 --wavelife|200 --pinglife|4000 --tokfilter|gmnotes:abjuration#6fa8dc, conjuration#green, divination#ffffff, enchantment#yellow, evocation#red, illusion#ff00ff, necromancy#000000, transmutation#blue --LoS|yes --title|Detect Magic --units|ft Aside from replacing double dashes (--) with underscores (_), how should I handle this? Getting a&nbsp; Cannot read property 'get' of undefined&nbsp; error with just that replacement. I'm sure at least the pipes are causing problems.&nbsp; At first the --replacement command for a template handout looked promising, although it looks like I'm going to get into problems with the special characters.&nbsp; Before spending untold hours figuring this out, is what I'm trying to do even possible? I don't know of anything that would prevent it from working... having a -- is the only real problem (hence the _ substitution). Note, however, that your initial syntax is missing a vertical bar after the tag name: --api_SomeApiName _arg1 _arg2 should be --api_SomeApiName|_arg1 _arg2 otherwise PowerCards will try to use everything up to the first | in your actual command as the tag and the rest as the arguments.
1605275303
David M.
Pro
API Scripter
I appreciate the confirmation, Kurt. After cleaning up some powercards syntax, looks like the ultimate problem was with my current radar script being able to handle messages from the api, sigh. Time to go down the caveman debugging rabbit hole :) Thanks again!
Hey, I'm pretty new to coding with APIs here on Roll20 and was hoping I could get some help. I'm trying to get a roll's results to display its total as well as the number of dice that rolled max. I read Powercards might be able to help with this. Is there a way to do this?
1605298792

Edited 1605298961
Kurt J.
Pro
API Scripter
Justin A. said: Hey, I'm pretty new to coding with APIs here on Roll20 and was hoping I could get some help. I'm trying to get a roll's results to display its total as well as the number of dice that rolled max. I read Powercards might be able to help with this. Is there a way to do this? Yes, you can do that... something like this: !power {{ --roll|Rolling [[ [$result] 10d6 ]] --result|Total was [^result] and [^result.aces] dice rolled 6 }} PowerCards supports several modifiers for roll results: .ones - # of dice that rolled a 1 .odds - # of dice that rolled an odd number .evens - # of dice that rolled an even number .aces - # of dice that rolled the max # on the die .total - total roll (same as just using the RollID) .base - What the dice rolled, without and modifiers (ie, with 1d20+6, .base would just return the result of the d20 without the added 6)
Sweet, I appreciate it! I've been trying to do that with the roll templates before being told it's pretty much impossible, so this is a huge help. Thank you very much!
Once Again - mine got lost in the huge blocks of text Still need help here ... <a href="https://app.roll20.net/forum/post/7136858/script-powercards-3-thread-6/?pageforid=9368955#post-9368955" rel="nofollow">https://app.roll20.net/forum/post/7136858/script-powercards-3-thread-6/?pageforid=9368955#post-9368955</a>
1605395354

Edited 1605395478
Kurt J.
Pro
API Scripter
Wolf Thunderspirit said: Need a little help on a script ... dunno what I'm doing wrong. In an undead companion's attack description called "Glare": The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? Dreadful Glare|%{-MIU8WnkrC0Uj7YSg5cF|1_Mummy_Glare} --?? [^Rando] -eq 2 ?? Terrifying Glare|%{-MIU8WnkrC0Uj7YSg5cF|2_Mummy_Glare} --?? [^Rando] -eq 3 ?? Cursing Glare|%{-MIU8WnkrC0Uj7YSg5cF|3_Mummy_Glare} --?? [^Rando] -eq 4 ?? Destroying Glare|%{-MIU8WnkrC0Uj7YSg5cF|4_Mummy_Glare} }} ! These are the macros set up on the sheet: 1_Mummy_Glare: --name|Dreadful Glare --rightsub|Constitution Save --!description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 2_Mummy_Glare: --name|Terrifying Glare --rightsub|Wisdom Save --!description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 3_Mummy_Glare: --name|Cursing Glare --rightsub|Constitution Save --!description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --!Damage|[[8d8]] Necrotic Damage; Half on Save 4_Mummy_Glare: --name|Destroying Glare --rightsub|Dexterity Save --!description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --!Damage|[[10d8]] Force Damage The thing is that it's not outputting anything but the 4th option, even when 1, 2, &amp; 3 are rolled (had to take out the --hroll, replacing with --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando], to see what was actually happening behind the scenes) Can anyone tidy this up for me?&nbsp; I think it's just not doing the conditionals right, but I'm missing what I'm doing wrong ... EDIT: I realize now what is happening - beyond the API.&nbsp; It is that the %{character ID|Ability Call} HAS to fire and replaces all before it.&nbsp; In contrast, Something like this won't work because of the reserved tags.&nbsp; The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? name|Dreadful Glare --?? [^Rando] -eq 1 ?? rightsub|Constitution Save --?? [^Rando] -eq 1 ?? !description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 2 ?? name|Terrifying Glare --?? [^Rando] -eq 2 ?? rightsub|Wisdom Save --?? [^Rando] -eq 2 ?? !description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 3 ?? name|Cursing Glare --?? [^Rando] -eq 3 ?? rightsub|Constitution Save --?? [^Rando] -eq 3 ?? !description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --?? [^Rando] -eq 3 ?? !Damage|[[8d8]] Necrotic Damage; Half on Save --?? [^Rando] -eq 4 ?? name|Destroying Glare --?? [^Rando] -eq 4 ?? rightsub|Dexterity Save --?? [^Rando] -eq 4 ?? !description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --?? [^Rando] -eq 4 ?? !Damage|[[10d8]] Force Damage }} ! I'm at a loss what to do here.&nbsp; Any suggestions? You are using expanded conditional operators with normal conditional tags. The ??..?? conditionals use ==, &gt;, &gt;=, etc. The expanded conditionals (?!..!?) are the ones that use "powershell" operators (-eq, -gt, etc.)&nbsp; None of the conditionals will ever fire because none of them will ever be true. But yes, you won't be able to include self-running macros in the powercard because they would have to be expanded by the chat server, and indeed you can't have multiple rightsub, etc. tags. You could have the card output buttons for the macros that you could then click.
1605414445

Edited 1605414559
Kurt J. said: Wolf Thunderspirit said: Need a little help on a script ... dunno what I'm doing wrong. In an undead companion's attack description called "Glare": The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? Dreadful Glare|%{-MIU8WnkrC0Uj7YSg5cF|1_Mummy_Glare} --?? [^Rando] -eq 2 ?? Terrifying Glare|%{-MIU8WnkrC0Uj7YSg5cF|2_Mummy_Glare} --?? [^Rando] -eq 3 ?? Cursing Glare|%{-MIU8WnkrC0Uj7YSg5cF|3_Mummy_Glare} --?? [^Rando] -eq 4 ?? Destroying Glare|%{-MIU8WnkrC0Uj7YSg5cF|4_Mummy_Glare} }} ! These are the macros set up on the sheet: 1_Mummy_Glare: --name|Dreadful Glare --rightsub|Constitution Save --!description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 2_Mummy_Glare: --name|Terrifying Glare --rightsub|Wisdom Save --!description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 3_Mummy_Glare: --name|Cursing Glare --rightsub|Constitution Save --!description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --!Damage|[[8d8]] Necrotic Damage; Half on Save 4_Mummy_Glare: --name|Destroying Glare --rightsub|Dexterity Save --!description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --!Damage|[[10d8]] Force Damage The thing is that it's not outputting anything but the 4th option, even when 1, 2, &amp; 3 are rolled (had to take out the --hroll, replacing with --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando], to see what was actually happening behind the scenes) Can anyone tidy this up for me?&nbsp; I think it's just not doing the conditionals right, but I'm missing what I'm doing wrong ... EDIT: I realize now what is happening - beyond the API.&nbsp; It is that the %{character ID|Ability Call} HAS to fire and replaces all before it.&nbsp; In contrast, Something like this won't work because of the reserved tags.&nbsp; The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? name|Dreadful Glare --?? [^Rando] -eq 1 ?? rightsub|Constitution Save --?? [^Rando] -eq 1 ?? !description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 2 ?? name|Terrifying Glare --?? [^Rando] -eq 2 ?? rightsub|Wisdom Save --?? [^Rando] -eq 2 ?? !description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 3 ?? name|Cursing Glare --?? [^Rando] -eq 3 ?? rightsub|Constitution Save --?? [^Rando] -eq 3 ?? !description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --?? [^Rando] -eq 3 ?? !Damage|[[8d8]] Necrotic Damage; Half on Save --?? [^Rando] -eq 4 ?? name|Destroying Glare --?? [^Rando] -eq 4 ?? rightsub|Dexterity Save --?? [^Rando] -eq 4 ?? !description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --?? [^Rando] -eq 4 ?? !Damage|[[10d8]] Force Damage }} ! I'm at a loss what to do here.&nbsp; Any suggestions? You are using expanded conditional operators with normal conditional tags. The ??..?? conditionals use ==, &gt;, &gt;=, etc. The expanded conditionals (?!..!?) are the ones that use "powershell" operators (-eq, -gt, etc.)&nbsp; None of the conditionals will ever fire because none of them will ever be true. But yes, you won't be able to include self-running macros in the powercard because they would have to be expanded by the chat server, and indeed you can't have multiple rightsub, etc. tags. You could have the card output buttons for the macros that you could then click. I'm trying to reduce the number of clicks.&nbsp; Since Powercards is the only API I know of that can use an IF/ THAN conditional, I was hoping to be able to process the variable out of the powercard itself, then be able to call only which one was randomized.&nbsp; Essentially, I just wanted him to be able to click the attack once and have it do what it needs to. I am right in assuming reserved tags can't be used with conditionals, correct?
1605452770
Kurt J.
Pro
API Scripter
Wolf Thunderspirit said: Kurt J. said: Wolf Thunderspirit said: Need a little help on a script ... dunno what I'm doing wrong. In an undead companion's attack description called "Glare": The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? Dreadful Glare|%{-MIU8WnkrC0Uj7YSg5cF|1_Mummy_Glare} --?? [^Rando] -eq 2 ?? Terrifying Glare|%{-MIU8WnkrC0Uj7YSg5cF|2_Mummy_Glare} --?? [^Rando] -eq 3 ?? Cursing Glare|%{-MIU8WnkrC0Uj7YSg5cF|3_Mummy_Glare} --?? [^Rando] -eq 4 ?? Destroying Glare|%{-MIU8WnkrC0Uj7YSg5cF|4_Mummy_Glare} }} ! These are the macros set up on the sheet: 1_Mummy_Glare: --name|Dreadful Glare --rightsub|Constitution Save --!description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 2_Mummy_Glare: --name|Terrifying Glare --rightsub|Wisdom Save --!description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 3_Mummy_Glare: --name|Cursing Glare --rightsub|Constitution Save --!description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --!Damage|[[8d8]] Necrotic Damage; Half on Save 4_Mummy_Glare: --name|Destroying Glare --rightsub|Dexterity Save --!description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --!Damage|[[10d8]] Force Damage The thing is that it's not outputting anything but the 4th option, even when 1, 2, &amp; 3 are rolled (had to take out the --hroll, replacing with --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando], to see what was actually happening behind the scenes) Can anyone tidy this up for me?&nbsp; I think it's just not doing the conditionals right, but I'm missing what I'm doing wrong ... EDIT: I realize now what is happening - beyond the API.&nbsp; It is that the %{character ID|Ability Call} HAS to fire and replaces all before it.&nbsp; In contrast, Something like this won't work because of the reserved tags.&nbsp; The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? name|Dreadful Glare --?? [^Rando] -eq 1 ?? rightsub|Constitution Save --?? [^Rando] -eq 1 ?? !description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 2 ?? name|Terrifying Glare --?? [^Rando] -eq 2 ?? rightsub|Wisdom Save --?? [^Rando] -eq 2 ?? !description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 3 ?? name|Cursing Glare --?? [^Rando] -eq 3 ?? rightsub|Constitution Save --?? [^Rando] -eq 3 ?? !description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --?? [^Rando] -eq 3 ?? !Damage|[[8d8]] Necrotic Damage; Half on Save --?? [^Rando] -eq 4 ?? name|Destroying Glare --?? [^Rando] -eq 4 ?? rightsub|Dexterity Save --?? [^Rando] -eq 4 ?? !description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --?? [^Rando] -eq 4 ?? !Damage|[[10d8]] Force Damage }} ! I'm at a loss what to do here.&nbsp; Any suggestions? You are using expanded conditional operators with normal conditional tags. The ??..?? conditionals use ==, &gt;, &gt;=, etc. The expanded conditionals (?!..!?) are the ones that use "powershell" operators (-eq, -gt, etc.)&nbsp; None of the conditionals will ever fire because none of them will ever be true. But yes, you won't be able to include self-running macros in the powercard because they would have to be expanded by the chat server, and indeed you can't have multiple rightsub, etc. tags. You could have the card output buttons for the macros that you could then click. I'm trying to reduce the number of clicks.&nbsp; Since Powercards is the only API I know of that can use an IF/ THAN conditional, I was hoping to be able to process the variable out of the powercard itself, then be able to call only which one was randomized.&nbsp; Essentially, I just wanted him to be able to click the attack once and have it do what it needs to. I am right in assuming reserved tags can't be used with conditionals, correct? That is correct.
1605550962

Edited 1605551168
Kurt J. said: Wolf Thunderspirit said: Kurt J. said: Wolf Thunderspirit said: Need a little help on a script ... dunno what I'm doing wrong. In an undead companion's attack description called "Glare": The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? Dreadful Glare|%{-MIU8WnkrC0Uj7YSg5cF|1_Mummy_Glare} --?? [^Rando] -eq 2 ?? Terrifying Glare|%{-MIU8WnkrC0Uj7YSg5cF|2_Mummy_Glare} --?? [^Rando] -eq 3 ?? Cursing Glare|%{-MIU8WnkrC0Uj7YSg5cF|3_Mummy_Glare} --?? [^Rando] -eq 4 ?? Destroying Glare|%{-MIU8WnkrC0Uj7YSg5cF|4_Mummy_Glare} }} ! These are the macros set up on the sheet: 1_Mummy_Glare: --name|Dreadful Glare --rightsub|Constitution Save --!description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 2_Mummy_Glare: --name|Terrifying Glare --rightsub|Wisdom Save --!description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. 3_Mummy_Glare: --name|Cursing Glare --rightsub|Constitution Save --!description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --!Damage|[[8d8]] Necrotic Damage; Half on Save 4_Mummy_Glare: --name|Destroying Glare --rightsub|Dexterity Save --!description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --!Damage|[[10d8]] Force Damage The thing is that it's not outputting anything but the 4th option, even when 1, 2, &amp; 3 are rolled (had to take out the --hroll, replacing with --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando], to see what was actually happening behind the scenes) Can anyone tidy this up for me?&nbsp; I think it's just not doing the conditionals right, but I'm missing what I'm doing wrong ... EDIT: I realize now what is happening - beyond the API.&nbsp; It is that the %{character ID|Ability Call} HAS to fire and replaces all before it.&nbsp; In contrast, Something like this won't work because of the reserved tags.&nbsp; The mummy uses a random glare on a target that it can see within 60 feet.}} @{Mute Companion|charname_output} !power {{ --tokenid|@{selected|token_id} --emote|Companion Glares ... --leftsub|DC 14 --Random Identifier|[[ [$Rando] 1d4 ]] checking [^Rando] --?? [^Rando] -eq 1 ?? name|Dreadful Glare --?? [^Rando] -eq 1 ?? rightsub|Constitution Save --?? [^Rando] -eq 1 ?? !description|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 2 ?? name|Terrifying Glare --?? [^Rando] -eq 2 ?? rightsub|Wisdom Save --?? [^Rando] -eq 2 ?? !description|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?? [^Rando] -eq 3 ?? name|Cursing Glare --?? [^Rando] -eq 3 ?? rightsub|Constitution Save --?? [^Rando] -eq 3 ?? !description|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --?? [^Rando] -eq 3 ?? !Damage|[[8d8]] Necrotic Damage; Half on Save --?? [^Rando] -eq 4 ?? name|Destroying Glare --?? [^Rando] -eq 4 ?? rightsub|Dexterity Save --?? [^Rando] -eq 4 ?? !description|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. --?? [^Rando] -eq 4 ?? !Damage|[[10d8]] Force Damage }} ! I'm at a loss what to do here.&nbsp; Any suggestions? You are using expanded conditional operators with normal conditional tags. The ??..?? conditionals use ==, &gt;, &gt;=, etc. The expanded conditionals (?!..!?) are the ones that use "powershell" operators (-eq, -gt, etc.)&nbsp; None of the conditionals will ever fire because none of them will ever be true. But yes, you won't be able to include self-running macros in the powercard because they would have to be expanded by the chat server, and indeed you can't have multiple rightsub, etc. tags. You could have the card output buttons for the macros that you could then click. I'm trying to reduce the number of clicks.&nbsp; Since Powercards is the only API I know of that can use an IF/ THAN conditional, I was hoping to be able to process the variable out of the powercard itself, then be able to call only which one was randomized.&nbsp; Essentially, I just wanted him to be able to click the attack once and have it do what it needs to. I am right in assuming reserved tags can't be used with conditionals, correct? That is correct. @Kurt So - with a little more poking, prodding, plowing through the wiki page, and good ol' trial and error - I got something that works ... Never let it be said it Can't be done! (Just find a different way of doing it...lol) !power {{ --tokenid|@{selected|token_id} --name|Mummy Glare^^[img2](<a href="https://thumbs.gfycat.com/AgitatedPoshEuropeanfiresalamander-max-1mb.gif" rel="nofollow">https://thumbs.gfycat.com/AgitatedPoshEuropeanfiresalamander-max-1mb.gif</a>) --emote|The Companion Glares ... --hroll|[[ [$Rando] 1d4 ]] --?! $Rando -eq 1 !? DC 14 Constitution Save| --?- $Rando -eq 2 -? DC 14 Wisdom Save| --?- $Rando -eq 3 -? DC 14 Constitution Save|^^[[8d8]] Necrotic Damage; Half on Save --?- $Rando -eq 4 -? DC 14 Dexterity Save|^^[[10d8]] Force Damage --?! $Rando -eq 1 !? Dreadful Glare|The targeted creature must succeed on a DC 14 Constitution saving throw or be paralyzed for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?- $Rando -eq 2 -? Terrifying Glare|The targeted creature must succeed on a DC 14 Wisdom saving throw or be frightened for 1 minute. ^^ The target can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success. --?- $Rando -eq 3 -? Cursing Glare|The targeted creature must make a DC 14 Constitution saving throw, taking 8d8 necrotic damage on a failed save, or half as much damage on a successful one. --?- $Rando -eq 4 -? Destroying Glare|If the target is a creature, it must succeed on a DC 14 Dexterity saving throw or take 10d8 force damage. If this damage reduces the creature to 0 hit points, its body becomes a pile of fine gray dust. ^^ If the target is a Large or smaller nonmagical object or creation of magical force, it is disintegrated without a saving throw. ^^ If the target is a Huge or larger nonmagical object or creation of magical force, this ray disintegrates a 10-foot cube of it. }} Just posting in case its useful as a jumping off point in making randomized single powercards for anyone else. It takes a bit of tweaking, but essentially you are making each consecutive line of if/else statements appear in order, rather than a block, and when you check the random conditional it had to be in a certain format and avoid certain characters ( [ and ]&nbsp; in my case ).&nbsp; And, of course (no matter how nice it would look), no using reserved tags in conditionals :-(&nbsp; &nbsp; I also had a typo on a couple lines.&nbsp; This API is SUPER SENSATIVE regarding typos!&nbsp; Get your syntax right or either crash, or ouput nada.&nbsp; lol But I'm glad to say that this works, and thanks for the API! PS: Here's the funny part ... we think the player I was doing this for quit the group ... *sigh*
Not sure if I am just dense or what.&nbsp; But the PC wiki stats that your can add an attribute to a character with the name spell_SPELLNAME_MACRO and #Macro in the value field and then when using the --spell_list tag the API button will automatically search for and replace the macro with your self-made macro.&nbsp; I have done this but I cannot get the API button to call my macro it always just uses the build-in.&nbsp; Any thoughts?
Hello, I absolutely love power cards so far. I have been able to get all of the PCMHelper Macros to work, except NPCACTION. Everytime I perform a roll, I get "[[ [$Atk] ~{{always=1}} {{r2=1 v" as an attack roll, but it shows the correct AC of the target. I have Advantage set to toggle, I tried looking at the inline roll to see if there was an open ended bracket, but no luck. I did notice the "NPCATTACK:" line started differently than the other Macros. Overall, this is what I have for the NPCACTION line in an attempt to correct it. Could anyone help? The NPC action is below. NPCBasics: --tokenid|~0! --target_list|~1! --emote|~S-CN$ ~2! against ~T-CN$ --format|badguys --name|~3! --['~NPCA-TYPE$' -eq 'ATTACK']leftsub|~4! --['~NPCA-RANGE$' -eq 'ATTACK']rightsub|~5! NPCAttack:&nbsp; --["~NPCA-TYPE$" -eq "ATTACK"]Attack |[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk &lt; ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$
Is there a way to use powercards within a roll template or vice versa? For example, using the Starfinder roll template in a powercard.
1605902209

Edited 1605902306
Kurt J.
Pro
API Scripter
Kyle M. said: Hello, I absolutely love power cards so far. I have been able to get all of the PCMHelper Macros to work, except NPCACTION. Everytime I perform a roll, I get "[[ [$Atk] ~{{always=1}} {{r2=1 v" as an attack roll, but it shows the correct AC of the target. I have Advantage set to toggle, I tried looking at the inline roll to see if there was an open ended bracket, but no luck. I did notice the "NPCATTACK:" line started differently than the other Macros. Overall, this is what I have for the NPCACTION line in an attempt to correct it. Could anyone help? The NPC action is below. NPCBasics: --tokenid|~0! --target_list|~1! --emote|~S-CN$ ~2! against ~T-CN$ --format|badguys --name|~3! --['~NPCA-TYPE$' -eq 'ATTACK']leftsub|~4! --['~NPCA-RANGE$' -eq 'ATTACK']rightsub|~5! NPCAttack:&nbsp; --["~NPCA-TYPE$" -eq "ATTACK"]Attack |[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk &lt; ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk &gt;= ~T-AC$ AND $Atk.base &lt;&gt; 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ The most common reason to get an error like that is that your Advantage method for the creature isn't set to Advantage Toggle. All of the PCMHelper templates require that for both players and NPCs. Changing the default for the game won't change the setting for individual creatures that already exist in the journal. You need to go into the creature and change it in the gear section. Alternatively there is a chatsetattr script I can dig up somewhere that will set it for all chars in the game.
Thank you so much Kurt! I sincerely appriciate all the work you've done on this!!!
(I am using chatsetattr as well)
1606142400

Edited 1606143265
Hello, I'm working on a script that uses skipto... I have looked in the documentation and on the forum to try to find a solution but I can't understand why my skipto doesn't work. Could you please help me? Thx ! Below is my code. !power {{ --name|Jet de compétence --tokenid|@{selected|token_id} --emote|Fait un jet de compétence... --corners|15 --bgcolor|#e8e8e8 --erowbg|#ffffff --orowbg|#ffffff !--name|Jet de compétence --leftsub|$$#98111D|**DIFFICILE**$$ --$Nombre de dés:|[! ?{Nombre de Dés|1} !] --$Assurer des qualités:|[! ?{Qualités assurées|0} !] --$Seuil réussite:|[! ?{Seuil|6} !] !Jet de dés - dés gardés --!Jet : |[[ [NH] [$Jet] (?{Nombre de Dés}- ?{Qualités assurées})d6 ]] ➤ Seuil de réussite de **?{Seuil}**~~~ --?? $Jet.base &gt;= ?{Seuil} ?? skipto*1|Reussite&nbsp; --?? $Jet.base &lt; {Seuil} ?? skipto*2|Echec --:Reussite| --hroll| [! [^Jet.evens] !] + **Assurées : **[[ [NH] [$Jet2] (?{Qualités assurées})d1 ]] --?? ?{Qualités assurées} == 0 AND $Jet.evens &gt;= 4 ?? !R |[image](<a href="https://i.imgur.com/4uxQpyn.jpg" rel="nofollow">https://i.imgur.com/4uxQpyn.jpg</a>) --?? ?{Qualités assurées} == 1 AND $Jet.evens &gt;= 3 ?? !R |[image](<a href="https://i.imgur.com/4uxQpyn.jpg" rel="nofollow">https://i.imgur.com/4uxQpyn.jpg</a>) --?? ?{Qualités assurées} == 2 AND $Jet.evens &gt;= 2 ?? !R |[image](<a href="https://i.imgur.com/4uxQpyn.jpg" rel="nofollow">https://i.imgur.com/4uxQpyn.jpg</a>) --?? ?{Qualités assurées} == 3 AND $Jet.evens &gt;= 1 ?? !R |[image](<a href="https://i.imgur.com/4uxQpyn.jpg" rel="nofollow">https://i.imgur.com/4uxQpyn.jpg</a>) --?? ?{Qualités assurées} &gt;= 4 ?? !R |[image](<a href="https://i.imgur.com/4uxQpyn.jpg" rel="nofollow">https://i.imgur.com/4uxQpyn.jpg</a>) --?? $Jet.evens == 1 ?? !Qualités : |~C***Qualités***^^★~C --?? $Jet.evens == 2 ?? !Qualités : |~C***Qualités***^^★★~C --?? $Jet.evens == 3 ?? !Qualités : |~C***Qualités***^^★★★~C --?? $Jet.evens == 4 ?? !Qualités : |~C***Qualités***^^★★★★~C --?? $Jet.evens == 5 ?? !Qualités : |~C***Qualités***^^★★★★★~C --?? $Jet.evens == 6 ?? !Qualités : |~C***Qualités***^^★★★★★ ★~C --?? $Jet.evens == 7 ?? !Qualités : |~C***Qualités***^^★★★★★ ★★~C --?? $Jet.evens == 8 ?? !Qualités : |~C***Qualités***^^★★★★★ ★★★~C --?? $Jet.evens == 9 ?? !Qualités : |~C***Qualités***^^★★★★★ ★★★★~C --?? $Jet.evens == 10 ?? !Qualités : |~C***Qualités***^^★★★★★ ★★★★★~C --?? $Jet2.total == 1 ?? !Assurées : |~C***Qualités assurées***^^★~C --?? $Jet2.total == 2 ?? !Assurées : |~C***Qualités assurées***^^★★~C --?? $Jet2.total == 3 ?? !Assurées : |~C***Qualités assurées***^^★★★~C --?? $Jet2.total == 4 ?? !Assurées : |~C***Qualités assurées***^^★★★★~C --?? $Jet2.total == 5 ?? !Assurées : |~C***Qualités assurées***^^★★★★★~C --?? $Jet2.total == 6 ?? !Assurées : |~C***Qualités assurées***^^★★★★★ ★~C --?? $Jet2.total == 7 ?? !Assurées : |~C***Qualités assurées***^^★★★★★ ★★~C --?? $Jet2.total == 8 ?? !Assurées : |~C***Qualités assurées***^^★★★★★ ★★★~C --?? $Jet2.total == 9 ?? !Assurées : |~C***Qualités assurées***^^★★★★★ ★★★★~C --?? $Jet2.total == 10 ?? !Assurées : |~C***Qualités assurées***^^★★★★★ ★★★★★~C --skipto*3|EndOfCard --:Echec| --!Echec : | $$#98111D|**ECHEC !**$$ --skipto*4|EndOfCard --:EndOfCard| --!Interprétation| [TTB 'width=100%'][TRB][TDB align=left colspan=15] ~~~**Qualité du résultat** [TDE][TRE][TRB][TDB width='10%' align=right] ★★★★ [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] Réussite complète [TDE][TRE][TRB][TDB width='10%' align=right] ★★★&nbsp; [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] Réussite partielle [TDE][TRE][TRB][TDB width='10%' align=right] ★★ [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] Entre-deux [TDE][TRE][TRB][TDB width='10%' align=right] ★&nbsp; [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] Semi-réussite [TDE][TRE][TTE] }}
Oh! Sorry, I've got it! There was a "?" missing in front of a rollquerie! Thank you for these great powercards! I take a lot of pleasure to prepare my sessions with :)
Hello - is it possible to make roll reference within one macro but in two separate power cards? If I make roll secretly as GM/player --whispering to GM&nbsp; - can I somehow make "portions" of powercard visible to player(s) or at least roll result? eg&nbsp; !power {{ --whisper|gm --name| @{selected|token_name} save throw (whatever) --Roll:| [[ [$Atk] 2d20kl1]] }} !power {{ --whisper|self --name| Roll result --Roll was:|[^Atk] }} I get roll and follwing error which I believe is bcs those two !power(s) does not "see" into each other&nbsp;&nbsp; &gt; ROLL ID NOT FOUND &lt;&nbsp;
Also is there equivalent of&nbsp; --ogl_pc_attack_list&nbsp; but for pc-actions? or pc-traits?
Hi all, am new to roll20 and more to PowerCards. Am trying to make a simple hit macro for Pathfinder 2 where critical can came either from a natural 20 or from hitting the target by more than 10. so i've tried this: !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** manoeuvre pour transpercer @{target|character_name} --name|Shortsword &amp; Dagger --leftsub|2-Actions --Attaque Shortsword|[[ [$Atk1] 1d20 + @{selected|dexterity_modifier} + 2 + @{selected|level} ]] vs AC --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk1.total &gt;= @{target|AC} AND &lt; {10 + @{target|AC}} AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts :|[[ [$Dmg] 1d6 + 2]] Dommage Tranchant --?? $Atk1 &gt;= @{target||ac} AND $Atk1.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk1.base == 20 OR $Atk1.total &gt; {10 + @{target|AC}} ?? Coup critique :|[[ [$CritDmg] 2d6 +2]] Dommage Tranchant --?? $Atk1.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk1 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood }} but doesn't work, even worse the script seems stopped at those sentence and don't display the end of the line. any hint please (i read the last 3 pages and watch video, but here am lost). Thks per advance
Ben L. said: Hi all, am new to roll20 and more to PowerCards. Am trying to make a simple hit macro for Pathfinder 2 where critical can came either from a natural 20 or from hitting the target by more than 10. so i've tried this: !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** manoeuvre pour transpercer @{target|character_name} --name|Shortsword &amp; Dagger --leftsub|2-Actions --Attaque Shortsword|[[ [$Atk1] 1d20 + @{selected|dexterity_modifier} + 2 + @{selected|level} ]] vs AC --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk1.total &gt;= @{target|AC} AND &lt; {10 + @{target|AC}} AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts :|[[ [$Dmg] 1d6 + 2]] Dommage Tranchant --?? $Atk1 &gt;= @{target||ac} AND $Atk1.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk1.base == 20 OR $Atk1.total &gt; {10 + @{target|AC}} ?? Coup critique :|[[ [$CritDmg] 2d6 +2]] Dommage Tranchant --?? $Atk1.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk1 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood }} but doesn't work, even worse the script seems stopped at those sentence and don't display the end of the line. any hint please (i read the last 3 pages and watch video, but here am lost). Thks per advance Hey Ben,&nbsp; I ran into a similar problem with my PF2 game and was shown that the math in the conditional doesn't quite work. You need to make the 10 + AC into a roll with a Roll ID for Powercards to compare to. Try adding: --hroll|[[ [$CritAC] 10d1 + @{target|AC} ]] Then you can update your conditional to&nbsp; --?? $Atk1.base == 20 OR $Atk1.total &gt; $CritAC ?? Coup critique :|[[ [$CritDmg] 2d6 +2]] Dommage Tranchant --?? $Atk1.base == 20 OR $Atk1.total &gt; $CritAC ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all That should do what you want it to.&nbsp; You can also (Shameless Plug!) check out my blog to see how to do a whole bunch of things in PF2 with Powercards and the API.&nbsp;
1606289265

Edited 1606320830
Merci beaucoup pour ce coup de pouce Erik (Thanks alot Erik).
so this give that !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** manoeuvre pour transpercer @{target|character_name} --name|Shortsword &amp; Dagger --leftsub|2-Actions --Attaque Shortsword|[[ [$Atk1] 1d20 + @{selected|dexterity_modifier} + 2 + @{selected|level} ]] vs AC --hroll|[[ [$CritAC] 10 + 0d0 + @{target|AC} ]] OR [[ [$Dmg1] 1d6 + @{selected|dexterity_modifier} ]] OR [[ [$CritDmg1] (1d6 + @{selected|dexterity_modifier})*2 ]] --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk1.total &gt;= @{target|AC} AND $Atk1.total &lt; $CritAC AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts:|[[ [^$Dmg1] ]] Dommage Tranchant --?? $Atk1 &gt;= @{target||ac} AND $Atk1.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk1.base == 20 OR $Atk1.total &gt;= $CritAC ?? Coup critique :|[[ [^$CritDmg1] ]] Dommage Tranchant --?? $Atk1.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg1] _show|all --?? $Atk1 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood }} and result is worst: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but end of input found. look like i need a valor between 2 valors (@{target||AC} and $CritAC)
which script do use? look like i miss some
Ben L. said: so this give that !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** manoeuvre pour transpercer @{target|character_name} --name|Shortsword &amp; Dagger --leftsub|2-Actions --Attaque Shortsword|[[ [$Atk1] 1d20 + @{selected|dexterity_modifier} + 2 + @{selected|level} ]] vs AC --hroll|[[ [$CritAC] 10 + 0d0 + @{target|AC} ]] OR [[ [$Dmg1] 1d6 + @{selected|dexterity_modifier} ]] OR [[ [$CritDmg1] (1d6 + @{selected|dexterity_modifier})*2 ]] --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk1.total &gt;= @{target|AC} AND $Atk1.total &lt; $CritAC AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts:|[[ [^$Dmg1] ]] Dommage Tranchant --?? $Atk1 &gt;= @{target||ac} AND $Atk1.base &lt;&gt; 20 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk1.base == 20 OR $Atk1.total &gt;= $CritAC ?? Coup critique :|[[ [^$CritDmg1] ]] Dommage Tranchant --?? $Atk1.base == 20 ?? alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg1] _show|all --?? $Atk1 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood }} and result is worst: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but end of input found. look like i need a valor between 2 valors (@{target||AC} and $CritAC) I noticed some of your "AC" tags are not using the same capitalization (Ac, AC, ac), you may want to go and double check which attribute you want to reference. Also, I am new to this as well, but you may need to take out one of the "pipe" symbols in @{target|AC} (make sure you hover over the spot on the sheet you would like to check the AC of to make sure you are targeting/formula is checking the right attributes.
1606469765

Edited 1606472452
Is it possible to input the added attributes "Attack_OnHit", "Attack_OnMiss","Sound_WhenHurt" into the PCMHelper templates by duplicating the conditionals by duplicating the code for said outcomes but substituting the appropriate soundattr (I don't have the Wiki pulled up right now, thats not the correct tag)? Also, if the previous logic works, in the PCMHelper, I noticed some of the resulting "[~3 ~eq] ect." Can reference an @{selected|Attribute} before defining other parameters. Would it be possible to reference an added attribute ("repeatingnpcaction_0_name")[or whatever the actions name would be] and @{selected|target} into the brackets of the supposed outcome of a roll "poison_sprayFX" to only play the sound of a poison spray attribute if it exists on the executing character sheet? Like, [~3 ~eq ... AND @{selected|self|target} ~eq @{selected|Poison_SprayFX}] ?? $Atk &gt;= @{selected|AC} ?? Soundattr|:Attack_OnHit... im not sure if ~eq or == is the same as "if in x sheet has/exists x attribute." I understand this would make for a lengthy template.
1606673209

Edited 1606673308
I have created a new game in Roll20. Installed Powercards and Powercards Macro helper. I launched the game, and ran !pcmsetup. When I am testing macros I get this kind of output. Code in the the attack rather than formatted outpu. Any idea what I am doing wrong, or what I can do to fix?
Once I set the creature to Advantage toggle, I was fine. I have updated my notes.
PLEASE HELP! Hello, I am a new DM and learning roll20 so please excuse if I have missed something obvious. Currently, I have the following APIs installed: 5th Edition OGL by Roll20 Companion PowerCards PowerCards Macro Helper AlterBars.js ACT.js Roll20 Audio Master Status FX GroupCheck ApplyDamage.js CombatMaster.js GroupInitiative SpellMaster-SRD SpellMaster Concentration Critical Fumbler It's a Trap! It's a Trap! - D&amp;D 5E Generic TokenMod Aura/Tint HealthColors Token Action Maker TokenNameNumber Token Collisions Torch&nbsp; Vector Math MatrixMath Path Math HTML Builder Character Sheet Utils splitArgs ChatSetAttr Now, I am not an API expert. I developed software a long time ago but I don't fully understand the syntax yet to develop and modify these scripts. Anyway, I watched some really good video tutuorials and read many posts in the forums but I am having trouble making sense of it all. I am trying to build a macros to allow Power Cards to do attacks and spells with auto damage (and animation).&nbsp; I am almost there, I think (although I have not figured out how to do this with attacks yet, only spells). I have the following for Fire Bolt thanks to Nick Olivio : !power {{ &nbsp;--name|Fire Bolt &nbsp;--leftsub|Ranged Spell Attack &nbsp;--rightsub|120 ft Range &nbsp;--whisper|gm Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{spell_attack_bonus} ]] vs ac @{target|ac} &nbsp;--?? $Atk &gt;= @{target|ac} AND $Atk.base &lt;&gt; 20 ?? Damage:|[[ [$Dmg] 1d10 ]] &nbsp;--?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d10 ]] &nbsp;--vfx_opt|@{selected|token_id} @{target|token_id} beam-fire&nbsp; --?? $Atk &gt;= @{target|ac} ?? Burned:|A flammable object hit by this spell ignites if it isn’t being worn or carried. &nbsp;--?? $Atk &gt;= @{target|ac} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|chemical-bolt &nbsp;--?? $Atk &gt;= @{target|ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all &nbsp;--?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all }} This works pretty awesome for the most part. It rolls and resolves the spell attack, will do damage to the selected target and even display a beam of fire streaking to the target (although I can't figure out the sounds but that is a minor issue).&nbsp; What I would like is to be able to select this spell from the list of available spells the way that the PCMacro Helper Marco does with this one: !power {{ &nbsp; --replacespell|@{selected|character_id}|?{Cantrip to cast|@{selected|cantrip_list}} &nbsp; --replaceattrs|S-|@{selected|character_id}&nbsp; &nbsp; --replaceattrs|T-|@{target|character_id}&nbsp; &nbsp; --replacement|Advantage &nbsp; --template|Basics|@{selected|token_id};@{target|token_id};casts ~SP-NAME$;~SP-NAME$;Cantrip;~SP-RANGE$;@{selected|whispertoggle} &nbsp; --template|CantripAttack|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod};@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit} }} This one works great stand alone to select the cantrip from the list of cantrips from the character sheet, but I would like to be able to roll and resolve the spells with the macros like when you click on the character sheet or even better like the first macro. I am ok to create the first macro for each spell that has an attack component (or all if needed) but I want to be able to have the PC select them.&nbsp; Maybe I am asking for too much...&nbsp; At the end of the day what I would want is a way for the macro/API combo to check the character sheet, allow a selection of a target and roll the attack vs AC and then resolve the damage. Note that I don't know how to change the first macro to a longsword attack for example either...&nbsp; I have watched dozens of youtube videos, read through the forums, posted to reddit, and I'm at the end of my rope. Any help would be GREATLY appreciated!!!
@catswann and @kurtJ I have made some modifications to the code (v3.8.15) that allows me to do certain multi-affected spells (ie. Prayer of Healing) with Alterbars. See the following macro: !power {{ --whisper|gm --name|Prayer of Healing --leftsub|Ranged Healing Spell --rightsub|30 ft Range --target_list|@{target|first|token_id} | @{target|second|token_id} | @{target|third|token_id} | @{target|fourth|token_id} | @{target|fifth|token_id} | @{target|sixth|token_id} --alterbar*#?{Number of targets|1}|_target|%%token_id%% _bar|1 _amount|+[[ ( @{selected|spellcasting_ability} ?{Level Cast|2|3|4|5|6|7|8|9} )d8 ]] _show|gm }} I had to modify the function buildinlineroll, in the following ways: 1. I added a new parameter at the end (RollOnly) 2. Before the rollOut functions, i added a simple if statement: if(RollOnly !== undefined &amp;&amp; RollOnly == true) return inlineroll.results.total; 3. I added/modified the alterbar section of the tags: if (Tag.substring(0, 8) == "alterbar") { &nbsp;&nbsp;&nbsp;&nbsp;PowerCard[Tag] = doInlineFormatting(PowerCard[Tag], ALLOW_URLS, ALLOW_HIDDEN_URLS, Rolls, PowerCards.NoInlineFormatting); &nbsp;&nbsp;&nbsp;&nbsp;var atbar = PowerCard; &nbsp;&nbsp;&nbsp;&nbsp;var TrackerID = "-1"; &nbsp;&nbsp;&nbsp;&nbsp;TrackerID = (PowerCard.charid !== undefined) ? "C|" + PowerCard.charid : TrackerID; &nbsp;&nbsp;&nbsp;&nbsp;TrackerID = (PowerCard.tokenid !== undefined) ? "T|" + PowerCard.tokenid : TrackerID; &nbsp;&nbsp;&nbsp;&nbsp;var RollExpression = ""; &nbsp;&nbsp;&nbsp;&nbsp;var RollValue = 0; &nbsp;&nbsp;&nbsp;&nbsp;var i = 1; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;Object.keys(x[0].inlinerolls).forEach(function (i) { &nbsp;&nbsp;&nbsp;&nbsp; RollValue = x[0].inlinerolls[i]; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (atbar[Tag].indexOf("$[[" + i + "]]") !== -1) &nbsp;&nbsp;&nbsp;&nbsp;atbar[Tag] = atbar[Tag].replace("$[[" + i + "]]", buildInline(RollValue, TrackerID, msg.who, true)); &nbsp;&nbsp;&nbsp;&nbsp;}); &nbsp;&nbsp;&nbsp;&nbsp;setTimeout(function () { sendChat(msg.who, "!alter " + atbar[Tag].replace(/(?:\s+|\b)_/g, " --")) &nbsp;&nbsp;&nbsp;&nbsp;}, timeout); &nbsp;&nbsp;&nbsp;&nbsp;timeout = timeout + 250; } 4. I added a new case in the Charms section: case 'token_id': return Token.id; There is obviously room for improvement, i'm still curious how to do a non-specified targetlist, however for my first offical modification, this worked excellently.&nbsp; &nbsp;After my testing, i was successfully able to auto-heal my players without having to resort to the chat bar, or worrying about my characters not ready to update their health bars.
BartalowBill &nbsp; There are 2 ways to do what you wish with your PC's.&nbsp; The first is to build the macro directly on the PC sheet, (in the abilities and attributes tab), and check the box that reads Show as Token Action. The second is to build the macro in your Macro section, add the user(s) you want to be able to see the macro in the Visible to Players section, and check the Show as Token Action box. These may wind up cluttering up YOUR interface, so you might have a macro built to just display buttons and show them in Chat instead with the macro names you created.&nbsp;&nbsp;&nbsp;&nbsp;
1607075707

Edited 1607077343
I've been doing some experimenting with altering the PCMHelper as well. On a tester game, I have broken down all of the Templates and added effects and Audio to the "?? ??" Query sections. So far, I have added "replaceattrlist" for ~T and one for ~S to macros to include the new visual/audio attributes, but I'm stumped ad to where the first "--soundattr *1 |attack_$0_sound" goes, if it would go before the template attack line...
I'm so close to having the macros I want in game. For the Ray of Frost I think I have it figured out: !power {{ &nbsp;--whisper|gm &nbsp;--name|Ray of Frost &nbsp;--leftsub|Ranged Spell Attack &nbsp;--rightsub|60 ft Range &nbsp;--Attack:|[[ [$Atk] ?{Attack|Standard,1d20|Advantage,2d20kh1|Disadvantage,2d20kl1} + @{spell_attack_bonus} ]] vs ac @{target|ac} &nbsp;--?? $Atk &gt;= @{target|ac} AND $Atk.base &lt;&gt; 20 ?? Damage:|[[ [$Dmg] 1d8 ]] &nbsp;--?? $Atk.base == 20 ?? Critical Hit|[[ [$CritDmg] 2d8 ]] &nbsp; --soundfx|_audio,play,nomenu|boltsound &nbsp;--vfx_opt|@{selected|token_id} @{target|token_id} beam-frost&nbsp; &nbsp;--?? $Atk &gt;= @{target|ac} ?? Slowed:|Target's speed is reduced by 10 ft until start of your next turn &nbsp;--?? $Atk &gt;= @{target|ac} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|tread &nbsp;--?? $Atk &gt;= @{target|ac} ?? api_act|-1 1 _Slow &nbsp;--?? $Atk &gt;= @{target|ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all &nbsp;--?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all }} and then I want to use the same concept and I am trying to adapt the PC-Attack macro: !power {{&nbsp; &nbsp;--whisper|gm&nbsp; &nbsp;--soundfx|_audio,play,nomenu|axe_attack --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}}&nbsp; &nbsp; --replacement|Advantage&nbsp; &nbsp; --replaceattrs|S-|@{selected|character_id}&nbsp; &nbsp; --replaceattrs|T-|@{target|character_id}&nbsp; &nbsp; --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} &nbsp;&nbsp; -- template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod};@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit} &nbsp;--?? $Atk &gt;= @{target|ac} AND $Atk.base &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all &nbsp;--?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all }} Now I can't just put those lines in the bottom because the damage doesn't match what is rolled above in the power card. It's soooo close to perfect... the output I get is this : Gabriel D'more uses Longsword (One-Handed) against Giant Spider (From BartalowBill): <div class="userscript-showtip userscript-tipsy" original-title="PowerCard sent by: BartalowBill" style="box-sizing: content-box; min-width: 150px; font-family: georgia; font-size: 1.2em; line-height: 1.2em; font-variant-numeric: normal; font-variant-east-asian: normal; letter-spacing: 2px; text-align: center; vertical-align: middle; margin: 0px; padding: 2px 0px 0px; border: 1px solid rgb(0, 0, 0); border-radius: 5px 5px 0px 0px; color: rgb(255, 255, 255); text-shadow: rgb(0, 0, 0) -1px -1px 0px, rgb(0, 0, 0) 1px -1px 0px, rgb(0, 0, 0) -1px 1px 0px, rgb(0, 0, 0) 1px 1px 0px; background-color: rgb(0, 68, 0); background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));">Longsword (One-Handed) Attack Attack &nbsp;<span class="userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: [$Atk] 1d20 + 6 [Attack Bonus] Results: ( 11 ) + 6 = 17" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">17 &nbsp;vs&nbsp; AC &nbsp;<span title="Roll: 14 Results: 14 = 14" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">14 Hit &nbsp;Gabriel D'more hits Giant Spider for&nbsp;<span title="Roll: [$Dmg] 1d8 + 4 Results: ( 7 ) + 4 = 11" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">11 &nbsp;Slashing damage Giant Spider takes 14 damage. So how do I get the&nbsp; highlighted &nbsp;text to then take that damage from alterbar1 like I did with the ray of frost example in bold ? I want to try and redefine the variable $Atk to the output of&nbsp; template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod};@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit} &nbsp; but I can't seem to figure it out right. This would be so awesome because it looks at the character sheet, finds your attack, automatically adds your modifiers, advantage and etc. and is just missing the alterbar damage...&nbsp; So close... if this works, I can summarize the APIs used and macro set for future use for the community because I'm sure others would find it useful....
I'm thinking something like this but my syntax is all wrong.... !power {{&nbsp; &nbsp;--whisper|gm&nbsp; &nbsp;--soundfx|_audio,play,nomenu|axe_attack --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}}&nbsp; &nbsp; --replacement|Advantage&nbsp; &nbsp; --replaceattrs|S-|@{selected|character_id}&nbsp; &nbsp; --replaceattrs|T-|@{target|character_id}&nbsp; &nbsp; --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} &nbsp; --template|PCAttack|?? ~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod}; &gt;= @{target|ac} AND @{selected|rtype} &lt;&gt; 20 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit}] _show|all &nbsp;--?? @{selected|rtype} == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[@{selected|global_damage_mod_roll};@{selected|global_damage_mod_type};@{selected|global_damage_mod_crit}+@{selected|global_damage_mod_roll}] _show|all }} PowerCards: {"name":"SyntaxError","expected":["\"(\"","\".\"","\"[\"","\"abs(\"","\"ceil(\"","\"d\"","\"floor(\"","\"round(\"","\"t\"","\"{\"","[ |\\t]","[+|\\-]","[0-9]"],"found":"?","message":"Expected \"(\", \".\", \"[\", \"abs(\", \"ceil(\", \"d\", \"floor(\", \"round(\", \"t\", \"{\", [ |\\t], [+|\\-] or [0-9] but \"?\" found.","offset":8,"line":1,"column":9}
1608141078

Edited 1608141139
Hello everyone, I'm trying to get the Fumbler api to work with PowerCards for fumbled rolls. Below is simplified script that I am using for testing. !power {{ &nbsp;--name|Test Card &nbsp;--Attack:|[[ [$Atk] 1d1 ]] &nbsp;--?? $Atk.base == 1 ?? Fumble:|api_fumbler }} What am I doing wrong?
Eric R. said: Hello everyone, I'm trying to get the Fumbler api to work with PowerCards for fumbled rolls. Below is simplified script that I am using for testing. !power {{ &nbsp;--name|Test Card &nbsp;--Attack:|[[ [$Atk] 1d1 ]] &nbsp;--?? $Atk.base == 1 ?? Fumble:|api_fumbler }} What am I doing wrong? Change the last line to:&nbsp;&nbsp;&nbsp;--?? $atk.base == 1 ?? api_fumble| Here is a full macro example for a 5E attack using this mechanism (note the example auto rolls damage but doesn't automatically account for the output of the Fumbler or Critical APIs: !power {{ --name|5E Attack --hroll|[[ [$ac] 1d6+10 ]] [[ [$dmgBase] 1d8 + 5 ]] [[ [$dmgCrit] 2d8 + 5 ]] --Attack|You attack, rolling [[ [$atk] 1d20 + 5 [STR] + 3 [PROF] ]] vs AC [! [^ac] !] --?? $atk.base == 20 ?? Critical Hit!|You strike a vital spot for [! [^dmgCrit] !] damage! &nbsp;--?? $atk.base == 20 ?? api_critical|1d100 --?? $atk.total &gt;= $ac AND $atk.base &lt;&gt; 20 AND $atk.base &lt;&gt; 1 ?? Hit!|Your blow lands for [! [^dmgBase] !] damage! --?? $atk.total &lt; $ac AND $atk.base &lt;&gt; 20 AND $atk.base &lt;&gt; 1 ?? Miss|Your attack missed! &nbsp;--?? $atk.base == 1 ?? Fumble|Your attack went horribly wrong! &nbsp;--?? $atk.base == 1 ?? api_fumble| }}
1608161009

Edited 1608161032
Eric R. said: Hello everyone, I'm trying to get the Fumbler api to work with PowerCards for fumbled rolls. Below is simplified script that I am using for testing. !power {{ &nbsp;--name|Test Card &nbsp;--Attack:|[[ [$Atk] 1d1 ]] &nbsp;--?? $Atk.base == 1 ?? Fumble:|api_fumbler }} What am I doing wrong? Here is your specific example:&nbsp;&nbsp; &nbsp;!power {{ &nbsp;--name|Test Card &nbsp;--Attack:|[[ [$Atk] 1d1 ]] &nbsp;--?? $Atk.base == 1 ?? Fumble:|Oh no! &nbsp;--?? $Atk.base == 1 ??api_fumble| }} Now if I can get someone to help me with my problem above...
Thanks for the help BartalowBill. I'm pretty new to Roll20 macros and PowerCards. What you have is beyond my current skill level. :)