Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

[Script] PowerCards 3 (Thread 5)

Question on the spell_list function. I currently am using the spell list example right from the wiki. It generates the list just fine, but when I click the button for one of my spells that I'm trying to replace it just outputs #CharmPerson to chat. I have an attribute defined spell_charm_person_macro with a value of #CharmPerson, and a macro named CharmPerson. The attribute seems to be working since it is picking up #CharmPerson but then in chat I'm getting #CharmPerson. Hitting arrow up gives me a previous command of !#CharmPerson. Any ideas why that wouldn't be working?  !power {{ --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }}
Micah Zoltu said: Ah, that did it (moving ribbon).  Happen to have a magic solution for everything else?  :D I think I figured out the AC thing, I can do the character replacements which includes the ac || ncp_ac thing for me, and that seems to work.  I still can't figure out how to have a roll query that I use for two different things (e.g., advantage/disadvantage roll query both for presentation to the user and deciding how to roll the dice). I also haven't been able to figure out a way to roll for damage across multiple attacks and total them.  The problem is that rolling for crit requires a conditional, and I can only do conditionals for display, not for rolling/not-rolling. If you're going with a toggle so that when you roll advantage you know you're always using both dice then something like this should work. You say total damage across multiple attacks so not sure if this would work or not for what you're looking for.  Do two damage rolls inside a conditional based on your attacks. The first damage roll is a non-crit, the 2nd is the crit. --Attack1:|[[ [$Atk1] 1d20]] --Attack2:|[[ [$Atk2] 1d20]] --??$Atk1.base <> 20 AND $Atk2.base <> 20 ?? Damage:|[[1d8 ]] --??$Atk1.base == 20 OR $Atk2.base == 20 ?? Damage:|[[1d8 +1d8[Crit]]]
1539296589
Kurt J.
Pro
API Scripter
Kevin S. said: Question on the spell_list function. I currently am using the spell list example right from the wiki. It generates the list just fine, but when I click the button for one of my spells that I'm trying to replace it just outputs #CharmPerson to chat. I have an attribute defined spell_charm_person_macro with a value of #CharmPerson, and a macro named CharmPerson. The attribute seems to be working since it is picking up #CharmPerson but then in chat I'm getting #CharmPerson. Hitting arrow up gives me a previous command of !#CharmPerson. Any ideas why that wouldn't be working?  !power {{ --name|Spell List --tokenid|@{selected|token_id} --emote|@{selected|character_name} --leftsub|Atk Bonus: @{selected|spell_attack_bonus} --rightsub|Save DC: @{selected|spell_save_dc} --spell_slots|@{selected|character_id} --spell_list|@{selected|character_id} }} As written, PowerCards spell macros assume that the macro is not local to a character, but rather a game-level macro. I do this because I use fairly generic spell macros that reference anything they need from the selected character sheet. Otherwise, every character that knows Cure Wounds would need a copy of the Cure Wounds macro attached to their character.
1539451385

Edited 1539452221
I have the following PowerCard (rest of the junk removed to highlight the issue): !power {{ --bgcolor|#404040 --erowbg|#fff --orowbg|#e5e5e5 --name|Hit Locations --hr|[[ [$hit_location] ?{Hit Location|Torso, 0|Vitals, -3|Skull, -7|Eye, -9|Face, -5|Neck, -5|Groin, -3|Arm of Leg, -2|Hands or Feet, -3} + 0d0]] --Hit Loc.:|[^hit_location] + 2 }} In the line --Hit Loc.:|[^hit_location] + 2 , the output is  0 + 2  (for Torso), literally. How can I make it so that the result is the sum of both numbers? Is it even possible? Thanks in advance. EDIT:  The workaround I'm using is to just call the query directly in  --Hit Loc.:  , but it clutters the macro and makes it hard to read/debug. I wanted to have everything under  --hroll  if possible.
Anyone else having this problem with the title overflowing the title box? Michael D. said: Kurt J. said: From Michael D. :  How do you change the height or padding of the title bar?  When I increase the titlefontsize it spills over. I would need a specific example, as I'm not sure what you mean. Given that it is an HTML construct, it should expand automatically to encompass any content. This is from a fresh game with no other scripts.  First was 25pt then 35pt.
1539806440
Kurt J.
Pro
API Scripter
Re4XN said: I have the following PowerCard (rest of the junk removed to highlight the issue): !power {{ --bgcolor|#404040 --erowbg|#fff --orowbg|#e5e5e5 --name|Hit Locations --hr|[[ [$hit_location] ?{Hit Location|Torso, 0|Vitals, -3|Skull, -7|Eye, -9|Face, -5|Neck, -5|Groin, -3|Arm of Leg, -2|Hands or Feet, -3} + 0d0]] --Hit Loc.:|[^hit_location] + 2 }} In the line --Hit Loc.:|[^hit_location] + 2 , the output is  0 + 2  (for Torso), literally. How can I make it so that the result is the sum of both numbers? Is it even possible? Thanks in advance. EDIT:  The workaround I'm using is to just call the query directly in  --Hit Loc.:  , but it clutters the macro and makes it hard to read/debug. I wanted to have everything under  --hroll  if possible. Performing calculations on the result of a roll (other than comparisons) isn't possible. I'm assuming there are more complexities here, but why do this as two separate steps? Why isn't the value of Torso 2, Vitals -1, etc?
1539807469
Kurt J.
Pro
API Scripter
Version 3.8.7 is up on the Development GIST Baring any serious issues, it will be promoted to OneClick next week. Only a couple of changes here : - Cleaned up extraneous log commands that were resulting in lots of console chatter. - Updated the getSpellMacro function based on a suggestion by Kevin S. This should not break existing games. If the value of the spell macro attribute begins with a #, it is assumed to be a game-level macro (this is the current behavior, and the # is currently required). If the spell macro attribute does not begin with a # PowerCards will assume it is a character-level macro and prefix it with the character ID. (This is the new behavior).
1539822709

Edited 1539823020
Kurt J. said: Performing calculations on the result of a roll (other than comparisons) isn't possible. I'm assuming there are more complexities here, but why do this as two separate steps? Why isn't the value of Torso 2, Vitals -1, etc? Yeah, I thought so. The Torso example wasn't too good, as it isn't as relevant there. The main reason I wanted to perform calculations was to display a better result on the macro, e.g. Failed by 8  instead of Failed  (20 vs. 12) . But it's a very minor thing. Why isn't it possible to perform calculations with the results of a roll, if I may ask? I am genuinely curious. Either way, thanks for the reply. Great work on the script!
1540067454

Edited 1540067593
OK, so I've suddenly been getting issues with my Replacements Handout and related macros.  This is one of the macros I had working until a few minutes ago. It's a master list of Martial weapons for when I don't have characters equipped with macros in their ability section. It uses a repeating attack section so that it can act as a template for multiple-attack macros.  !power {{ --replaceattrs|T-|@{target|character_id} --replaceattrs|S-|@{selected|character_id} --replacement|?{Weapon|Battleaxe|+1 Battleaxe|+2 Battleaxe|+3 Battleaxe|Two-handed Battleaxe|+1 Two-handed Battleaxe|+2 Two-handed Battleaxe|+3 Two-handed Battleaxe|Flail|+1 Flail|+2 Flail|+3 Flail|Glaive|+1 Glaive|+2 Glaive|+3 Glaive|Greataxe|+1 Greataxe|+2 Greataxe|+3 Greataxe|Greatsword|+1 Greatsword|+2 Greatsword|+3 Greatsword|Halberd|+1 Halberd|+2 Halberd|+3 Halberd|Lance|+1 Lance|+2 Lance|+3 Lance|Longsword|+1 Longsword|+2 Longsword|+3 Longsword|Two-handed Longsword|+1 Two-handed Longsword|+2 Two-handed Longsword|+3 Two-handed Longsword|Maul|+1 Maul|+2 Maul|+3 Maul|Morningstar|+1 Morningstar|+2 Morningstar|+3 Morningstar|Pike|+1 Pike|+2 Pike|+3 Pike|Rapier|+1 Rapier|+2 Rapier|+3 Rapier|Finesse Rapier|+1 Finesse Rapier|+2 Finesse Rapier|+3 Finesse Rapier|Scimitar|+1 Scimitar|+2 Scimitar|+3 Scimitar|Finesse Scimitar|+1 Finesse Scimitar|+2 Finesse Scimitar|+3 Finesse Scimitar|Shortsword|+1 Shortsword|+2 Shortsword|+3 Shortsword|Finesse Shortsword|+1 Finesse Shortsword|+2 Finesse Shortsword|+3 Finesse Shortsword|Trident|+1 Trident|+2 Trident|+3 Trident|Two-handed Trident|+1 Two-handed Trident|+2 Two-handed Trident|+3 Two-handed Trident|War pick|+1 War pick|+2 War pick|+3 War pick|Warhammer|+1 Warhammer|+2 Warhammer|+3 Warhammer|Two-handed Warhammer|+1 Two-handed Warhammer|+2 Two-handed Warhammer|+3 Two-handed Warhammer|Whip|+1 Whip|+2 Whip|+3 Whip|Finesse Whip|+1 Finesse Whip|+2 Finesse Whip|+3 Finesse Whip|Blowgun|+1 Blowgun|+2 Blowgun|+3 Blowgun|Hand Crossbow|+1 Hand Crossbow|+2 Hand Crossbow|+3 Hand Crossbow|Heavy Crossbow|+1 Heavy Crossbow|+2 Heavy Crossbow|+3 Heavy Crossbow|Longbow|+1 Longbow|+2 Longbow|+3 Longbow} --name|?{Weapon} Attack --charid|@{selected|character_id} --emote|@{selected|token_name} tries to hit @{target|token_name} with their ?{Weapon}! --leftsub|Action --hroll| [#[ [$Crit] 20 + ~S-PB$ + ~HitBonus$ + 0d0 ]#] [#[ [$res1] round(1e1*(~DCode$*@{target|Resistance} - floor(~DCode$*@{target|Resistance}))) + 0d0 ]#] --target_list|@{target|token_id} --Attack#1| [#[ [$atk] ?{Roll Type|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1|Crit Test, 20} + ~S-PB$ + ~HitBonus$ + 0d0 ]#] vs %%npc_ac%% AC (%%token_name%%) --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 00 ?? Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$Dmg1] ~BaseDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 00 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 00 ?? Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$CritDmg1] ~CritDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 00 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg1] _show|none --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$resDmg1] ceil((~BaseDamage$+~HitBonus$)/2) +0d0 ]#] ~DType$ damage --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar3|_target|@{target|token_id} _bar|1 _amount|-[^resDmg1] _show|none --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MresDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage resistance! --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|-[^MresDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$resCritDmg1] ceil((~CritDamage$+~HitBonus$)/2 +0d0)]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-[^resCritDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MresCritDmg1] ~CritDamage$+~HitBonus$ +0d0)]#] ~DType$ damage and overcome damage resistance! --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar6|_target|@{target|token_id} _bar|1 _amount|-[^MresCritDmg1] _show|none --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$immuneDmg1] ceil((~BaseDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar7|_target|@{target|token_id} _bar|1 _amount|-[^immuneDmg1] _show|none --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MimmuneDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity! --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar8|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$immuneCritDmg1] ceil((~CritDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar9|_target|@{target|token_id} _bar|1 _amount|-[^immuneCritDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MimmuneCritDmg1] ~CritDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity! --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar10|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneCritDmg1] _show|none --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 03 ?? Weakness Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$weakDmg1] ceil((~BaseDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage --?? $atk_1 >= ~T-AC$ AND $atk_1 <> $Crit AND $res1 == 03 ?? alterbar11|_target|@{target|token_id} _bar|1 _amount|-[^weakDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 03 ?? Weakness Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$weakCritDmg1] ceil((~CritDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 03 ?? alterbar12|_target|@{target|token_id} _bar|1 _amount|-[^weakCritDmg1] _show|none --?? $atk_1 < ~T-AC$ ?? Miss 1 |You miss @{target|token_name} with your 1st attack. --?? $atk_1 >= ~T-AC$ AND ~DType$ == bludgeoning ?? soundfx1:|_audio,play,nomenu|Cestus --?? $atk_1 >= ~T-AC$ AND ~DType$ == piercing ?? soundfx3:|_audio,play,nomenu|Pierce Attack --?? $atk_1 >= ~T-AC$ AND ~DType$ == slashing ?? soundfx4:|_audio,play,nomenu|Sword 3 by d100GM --?? $atk_1 < ~T-AC$ ?? soundfx5:|_audio,play,nomenu|Miss SFX - Roll20 by Spikkle --?? $atk_1 == $Crit ?? soundfx6:|_audio,play,nomenu,delay=0.5|A Singular Strike 2 }} This is how my replacements look. I have pretty much every weapon in the game and +1, +2,+3, and monk versions in a single handout. (The DCode stuff is for dealing with resistance/immunity/weakness). There are Attribute replacements nested inside these replacements which initially caused issues because of load order, but moving the Attribute replacements above the handout replacements did the trick up until recently.  Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Two-handed Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Flail:AttackName|Flail;AType|STR;DType|bludgeoning;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e3 Glaive:AttackName|Glaive;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, reach, two-handed;DCode|1e1 Greataxe:AttackName|Greataxe;AType|STR;DType|slashing;BaseDamage|1d12;CritDamage|2d12;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, two-handed;DCode|1e1 I honestly have no clue what happened. 1. I added all of the monk weapons to the handout today and rewrote the above macro to query them instead of the martial weapons.  2. I ran a few tests which worked just fine. There was a slight problem with my own DCode stuff in the monk weapons from when I handled magical weapons differently. 3. I changed the DCode values for the monk weapons to be the correct values for bludgeoning weapons. 4. I tested the Monk Unarmed attacks that are not magical against an enemy who was immune to bludgeoning damage which worked just fine.  5. I tested the Monk Ki Empowered Unarmed Strikes to see if they would bypass the enemy immunity and the macro spit this out:   PowerCards:  "Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" 6. I tried to monkey with the spacing and looked for errors on my end. 7. Found that all of my macros that rely on the replacements handout give the same error. 8. Got frustrated and posted here. Note: I am running Alter Bars and Roll20AM and a few more scripts that aren't directly related to power card functionality (group initiative, chatsetattr, etc). Any help would be greatly appreciated. 
A few more notes: 1. Changing the Weapon query to a static value doesn't help. I set ?{Weapon} to just Club and tried it. Got the same error.  2. The API spits this out "Error: No attribute or sheet field found for character_id -LPHPsJGHRtl80KKK_X7 named 0*" now. This is the same output as my old load order problem.  3. Removing pieces of the macro (like the offending line in the above example) just makes it hang on the next handout replacement. (Removing the [$Crit] section just makes it hang on the ~DCode$ in the [res1] section. 
1540157936

Edited 1540158051
I need some help with using Templates and Replacements in a PowerCard macro. A couple of notes prior to posting images and code. I have handouts named 'PowerCard Templates' 'PowerCard Replacements' and 'PowerCard Formats' (exactly as I have typed them, without the ' symbols). Using the PowerCard script without replacements and templates works fine, and no issues. When using a hidden roll (hroll), the die roll is not output in a yellow (or other colored) box, and does not let me hover to see the breakdown. With a hidden roll (hroll) with the [XPND] tag does not show an expanded output of the roll The issues are coming up with the Template parameters ~2! - ~5! not parsing correctly with both templates and replacements and with Template parameter ~6! not returning and displaying the input from the query. EDIT: forgot to include the game system and PowerCard version - Pathfinder game system utilizing the Pathfinder Community Sheet and PowerCards version 3.8.5 My code and images of the output are below (with specific notes below each code snippet and image) !power {{ --whisper|GM --tokenid|@{selected|token_id} --format|general --emote|~C // @{selected|character_name} looks the item over carefully. // ~C --name|** @{selected|character_name} Blind Roll ** --title|Appraise roll shown only to the GM. --leftsub|** Appraise ** --rightsub|** @{selected|Appraise-ranks} Ranks ** --!Message: |~C //?{To GM}// ~C ~~~ --hroll|[[ [$SklRol] [XPND] 1d20 + @{selected|Appraise}]] --?? @{Selected|Appraise-ability} == STR-mod ?? Appraise (Str)|~R [^SklRol] ~R --?? @{Selected|Appraise-ability} == DEX-mod ?? Appraise (Dex)|~R [^SklRol] ~R --?? @{Selected|Appraise-ability} == CON-mod ?? Appraise (Con)|~R [^SklRol] ~R --?? @{Selected|Appraise-ability} == INT-mod ?? Appraise (Int)|~R [^SklRol] ~R --?? @{Selected|Appraise-ability} == WIS-mod ?? Appraise (Wis)|~R [^SklRol] ~R --?? @{Selected|Appraise-ability} == CHA-mod ?? Appraise (Cha)|~R [^SklRol] ~R ~~~ --!Notes|~C @{selected|Appraise-note} ~C ~~~ --!AppraiseInfo|~C Appraising an item takes 1 standard action. Determining the most valuable object in a treasure hoard takes 1 full-round action. ~C ^^ @@<a href="http://www.aonprd.com/Skills.aspx?ItemName=Appraise||~C" rel="nofollow">http://www.aonprd.com/Skills.aspx?ItemName=Appraise||~C</a> __ Appraise Skill __ ~C @@ }} This is the PowerCard information. If I copy this into a macro or directly into the chat box, it works fine with no major issues. Regarding the [XPND] tag in the hroll line - I have tried both with and without, but the output still shows as only a number (see images below). If i take out the hroll line and put the die roll in place of the called rollID (the [^SklRol] tag), then the roll shows perfectly (with a colored box and expanded information as appropriate). !power {{ --whisper|GM --format|general --tokenid|@{selected|token_id} --replacement|WebFormat --replacement|Appraise --template|BlindSkills| @{selected|token_id}; @{selected|character_name}; @{selected|~SkillRanks$}; @{selected|~SkillAbility$}; @{selected|~SkillRoll$}; @{selected|~SkillNote$}; ?{To GM} }} This is my PowerCard macro when using Templates and Replacements. I also have the --template line completely on one line with no spaces between the template parameters, it is broken down to individual parameters on a line for examination purposes. BlindSkills: --emote|~C //~1! ~SkillEmote$ // ~C --name|** ~SkillName$ Blind Roll ** --title| ~SkillName$ role shown only to the GM. --leftsub|** ~1! ** --rightsub|** ~2! Ranks ** --!Message:|~C // ~6! // ~C ~~~ --hroll|[#[ [$SklRol] [XPND] 1d20 + ~4!]#] --?? ~3! == STR-mod ?? ~SkillName$ (Str)|~R [^SklRol] ~R --?? ~3! == DEX-mod ?? ~SkillName$ (Dex)|~R [^SklRol] ~R --?? ~3! == CON-mod ?? ~SkillName$ (Con)|~R [^SklRol] ~R --?? ~3! == INT-mod ?? ~SkillName$ (Int)|~R [^SklRol] ~R --?? ~3! == WIS-mod ?? ~SkillName$ (Wis)|~R [^SklRol] ~R --?? ~3! == CHA-mod ?? ~SkillName$ (Cha)|~R [^SklRol] ~R ~~~ --!Notes|~C ~5! ~C ~~~ -- !~SkillNameInfo$ |~C ~SkillInfo$ ~C ^^ ~URL$~SkillWeb$||~CENT$ ~UDL$ ~SkillName$ Skill ~UDL$ ~CENT$ ~URL$ This is my template for BlindSkills. I have this in the "Dexcription &amp; Notes" text box of the 'PowerCard Templates' handout. I have this all on one line with a space before each PowerCard line (e.g. a space before the -- symbols, or the ~~~ lines or the ^^ symbols). I have separated each line for examination purposes. WebFormat:URL|@@;UDL|__;CENT|~C Appraise: SkillName|Appraise; SkillNameInfo|AppraiseInfo; SkillRoll|Appraise; SkillRanks|Appraise-ranks; SkillAbility|Appraise-ability; SkillNote|Appraise-note; SkillEmote|looks the item over carefully.; SkillInfo|Appraising an item takes 1 standard action. Determining the most valuable object in a treasure hoard takes 1 full-round action.; SkillWeb|<a href="http://www.aonprd.com/Skills.aspx?ItemName=Appraise" rel="nofollow">www.aonprd.com/Skills.aspx?ItemName=Appraise</a> This is my replacements used in the macro. These are located in the 'Description &amp; Notes' text box of the 'PowerCards Replacements' handout. The Appraise replacement line is on one line in my handout with no spaces after the ; symbols. It is broken down for ease of examination. The WebFormat replacement line had to be done for the URL to parse properly in the PowerCard output. general: --titlefont|Georgia --subtitlefont|Tahoma --bodyfont|Helvetica --bodyfontsize|12px --corners|8 --titlefontshadow|none --emotefont|Contrail One --lineheight|1.2 This is the format I am using. I have this all on one line in the 'PowerCard Formats' handout and is working correctly (a single space before each -- symbols). I included this hear for reference to see everything I was calling in the macro. This is the PowerCard output if I have a macro setup with no templates or replacements, but using the hidden roll (referring to the Appraise 3 line and the die roll output). This is the PowerCard output when using replacements and templates, with the codes thrown up in the chat window by parsing the templates and replacements.
1540165678
Kurt J.
Pro
API Scripter
Dylan S. said: OK, so I've suddenly been getting issues with my Replacements Handout and related macros.&nbsp; This is one of the macros I had working until a few minutes ago. It's a master list of Martial weapons for when I don't have characters equipped with macros in their ability section. It uses a repeating attack section so that it can act as a template for multiple-attack macros.&nbsp; !power {{ --replaceattrs|T-|@{target|character_id} --replaceattrs|S-|@{selected|character_id} --replacement|?{Weapon|Battleaxe|+1 Battleaxe|+2 Battleaxe|+3 Battleaxe|Two-handed Battleaxe|+1 Two-handed Battleaxe|+2 Two-handed Battleaxe|+3 Two-handed Battleaxe|Flail|+1 Flail|+2 Flail|+3 Flail|Glaive|+1 Glaive|+2 Glaive|+3 Glaive|Greataxe|+1 Greataxe|+2 Greataxe|+3 Greataxe|Greatsword|+1 Greatsword|+2 Greatsword|+3 Greatsword|Halberd|+1 Halberd|+2 Halberd|+3 Halberd|Lance|+1 Lance|+2 Lance|+3 Lance|Longsword|+1 Longsword|+2 Longsword|+3 Longsword|Two-handed Longsword|+1 Two-handed Longsword|+2 Two-handed Longsword|+3 Two-handed Longsword|Maul|+1 Maul|+2 Maul|+3 Maul|Morningstar|+1 Morningstar|+2 Morningstar|+3 Morningstar|Pike|+1 Pike|+2 Pike|+3 Pike|Rapier|+1 Rapier|+2 Rapier|+3 Rapier|Finesse Rapier|+1 Finesse Rapier|+2 Finesse Rapier|+3 Finesse Rapier|Scimitar|+1 Scimitar|+2 Scimitar|+3 Scimitar|Finesse Scimitar|+1 Finesse Scimitar|+2 Finesse Scimitar|+3 Finesse Scimitar|Shortsword|+1 Shortsword|+2 Shortsword|+3 Shortsword|Finesse Shortsword|+1 Finesse Shortsword|+2 Finesse Shortsword|+3 Finesse Shortsword|Trident|+1 Trident|+2 Trident|+3 Trident|Two-handed Trident|+1 Two-handed Trident|+2 Two-handed Trident|+3 Two-handed Trident|War pick|+1 War pick|+2 War pick|+3 War pick|Warhammer|+1 Warhammer|+2 Warhammer|+3 Warhammer|Two-handed Warhammer|+1 Two-handed Warhammer|+2 Two-handed Warhammer|+3 Two-handed Warhammer|Whip|+1 Whip|+2 Whip|+3 Whip|Finesse Whip|+1 Finesse Whip|+2 Finesse Whip|+3 Finesse Whip|Blowgun|+1 Blowgun|+2 Blowgun|+3 Blowgun|Hand Crossbow|+1 Hand Crossbow|+2 Hand Crossbow|+3 Hand Crossbow|Heavy Crossbow|+1 Heavy Crossbow|+2 Heavy Crossbow|+3 Heavy Crossbow|Longbow|+1 Longbow|+2 Longbow|+3 Longbow} --name|?{Weapon} Attack --charid|@{selected|character_id} --emote|@{selected|token_name} tries to hit @{target|token_name} with their ?{Weapon}! --leftsub|Action --hroll| [#[ [$Crit] 20 + ~S-PB$ + ~HitBonus$ + 0d0 ]#] [#[ [$res1] round(1e1*(~DCode$*@{target|Resistance} - floor(~DCode$*@{target|Resistance}))) + 0d0 ]#] --target_list|@{target|token_id} --Attack#1| [#[ [$atk] ?{Roll Type|Normal, 1d20|Advantage, 2d20kh1|Disadvantage, 2d20kl1|Crit Test, 20} + ~S-PB$ + ~HitBonus$ + 0d0 ]#] vs %%npc_ac%% AC (%%token_name%%) --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 00 ?? Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$Dmg1] ~BaseDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 00 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 00 ?? Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$CritDmg1] ~CritDamage$ + ~HitBonus$ +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 00 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg1] _show|none --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$resDmg1] ceil((~BaseDamage$+~HitBonus$)/2) +0d0 ]#] ~DType$ damage --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar3|_target|@{target|token_id} _bar|1 _amount|-[^resDmg1] _show|none --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MresDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage resistance! --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|-[^MresDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$resCritDmg1] ceil((~CritDamage$+~HitBonus$)/2 +0d0)]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 0 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|-[^resCritDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? Magic Res Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MresCritDmg1] ~CritDamage$+~HitBonus$ +0d0)]#] ~DType$ damage and overcome damage resistance! --?? $atk_1 == $Crit AND $res1 == 01 AND ~MagicBonus$ == 1 ?? alterbar6|_target|@{target|token_id} _bar|1 _amount|-[^MresCritDmg1] _show|none --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$immuneDmg1] ceil((~BaseDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar7|_target|@{target|token_id} _bar|1 _amount|-[^immuneDmg1] _show|none --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$MimmuneDmg1] ~BaseDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity! --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar8|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$immuneCritDmg1] ceil((~CritDamage$+~HitBonus$)*0) +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 0 ?? alterbar9|_target|@{target|token_id} _bar|1 _amount|-[^immuneCritDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? Magic Immune Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$MimmuneCritDmg1] ~CritDamage$+~HitBonus$ +0d0 ]#] ~DType$ damage and overcome damage immunity! --?? $atk_1 == $Crit AND $res1 == 02 AND ~MagicBonus$ == 1 ?? alterbar10|_target|@{target|token_id} _bar|1 _amount|-[^MimmuneCritDmg1] _show|none --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 03 ?? Weakness Hit 1 |You hit @{target|token_name} with your 1st attack for [#[ [$weakDmg1] ceil((~BaseDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage --?? $atk_1 &gt;= ~T-AC$ AND $atk_1 &lt;&gt; $Crit AND $res1 == 03 ?? alterbar11|_target|@{target|token_id} _bar|1 _amount|-[^weakDmg1] _show|none --?? $atk_1 == $Crit AND $res1 == 03 ?? Weakness Crit 1 |You crit strike @{target|token_name} with your 1st attack for [#[ [$weakCritDmg1] ceil((~CritDamage$+~HitBonus$)*2) +0d0 ]#] ~DType$ damage --?? $atk_1 == $Crit AND $res1 == 03 ?? alterbar12|_target|@{target|token_id} _bar|1 _amount|-[^weakCritDmg1] _show|none --?? $atk_1 &lt; ~T-AC$ ?? Miss 1 |You miss @{target|token_name} with your 1st attack. --?? $atk_1 &gt;= ~T-AC$ AND ~DType$ == bludgeoning ?? soundfx1:|_audio,play,nomenu|Cestus --?? $atk_1 &gt;= ~T-AC$ AND ~DType$ == piercing ?? soundfx3:|_audio,play,nomenu|Pierce Attack --?? $atk_1 &gt;= ~T-AC$ AND ~DType$ == slashing ?? soundfx4:|_audio,play,nomenu|Sword 3 by d100GM --?? $atk_1 &lt; ~T-AC$ ?? soundfx5:|_audio,play,nomenu|Miss SFX - Roll20 by Spikkle --?? $atk_1 == $Crit ?? soundfx6:|_audio,play,nomenu,delay=0.5|A Singular Strike 2 }} This is how my replacements look. I have pretty much every weapon in the game and +1, +2,+3, and monk versions in a single handout. (The DCode stuff is for dealing with resistance/immunity/weakness). There are Attribute replacements nested inside these replacements which initially caused issues because of load order, but moving the Attribute replacements above the handout replacements did the trick up until recently.&nbsp; Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Two-handed Battleaxe:AttackName|Battleaxe;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e1 Flail:AttackName|Flail;AType|STR;DType|bludgeoning;BaseDamage|1d8;CritDamage|2d8;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|;DCode|1e3 Glaive:AttackName|Glaive;AType|STR;DType|slashing;BaseDamage|1d10;CritDamage|2d10;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, reach, two-handed;DCode|1e1 Greataxe:AttackName|Greataxe;AType|STR;DType|slashing;BaseDamage|1d12;CritDamage|2d12;MagicBonus|0;HitBonus|~S-MSTR$;ADesc|heavy, two-handed;DCode|1e1 I honestly have no clue what happened. 1. I added all of the monk weapons to the handout today and rewrote the above macro to query them instead of the martial weapons.&nbsp; 2. I ran a few tests which worked just fine. There was a slight problem with my own DCode stuff in the monk weapons from when I handled magical weapons differently. 3. I changed the DCode values for the monk weapons to be the correct values for bludgeoning weapons. 4. I tested the Monk Unarmed attacks that are not magical against an enemy who was immune to bludgeoning damage which worked just fine.&nbsp; 5. I tested the Monk Ki Empowered Unarmed Strikes to see if they would bypass the enemy immunity and the macro spit this out: &nbsp; PowerCards: &nbsp;"Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" 6. I tried to monkey with the spacing and looked for errors on my end. 7. Found that all of my macros that rely on the replacements handout give the same error. 8. Got frustrated and posted here. Note: I am running Alter Bars and Roll20AM and a few more scripts that aren't directly related to power card functionality (group initiative, chatsetattr, etc). Any help would be greatly appreciated.&nbsp; My first suggestion would be to copy the whole handout to the clipboard and paste it into NotePad++. If you made any changes to the handout inside the Roll20 editor, there are probably extra hidden characters in it that can throw things off. Look for any extra junk and then paste it back into the handout. The biggest clue here is this line: Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" Which seems to indicate that the HitBonus replacement value is not being set (otherwise it wouldn't be shown as ~HitBonus$ but rather the replacement value).
1540168731

Edited 1540168954
Kurt J.
Pro
API Scripter
Ken P. said: This is the PowerCard output when using replacements and templates, with the codes thrown up in the chat window by parsing the templates and replacements. This is happening because the @{selected...} notation is processed by the chat server before the macro is sent to PowerCards. This means that PowerCards has not had a chance to replace ~SkillRanks$, ~SkillAbility$, etc with the attribute references and the chat server doesn't know what they mean. I *do* have a workaround that I uploaded to the dev server as 3.8.8 , but it requires a little oddness to work. I've added a new tag called "--replaceattrlist", which is just like --replaceattrs except it takes an extra parameter - a semicolon separated list of attributes to change into replacement values. For example: --replaceattrlist|S-|@{selected|character_id}|npc_senses;npc_type} Will create "~S-npc_senses$" and "~S-npc_type$". The tricky parts is that this still wouldn't let you do what you are looking to do, because the skill is unknown at the time replacements are processed. So to get around this, for only --replaceattrlist , the attribute list is processed for replacements. To complicate things a bit further, replacements in the actual PowerCard are processed in reverse order, so the ability specifier needs to be *after* the --replaceattrlist. Ok, I know that is confusing. Here is a simple example (note the inline replace after the replaceattrlist): !power {{ --name|Test --replaceattrlist|S-|@{selected|character_id}|~myrep$_type;~myrep$_senses --inlinereplace|myrep|npc --Senses|~S-~myrep$_senses$ }} Using the idea above that we want npc_senses and npc_type, we have an --inlinereplace of "~myrep$" with "npc". In your example, this would be Appraise. Instead of : SkillRanks|Appraise-ranks; SkillAbility|Appraise-ability; in your replacement list, you would need something like: --replaceattrlist|S-|@{selected|character_id}|~SkillName$-ranks;~SkillName$-ability The --replacement|Appraise would need to come AFTER this line so the replacement would recurse. Then you would use ~S-~SkillName$-ranks$ in your template. At least in theory that should work. The ~SkillName$ variable will be above the ~S-Appraise-ranks$ variable, so it should properly replace the nested variable. I hope that makes sense... as it sounds a little convoluted to me, and I wrote it :)
1540172398

Edited 1540172420
Kurt J. said: My first suggestion would be to copy the whole handout to the clipboard and paste it into NotePad++. If you made any changes to the handout inside the Roll20 editor, there are probably extra hidden characters in it that can throw things off. Look for any extra junk and then paste it back into the handout. The biggest clue here is this line: Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" Which seems to indicate that the HitBonus replacement value is not being set (otherwise it wouldn't be shown as ~HitBonus$ but rather the replacement value). I write my macros/handouts in Notepad++ and copy/paste from the file stored on my computer. I also use select all when updating the replacement handout so that i don't get any leftover junk. (I also checked the original file, there's nothing out of place.) I just tried removing the monk weapons that I added right before the error started, but that hasn't done any good either.&nbsp;
Hi everyone! I'm having trouble with the format-tag right now. I wanted to add a few more formats than the 5 I already had, so I entered the new ones in the PoewrCards Formats-handout, and now none of my formats is working. What have I done wrong?
1540248815
Kurt J.
Pro
API Scripter
Eli P. said: Hi everyone! I'm having trouble with the format-tag right now. I wanted to add a few more formats than the 5 I already had, so I entered the new ones in the PoewrCards Formats-handout, and now none of my formats is working. What have I done wrong? Can you post the content of your format handout?
1540248851
Kurt J.
Pro
API Scripter
Dylan S. said: Kurt J. said: My first suggestion would be to copy the whole handout to the clipboard and paste it into NotePad++. If you made any changes to the handout inside the Roll20 editor, there are probably extra hidden characters in it that can throw things off. Look for any extra junk and then paste it back into the handout. The biggest clue here is this line: Could not determine result type of: [{\"type\":\"L\",\"text\":\"$Crit\"},{\"type\":\"M\",\"expr\":20},{\"type\":\"C\",\"text\":\" + 2 + ~HitBonus$ + 0d0 \"}]" Which seems to indicate that the HitBonus replacement value is not being set (otherwise it wouldn't be shown as ~HitBonus$ but rather the replacement value). I write my macros/handouts in Notepad++ and copy/paste from the file stored on my computer. I also use select all when updating the replacement handout so that i don't get any leftover junk. (I also checked the original file, there's nothing out of place.) I just tried removing the monk weapons that I added right before the error started, but that hasn't done any good either.&nbsp; I'm wondering if there were undocumented updates to the editor that are causing more issues... let me do some poking around.
1540249529
Kurt J.
Pro
API Scripter
Dylan S. said: ... This is how my replacements look. I have pretty much every weapon in the game and +1, +2,+3, and monk versions in a single handout. (The DCode stuff is for dealing with resistance/immunity/weakness). There are Attribute replacements nested inside these replacements which initially caused issues because of load order, but moving the Attribute replacements above the handout replacements did the trick up until recently.&nbsp; ... Rereading this now, this SHOULDN'T have ever worked... replacement sets are processed from the bottom of the macro up, and can't be nested (except for the special case of the --replaceattrlist described above). I've been updating my replacement handouts in my own game, and I haven't been able to break anything so far... still testing.
Kurt J. said: Eli P. said: Hi everyone! I'm having trouble with the format-tag right now. I wanted to add a few more formats than the 5 I already had, so I entered the new ones in the PoewrCards Formats-handout, and now none of my formats is working. What have I done wrong? Can you post the content of your format handout? Yes. Here it is: atst: --txcolor|#FFFFFF --bgcolor|#404400 atmo: --txcolor|#FFFFFF --bgcolor|#044400 atmi: --txcolor|#FFFFFF --bgcolor|#008400 atfr: --txcolor|#FFFFFF --bgcolor|#004800 atre: --txcolor|#FFFFFF --bgcolor|#004440 atin: --txcolor|#FFFFFF --bgcolor|#004404 enst: --txcolor|#FFFFFF --bgcolor|#840000 enmo: --txcolor|#FFFFFF --bgcolor|#480000 enmi: --txcolor|#FFFFFF --bgcolor|#444000 enfr: --txcolor|#FFFFFF --bgcolor|#440400 enre: --txcolor|#FFFFFF --bgcolor|#440040 enin: --txcolor|#FFFFFF --bgcolor|#440004 dast: --txcolor|#FFFFFF --bgcolor|#844444 damo: --txcolor|#FFFFFF --bgcolor|#484444 dami: --txcolor|#FFFFFF --bgcolor|#448444 dafr: --txcolor|#FFFFFF --bgcolor|#444844 dare: --txcolor|#FFFFFF --bgcolor|#444484 dain: --txcolor|#FFFFFF --bgcolor|#444448 rest: --txcolor|#FFFFFF --bgcolor|#400044 remo: --txcolor|#FFFFFF --bgcolor|#040044 remi: --txcolor|#FFFFFF --bgcolor|#004044 refr: --txcolor|#FFFFFF --bgcolor|#000444 rere: --txcolor|#FFFFFF --bgcolor|#000084 rein: --txcolor|#FFFFFF --bgcolor|#000048 itst: --txcolor|#FFFFFF --bgcolor|#358900 itmo: --txcolor|#FFFFFF --bgcolor|#e98900 itmi: --txcolor|#FFFFFF --bgcolor|#e5c900 itfr: --txcolor|#FFFFFF --bgcolor|#e58d00 itre: --txcolor|#FFFFFF --bgcolor|#e58940 itin: --txcolor|#FFFFFF --bgcolor|#e58904
I'm a bit new to this script and was wondering if is it possible to create a powercard menu of macros? Running a game &amp; my macros are beginning to overflow. Something like the example I tried below?
1540263035

Edited 1540263195
Kurt J. said: Dylan S. said: ... This is how my replacements look. I have pretty much every weapon in the game and +1, +2,+3, and monk versions in a single handout. (The DCode stuff is for dealing with resistance/immunity/weakness). There are Attribute replacements nested inside these replacements which initially caused issues because of load order, but moving the Attribute replacements above the handout replacements did the trick up until recently.&nbsp; ... Rereading this now, this SHOULDN'T have ever worked... replacement sets are processed from the bottom of the macro up, and can't be nested (except for the special case of the --replaceattrlist described above). I've been updating my replacement handouts in my own game, and I haven't been able to break anything so far... still testing. Ha. That sounds about right for my macros &gt;.&gt;. Nesting the replacement was the only way I could figure out how to make each weapon automatically apply the appropriate attribute for attack rolls and damage rolls since (as I understand it) you can't put calls in a replacement. Considering how much work it took to get the damn thing working in the first place, it doesn't surprise me that it was never supposed to work at all. Any suggestions on how i could change the replacement and get the same effect?
I'm sorry if this question has been asked before. This is my first time being exposed to any kind of coding so I'm still trying to figure things out. It has been quite daunting but I'm getting there. So far I've been able to make some power cards for my players to a satisfactory level. Real basic stuff like Rolling STR vs. AC and have the card display the attack roll against the opposing creature's defense, and giving an answer back if the attack roll failed or was a success. I want to know if it is possible to have the PowerCard activate a condition on the target creature on a success. I am using CombatTracker and StatusInfo for my game. Can PowerCard run the !ct add [condition name] [duration] [direction] [message] command off a success, or am I better off applying conditions manually myself? Thanks for the answers!
1540337291

Edited 1540363372
RedEye said: I'm sorry if this question has been asked before. This is my first time being exposed to any kind of coding so I'm still trying to figure things out. It has been quite daunting but I'm getting there. So far I've been able to make some power cards for my players to a satisfactory level. Real basic stuff like Rolling STR vs. AC and have the card display the attack roll against the opposing creature's defense, and giving an answer back if the attack roll failed or was a success. I want to know if it is possible to have the PowerCard activate a condition on the target creature on a success. I am using CombatTracker and StatusInfo for my game. Can PowerCard run the !ct add [condition name] [duration] [direction] [message] command off a success, or am I better off applying conditions manually myself? Thanks for the answers! PowerCards can't add conditions directly by itself. BUT, when combined with another script (TokenMod specifically), it can. Details are in this wiki page: API Usage Hope that helps. Edit: added more info. I just reread your post too...and with the below info regarding tokenmod, you can do the same thing with combattracker (ct), just using the ct commands instead of the tokenmod commands. I was just doing a little more research on using tokenmod with powercards. (pulling the information from multiple sources for you.) To add a condition, you would add a powercard line: --api_token-mod|_ids @{selected|token_id} _ignore-selected _set statusmarkers|blue if you wanted to add the blue status marker to the selected token. The following lines of code are pulled from the TokenMod forum page, but edited to work from within powercards. --api_token-mod|_ids @{selected|token_id} _ignore-selected _set statusmarkers|blue:1 this is the command you would use in powercard to add a blue status marker with an index of 1 attacked to the status marker. There are some interesting things that you can do with tokenmod for condition markers. (these are modified for powercards) --api_token-mod|_ids {@selected|token_id} _ignore-selected _set statusmarkers|blue[2]:2 Using tokenmod, you can set multiple status markers of each one (the number in the [] is the number of the blue status marker, and the number after the : is the indexed number of that status marker). This powercard command would set a second blue status marker on the selected token, with an indexed number showing in the blue dot of 2. --api_token-mod|ids {@selected|token_id} _ignore_selected _set statusmarkers|blue:1|blue[2]:2|blue[]:3 This line of code would add three blue status markers to the selected token, each one with a different indexed number (1, 2, and 3) The other neat thing you can do with tokenmod and status markers uses this code: !token_mod --set statusmarkers|?blue:-1|?blue[2]:+2 --api_token-mod|ids @{selected|token_id} _ignore_selected _set statusmarkers|?blue:-1|?blue[2]:+2 These both do the same thing, but the first one is for tokenmod directly, while the second one is for powercards. What they do - (pulling from the tokenmod forum page again) they reduce the index number of the first blue status marker by 1 (the -1 after the colon) and increase the second blue status marker index number by +2. Why this is neat - with a little juggling (i can't remember the script off the top of my head) you can setup a macro to activate at the beginning of a player's combat turn. Inside this macro, you could do something like either one of the above lines of code to decrease the index number on a status marker (for example counting down rounds left in a buff effect). Edit2: I just remembered the script I was referring to above. It is an api snipped called OnMyTurn (again by The Aaron, awesome scripter). You can find it at OnMyTurn with directions on how to use (fairly straightforward). Also below is a very handy reference to the status guides and their roll20 names.
Hello, I am currently working on a death save throw macro (for DD5th). Here's below the best I could reach : The first macro is the one who did the save throw and pop one link to the second (if the throw is a failure) and to the third (if the throw is a success). Everything is working, the conditionnals, the check on success/fails in the character main page, etc. I have one question : I s it possible with powercard to automatically call another macro with conditionnals (power card or not) or the way I have chosen is the only viable ? Macro 1 (Dice throw) : Death save throw, check result and send link to the correct next macro (regarding if the throw is a success or a failure) !power {{ --name|**@{selected|token_name}** --rightsub|**Sauvegarde contre la mort** --Jet : | [[ [$s]1d20 + @{selected|death_save_bonus} [Bonus aux jets de sauvegarde contre la mort] ]] --?? $s.total &gt;= 10 AND $s.base &lt;&gt; 20 ?? C'est une |[réussite](!&amp;#13;#DSaveS) --?? $s.total &lt; 10 AND $s.base &lt;&gt; 1 ?? C'est un |[échec](!&amp;#13;#DSaveF) --?? $s.base == 20 ?? C'est une |[réussite critique](!&amp;#13;#DSaveS)^^ (Cliquer deux fois) --?? $s.base == 1 ?? C'est un |[échec critique](!&amp;#13;#DSaveF)^^ (Cliquer deux fois) }} Macro 2 (Failure) : Send a message to the GM with the current (including the present roll) success and failures, and, where appropriate, the agony of the hero (with sound). Then the macro checks the actual hero condition and ticks the appropriate square in character's sheet. !power {{ --whisper|GM --name|@{selected|token_name} --rightsub|**État de santé :** --?? @{selected|deathsave_succ2} == on AND @{selected|deathsave_fail2} &lt;&gt; on ?? Jets réussi(s) : | [[ [NH] 2d1 [Plus qu'un !] ]] --?? @{selected|deathsave_succ1} == on AND @{selected|deathsave_succ2} &lt;&gt; on AND @{selected|deathsave_fail2} &lt;&gt; on ?? Jets réussi(s) : | [[ [NH] 1d1 [Il faut encore deux succès !] ]] --?? @{selected|deathsave_succ1} == 0 AND @{selected|deathsave_fail2} &lt;&gt; on ?? Jets réussi(s) : | [[ [NH] 1d0 [Serre les poings et bats-toi !] ]] --?? @{selected|deathsave_fail1} == 0 ?? Jets raté(s) : |[[ [NH] 1d1 [Encore deux et c'est bassine !] ]] --?? @{selected|deathsave_fail1} == on AND @{selected|deathsave_fail2} &lt;&gt; on ?? Jets raté(s) : | [[ [NH] 2d1 [T'as déjà une idée pour ton prochain perso ?] ]] --?? @{selected|deathsave_fail2} == on ?? !mort|@{selected|token_name} n'est plus, longue vie à @{selected|token_name} ! --?? @{selected|deathsave_fail2} == on ?? soundfx:|_audio,play,nomenu|Dead }} !setattr {{ --sel --evaluate --deathsave_fail3|("%deathsave_fail2%" === "on") ? "on" : "0" }} !setattr {{ --sel --evaluate --deathsave_fail2|("%deathsave_fail1%" === "on") ? "on" : "0" }} !setattr {{ --sel --evaluate --deathsave_fail1|("%deathsave_fail1%" === "0") ? "on" : "on" }} Macro 3 (Success) : Same shit than the previous one for the success. &nbsp;!power {{ --whisper|GM --name|@{selected|token_name} --rightsub|**État de santé :** --?? @{selected|deathsave_succ2} == on ?? !Stable|Ouf !!! @{selected|token_name} est stabilisé :) --?? @{selected|deathsave_succ2} == on ?? soundfx:|_audio,play,nomenu|Alive --?? @{selected|deathsave_succ1} == on AND @{selected|deathsave_succ2} &lt;&gt; on ?? Jets réussi(s) : | [[ [NH] 2d1 [Plus qu'un !] ]] --?? @{selected|deathsave_succ1} == 0 ?? Jets réussi(s) : | [[ [NH] 1d1 [Il faut encore deux succès !] ]] --?? @{selected|deathsave_fail2} == on AND @{selected|deathsave_succ2} &lt;&gt; on ?? Jets raté(s) : | [[ [NH] 2d1 [T'as déjà une idée pour ton prochain perso ?] ]] --?? @{selected|deathsave_fail1} == on AND @{selected|deathsave_fail2} &lt;&gt; on AND @{selected|deathsave_succ2} &lt;&gt; on ?? Jets raté(s) : | [[ [NH] 1d1 [Encore deux et c'est bassine !] ]] --?? @{selected|deathsave_fail1} == 0 AND @{selected|deathsave_succ2} &lt;&gt; on ?? Jets raté(s) : |[[ d0 [Jusqu'ici... tout va bien !] ]] }} !setattr {{ --sel --evaluate --deathsave_succ3|("%deathsave_succ2%" === "on") ? "on" : "0" }} !setattr {{ --sel --evaluate --deathsave_succ2|("%deathsave_succ1%" === "on") ? "on" : "0" }} !setattr {{ --sel --evaluate --deathsave_succ1|("%deathsave_succ1%" === "0") ? "on" : "on" }} Tks for your help !
1541273410

Edited 1541273449
Got my macros working. You were right about there being invisible junk in my handout. I checked it several times in the last week and never seemed to find anything, but i finally found the junk characters and removed them. All is well.&nbsp; P.S. My nested replacements work again. I eventually came up with a workaround for them, but using the nested replacements is just so much easier than the alternative. Let me know if you want any more info on how they hold up over time.&nbsp;
Yooo! Thanks very much for the detailed reply Ken, I'll give it a shot after work today. I appreciate you taking the time to look into TokenMod for me. I'll check out OnMyTurn, too. I believe this is exactly what I was looking for. You're awesome!
I'm hoping to add a simple blood splatter to my player's melee macros but I'm having some trouble.&nbsp; On one of my games I can insert the following line in a powercard and it works fine: -- ?? $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 AND $Atk.total &gt;= [[@{target|npc_ac}]] ?? vfx_opt|@{target|token_id} glow-blood But when I copy that same line to a similar powercard in another game I don't see the blood splatter.&nbsp; I don't get any other errors, the card shows up in the chat, and an appropriate sound effect is played. For testing, I tried inserting the line without conditional, and I get the same result.&nbsp; In works in the first game but not the second. -- vfx_opt|@{target|token_id} glow-blood For reference here is the complete powercard that doesn't display the blood splatter effect. !power {{ --emote|@{selected|token_name} attacks with the shortsword in his right hand --tokenid|@{selected|token_id} --format|Conditions --titlefontshadow|none --corners|10 --name|Shortsword --leftsub|Melee Attack --rightsub|Reach 5 ft --target_list|@{target|token_id} --Attack:|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadvantage, 2d20KL1} + @{selected|dexterity_mod} [Dex Mod] + @{selected|pb} [Proficiency] ]] vs AC -- ?? $Atk.base == 1 ?? Critical Fail:|Fumble. -- ?? $Atk.base == 1 ?? soundfx:|_audio,play,nomenu|MeleeMiss -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &lt; [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? !Miss|You missed. -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &lt; [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? soundfx:|_audio,play,nomenu|MeleeMiss -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? Hit:|[[1d6 + @{selected|dexterity_mod} [Dex Mod] ]] Piercing damage -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? soundfx|_audio,play,nomenu|ShortswordHit -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? vfx_opt|@{target|token_id} glow-blood -- ?? $Atk.base == 20 ?? Critical:|[[2d6 + @{selected|dexterity_mod} [Dex Mod] ]] Piercing damage -- ?? $Atk.base == 20 ?? soundfx|_audio,play,nomenu|ShortswordHit -- ?? $Atk.base == 20 ?? vfx_opt|@{target|token_id} glow-blood }} There aren't any game settings that I'm missing are there? Thanks in advance for any assistance!
1541711637
Kurt J.
Pro
API Scripter
Scott P. said: I'm hoping to add a simple blood splatter to my player's melee macros but I'm having some trouble.&nbsp; On one of my games I can insert the following line in a powercard and it works fine: -- ?? $Atk.base &lt;&gt; 1 AND $Atk.base &lt;&gt; 20 AND $Atk.total &gt;= [[@{target|npc_ac}]] ?? vfx_opt|@{target|token_id} glow-blood But when I copy that same line to a similar powercard in another game I don't see the blood splatter.&nbsp; I don't get any other errors, the card shows up in the chat, and an appropriate sound effect is played. For testing, I tried inserting the line without conditional, and I get the same result.&nbsp; In works in the first game but not the second. -- vfx_opt|@{target|token_id} glow-blood For reference here is the complete powercard that doesn't display the blood splatter effect. !power {{ --emote|@{selected|token_name} attacks with the shortsword in his right hand --tokenid|@{selected|token_id} --format|Conditions --titlefontshadow|none --corners|10 --name|Shortsword --leftsub|Melee Attack --rightsub|Reach 5 ft --target_list|@{target|token_id} --Attack:|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20KH1|w/Disadvantage, 2d20KL1} + @{selected|dexterity_mod} [Dex Mod] + @{selected|pb} [Proficiency] ]] vs AC -- ?? $Atk.base == 1 ?? Critical Fail:|Fumble. -- ?? $Atk.base == 1 ?? soundfx:|_audio,play,nomenu|MeleeMiss -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &lt; [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? !Miss|You missed. -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &lt; [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? soundfx:|_audio,play,nomenu|MeleeMiss -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? Hit:|[[1d6 + @{selected|dexterity_mod} [Dex Mod] ]] Piercing damage -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? soundfx|_audio,play,nomenu|ShortswordHit -- ?? $Atk.base &lt;&gt; 1 AND $Atk.total &gt;= [[@{target|npc_ac}]] AND $Atk.base &lt;&gt; 20 ?? vfx_opt|@{target|token_id} glow-blood -- ?? $Atk.base == 20 ?? Critical:|[[2d6 + @{selected|dexterity_mod} [Dex Mod] ]] Piercing damage -- ?? $Atk.base == 20 ?? soundfx|_audio,play,nomenu|ShortswordHit -- ?? $Atk.base == 20 ?? vfx_opt|@{target|token_id} glow-blood }} There aren't any game settings that I'm missing are there? Thanks in advance for any assistance! Make sure your Player Ribbon is on the same page you are... The VFX plays on the page the player ribbon is set to. When having trouble with VFX, this is nearly always the cause :) - Kurt
Make sure your Player Ribbon is on the same page you are... The VFX plays on the page the player ribbon is set to. When having trouble with VFX, this is nearly always the cause :) - Kurt That was my problem.&nbsp; Thank you!
Hi everyone, I have a problem with a macro. I have more and more monsters with multiple attacks, but I thought that my macros worked well for multiple hits with HP removed but this is no longer the case. I do not understand why there is only one attack on the 2 who remove the HP. An idea ? !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** tente de trancher @{target|character_name} --name|Epée courte --leftsub|Action --rightsub|Cac 1.5m --Attaque : *1|[[ [$Atk1] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk1.base == 1 OR $Atk1.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk1 &lt; @{target|AC} ?? soundfx|_play|miss --?? $Atk1 &gt;= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk1.total &gt;= @{target|AC} AND $Atk1.base &lt;&gt; 1 AND $Atk1.base &lt;&gt; 20 ?? Dégâts : *1| [[ [$Dmg1] 1d6 + 3 + ?{Attaque surnoise|Non, 0|Oui, 3d6 [Attaque surnoise]} ]] Dommage Perforant --?? $Atk1 &gt;= @{target||ac} AND $Atk1.base &lt;&gt; 20 ?? alterbar *1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk1.base == 20 ?? Coup critique : *1|[[ [$CritDmg1] [2d6 + 3 + ?{Attaque surnoise|Non, 0|Oui, 2d6 [Attaque surnoise]}]] Dommage Perforant --?? $Atk1.base == 20 ?? alterbar *2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg1] _show|all --?? $Atk1 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood --Attaque : *2|[[ [$Atk2] ?{Advantage?| Normal, 1d20 + [[5]] | Advantage, 2d20kh1 + [[5]] | Disadvantage, 2d20kl1 + [[5]] [PROF]]} ]] vs AC --?? $Atk2.base == 1 OR $Atk2.total &lt; @{target|AC}?? !Miss:|Echec. --?? $Atk2 &lt; @{target|AC} ?? soundfx|_play|miss --?? $Atk2 &gt;= @{target|AC} ?? soundfx|_play|Slash1 --?? $Atk2.total &gt;= @{target|AC} AND $Atk2.base &lt;&gt; 1 AND $Atk2.base &lt;&gt; 20 ?? Dégâts : *2| [[ [$Dmg2] 1d6 + 3 + ?{Attaque surnoise|Non, 0|Oui, 3d6 [Attaque surnoise]} ]] Dommage Perforant --?? $Atk2 &gt;= @{target||ac} AND $Atk2.base &lt;&gt; 20 ?? alterbar *3|_target|@{target||token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk2.base == 20 ?? Coup critique : *1|[[ [$CritDmg2] [2d6 + 3 + ?{Attaque surnoise|Non, 0|Oui, 2d6 [Attaque surnoise]}]] Dommage Perforant --?? $Atk2.base == 20 ?? alterbar *4|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg2] _show|all --?? $Atk2 &gt;= @{target|AC} ?? vfx_opt|@{target|token_id} glow-blood }}
1542128365
Kurt J.
Pro
API Scripter
Version 3.8.8 has been promoted to OneClick Install The latest dev version has been distributed to the OneClick install system.
Kurt J. said: Version 3.8.8 has been promoted to OneClick Install The latest dev version has been distributed to the OneClick install system. Awesome, thanks for the local macro fix, very much appreciated.&nbsp;
1542166188

Edited 1542166909
I'm having some trouble creating a macro that checks the maximum value of an attribute. !power {{ &nbsp; --name|Mend Wound &nbsp; --leftsub|Healing Spell &nbsp; --rightsub|Standard Action &nbsp; --Heal:|[[ [$Heal] 3d6 + (@{target|HP|max} / 5) ]] &nbsp; }} I get the error&nbsp; No attribute was found for @{TARGET:HP|max} &nbsp;and when I check API or Player Generated Content box for the dice results it lists&nbsp; TARGET:HP|max|max &nbsp;as part of the dice roll.&nbsp;I don't know why an extra |max is being tagged onto the roll when I try to run the macro but I guess that is what is causing the error. Does PowerCard use another method for checking the max value of an attribute? Thanks in advance! EDIT: Oh! I figured it out. {target|HP|max} doesn't work but {target|Target1|HP|max} does.&nbsp;
I'm getting a strange error when installing the script. I made 6 powercard macros with it and everything was fine. When I made 2 more which were similar the powercard scripts were turned off due to an error and when I go to reinstall them I get this: docker: Error response from daemon: Conflict. The name "/campaign-2731524--t51wbmI8Qyqyhv8kdC4cQ" is already in use by container 196227f901e620534729918b1c69137f40c494ffb1b109525b41271c3f95f101. You have to remove (or rename) that container to be able to reuse that name.. See 'docker run --help'. What can I do?
1542228424
Kurt J.
Pro
API Scripter
Hannu said: I'm getting a strange error when installing the script. I made 6 powercard macros with it and everything was fine. When I made 2 more which were similar the powercard scripts were turned off due to an error and when I go to reinstall them I get this: docker: Error response from daemon: Conflict. The name "/campaign-2731524--t51wbmI8Qyqyhv8kdC4cQ" is already in use by container 196227f901e620534729918b1c69137f40c494ffb1b109525b41271c3f95f101. You have to remove (or rename) that container to be able to reuse that name.. See 'docker run --help'. What can I do? If you get a sandbox error, you shouldn't need to reinstall anything... you should just need to click the "Restart API Sandbox" button on the API Scripts screen for your game. It sounds like it is trying to install a second copy of the script, which will indeed conflict.
1542229633

Edited 1542276098
Thank you Kurt, "Restart API Sandbox" unfortunately didn't fix it. I was able to get the script to start again without error by disabling and then enabling it. But once I went to the game and tried using powercards they're turned off again and the same thing repeats. And now disabling and enabling just gives the same error once again :/ Edit: I deleted the whole Powercards API enhancement, and now it's still giving me the error message. Clearly something has broken down on Roll20's side. Edit 2: I made a new game with the exact same PowerCards.js and macros. Everything works fine. Roll20 is broken in that one game is all.
1542277422
Ziechael
Forum Champion
Sheet Author
API Scripter
This is likely due to the ongoing known issue, reports are being consolidated here:&nbsp; <a href="https://app.roll20.net/forum/post/6965436/docker-script-error/?pageforid=6965923#post-6965923" rel="nofollow">https://app.roll20.net/forum/post/6965436/docker-script-error/?pageforid=6965923#post-6965923</a>
1542407154
Kurt J.
Pro
API Scripter
Version 3.8.9 is now up on the development GIST This version includes a bit of cleanup, and the official implementation of the --replacepcattack tag. This tag has been in the script for a couple of verisons now, but was considered "undocumented" as it was not doing what I wanted it to do. With 3.8.9, this tag, which accepts a character id and an attack name (drawn from the list of attacks in the center of the 5E OGL character sheet), will return a set of replacement values based on what is filled out on the character sheet for that attack. The returned values are : PCA-ATYPE - Will contain the work "Attack" PCA-NAME - Will contain the name of the attack - same that was passed in. PCA-ATKATTR - Attribute used for the attack (Str, Dex, etc) PCA-RANGE - Specified attack range PCA-ATKBONUS - The total attack bonus for the attack, including all ability, proficiency, and magic bonuses PCA-DMG1DICE - The dice roll used for damage type 1 (or "none" if there is no damage type 1 selected) PCA-DMG1CRIT - The dice roll used for a critical hit for damage type 1 PCA-DMG1TYPE - The damage type for damage type 1 (ie, Piercing, Slashing, etc.) PCA-DMG2DICE - The dice roll used for damage type 2 (or "none" if there is no damage type 2 selected) PCA-DMG2CRIT - The dice roll used for a critical hit for damage type 2 PCA-DMG2TYPE - The damage type for damage type 1 (ie, Fire, Holy, etc.) The real intent here, though, is that I've been working on a set of templates and scripts that can be used generically for both PCs and NPCs create PowerCards based on "repeating_npc_action" and "repeating_attack" entries on the character sheet. In my game, I now have a single global macro for called "NPC-Attack" that will prompt for the attack to use (listed on the NPC/Monster character sheet) for the selected NPC. I have a second macro that can be used by players to prompt them for a list of the actions on their character sheet and automatically generate an appropriate PowerCard for those actions. The whole thing uses 4 templates, 1 replacement, and 2 macros. The only requirement is that an attribute is set on the characters listing their abilities for use in a roll query, but I've put together a helper API script that will generate the required attribute for any number of selected characters with a single click (or update it if a player changes their character sheet). I need a little more testing (hence why 3.8.9 is a development build) but so far everything seems to be working well. I've also got a one-macro setup working for Cantrips, and will be working on implementing the same for normal spells in the next couple of weeks. Once I'm confident that things are working the way I intend, I'll make what I have available if anyone wants to try it out.
I've been playing around with using the PowerCards API to augment a character sheet I'm creating, and have just ran into a problem that I can't find on my own. The macro works perfectly fine in all but one aspect, I cannot get it to show the result of the Attack Roll. Is this an intended function that I missed, or have I made an error in writing the macro? "!power {{ --name|**Attack!** --Bonuses/Maluses| [[ [Type] (1d0+(@{weaponbonus})) ]] --?? $Type.total &gt;= 1 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - (3+(@{weaponbonus}))d10kl3s)]] additional DoS/DoF! --?? $Type.total == 0 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - 3d10s)]] additional DoS/DoF! --?? $Type.total &lt;= -1 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - (3-(@{weaponbonus}))d10kh3s)]] additional DoS/DoF! --Hit Location! | [[ [$Hit] 1d100]] --Damage! | [[(@{weapon_damage})]] --?? $Hit.base &lt; 11 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Sensor Array!** --?? $Hit.base &lt; 21 AND $Hit.base &gt; 10 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Right Manipulator!** --?? $Hit.base &lt; 31 AND $Hit.base &gt; 20 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Left Manipulator!** --?? $Hit.base &lt; 71 AND $Hit.base &gt; 30 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Torso!** --?? $Hit.base &lt; 101 AND $Hit.base &gt; 70 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Mobility System!** --?? $Atk.total &lt; 0 ?? !Miss:| **You Missed!** }}"
I have a question about conditionals. In the following example, how would the expression be evaluated: --?? a AND b OR a AND c ?? Would it result in&nbsp; 1. (a AND b) OR (a AND c) or would it evaluate as&nbsp; 2. ((a AND b) OR a) AND c ?
1542474783
Kurt J.
Pro
API Scripter
Re4XN said: I have a question about conditionals. In the following example, how would the expression be evaluated: --?? a AND b OR a AND c ?? Would it result in&nbsp; 1. (a AND b) OR (a AND c) or would it evaluate as&nbsp; 2. ((a AND b) OR a) AND c ? Looking at the conditional code (not mine, so I'm interpreting) it looks like the conditional will exit as soon as it hits and AND with a preceding false condition or an OR with a preceding true condition. Only the most recent true/false is checked, and the operand at the time makes the decision to either exit or keep going. if A is true and B is true, as soon as it hits the OR you will get true.with no regard to what comes afterward. if A is false, as soon as it hits the AND you will get false. Note that this is not consistent with normal order of operations."false AND true OR true AND true" would normally be true, but in this case it will be false because the AND condition bounces the evaluation out. Consider: !power {{ &nbsp; --name|testing &nbsp; --?? 1 == 2 AND 3 == 3 OR 1 == 1 AND 3 == 3??True|Yep! }} This will end up being false, while this: !power {{ &nbsp; --name|testing &nbsp; --?? 1 == 1 AND 2 == 3 OR 1 == 1 AND 3 == 3??True|Yep! }} will end up being true because OR sees a false before it and keeps on going. One alternative is to use expanded conditionals (surrounded by ?! and !? instead of ?? and ??), which I added in version 3.8.4/3.8.5. These use a different syntax, but will follow the Javascript order of operations, so: !power {{ &nbsp; --name|testing &nbsp; --?! 1 -eq 2 -and 3 -eq 3 -or 1 -eq 1 -and 3 -eq 3!?True|Yep! }} Will properly be true because it will be evaluated as (a AND b) or (c AND d). Details on expanded conditionals can be found on the Wiki page here : <a href="https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals</a>
1542474826
Kurt J.
Pro
API Scripter
GM-kun said: I've been playing around with using the PowerCards API to augment a character sheet I'm creating, and have just ran into a problem that I can't find on my own. The macro works perfectly fine in all but one aspect, I cannot get it to show the result of the Attack Roll. Is this an intended function that I missed, or have I made an error in writing the macro? "!power {{ --name|**Attack!** --Bonuses/Maluses| [[ [Type] (1d0+(@{weaponbonus})) ]] --?? $Type.total &gt;= 1 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - (3+(@{weaponbonus}))d10kl3s)]] additional DoS/DoF! --?? $Type.total == 0 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - 3d10s)]] additional DoS/DoF! --?? $Type.total &lt;= -1 ?? Attack Roll | @{character_name} attacks with [[ [$Atk] (@{weaponclass} - (3-(@{weaponbonus}))d10kh3s)]] additional DoS/DoF! --Hit Location! | [[ [$Hit] 1d100]] --Damage! | [[(@{weapon_damage})]] --?? $Hit.base &lt; 11 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Sensor Array!** --?? $Hit.base &lt; 21 AND $Hit.base &gt; 10 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Right Manipulator!** --?? $Hit.base &lt; 31 AND $Hit.base &gt; 20 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Left Manipulator!** --?? $Hit.base &lt; 71 AND $Hit.base &gt; 30 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Torso!** --?? $Hit.base &lt; 101 AND $Hit.base &gt; 70 AND $Atk.total &gt;= 0 ?? !Hit:| **You hit the Mobility System!** --?? $Atk.total &lt; 0 ?? !Miss:| **You Missed!** }}" What output are you getting?
Never mind me. I just realized I wrote [Type] instead of [$Type].&nbsp;
Kurt J. said: Note that this is not consistent with normal order of operations."false AND true OR true AND true" would normally be true, but in this case it will be false because the AND condition bounces the evaluation out. Yeah, that was my suspicion after fiddling with some macros and getting unexpected results. Kurt J. said: One alternative is to use expanded conditionals (surrounded by ?! and !? instead of ?? and ??), which I added in version 3.8.4/3.8.5. These use a different syntax, but will follow the Javascript order of operations, so: !power {{ &nbsp; --name|testing &nbsp; --?! 1 -eq 2 -and 3 -eq 3 -or 1 -eq 1 -and 3 -eq 3!?True|Yep! }} Will properly be true because it will be evaluated as (a AND b) or (c AND d). Details on expanded conditionals can be found on the Wiki page here : <a href="https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals" rel="nofollow">https://wiki.roll20.net/Script:PowerCards#Expanded_Conditionals</a> Thanks for the suggestion! It'll make my macros a lot cleaner and easier to read/debug. I wasn't sure whether the order mattered in the "Expanded" version as well, since the Wiki doesn't mention it specifically (unless I missed it).
1542481776
Kurt J.
Pro
API Scripter
Re4XN said: Thanks for the suggestion! It'll make my macros a lot cleaner and easier to read/debug. I wasn't sure whether the order mattered in the "Expanded" version as well, since the Wiki doesn't mention it specifically (unless I missed it). You're right... I should probably clarify that in the Wiki :)
Kurt J. said: Version 3.8.9 is now up on the development GIST This version includes a bit of cleanup, and the official implementation of the --replacepcattack tag. This tag has been in the script for a couple of verisons now, but was considered "undocumented" as it was not doing what I wanted it to do. With 3.8.9, this tag, which accepts a character id and an attack name (drawn from the list of attacks in the center of the 5E OGL character sheet), will return a set of replacement values based on what is filled out on the character sheet for that attack. The returned values are : PCA-ATYPE - Will contain the work "Attack" PCA-NAME - Will contain the name of the attack - same that was passed in. PCA-ATKATTR - Attribute used for the attack (Str, Dex, etc) PCA-RANGE - Specified attack range PCA-ATKBONUS - The total attack bonus for the attack, including all ability, proficiency, and magic bonuses PCA-DMG1DICE - The dice roll used for damage type 1 (or "none" if there is no damage type 1 selected) PCA-DMG1CRIT - The dice roll used for a critical hit for damage type 1 PCA-DMG1TYPE - The damage type for damage type 1 (ie, Piercing, Slashing, etc.) PCA-DMG2DICE - The dice roll used for damage type 2 (or "none" if there is no damage type 2 selected) PCA-DMG2CRIT - The dice roll used for a critical hit for damage type 2 PCA-DMG2TYPE - The damage type for damage type 1 (ie, Fire, Holy, etc.) The real intent here, though, is that I've been working on a set of templates and scripts that can be used generically for both PCs and NPCs create PowerCards based on "repeating_npc_action" and "repeating_attack" entries on the character sheet. In my game, I now have a single global macro for called "NPC-Attack" that will prompt for the attack to use (listed on the NPC/Monster character sheet) for the selected NPC. I have a second macro that can be used by players to prompt them for a list of the actions on their character sheet and automatically generate an appropriate PowerCard for those actions. The whole thing uses 4 templates, 1 replacement, and 2 macros. The only requirement is that an attribute is set on the characters listing their abilities for use in a roll query, but I've put together a helper API script that will generate the required attribute for any number of selected characters with a single click (or update it if a player changes their character sheet). I need a little more testing (hence why 3.8.9 is a development build) but so far everything seems to be working well. I've also got a one-macro setup working for Cantrips, and will be working on implementing the same for normal spells in the next couple of weeks. Once I'm confident that things are working the way I intend, I'll make what I have available if anyone wants to try it out. This sounds great. I'd love to see the macros you have that go with this. I was just in the process of creating some cards using the existing replacements and came to look something up and saw this. Amazing timing. Hopefully testing will go smoothly and this will be out of dev soon.
Hello there, I think I need help with a macro i'm doing with PowerCard (Don't know if this is the best post to ask for it, sorry in advance). I'm playing Anima Beyond Fantasy and i'm trying to make a macro that calculate the attack and damage result of an attack. So far i have this: !power {{ &nbsp; --name|Attack &nbsp; --tokenid|@{selected|token_id} &nbsp; --target_list|@{target|token_id} &nbsp; --emote|@{selected|character_name} attacks &nbsp; --Attack|@{selected|character_name} [[ [$Def] 1d100!&gt;90 [Base] + @{selected|Attack}+?{Modificador|0}]] contra [[ [$Def] 1d100!&gt;90 +@{target|Defense} +?{Modificador enemigo|0}]] }} This means the macro takes the attack of the selected token and the defense of the target token. Now I have to kinda do very line inpouts for every variant. If the attack is superior to the defense now I have to take de Armor of the target and substract that to the attack result, if the attack is still positive I have to calculate the damage, wich is a % of the weapon damage based on attack final result. Example: The attack is 200, the defense is 150, the attack hit the target with 50. Now the target has 3 armor points. Then I subtract 30 of that 50. The result is 20 wich means the selected token does 20% of damage to the selected target. How I can do that? I tried this with no results: &nbsp;--?? $Atk.base == 1 OR $Atk.total &lt; ??$Def !Miss:|You missed.
1543535420
Kurt J.
Pro
API Scripter
Ryushiro said: &nbsp; --Attack|@{selected|character_name} [[ [ $Def ] 1d100!&gt;90 [Base] + @{selected|Attack}+?{Modificador|0}]] contra [[ [ $Def ] 1d100!&gt;90 +@{target|Defense} +?{Modificador enemigo|0}]] In the line above, I've bolded both of the roll id assignments. They are both assigning to the $Def rollid, meaning $Atk doesn't exist. I believe the first roll should be using [$Atk] instead of [$Def] to achieve the result you are looking for.
1543536619

Edited 1543549478
Kurt J. said: In the line above, I've bolded both of the roll id assignments. They are both assigning to the $Def rollid, meaning $Atk doesn't exist. I believe the first roll should be using [$Atk] instead of [$Def] to achieve the result you are looking for. Yes, I copied wrong here. This is the correct form (Or so i think): !power {{ &nbsp; --name|Ataque &nbsp; --tokenid|@{selected|token_id} &nbsp; --target_list|@{target|token_id} &nbsp; --emote|@{selected|character_name} ataca a &nbsp; --Proyección|@{selected|character_name} [[ [$Atk] 1d100!&gt;90 + @{selected|Ataque} +?{Modificador|0}]] contra [[ [$Def] 1d100!&gt;90 +@{target|Defensa} +?{Modificador enemigo|0}]] &nbsp; --?? $Atk.base == 1 OR $Atk.total &lt; ??$Def !Miss:|You missed. }} The maths behind the attack and defense checks are a bit more complex but I'm doing little steps each time.The objective for me is to do the complete check in one go that means the fallowing: Fumbles: In base roll is a 1, 2 o 3 is a Fumble. If the roll is 1 you have to roll 1d100 +15 and substract that to the ability base (If you're attack is 200 and the fumble roll is 57 the result of the fumble is 143) If the roll is 2 you have to roll 1d100 +0 and substract that to the ability base. If the roll is 3 you have to roll 1d100 -15 and substract that to the ability base. The system is so complex that I'm complete at lost to translate it to PowerCard... Edit: I think I know how I must do it!