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)

Is it possible to pass a button that invokes an ability to a powercard template through an argument that will render the button and preserve the ability call? Something like: !power --template|mytemplate|text;[button](~character|ability) The | to replace | that seems to get used by powercard was my attempt to make it work.  The called template does something like: --~0!|~1! and outputs nothing.
1595022131
Kurt J.
Pro
API Scripter
kgsodie said: Is it possible to pass a button that invokes an ability to a powercard template through an argument that will render the button and preserve the ability call? Something like: !power --template|mytemplate|text;[button](~character|ability) The | to replace | that seems to get used by powercard was my attempt to make it work.  The called template does something like: --~0!|~1! and outputs nothing. I believe code changes would be required for this, as it wasn't something I considered when building the template functionality. I'll take a look at what would be required to make something like this work, but until I consider it a bit more I don't have a solid answer.
1595029629

Edited 1595030065
Understood Kurt, and I appreciate you looking at it. For a workaround, I think I can pass the button text and ability separately and put it together inside the template. I suspect that will work, just a lot  more args. I also suspect that similar to how @{} works, the substitution for the hash code for the ability link happens before powercard gets to run. Just a guess though.
1595100339

Edited 1595100566
I'm using Expanded Conditionals in my powercard and was wondering if you fixed or found a work around for the "." (i.e.  --?! $Atk -ge 30 -and $Atk - 50 -lt 30 -and $Atk.base -ne 100 !?Damage:|[[ [$NDmg] @{selected|primarydamage} [@{selected|primaryname} DMG] ]] Physical
Hi, everyone. I'm from Brazil, so please forgive my english. After decades, me and my friends are playing a D&D 3.5E custom sheet campaing (because we stopped playing 20 years ago and that was the system we used to play). In our game we use a diferent kind of critical damage. When a player (or NPC) rolls a 20, that player rolls a plus d6 (or table, in Roll20) and the enemy suffers a consequence acording result of dice. For example, 1 = Maximum Damage, 2 = Dobble Damage... So, I want to create a macro using Power Cards that allow me to attack, check if the player hits or misses and, if the attack base = 20, roll the table, put the result in a RollID and check this result for a especial damage. This is my macro: !power {{ --charid|@{character_id} --target_list|@{target|token_id} --emote|**@{selected|token_name} attacks *@{target|token_name}*** --bgcolor|#702082 --orowbg|#FFFFFF --erowbg|#EEEEEE --titlefontshadow|none --name|Weapon:***Hands*** --leftsub|Dano: **Concussion** --rightsub|Range: **1,5m** --Attack:|[[ [$Atk] 1d20+11 ]] vs AC @{target|AC} --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? Hits|and takes [[ [$Dmg] 1d6+10 ]] damage --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? CRITICAL SUCCESS!!!|[[ [$CritSuc] 1t[Critical-Success] ]] --?? $Atk < @{target|AC} ?? Misses UP TO THIS LINE THE MACRO WORKS PERFECTLY. WHEN I ADD THE LINES BELOW THE SYSTEM RETURNS ERROR. --?? $Atk.base == 20 AND $CritSuc == "Max Damage" ?? Critical Damage:|[[ [$CritMax] 16 ]] --?? $Atk.base == 20 AND $CritSuc == "Max Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritMax] _show|all --?? $Atk.base == 20 AND $CritSuc == "Dobble Damage" ?? Critical Damage:|[[ [$CritDbl] [^Dmg]*2 ]] --?? $Atk.base == 20 AND $CritSuc == "Dobble Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDbl] _show|all --?? $Atk.base == 20 AND $CritSuc == "Triple Damage" ?? Critical Damage:|[[ [$CritTpl] [^Dmg]*3 ]] --?? $Atk.base == 20 AND $CritSuc == "Triple Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritTpl] _show|all --?? $Atk.base == 20 AND $CritSuc == "Knockout" OR $CritSuc == "Sever Limb" ?? Critical Damage:|[[ [$CritDmg] [^Dmg] ]] --?? $Atk.base == 20 AND $CritSuc == "Knockout" OR $CritSuc == "Sever Limb" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] _show|all --?? $Atk.base == 20 AND $CritSuc == "Death" ?? Critical Damage:|[[ [$CritDth] [@{target|HP}]+10 ]] --?? $Atk.base == 20 AND $CritSuc == "Death" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDth] _show|all }} This is the result if I don't insert the special critical damage in the macro. And this is the error that Roll20 returns when I insert the special critical damage. What am I doing wrong? Thanks in advance. Take care yourselves, guys!
1595108941
Kurt J.
Pro
API Scripter
Sims said: I'm using Expanded Conditionals in my powercard and was wondering if you fixed or found a work around for the "." (i.e.  --?! $Atk -ge 30 -and $Atk - 50 -lt 30 -and $Atk.base -ne 100 !?Damage:|[[ [$NDmg] @{selected|primarydamage} [@{selected|primaryname} DMG] ]] Physical I haven't as of yet. There are potential game security issues if dots (and several other characters) are allowed in extended conditionals. It is on my list to get back to, but I haven't dealt with it yet.
1595109147
Kurt J.
Pro
API Scripter
Cristiano Grass said: Hi, everyone. I'm from Brazil, so please forgive my english. After decades, me and my friends are playing a D&D 3.5E custom sheet campaing (because we stopped playing 20 years ago and that was the system we used to play). In our game we use a diferent kind of critical damage. When a player (or NPC) rolls a 20, that player rolls a plus d6 (or table, in Roll20) and the enemy suffers a consequence acording result of dice. For example, 1 = Maximum Damage, 2 = Dobble Damage... So, I want to create a macro using Power Cards that allow me to attack, check if the player hits or misses and, if the attack base = 20, roll the table, put the result in a RollID and check this result for a especial damage. This is my macro: !power {{ --charid|@{character_id} --target_list|@{target|token_id} --emote|**@{selected|token_name} attacks *@{target|token_name}*** --bgcolor|#702082 --orowbg|#FFFFFF --erowbg|#EEEEEE --titlefontshadow|none --name|Weapon:***Hands*** --leftsub|Dano: **Concussion** --rightsub|Range: **1,5m** --Attack:|[[ [$Atk] 1d20+11 ]] vs AC @{target|AC} --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? Hits|and takes [[ [$Dmg] 1d6+10 ]] damage --?? $Atk >= @{target|AC} AND $Atk.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg] _show|all --?? $Atk.base == 20 ?? CRITICAL SUCCESS!!!|[[ [$CritSuc] 1t[Critical-Success] ]] --?? $Atk < @{target|AC} ?? Misses UP TO THIS LINE THE MACRO WORKS PERFECTLY. WHEN I ADD THE LINES BELOW THE SYSTEM RETURNS ERROR. --?? $Atk.base == 20 AND $CritSuc == "Max Damage" ?? Critical Damage:|[[ [$CritMax] 16 ]] --?? $Atk.base == 20 AND $CritSuc == "Max Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritMax] _show|all --?? $Atk.base == 20 AND $CritSuc == "Dobble Damage" ?? Critical Damage:|[[ [$CritDbl] [^Dmg]*2 ]] --?? $Atk.base == 20 AND $CritSuc == "Dobble Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDbl] _show|all --?? $Atk.base == 20 AND $CritSuc == "Triple Damage" ?? Critical Damage:|[[ [$CritTpl] [^Dmg]*3 ]] --?? $Atk.base == 20 AND $CritSuc == "Triple Damage" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritTpl] _show|all --?? $Atk.base == 20 AND $CritSuc == "Knockout" OR $CritSuc == "Sever Limb" ?? Critical Damage:|[[ [$CritDmg] [^Dmg] ]] --?? $Atk.base == 20 AND $CritSuc == "Knockout" OR $CritSuc == "Sever Limb" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDmg] _show|all --?? $Atk.base == 20 AND $CritSuc == "Death" ?? Critical Damage:|[[ [$CritDth] [@{target|HP}]+10 ]] --?? $Atk.base == 20 AND $CritSuc == "Death" ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^CritDth] _show|all }} This is the result if I don't insert the special critical damage in the macro. And this is the error that Roll20 returns when I insert the special critical damage. What am I doing wrong? Thanks in advance. Take care yourselves, guys! Conditionals use spaces to separate their parts, and don't respect quoting of strings. This means that the script is checking to see if $CritSuc is equal to "Max (a quote and the letters Max) and then gets to Damage" and doesn't know what that is. The simplest thing to do (because you can't use the .base in an advanced query) is to remove the spaces from the table roll result and remove the quotes, so: $CritSuc == MaxDamage Also, all of your Critical Damage and Alterbar lines need to have "same name" modifiers added to them (*1, *2, *3, etc.) otherwise only one will end up being processed. Include a space before the * to prevent display strangeness.
Just want to say thanks for all the feedback you've given on the forum - I've figured out the shortcomings of my previous posts, however I have another question.  Is there a way to increment replacement key values, esp those in inline replacements? For instance: Using PCMH, for the purposes of passing the ~SSL$ replacement key in the Cast-Lx macros to a generic API call, is there a way to increment that value by one to use chatsetattr to increment/reduce a character's current spell slots? Currently I think I have the generic api call down, but ofc the value passed is one less (although I understand why - it's using the value for Higher Level Casting). I have a workaround or two, but they involve more drop down boxes and I'm trying to limit clicks or using too many conditionals (per my older posts - yikes)  Thanks!
1595160716
Kurt J.
Pro
API Scripter
Hrekto said: Just want to say thanks for all the feedback you've given on the forum - I've figured out the shortcomings of my previous posts, however I have another question.  Is there a way to increment replacement key values, esp those in inline replacements? For instance: Using PCMH, for the purposes of passing the ~SSL$ replacement key in the Cast-Lx macros to a generic API call, is there a way to increment that value by one to use chatsetattr to increment/reduce a character's current spell slots? Currently I think I have the generic api call down, but ofc the value passed is one less (although I understand why - it's using the value for Higher Level Casting). I have a workaround or two, but they involve more drop down boxes and I'm trying to limit clicks or using too many conditionals (per my older posts - yikes)  Thanks! Without seeing the card, my suggestion would be to create a roll for the result by using Xd1 + 1. The spell level in this case isn't a RollID, so it can be used in rolls ([[ [$ToDeduct] ~SSL$d1 + 1 ]]) and then use [^ToDeduct] in the call to chatsetattr.
1595169425
Kurt J.
Pro
API Scripter
New Video Series I've begun creating a new video series on my YouTube channel I'm calling "PowerCards 101". The first episode is up on the channel (it's actually been there for a bit over a week) and the second episode has just finished uploading. I'm hoping to do one of these a week and plan on covering the following topics: Part 1 - Installation and PowerCard Basics - Covers setting up the API script, creating basic cards, using Tag/Content pairs, and inline formatting. Part 2 - Card Formatting - Discusses the three main card sections, including Emote block, the Title block, and the Card Lines blocks. Setting fonts and colors, and creating Format handouts. Part 3 - Rolls, RollIDs, and Conditionals Part 4 - Chat Server Syntax and Roll Queries Part 5 - Visual and Sound Effects Part 6 - Templates Part 7 - Replacements Part 8 - PowerCard Tips and Tricks I'll update this post as I complete episodes, and will put a full index in the first post in this thread (on page 1).
Hey everyone, I was wondering if anyone has figured out how to work with immunities and resistances when dealing with the power cards and alterbars combo. I was diving through some of the previous threads and saw a fella talking about defining them as damage types or Dtypes and I'm not really sure where the starting point to setting that kind of stuff is. I'm just more looking to set these autocalculations up for my parties bread and butter moves; so mostly just the 3 physical but I have no idea where to start. Can anyone help?
1595172830

Edited 1595174046
Hrekto said: Just want to say thanks for all the feedback you've given on the forum - I've figured out the shortcomings of my previous posts, however I have another question.  Is there a way to increment replacement key values, esp those in inline replacements? For instance: Using PCMH, for the purposes of passing the ~SSL$ replacement key in the Cast-Lx macros to a generic API call, is there a way to increment that value by one to use chatsetattr to increment/reduce a character's current spell slots? Currently I think I have the generic api call down, but ofc the value passed is one less (although I understand why - it's using the value for Higher Level Casting). I have a workaround or two, but they involve more drop down boxes and I'm trying to limit clicks or using too many conditionals (per my older posts - yikes)  Thanks! --['~SSL$' -eq '0']Level 1 Slots|[[~le1$-1]] of [[~lt1$]] remaining --['~SSL$' -eq '1']Level 2 Slots|[[~le2$-1]] of [[~lt2$]] remaining --['~SSL$' -eq '2']Level 3 Slots|[[~le3$-1]] of [[~lt3$]] remaining --['~SSL$' -eq '3']LLevel 4 Slots|[[~le4$-1]] of [[~lt4$]] remaining --['~SSL$' -eq '4']LLevel 5 Slots|[[~le5$-1]] of [[~lt5$]] remaining --['~SSL$' -eq '5']LLevel 6 Slots|[[~le6$-1]] of [[~lt6$]] remaining --['~SSL$' -eq '6']LLevel 7 Slots|[[~le7$-1]] of [[~lt7$]] remaining --['~SSL$' -eq '7']LLevel 8 Slots|[[~le8$-1]] of [[~lt8$]] remaining --['~SSL$' -eq '8']LLevel 9 Slots|[[~le9$-1]] of [[~lt9$]] remaining --api_modbattr|_name ~S-CN$ _zzzjunk|[[ [$a] 0d0+~SSL$+1]] _lvl[^a]_slots_expended|-1 _mute I added these to the SpellCast Template from pcmhelper and changed the Spellcasting Macros from PCMHelper to !power {{ --titlefontshadow|none   --replacespell|@{selected|character_id}|?{Spell to Cast|@{selected|l1_spell_list}}   --inlinereplace|SSL|?{Spell Slot Level?|1,0|2,1|3,2|4,3|5,4|6,5|7,6|8,7|9,8};le1|@{selected|lvl1_slots_expended};le2|@{selected|lvl2_slots_expended};le3|@{selected|lvl3_slots_expended};le4|@{selected|lvl4_slots_expended};le5|@{selected|lvl5_slots_expended};le6|@{selected|lvl6_slots_expended};le7|@{selected|lvl7_slots_expended};le8|@{selected|lvl8_slots_expended};le9|@{selected|lvl9_slots_expended};lt1|@{selected|lvl1_slots_total};lt2|@{selected|lvl2_slots_total};lt3|@{selected|lvl3_slots_total};lt4|@{selected|lvl4_slots_total};lt5|@{selected|lvl5_slots_total};lt6|@{selected|lvl6_slots_total};lt7|@{selected|lvl7_slots_total};lt8|@{selected|lvl8_slots_total};lt9|@{selected|lvl9_slots_total}   --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --replacement|Advantage   --template|Basics|@{selected|token_id};@{target|token_id};casts ~SP-NAME$;~SP-NAME$;Save DC ~S-SSDC$;~SP-RANGE$;@{selected|whispertoggle}   --template|SpellCast|~@{selected|rtype}$;@{selected|whispertoggle};@{selected|global_attack_mod} }} There might be other changes from my personal edits in there, but this should get you a long way there. edit: I couldn't get chatsetattr to work without the zzzjunk attribute for the roll...it doesn't do anything else, and it worked this way, so I was to lazy to look further ;P edit2: you don't need all the conditional lines and the le and lt replacements, if you don't want to display the Spell levels, and you don't need the changes to the macro. If you only want the Spell levels decreased, the api call alone should be the only change you need.
Kurt J. said: Conditionals use spaces to separate their parts, and don't respect quoting of strings. This means that the script is checking to see if $CritSuc is equal to "Max (a quote and the letters Max) and then gets to Damage" and doesn't know what that is. The simplest thing to do (because you can't use the .base in an advanced query) is to remove the spaces from the table roll result and remove the quotes, so: $CritSuc == MaxDamage Also, all of your Critical Damage and Alterbar lines need to have "same name" modifiers added to them (*1, *2, *3, etc.) otherwise only one will end up being processed. Include a space before the * to prevent display strangeness. Thank you so much, Kurt. In fact, after your answer, I replaced all the strings by numbers, and this change show me a few more errors and allow me to improve the macro. Very good!!!
1595191153

Edited 1595191164
Kurt J.
Pro
API Scripter
Development version of PCMHelper Updated to 1.0.7 I've updated the  Development GIST  for PCMHelper to include the following updates: Updated templates and macros based on Sven K's posts a page or so ago in the thread. Implemented a versioning system to remind you to update your macros/handouts/etc. when a new version of the script is installed. Rewrote the entire queue system to actually work properly now. I tested this by creating a new Tomb of Annihilation game and just running !pcmeverybody, which now works properly, processing all 292 characters in blocks of 20. The API output window will keep you updated on the progress of processing the queue. Since this only needs to be run once, it is best to let it spin for a few minutes until it completes the queue. Any changes to attributes and spells will now add the resultant character to the processing queue and they will be hit the next time the queue runs (the max time you should see between updating a character and PCMHelper updating the appropriate attributes is about 5 seconds).
1595250337

Edited 1595251006
I thought I'd leave a complete paste of my current edits to the PCMHelper templates and macros. These are all based on the 1.0.5, and would be required to be updated to any changes from the 1.0.7 most notable change to the 1.0.5 version is that the Player attacks, spells and cantrip templates (and by extension the basics template) all respect the gm whisper toggle, global attack and global damage modifiers. The Macros have some additional arguments to accomodate that. The version I posted also requires chatsetattr, for changing the amount of spell slots, and also display the amount of spellslots. I didn't add any logic to check if there are enough spell slots left. When someone with 0 slots casts a spell, it will display -1 slot left. This is actually not true, it won't get changed to -1 If you want to use it without chatsetattr, all you have to do is remove lines 111-120 in the paste and reset line 147 to the standard value. You'll also have to remove all the line breaks from the templates itself. I added them for better redability and easier explanation on what to remove. ;) Here is an example of an attack with a global attack and global damage mod: And here is a Guiding bolt with Spell levels global attack mod and global damage mod
1595264665

Edited 1595264679
Kurt J.
Pro
API Scripter
Sven K. said: I thought I'd leave a complete paste of my current edits to the PCMHelper templates and macros. These are all based on the 1.0.5, and would be required to be updated to any changes from the 1.0.7 most notable change to the 1.0.5 version is that the Player attacks, spells and cantrip templates (and by extension the basics template) all respect the gm whisper toggle, global attack and global damage modifiers. The Macros have some additional arguments to accomodate that. The version I posted also requires chatsetattr, for changing the amount of spell slots, and also display the amount of spellslots. I didn't add any logic to check if there are enough spell slots left. When someone with 0 slots casts a spell, it will display -1 slot left. This is actually not true, it won't get changed to -1 If you want to use it without chatsetattr, all you have to do is remove lines 111-120 in the paste and reset line 147 to the standard value. You'll also have to remove all the line breaks from the templates itself. I added them for better redability and easier explanation on what to remove. ;) Here is an example of an attack with a global attack and global damage mod: And here is a Guiding bolt with Spell levels global attack mod and global damage mod Very cool. Your updates should work with 1.0.7 (there weren't any macro/template changes since 1.0.5 except what you had posted earlier). I'll roll these in and update development again later today.
Kurt J. said: Development version of PCMHelper Updated to 1.0.7 I've updated the  Development GIST  for PCMHelper to include the following updates: Updated templates and macros based on Sven K's posts a page or so ago in the thread. Implemented a versioning system to remind you to update your macros/handouts/etc. when a new version of the script is installed. Rewrote the entire queue system to actually work properly now. I tested this by creating a new Tomb of Annihilation game and just running !pcmeverybody, which now works properly, processing all 292 characters in blocks of 20. The API output window will keep you updated on the progress of processing the queue. Since this only needs to be run once, it is best to let it spin for a few minutes until it completes the queue. Any changes to attributes and spells will now add the resultant character to the processing queue and they will be hit the next time the queue runs (the max time you should see between updating a character and PCMHelper updating the appropriate attributes is about 5 seconds). So happy to see this in the works, Kurt. :)
1595328688

Edited 1595345278
Hi! I'm not very good at programming. Can you tell me what the error of the macro is? Everything related to $ Atk and audio does not work !power {{  --bgcolor|#8A2BE2  --txcolor|#000000  --name|@{selected|token_name}  --leftsub|use spell Stream of Fire  --rightsub|to @{target|token_name}  --Hit|[[ [NH| $Atk ] (@{Hit wisdom}+1d6+1d4)-(@{target|Dodge}+1d6+1d4) ]]  --?? $Atk >= 0 ?? Damage|[[ [$DMG] round(3*?{Fire modifier|1.15}*@{target|Magic Fire  resist}) ]]  --soundfx|_audio,play,nomenu|fire  --vfx_opt|@{selected|token_id} @{target|token_id} breath-fire  --?? $Atk >= 0 < 8 ?? Burning|1*@{target|Burning resist} for 3 moves  --?? $Atk >= 8 ?? Burning crit|2*@{target|Burning resist} for 3 moves  --?? $Atk >= 0 ?? api_token-mod|_ids @{target|token_id} _ignore-selcted _set statusmarkers|49  --?? $Atk >= 0 ?? api_act|-1 3 _Burning  --?? $Atk >= 0 ?? alterbar|_target|@{target|token_id} _bar|1 _amount|-[^DMG] _show|all }}
Kurt J. said: Very cool. Your updates should work with 1.0.7 (there weren't any macro/template changes since 1.0.5 except what you had posted earlier). I'll roll these in and update development again later today. Glad to be of Help. I really love these Powercards, they do look so much better than the standard templates coming with the sheet. I have a few observations/notes/suggestions I stumbled upon while doing these. Note, that I'm not really a good coder. I just spend a lot of time with trial and error, so its always very possible I have overlooked something. :) 1. Inline Conditionals. It would greatly reduce the amount of lines needed for the global modifiers, if we could do something like --Hit|You hit for [[<dmg>]] [? "~3!" -ne "0" |<stuff that happens when true>|<stuff that happens when false> ?] I had to double up on lines for both Hits and Critical Hits. With inline Conditionals I could have fit all of that inside the already existing lines, maybe you could even ditch the additional Critical hit line and condense the template further down. 2. --replaceattrs seems to not have all attributes available? ie I couldn't seem to use it for the global modifiers 3. It would be nice to have a custom attribute from PCM Helper, that includes all Trait names from the repeating traits fields, for similar use as the Spell List and Attack List macros. I will glady clean up my feats macros/templates for that, after I've cleaned them up. 4. I know, I already asked this and I know it's difficult bc how the pchelper macros/templates are built, but some way to call a second macro or template within an template and abort the current template would be really nice, to allow for special case spells/attacks without having to ditch the nice convenient complete list that works for 95% of spells. It's no priority at all, but if you get an Idea for that, it would greatly improve the possibilities imo. :) Those are the major things I noticed. Nothing of this is really that important, just some things I've noticed, and wanted to mention in a seperate post. :)
1595341744
Kurt J.
Pro
API Scripter
Max A. said: Hi! I'm not very good at programming. Can you tell me what the error of the macro is? Everything related to $ Atk and audio does not work !power {{  --bgcolor|#8A2BE2  --txcolor|#000000  --name|@{selected|token_name}  --leftsub|use spell Stream of Fire  --rightsub|to @{target|token_name}  --Hit|[[ [NH|Atk] (@{Hit wisdom}+1d6+1d4)-(@{target|Dodge}+1d6+1d4) ]]  --?? $Atk >= 0 ?? Damage|[[ [$DMG] round(3*?{Fire modifier|1.15}*@{target|Magic Fire  resist}) ]]  --soundfx|_audio,play,nomenu|fire  --vfx_opt|@{selected|token_id} @{target|token_id} breath-fire  --?? $Atk >= 0 < 8 ?? Burning|1*@{target|Burning resist} for 3 moves  --?? $Atk >= 8 ?? Burning crit|2*@{target|Burning resist} for 3 moves  --?? $Atk >= 0 ?? api_token-mod|_ids @{target|token_id} _ignore-selcted _set statusmarkers|49  --?? $Atk >= 0 ?? api_act|-1 3 _Burning  --?? $Atk >= 0 ?? alterbar|_target|@{target|token_id} _bar|1 _amount|-[^DMG] _show|all }} RollIDs in inside inline rolls need to start with a $, so  --Hit|[[ [NH|Atk] (@{Hit wisdom}+1d6+1d4)-(@{target|Dodge}+1d6+1d4) ]] needs to be something line:  --Hit|[[ [NH| $ Atk] (@{Hit wisdom}+1d6+1d4)-(@{target|Dodge}+1d6+1d4) ]] I'm not familiar with your system, so I'm assuming the other components of the roll produce a usable result.
1595347826
Kurt J.
Pro
API Scripter
Sven K. said: Kurt J. said: Very cool. Your updates should work with 1.0.7 (there weren't any macro/template changes since 1.0.5 except what you had posted earlier). I'll roll these in and update development again later today. Glad to be of Help. I really love these Powercards, they do look so much better than the standard templates coming with the sheet. I have a few observations/notes/suggestions I stumbled upon while doing these. Note, that I'm not really a good coder. I just spend a lot of time with trial and error, so its always very possible I have overlooked something. :) 1. Inline Conditionals. It would greatly reduce the amount of lines needed for the global modifiers, if we could do something like --Hit|You hit for [[<dmg>]] [? "~3!" -ne "0" |<stuff that happens when true>|<stuff that happens when false> ?] I had to double up on lines for both Hits and Critical Hits. With inline Conditionals I could have fit all of that inside the already existing lines, maybe you could even ditch the additional Critical hit line and condense the template further down. 2. --replaceattrs seems to not have all attributes available? ie I couldn't seem to use it for the global modifiers 3. It would be nice to have a custom attribute from PCM Helper, that includes all Trait names from the repeating traits fields, for similar use as the Spell List and Attack List macros. I will glady clean up my feats macros/templates for that, after I've cleaned them up. 4. I know, I already asked this and I know it's difficult bc how the pchelper macros/templates are built, but some way to call a second macro or template within an template and abort the current template would be really nice, to allow for special case spells/attacks without having to ditch the nice convenient complete list that works for 95% of spells. It's no priority at all, but if you get an Idea for that, it would greatly improve the possibilities imo. :) Those are the major things I noticed. Nothing of this is really that important, just some things I've noticed, and wanted to mention in a seperate post. :) 1 - Inline conditionals. Very interesting idea. I'll play with it a bit and see if I can cook up something that will work. 2 - You are correct... I defined a subset of attributes, and the global modifiers weren't part of the sheet when I was originally working on it. As long as they are standard attributes, it shouldn't be a problem to add them. 3 - That shouldn't be an issues. I'll add it to the to-do list. 4 - Would be awesome... I just have to try to keep my brain from melting trying to figure something out :)
Hmm, I might have an Idea I'm gonna play around a bit later. Dunno if it's possible...but is it possible to call templates from within templates? With that you could make a master template which then forks to different templates based on conditions ie: mastertemplate: -- ?? $spellname == "Magic Missile" ?? template|magicmissiletemplate|args; -- ?? $spellname == "Eldritch Blast" ?? template|eldritchblasttemplate|args; The biggest problem I don't know atm is how to set the default template to use, without having a negative conditional for each spell to use... But this should clean things up a bit...if you can use templates in templates...I wouldn't really want to have it in the macro either, as that makes the macros to cumbersome imo....as I said, just an Idea I just had...
Dealt with the problem. It turned out that the script doesn't work if there are no throws. One question is just how to make double conditions? Something like a $Hit > 0 < 8
1595355444
Kurt J.
Pro
API Scripter
Max A. said: Dealt with the problem. It turned out that the script doesn't work if there are no throws. One question is just how to make double conditions? Something like a $Hit > 0 < 8 Separate them with AND ( --?? $Hit > 0 AND $Hit < 8 ?? ) 
Kurt J. said: Max A. said: Dealt with the problem. It turned out that the script doesn't work if there are no throws. One question is just how to make double conditions? Something like a $Hit > 0 < 8 Separate them with AND ( --?? $Hit > 0 AND $Hit < 8 ?? )  Thank! The tips helped a lot!
Is it possible to create a powrcard where buttons can be clicked to run other powercards?
1595466196
Kurt J.
Pro
API Scripter
Dan L. said: Is it possible to create a powrcard where buttons can be clicked to run other powercards? If they are linked to macros or character abilities, yes: !power {{ --name|Test --macro|[Macro](!
#MacroName) --ability|[Ability](!
%{CharName|AbilityName}) }} Should create two buttons that will call a macro or ability, that themselves can be PowerCard macros. 
Are RollIDs not allowed in inline rolls? !power {{  --!roll|@{selected|cname} rolls [[ [$DCast] round((1d100 + @{selected|skConcentration}) / 2) [Concentration] ]]  --!vs|vs ?{Spell Name|@{selected|spell1name},@{selected|spell1name} Mana Cost: [[ [$ManaCost] 0d0 + @{selected|spell1mana} ]]|@{selected|spell2name},@{selected|spell2name} Mana Cost: [[ [$ManaCost] 0d0 + @{selected|spell2mana} ]]}  --?? $DCast >= $ManaCost ??Result:|Dual Cast Succeeded...  --?? $DCast < $ManaCost ??Result:|Dual Cast Failed...  --?? $DCast < $ManaCost ??!mana|[[ [$Manaspent] [^ManaCost] * 2 ]]     <----------Error  --?? $DCast < $ManaCost ??alterbar|_target|@{selected|token_id} _bar|2 _amount|-[^Manaspent] _show|all }} I need to get the mana cost of the spell and double it, can you please check it out to see what is wrong?
Sims said: Are RollIDs not allowed in inline rolls? !power {{  --!roll|@{selected|cname} rolls [[ [$DCast] round((1d100 + @{selected|skConcentration}) / 2) [Concentration] ]]  --!vs|vs ?{Spell Name|@{selected|spell1name},@{selected|spell1name} Mana Cost: [[ [$ManaCost] 0d0 + @{selected|spell1mana} ]]|@{selected|spell2name},@{selected|spell2name} Mana Cost: [[ [$ManaCost] 0d0 + @{selected|spell2mana} ]]}  --?? $DCast >= $ManaCost ??Result:|Dual Cast Succeeded...  --?? $DCast < $ManaCost ??Result:|Dual Cast Failed...  --?? $DCast < $ManaCost ??!mana|[[ [$Manaspent] [^ManaCost] * 2 ]]     <----------Error  --?? $DCast < $ManaCost ??alterbar|_target|@{selected|token_id} _bar|2 _amount|-[^Manaspent] _show|all }} I need to get the mana cost of the spell and double it, can you please check it out to see what is wrong? You can use RollIDs only for output and conditionals. In your case you can use the --hroll tag to assign a second manacost RollID, or just don't use a rollid at all, since you aren't really rolling anything. --?? $DCast < $ManaCost ??!mana|[[ [$Manaspent] 0d0 + @{selected|spell2mana} * 2 ]]
I'm trying to use Powercards for a Wildshape attack when I have three attacks and I'm running into issues. Not with the card output, but the updating of the target health bar (bar3). !power {{  --name|Wildshape - Deinonychus  --leftsub|Attacks: Talons, claws & bite  --rightsub|Special: Pounce  --Talons:|[[ [$A1] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A1.base == 20 ?? Talons Crit!:|[[ [$A1c] 1d20 + @{WS_Attack_Calc} ]]  --Claws:|[[ [$A2] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A2.base == 20 ?? Claws Crit!:|[[ [$A2c] 1d20 + @{WS_Attack_Calc} ]]  --Bite:|[[ [$A3] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A3.base == 20 ?? Bite Crit!:|[[ [$A3c] 1d20 + @{WS_Attack_Calc} ]]    --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? Talon Damage:|[[ [$Dmg1] 1d8+@{WS_Str_Mod} ]]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? Talon Crit Damage:|[[ [$Dmg2] (1d8 + @{WS_Str_Mod})*2 ]]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? Talon Damage:|[[ [$Dmg3] (1d8 + @{WS_Str_Mod}) ]]    --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? Claw Damage:|[[ [$Dmg4] 1d3+@{WS_Str_Mod} ]]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? Claw Crit Damage:|[[ [$Dmg5] (1d3 + @{WS_Str_Mod})*2 ]]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? Claw Damage:|[[ [$Dmg6] (1d3 + @{WS_Str_Mod}) ]]    --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? Bite Damage:|[[ [$Dmg7] 2d4+@{WS_Str_Mod} ]]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? Bite Crit Damage:|[[ [$Dmg8] (2d4 + @{WS_Str_Mod})*2 ]]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? Bite Damage:|[[ [$Dmg9] (2d4 + @{WS_Str_Mod}) ]]    --alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg1] + [^Dmg2] + [^Dmg3] + [^Dmg4] + [^Dmg5] + [^Dmg6] + [^Dmg7] + [^Dmg8] + [^Dmg9] _show|all }} Executing this attack will sometimes only hit with the Claw for 5 damage, but the alterbar updates as if the NPC took 90 damage, because ALL the Dmg variables have a value. I've tried placing each update immediately after the damage condition, but that doesn't work either, the update is always off by a few points from what shows in the output. It's like the damage is re-rolled as the API is called or something.
1596193259
Kurt J.
Pro
API Scripter
john s. said: I'm trying to use Powercards for a Wildshape attack when I have three attacks and I'm running into issues. Not with the card output, but the updating of the target health bar (bar3). !power {{  --name|Wildshape - Deinonychus  --leftsub|Attacks: Talons, claws & bite  --rightsub|Special: Pounce  --Talons:|[[ [$A1] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A1.base == 20 ?? Talons Crit!:|[[ [$A1c] 1d20 + @{WS_Attack_Calc} ]]  --Claws:|[[ [$A2] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A2.base == 20 ?? Claws Crit!:|[[ [$A2c] 1d20 + @{WS_Attack_Calc} ]]  --Bite:|[[ [$A3] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A3.base == 20 ?? Bite Crit!:|[[ [$A3c] 1d20 + @{WS_Attack_Calc} ]]    --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? Talon Damage:|[[ [$Dmg1] 1d8+@{WS_Str_Mod} ]]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? Talon Crit Damage:|[[ [$Dmg2] (1d8 + @{WS_Str_Mod})*2 ]]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? Talon Damage:|[[ [$Dmg3] (1d8 + @{WS_Str_Mod}) ]]    --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? Claw Damage:|[[ [$Dmg4] 1d3+@{WS_Str_Mod} ]]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? Claw Crit Damage:|[[ [$Dmg5] (1d3 + @{WS_Str_Mod})*2 ]]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? Claw Damage:|[[ [$Dmg6] (1d3 + @{WS_Str_Mod}) ]]    --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? Bite Damage:|[[ [$Dmg7] 2d4+@{WS_Str_Mod} ]]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? Bite Crit Damage:|[[ [$Dmg8] (2d4 + @{WS_Str_Mod})*2 ]]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? Bite Damage:|[[ [$Dmg9] (2d4 + @{WS_Str_Mod}) ]]    --alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg1] + [^Dmg2] + [^Dmg3] + [^Dmg4] + [^Dmg5] + [^Dmg6] + [^Dmg7] + [^Dmg8] + [^Dmg9] _show|all }} Executing this attack will sometimes only hit with the Claw for 5 damage, but the alterbar updates as if the NPC took 90 damage, because ALL the Dmg variables have a value. I've tried placing each update immediately after the damage condition, but that doesn't work either, the update is always off by a few points from what shows in the output. It's like the damage is re-rolled as the API is called or something. All rolls and roll id assignments in a PowerCard happen at the same time, and happen no matter what conditionals are applied, so all nine rolls will be made and then the final line that adds them all together and runs alterbars will happen. You will also run into problems because you have duplicate tags for "Talon Damage", "Claw Damage" and "Bite Damage". That is why you are seeing different numbers. Every tag in a card has to be unique, so your first "Talon Damage" line is being replace by the second "Talon Damage" line when the output is generated - but the damage rolls and roll id assignments. That doesn't mean such a card can't work, but it does mean that it needs to be restructured to take those limitations into account. Usually this would mean multiple calls to alterbar, each dealing part of the damage conditionally instead of adding them all up at the end. I'm not sure what sheet you are using or really what game you are playing because it looks like you are rolling a second attack roll to see if there is a critical hit, but then also rolling additional critical damage if there isn't... If this is really the way crits work, you would need to have 6 different calls to alterbars, each one running conditional depending on the roll results.
Playing D&D 3.5 so if a roll is a natural 20 I need to "confirm the crit" which is what the second roll is for. So the three "if" statements are for regular hit, crit but unconfirmed and crit confirmed. The output on each line works fine, but the amount being used by alterbar seems to be the last roll. Each damage roll has its own unique tag (Dmg1, Dmg2, Dmg3, etc...). Not sure what else to try.  .  !power {{  --name|Wildshape - Deinonychus  --leftsub|Attacks: Talons, claws & bite  --rightsub|Special: Pounce  --Talons:|[[ [$A1] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A1.base == 20 ?? Talons Crit!:|[[ [$A1c] 1d20 + @{WS_Attack_Calc} ]]  --Claws:|[[ [$A2] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A2.base == 20 ?? Claws Crit!:|[[ [$A2c] 1d20 + @{WS_Attack_Calc} ]]  --Bite:|[[ [$A3] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A3.base == 20 ?? Bite Crit!:|[[ [$A3c] 1d20 + @{WS_Attack_Calc} ]]  --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? Talon Damage:|[[ [$Dmg1] 1d8+@{WS_Str_Mod} ]]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? Talon Crit Damage:|[[ [$Dmg2] (1d8 + @{WS_Str_Mod})*2 ]]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? Non-Crit Talon Damage:|[[ [$Dmg3] (1d8 + @{WS_Str_Mod}) ]]  --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg1]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg2]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg3]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? Claw Damage:|[[ [$Dmg4] 1d3+@{WS_Str_Mod} ]]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? Claw Crit Damage:|[[ [$Dmg5] (1d3 + @{WS_Str_Mod})*2 ]]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? Non-Crit Claw Damage:|[[ [$Dmg6] (1d3 + @{WS_Str_Mod}) ]]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg4]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg5]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg6]    --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? Bite Damage:|[[ [$Dmg7] 2d4+@{WS_Str_Mod} ]]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? Bite Crit Damage:|[[ [$Dmg8] (2d4 + @{WS_Str_Mod})*2 ]]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? Non-Crit Bite Damage:|[[ [$Dmg9] (2d4 + @{WS_Str_Mod}) ]]  --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg7]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg8]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg9] }}
I have this replacement defined: CharacterNames:Player1Name|Reed Rudy;Player2Name|Waris Wiadon;Player3Name|Cantus Cillian;Player4Name|Flint Fireforge And I have this powercard: !power --name|test --replacement|CharacterNames --test|~Player1Name$ And I get this output: test ReedRudy What happened to the space between Reed and Rudy?
1596305020
Kurt J.
Pro
API Scripter
john s. said: Playing D&D 3.5 so if a roll is a natural 20 I need to "confirm the crit" which is what the second roll is for. So the three "if" statements are for regular hit, crit but unconfirmed and crit confirmed. The output on each line works fine, but the amount being used by alterbar seems to be the last roll. Each damage roll has its own unique tag (Dmg1, Dmg2, Dmg3, etc...). Not sure what else to try.  .  !power {{  --name|Wildshape - Deinonychus  --leftsub|Attacks: Talons, claws & bite  --rightsub|Special: Pounce  --Talons:|[[ [$A1] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A1.base == 20 ?? Talons Crit!:|[[ [$A1c] 1d20 + @{WS_Attack_Calc} ]]  --Claws:|[[ [$A2] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A2.base == 20 ?? Claws Crit!:|[[ [$A2c] 1d20 + @{WS_Attack_Calc} ]]  --Bite:|[[ [$A3] 1d20 + @{WS_Attack_Calc} ]] vs. AC: [[ @{target|npcarmorclass} ]]  --?? $A3.base == 20 ?? Bite Crit!:|[[ [$A3c] 1d20 + @{WS_Attack_Calc} ]]  --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? Talon Damage:|[[ [$Dmg1] 1d8+@{WS_Str_Mod} ]]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? Talon Crit Damage:|[[ [$Dmg2] (1d8 + @{WS_Str_Mod})*2 ]]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? Non-Crit Talon Damage:|[[ [$Dmg3] (1d8 + @{WS_Str_Mod}) ]]  --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg1]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg2]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg3]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? Claw Damage:|[[ [$Dmg4] 1d3+@{WS_Str_Mod} ]]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? Claw Crit Damage:|[[ [$Dmg5] (1d3 + @{WS_Str_Mod})*2 ]]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? Non-Crit Claw Damage:|[[ [$Dmg6] (1d3 + @{WS_Str_Mod}) ]]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg4]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg5]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg6]    --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? Bite Damage:|[[ [$Dmg7] 2d4+@{WS_Str_Mod} ]]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? Bite Crit Damage:|[[ [$Dmg8] (2d4 + @{WS_Str_Mod})*2 ]]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? Non-Crit Bite Damage:|[[ [$Dmg9] (2d4 + @{WS_Str_Mod}) ]]  --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg7]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg8]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? alterbar|_target|@{target|token_id} _bar|3 _amount|-[^Dmg9] }} When I say all tags have to be unique, that includes calls to alterbar (The Dmg1, Dmg2, etc. are RollIDs - and you are correct they need to be unique as well). A PowerCard line consists of a tag and it's content. In your card, you have nine tags named "alterbar", which is not allowed. You need to use the "same name" tag modifier (see the  Wiki entry for the scrip t), meaning that you would need "alterbar *1", "alterbar *2", etc. That said, I would change a few things up as well. Instead of inline rolls for NPC Armor Class, I would just surround them with [! and !] so they LOOK like inline rolls but don't require the additional processing. Also, I would consolidate most of the dir rolling under an hroll - the dice will be rolled even if the conditionals don't match, so they will happen anyway. It is visually cleaner (for me) if they all happen in one spot so it is easier to see what is going on. Here is what I came up with based on your marcro: !power {{  --name|Wildshape - Deinonychus  --leftsub|Attacks: Talons, claws & bite  --rightsub|Special: Pounce  --Talons:|[[ [$A1] 1d20 + @{selected|WS_Attack_Calc} ]] vs. AC: [! @{target|npcarmorclass} !]  --Claws:|[[ [$A2] 1d20 + @{selected|WS_Attack_Calc} ]] vs. AC: [! @{target|npcarmorclass} !]  --Bite:|[[ [$A3] 1d20 + @{selected|WS_Attack_Calc} ]] vs. AC: [! @{target|npcarmorclass} !]  --hroll|[[ [$A1c] 1d20 + @{selected|WS_Attack_Calc} ]] [[ [$A2c] 1d20 + @{selected|WS_Attack_Calc} ]] [[ [$A3c] 1d20 + @{selected|WS_Attack_Calc} ]]           [[ [$TDmg] 1d8 + @{selected|WS_Str_Mod} ]] [[ [$CDmg] 1d8 + @{selected|WS_Str_Mod} ]] [[ [$BDmg] 1d8 + @{selected|WS_Str_Mod} ]]           [[ [$TCrit] (1d8 + @{selected|WS_Str_Mod}) *2 ]] [[ [$CCrit] (1d8 + @{selected|WS_Str_Mod}) * 2 ]] [[ [$BCrit] (1d8 + @{selected|WS_Str_Mod}) * 2 ]]   --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? Talon Damage:| [! [^TDmg] !]  --?? $A1 >= @{target|npcarmorclass} AND $A1.base <> 20 ?? alterbar *1|_target|@{target|token_id} _bar|3 _amount|-[^TDmg]  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? Talon Damage: *2| [! [^TDmg] !] (Crit roll was [! [^A1c] !])  --?? $A1.base == 20 AND $A1c < @{target|npcarmorclass} ?? alterbar *2|_target|@{target|token_id} _bar|3 _amount|-[^TDmg]  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? Talon Critical Damage:| [! [^TCrit] !] (Crit roll was [! [^A1c] !])  --?? $A1.base == 20 AND $A1c >= @{target|npcarmorclass} ?? alterbar *3|_target|@{target|token_id} _bar|3 _amount|-[^TCrit]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? Claw Damage:| [! [^CDmg] !]  --?? $A2 >= @{target|npcarmorclass} AND $A2.base <> 20 ?? alterbar *4|_target|@{target|token_id} _bar|3 _amount|-[^CDmg]  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? Claw Damage: *2| [! [^CDmg] !] (Crit roll was [! [^A2c] !])  --?? $A2.base == 20 AND $A2c < @{target|npcarmorclass} ?? alterbar *5|_target|@{target|token_id} _bar|3 _amount|-[^CDmg]  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? Claw Critical Damage:| [! [^CCrit] !] (Crit roll was [! [^A2c] !])  --?? $A2.base == 20 AND $A2c >= @{target|npcarmorclass} ?? alterbar *6|_target|@{target|token_id} _bar|3 _amount|-[^CCrit]  --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? Bite Damage:| [! [^BDmg] !]  --?? $A3 >= @{target|npcarmorclass} AND $A3.base <> 20 ?? alterbar *7|_target|@{target|token_id} _bar|3 _amount|-[^BDmg]  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? Bite Damage: *2| [! [^BDmg] !] (Crit roll was [! [^A3c] !])  --?? $A3.base == 20 AND $A3c < @{target|npcarmorclass} ?? alterbar *8|_target|@{target|token_id} _bar|3 _amount|-[^BDmg]  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? Bite Critical Damage:| [! [^BCrit] !] (Crit roll was [! [^A3c] !])  --?? $A3.base == 20 AND $A3c >= @{target|npcarmorclass} ?? alterbar *9|_target|@{target|token_id} _bar|3 _amount|-[^BCrit] }} It does essentially the same thing, but you should get the right values from AlterBars. If a crit doesn't get confirmed (well, and even if it does) it lets the player know what they rolled in the crit attampt.
1596305373

Edited 1596305439
Kurt J.
Pro
API Scripter
kgsodie said: I have this replacement defined: CharacterNames:Player1Name|Reed Rudy;Player2Name|Waris Wiadon;Player3Name|Cantus Cillian;Player4Name|Flint Fireforge And I have this powercard: !power --name|test --replacement|CharacterNames --test|~Player1Name$ And I get this output: test ReedRudy What happened to the space between Reed and Rudy? I would do the Handout Notes Replacement Dance, which consists of: Copy the text of the notes field of your replacements handout and place it into a blank Notepad window Go back to your handout and click in the notes field and select all (Control - A), hit delete, and save the handout with empty notes. Copy the text from your Notepad window Go back to the handout, right-click in the notes field and click "Paste as plain text" Save the handout. because using your replacements works fine for me:
Good call Kurt,  that fixed  it. Strange that a hex editor  showed normal spaces, but copy out  and paste back worked great. Wouldn't  have thought to try  that.
Kurt, is there an easy way to change the backgroundcolor for different characters?  I was wanting to try to get them to match up with their colors in their 'avatars' at the bottom of the screen.  I am happy to have a PC-Attack macro for each character if that makes it easier. Thank you, Don
1596388954
Kurt J.
Pro
API Scripter
Donald K. said: Kurt, is there an easy way to change the backgroundcolor for different characters?  I was wanting to try to get them to match up with their colors in their 'avatars' at the bottom of the screen.  I am happy to have a PC-Attack macro for each character if that makes it easier. Thank you, Don This should be built-in to PCMHelper. You just need to create a format named after each character in your formats handout.
1596490024

Edited 1596490147
Hi Kurt! Would you be amenable to changing the syntax of recalling stored values? I'm talking about how there are brackets around the format [^Atk] . It clashes with trying to add together two stored values. Or is that not due to syntax but a more general limitation of PowerCards? Where this came up is that I wrote a test macro like this: !power {{ --bgcolor|#FFC0CB  --name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]] --First Roll:| [[ [$Fir] 1d20]] --Second Roll:| [[ [$Sec] 1d20]] --?? $Hid.base < 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base < 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base < 10 ?? Result 2:|Second roll was less than 10 --Sum:|  [^Fir.total] + [^Sec.total] }} And I'm unable to get the two stored values Fir and Sec to add together in any way. Putting double brackets around the calculation in the form of  --Sum:| [[ [^Fir.total] + [^Sec.total] ]]  leads to SyntaxError: Expected [0-9] but " " found. Best Regards, Hannu
1596542772
Kurt J.
Pro
API Scripter
Hannu said: Hi Kurt! Would you be amenable to changing the syntax of recalling stored values? I'm talking about how there are brackets around the format [^Atk] . It clashes with trying to add together two stored values. Or is that not due to syntax but a more general limitation of PowerCards? Where this came up is that I wrote a test macro like this: !power {{ --bgcolor|#FFC0CB  --name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]] --First Roll:| [[ [$Fir] 1d20]] --Second Roll:| [[ [$Sec] 1d20]] --?? $Hid.base < 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base < 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base < 10 ?? Result 2:|Second roll was less than 10 --Sum:|  [^Fir.total] + [^Sec.total] }} And I'm unable to get the two stored values Fir and Sec to add together in any way. Putting double brackets around the calculation in the form of  --Sum:| [[ [^Fir.total] + [^Sec.total] ]]  leads to SyntaxError: Expected [0-9] but " " found. Best Regards, Hannu Currently, this isn't possible with PowerCards. Anything in the content side of the Tag/Content pair is processed for formatting and replacing RollIDs with values, but is otherwise not treated as anything except output text. The exception to this are rolls themselves, but all rolls are conducted at the same time at the beginning of processing, so [[ [^Fir.total] + [^Sec.total] ]] will essentially end up as [[ + ]] because the RollIDs don't have values yet. A RollID can't be used as part of another roll.
Thanks for letting me know Kurt! It's a shame because I have found no other way of creating a weather macro using the Pathfinder weather ruleset:&nbsp; <a href="https://www.d20pfsrd.com/gamemastering/environment/weather/" rel="nofollow">https://www.d20pfsrd.com/gamemastering/environment/weather/</a> Best Regards, Hannu
Hannu said: Hi Kurt! Would you be amenable to changing the syntax of recalling stored values? I'm talking about how there are brackets around the format [^Atk] . It clashes with trying to add together two stored values. Or is that not due to syntax but a more general limitation of PowerCards? Where this came up is that I wrote a test macro like this: !power {{ --bgcolor|#FFC0CB &nbsp;--name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]] --First Roll:| [[ [$Fir] 1d20]] --Second Roll:| [[ [$Sec] 1d20]] --?? $Hid.base &lt; 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base &lt; 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base &lt; 10 ?? Result 2:|Second roll was less than 10 --Sum:|&nbsp; [^Fir.total] + [^Sec.total] }} And I'm unable to get the two stored values Fir and Sec to add together in any way. Putting double brackets around the calculation in the form of&nbsp; --Sum:| [[ [^Fir.total] + [^Sec.total] ]] &nbsp;leads to SyntaxError: Expected [0-9] but " " found. Best Regards, Hannu Shouldn't something like !power {{ --bgcolor|#FFC0CB --name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]][[ [$Sum] [[ [$Fir] 1d20 ]] + [[ [$Sec] 1d20 ]] ]] --First Roll:| [^Fir.total] --Second Roll:| [^Sec.total] --?? $Hid.base &lt; 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base &lt; 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base &lt; 10 ?? Result 2:|Second roll was less than 10 --Sum:|&nbsp; [^Sum.total] }} in Theory work? Never tried it, didn't have the Use case yet... Are RollIDs inside of RollIDs allowed?
1596744080
Kurt J.
Pro
API Scripter
Sven K. said: Hannu said: Hi Kurt! Would you be amenable to changing the syntax of recalling stored values? I'm talking about how there are brackets around the format [^Atk] . It clashes with trying to add together two stored values. Or is that not due to syntax but a more general limitation of PowerCards? Where this came up is that I wrote a test macro like this: !power {{ --bgcolor|#FFC0CB &nbsp;--name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]] --First Roll:| [[ [$Fir] 1d20]] --Second Roll:| [[ [$Sec] 1d20]] --?? $Hid.base &lt; 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base &lt; 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base &lt; 10 ?? Result 2:|Second roll was less than 10 --Sum:|&nbsp; [^Fir.total] + [^Sec.total] }} And I'm unable to get the two stored values Fir and Sec to add together in any way. Putting double brackets around the calculation in the form of&nbsp; --Sum:| [[ [^Fir.total] + [^Sec.total] ]] &nbsp;leads to SyntaxError: Expected [0-9] but " " found. Best Regards, Hannu Shouldn't something like !power {{ --bgcolor|#FFC0CB --name|Conditionals Test --leftsub|Should show text below the rolls when they are less than 10 --hroll|[[ [$Hid] 1d20 ]][[ [$Sum] [[ [$Fir] 1d20 ]] + [[ [$Sec] 1d20 ]] ]] --First Roll:| [^Fir.total] --Second Roll:| [^Sec.total] --?? $Hid.base &lt; 10 ?? Hidden result:|Hidden roll was less than 10 --?? $Fir.base &lt; 10 ?? Result 1:|First roll was less than 10 --?? $Sec.base &lt; 10 ?? Result 2:|Second roll was less than 10 --Sum:|&nbsp; [^Sum.total] }} in Theory work? Never tried it, didn't have the Use case yet... Are RollIDs inside of RollIDs allowed? I believe they will all be assigned the total value of the roll, not separated out.
very nice sir
1596809947

Edited 1596810265
-G-
Pro
Hi folks, I've been tinkering with formulas in a multi-targetting macro. The results seems fine but when you look up the numbers, you realise that the results are wrongs. This is the macro : !power {{&nbsp; --name|Grenade Flash| 9 cibles --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id}&nbsp; &nbsp;--%%token_name%%#?{Number of targets|1}|&nbsp; ^^ *Constitution (%%body%%)* [[ [NH] [$NoH] 4df - ?{Niveau de&nbsp; éblouissant?|1|2|3} - {%%blessure%%}+0d0, 0d0}kh1 - {%%blessure_grave%%}+0d0, 0d0}kh1 - {%%inconscient%%}+0d0, 0d0}kh1 + {%%body%%}+0d0, 0d0}kh1 +{%%stunlvl%%}+0d0, 0d0}kh1 ]] }} And the results I get : Which seems fine. But when looking at the rolled dice for Sergio, you get this : When doing the math, you realise that the result should be 3, not 1. the ERROR part seems to cause problem but I can't get a workaround. Any way to fix that? Thanks.
1596817107
Kurt J.
Pro
API Scripter
G said: Hi folks, I've been tinkering with formulas in a multi-targetting macro. The results seems fine but when you look up the numbers, you realise that the results are wrongs. This is the macro : !power {{&nbsp; --name|Grenade Flash| 9 cibles --target_list|@{target|1st|token_id} | @{target|2nd|token_id} | @{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id} | @{target|6th|token_id} | @{target|7th|token_id} | @{target|8th|token_id} | @{target|9th|token_id}&nbsp; &nbsp;--%%token_name%%#?{Number of targets|1}|&nbsp; ^^ *Constitution (%%body%%)* [[ [NH] [$NoH] 4df - ?{Niveau de&nbsp; éblouissant?|1|2|3} - {%%blessure%%}+0d0, 0d0}kh1 - {%%blessure_grave%%}+0d0, 0d0}kh1 - {%%inconscient%%}+0d0, 0d0}kh1 + {%%body%%}+0d0, 0d0}kh1 +{%%stunlvl%%}+0d0, 0d0}kh1 ]] }} And the results I get : Which seems fine. But when looking at the rolled dice for Sergio, you get this : When doing the math, you realise that the result should be 3, not 1. the ERROR part seems to cause problem but I can't get a workaround. Any way to fix that? Thanks. Are "blessure", "blessure_grave", and "inconscient" the actual names of attributes on the character sheet you are using? Even if the display of a sheet is localized into French, the internal names of the attributes might not be. If you type "@{selected|blessure}" (and the same for the other two) and don't get back an error about a missing attribute, that wouldn't seem to be the problem, but it is my initial guess.