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)

Hi everyone! I'm kinda new to all this API scripts and all that stuff, I've only got my pro subscription 2 days ago... I was wondering if anybody has a script to cast spells at different levels.  ex. Cure wounds can be cast at lv.1, at lv.2 and higher u gain an extra 1d8 healing, I can't seem to find a way to do something like this Thanks in advance for your help. :D
Scott P. said: Emmanuel C. said: in a query and the have the correct ammo removed (normal, +1,+2...)? I can't find a command to use !ammo inside a powercard, that's why I put it before the !power Any api can be called in a Powercard using the special api tag created for this purpose.  I don't use the ammo script so I'm not familiar with the syntax but I think that if you would normally use this command: !ammo @{selected|token_id} other_resource -1 flèche then within your Powercard you can use: --api_ammo @{selected|token_id} other_resource -1 flèche You can find more information about Advanced API Usage within PowerCards here . Ok, it's almost that, the correct line is: --api_ammo|@{selected|token_id} other_resource -1 flèche BUT, I get this result (and the api crashes) any idea?
1592948236

Edited 1592948371
Elijah L. said: Hi everyone! I'm kinda new to all this API scripts and all that stuff, I've only got my pro subscription 2 days ago... I was wondering if anybody has a script to cast spells at different levels.  ex. Cure wounds can be cast at lv.1, at lv.2 and higher u gain an extra 1d8 healing, I can't seem to find a way to do something like this Thanks in advance for your help. :D I did that for my healer (it's in french). I prepared the spell for higher level (from 1 to 5), add a visual effect, and add automatically the HP to the "bar1" which is the one I use. !power {{ --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** soigne @{target|character_name} --target_list|@{target|token_id} --name|N1 - Sort de soins --leftsub|Action - Lancer un sort --rightsub|Contact --hroll| [[ [$NivLancement] 0d0 + ?{Sort lancé au niveau ? |1|2|3|4|5} ]] --vfx_opt|@{target|token_id} bomb-water --?? $NivLancement == 1 ?? |~C//**Sort lancé au Niveau 1//**~C ^^ ** @{target|character_name}** récupère [[ [$PVSoignésN1] 1d8 + @{selected|wisdom_mod} ]] **PV** --?? $NivLancement == 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|+[^PVSoignésN1] _show|none --?? $NivLancement == 2 ?? |~C//**Sort lancé au Niveau 2 //**~C^^ ** @{target|character_name}** récupère [[ [$PVSoignésN2] 2d8 + @{selected|wisdom_mod} ]] **PV** --?? $NivLancement == 2 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|+[^PVSoignésN2] _show|none --?? $NivLancement == 3 ?? |~C//**Sort lancé au Niveau 3 //**~C^^ ** @{target|character_name}** récupère [[ [$PVSoignésN3] 3d8 + @{selected|wisdom_mod} ]] **PV** --?? $NivLancement == 3 ?? alterbar3|_target|@{target|token_id} _bar|1 _amount|+[^PVSoignésN3] _show|none --?? $NivLancement == 4 ?? |~C//**Sort lancé au Niveau 4 //**~C^^ ** @{target|character_name}** récupère [[ [$PVSoignésN4] 4d8 + @{selected|wisdom_mod} ]] **PV** --?? $NivLancement == 4 ?? alterbar4|_target|@{target|token_id} _bar|1 _amount|+[^PVSoignésN4] _show|none --?? $NivLancement == 5 ?? |~C//**Sort lancé au Niveau 5 //**~C^^ ** @{target|character_name}** récupère [[ [$PVSoignésN5] 5d8 + @{selected|wisdom_mod} ]] **PV** --?? $NivLancement == 5 ?? alterbar5|_target|@{target|token_id} _bar|1 _amount|+[^PVSoignésN5] _show|none }}
Kurt J. said: Kariaudhanaur said: Hi everyone, I'm using PCM Helper to have the attacks for my npcs in the same visual than the actions of my players, but I have a question : Is there a way to not display the "description" of the attack ? For example, I would prefer if my players didn't know the DC is 11, nor the precise description of what it does if they fail... Is there a "hide" option please ? Thanks. (and "yes", in the character sheet it's already on "hide" :) ) It can be done, but it isn't for the faint of heart :) You would need to edit the PowerCard Templates PCMHelper handoud, which needs to be done in a very particular way to avoid the in-game editor causing problems by inserting HTML and other hidden stuff in the text. You will need to open the handout and select all of the text. Copy it and paste it into an empty document in something like Notepad++ (the build-in Notepad in windows doesn't have a line length long enough to handle some of the templates I don't believe). Once you have the text in Notepad++, look at the very end of the NPCAttack line (if wordwrap is off, each template is on a single line). What you would look to remove is: --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ Now hilight everything and copy it to the clipboard. Go back to Roll20 and hilight all of the text in the Handout and hit Delete. Save the template, then reopen it and paste the modified text back into the handout. Try out the macros to make sure nothing got broken. if it did, you'll need to rerun !pcmsetup to restore the default templates. Thx, I wasn't around here from a few days, but I'll try that soon... And I'm pretty sure it will work, so thanks a lot Kurt :D !!!
Guys I'm really desperate 'cause I cannot figure out wot's wrong with my usage of both Powercards, templates & (TokenMod or Alterbar)! Everytning seems to be ok in my conditionnal evaluation but when I get to the point of trying to decrease Bar1 by the amount ~9! passed (the coste in Psi point) it does not want to decrease the bar! (both with TokenMod or Alterbar).... for the code see on page 6 of this thread! Please help as it's driving me nuts and I don't have any hairs left to pull ^^
1593011037

Edited 1593011097
I've been busy fixing some Problems and annoyances I had with the PCMHelper Templates and scripts, and I thought I share my solutions. My main Problems were that the whole api crashed when someone cast a healing spell and the gm whisper toggle not working. Both problems are solved with my macros and updated templates, and I did a bit of testing and couldn't find new problems. I'm still new to powercards and roll20 macros, so it's very possible I overlooked something or these solutions aren't the best ones. Updated PCM Helper Templates: Basics: --tokenid|~0! --target_list|~1! --['~6!' -ne '/w gm ']emote|~S-CN$ ~2! against ~T-CN$ --format|~S-CN$ --name|~3! --leftsub|~4! --rightsub|~5! PCAttack: --['~1!' -eq '/w gm ']whisper|gm --Attack|[#[ [$Atk] ~0! + ~PCA-ATKBONUS$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --?? $Atk.base == 1 ?? Fumble|The attack went horribly wrong! --?? $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk.total < ~T-AC$ ?? Miss|~S-CN$ missed. --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2DICE$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2CRIT$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-SAVE$" -eq "true"]?? $Atk.base == 20 OR $Atk.total >= ~T-AC$ ?? Save|~T-CN$ can attempt a **DC ~PCA-SAVEDC$** ~PCA-SAVEATTR$ saving throw for ~PCA-SAVEEFFECT$ --["~PCA-DESC$" -ne "none"]Description|~PCA-DESC$ NPCBasics: --tokenid|~0! --target_list|~1! --emote|~S-CN$ ~2! against ~T-CN$ --format|badguys --name|~3! --['~NPCA-TYPE$' -eq 'ATTACK']leftsub|~4! --['~NPCA-RANGE$' -eq 'ATTACK']rightsub|~5! NPCAttack: --["~NPCA-TYPE$" -eq "ATTACK"]Attack:|[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk < ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ CantripAttack: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk -ge ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ~SP-DAMAGETYPE$ ]#] damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horribly wrong! --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -ne 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ avoids the effect of the ~SP-NAME$ --Description|~SP-DESCRIPTION$ SpellCast: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -ne 'None' -and '~SP-DAMAGE$' -ne '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -eq 'None' -and '~SP-DAMAGE$' -ne '']hroll|[#[ [$Atk] 1d10 + 500 ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE$' -ne '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] (~SP-DAMAGE2$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ saves for ~SP-SAVESUCCESS$ --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-HEALING$' -ne '']Healing:|[#[ [$Heal] (~SP-HEALING$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] --Description|~SP-DESCRIPTION$ updated pc attacks macro: !power {{ --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} --replacement|Advantage --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} --template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} updated cantrips macro: !power {{ --replacespell|@{selected|character_id}|?{Cantrip to cast|@{selected|cantrip_list}} --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$;Cantrip;~SP-RANGE$;@{selected|whispertoggle} --template|CantripAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} Updated level 1 spells macro: !power {{ --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} --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} }} You'll have to copy and modify this one for higher spell lists yourself... I also made 2 macros for Saving Throws and Skill checks, that follow the gm whisper toggle and the advantage toggle. Both need the Advante replacement from pcmhelper Templates for both: skillcheck: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Skillcheck --~2!|[[~1! + ~3! ]] save: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Saving Throw --~2!|[#[~1! + ~3! ]#] Skillcheck Macro: !power {{ --replacement|Advantage --inlinereplace|acn|Acrobatics;acs|@{selected|acrobatics_bonus};ahn|Animal Handling;ahs|@{selected|animal_handling_bonus};arn|Arcana;ars|@{selected|arcana_bonus};atn|Athletics;ats|@{selected|athletics_bonus};den|Decpetion;des|@{selected|deception_bonus};hin|History;his|@{selected|history_bonus};isn|Insight;iss|@{selected|insight_bonus};idn|Intimidation;ids|@{selected|intimidation_bonus};ivn|Investigation;ivs|@{selected|investigation_bonus};men|Medicine;mes|@{selected|medicine_bonus};nan|Nature;nas|@{selected|nature_bonus};pen|Perception;pes|@{selected|perception_bonus};pfn|Performance;pfs|@{selected|performance_bonus};psn|Persuasion;pss|@{selected|persuasion_bonus};ren|Religion;res|@{selected|religion_bonus};shn|Sleight of Hand;shs|@{selected|sleight_of_hand_bonus};stn|Stealth;sts|@{selected|stealth_bonus};sun|Survival;sus|@{selected|survival_bonus} --template|skillcheck|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Acrobatics,~acn$;~acs$|Animal Handling,~ahn$;~ahs$|Arcana,~arn$;~ars$|Athletics,~atn$;~ats$|Decpetion,~den$;~des$|History,~hin$;~his$|Insight,~isn$;~iss$|Intimidation,~idn$;~ids$|Investigation,~ivn$;~ivs$|Medicine,~men$;~mes$|Nature,~nan$;~nas$|Perception,~pen$;~pes$|Performance,~pfn$;~pfs$|Persuasion,~psn$;~pss$|Religion,~ren$;~res$|Sleight of Hand,~shn$;~shs$|Stealth,~stn$;~sts$|Survival,~sun$;~sus$};@{selected|character_name} }} Saving Throw Macro: !power {{ --replacement|Advantage --inlinereplace|stn|Strength;sts|@{selected|strength_save_bonus};dxn|Dexterity;dxs|@{selected|dexterity_save_bonus};con|Constitution;cos|@{selected|constitution_save_bonus};inn|Intelligence;ins|@{selected|intelligence_save_bonus};win|Wisdom;wis|@{selected|wisdom_save_bonus};chn|Charisma;chs|@{selected|charisma_save_bonus} --template|save|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Strength,~stn$;~sts$|Dexterity,~dxn$;~dxs$|Constitution,~con$;~cos$|Intelligence,~inn$;~ins$|Wisdom,~win$;~wis$|Charisma,~chn$;~chs$};@{selected|character_name} }} I'm sure there are people that have better Solutions, but I thought I'd share mine none the less.
1593040396
Kurt J.
Pro
API Scripter
Sven K. said: I've been busy fixing some Problems and annoyances I had with the PCMHelper Templates and scripts, and I thought I share my solutions. My main Problems were that the whole api crashed when someone cast a healing spell and the gm whisper toggle not working. Both problems are solved with my macros and updated templates, and I did a bit of testing and couldn't find new problems. I'm still new to powercards and roll20 macros, so it's very possible I overlooked something or these solutions aren't the best ones. Updated PCM Helper Templates: Basics: --tokenid|~0! --target_list|~1! --['~6!' -ne '/w gm ']emote|~S-CN$ ~2! against ~T-CN$ --format|~S-CN$ --name|~3! --leftsub|~4! --rightsub|~5! PCAttack: --['~1!' -eq '/w gm ']whisper|gm --Attack|[#[ [$Atk] ~0! + ~PCA-ATKBONUS$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --?? $Atk.base == 1 ?? Fumble|The attack went horribly wrong! --?? $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk.total < ~T-AC$ ?? Miss|~S-CN$ missed. --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2DICE$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2CRIT$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-SAVE$" -eq "true"]?? $Atk.base == 20 OR $Atk.total >= ~T-AC$ ?? Save|~T-CN$ can attempt a **DC ~PCA-SAVEDC$** ~PCA-SAVEATTR$ saving throw for ~PCA-SAVEEFFECT$ --["~PCA-DESC$" -ne "none"]Description|~PCA-DESC$ NPCBasics: --tokenid|~0! --target_list|~1! --emote|~S-CN$ ~2! against ~T-CN$ --format|badguys --name|~3! --['~NPCA-TYPE$' -eq 'ATTACK']leftsub|~4! --['~NPCA-RANGE$' -eq 'ATTACK']rightsub|~5! NPCAttack: --["~NPCA-TYPE$" -eq "ATTACK"]Attack:|[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk < ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ CantripAttack: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk -ge ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ~SP-DAMAGETYPE$ ]#] damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horribly wrong! --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -ne 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ avoids the effect of the ~SP-NAME$ --Description|~SP-DESCRIPTION$ SpellCast: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -ne 'None' -and '~SP-DAMAGE$' -ne '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -eq 'None' -and '~SP-DAMAGE$' -ne '']hroll|[#[ [$Atk] 1d10 + 500 ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE$' -ne '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] (~SP-DAMAGE2$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ saves for ~SP-SAVESUCCESS$ --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-HEALING$' -ne '']Healing:|[#[ [$Heal] (~SP-HEALING$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] --Description|~SP-DESCRIPTION$ updated pc attacks macro: !power {{ --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} --replacement|Advantage --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} --template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} updated cantrips macro: !power {{ --replacespell|@{selected|character_id}|?{Cantrip to cast|@{selected|cantrip_list}} --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$;Cantrip;~SP-RANGE$;@{selected|whispertoggle} --template|CantripAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} Updated level 1 spells macro: !power {{ --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} --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} }} You'll have to copy and modify this one for higher spell lists yourself... I also made 2 macros for Saving Throws and Skill checks, that follow the gm whisper toggle and the advantage toggle. Both need the Advante replacement from pcmhelper Templates for both: skillcheck: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Skillcheck --~2!|[[~1! + ~3! ]] save: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Saving Throw --~2!|[#[~1! + ~3! ]#] Skillcheck Macro: !power {{ --replacement|Advantage --inlinereplace|acn|Acrobatics;acs|@{selected|acrobatics_bonus};ahn|Animal Handling;ahs|@{selected|animal_handling_bonus};arn|Arcana;ars|@{selected|arcana_bonus};atn|Athletics;ats|@{selected|athletics_bonus};den|Decpetion;des|@{selected|deception_bonus};hin|History;his|@{selected|history_bonus};isn|Insight;iss|@{selected|insight_bonus};idn|Intimidation;ids|@{selected|intimidation_bonus};ivn|Investigation;ivs|@{selected|investigation_bonus};men|Medicine;mes|@{selected|medicine_bonus};nan|Nature;nas|@{selected|nature_bonus};pen|Perception;pes|@{selected|perception_bonus};pfn|Performance;pfs|@{selected|performance_bonus};psn|Persuasion;pss|@{selected|persuasion_bonus};ren|Religion;res|@{selected|religion_bonus};shn|Sleight of Hand;shs|@{selected|sleight_of_hand_bonus};stn|Stealth;sts|@{selected|stealth_bonus};sun|Survival;sus|@{selected|survival_bonus} --template|skillcheck|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Acrobatics,~acn$;~acs$|Animal Handling,~ahn$;~ahs$|Arcana,~arn$;~ars$|Athletics,~atn$;~ats$|Decpetion,~den$;~des$|History,~hin$;~his$|Insight,~isn$;~iss$|Intimidation,~idn$;~ids$|Investigation,~ivn$;~ivs$|Medicine,~men$;~mes$|Nature,~nan$;~nas$|Perception,~pen$;~pes$|Performance,~pfn$;~pfs$|Persuasion,~psn$;~pss$|Religion,~ren$;~res$|Sleight of Hand,~shn$;~shs$|Stealth,~stn$;~sts$|Survival,~sun$;~sus$};@{selected|character_name} }} Saving Throw Macro: !power {{ --replacement|Advantage --inlinereplace|stn|Strength;sts|@{selected|strength_save_bonus};dxn|Dexterity;dxs|@{selected|dexterity_save_bonus};con|Constitution;cos|@{selected|constitution_save_bonus};inn|Intelligence;ins|@{selected|intelligence_save_bonus};win|Wisdom;wis|@{selected|wisdom_save_bonus};chn|Charisma;chs|@{selected|charisma_save_bonus} --template|save|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Strength,~stn$;~sts$|Dexterity,~dxn$;~dxs$|Constitution,~con$;~cos$|Intelligence,~inn$;~ins$|Wisdom,~win$;~wis$|Charisma,~chn$;~chs$};@{selected|character_name} }} I'm sure there are people that have better Solutions, but I thought I'd share mine none the less. Sven,   Very cool.  Thank you for sharing these updates. I've got a game coming up on Thursday and I'll try them out. Assuming all goes well, I'll push an update to one-click with these changes.
1593043569

Edited 1593044426
Does anyone know how to deal damage/heal multiple different tokens (with AlterBar API), I'm trying to make a script for Mass Healing Word and can't seem to get it to work. It only heals one of them and not the other 6 Script I got so far(I'm not the best):  !power {{ --format|Spells --name|Mass Healing Word --leftsub|Up to 6 creatures in 60 feet --rightsub|Healing --!Stats|~C**Bonus Action** | **V** | **Instantaneous**~C --Description|As you call out words of restoration, up to six creatures of your choice that you can see within range regain hit points equal to 1d4 + your spellcasting ability modifier. This spell has no effect on undead or constructs. --Higher Levels|When you cast this spell using a spell slot of 4th level or higher, the Healing increases by 1d4 for each slot level above 3rd. --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} --hroll|[[ [$Lvl] ?{Level|3|4|5|6|7|8|9} + 0d0]] --?? $Lvl == 3 ?? |~C//**Spell Cast at Lv 3 //**~C ^^ ** @{target|1st|character_name} | @{target|2nd|character_name} | @{target|3rd|character_name} | @{target|4th|character_name} | @{target|5th|character_name} | @{target|6th|character_name}** recovered [[ [$HealthHealedN1] 1d4 + @{selected|wisdom_mod} ]] **Health** --?? $Lvl == 3 ?? alterbar2|_target|@{target|1st|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|2nd|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|3rd|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|4th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|5th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|6th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none }}
Kurt J. said: Sven K. said: I've been busy fixing some Problems and annoyances I had with the PCMHelper Templates and scripts, and I thought I share my solutions. My main Problems were that the whole api crashed when someone cast a healing spell and the gm whisper toggle not working. Both problems are solved with my macros and updated templates, and I did a bit of testing and couldn't find new problems. I'm still new to powercards and roll20 macros, so it's very possible I overlooked something or these solutions aren't the best ones. Updated PCM Helper Templates: Basics: --tokenid|~0! --target_list|~1! --['~6!' -ne '/w gm ']emote|~S-CN$ ~2! against ~T-CN$ --format|~S-CN$ --name|~3! --leftsub|~4! --rightsub|~5! PCAttack: --['~1!' -eq '/w gm ']whisper|gm --Attack|[#[ [$Atk] ~0! + ~PCA-ATKBONUS$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --?? $Atk.base == 1 ?? Fumble|The attack went horribly wrong! --?? $Atk.base <> 1 AND $Atk.base <> 20 AND $Atk.total < ~T-AC$ ?? Miss|~S-CN$ missed. --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base <> 20 AND $Atk.total >= ~T-AC$ ?? Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1DICE$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2DICE$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-DMG2DICE$" -eq "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage --["~PCA-DMG2DICE$" -ne "none"]?? $Atk.base == 20 AND $Atk.total >= ~T-AC$ ?? Critical Hit|~S-CN$ hits ~T-CN$ for [#[ [$Dmg] ~PCA-DMG1CRIT$ ]] ~PCA-DMG1TYPE$ damage and [[ [$Dmg2] ~PCA-DMG2CRIT$ ]] ~PCA-DMG2TYPE$ damage --["~PCA-SAVE$" -eq "true"]?? $Atk.base == 20 OR $Atk.total >= ~T-AC$ ?? Save|~T-CN$ can attempt a **DC ~PCA-SAVEDC$** ~PCA-SAVEATTR$ saving throw for ~PCA-SAVEEFFECT$ --["~PCA-DESC$" -ne "none"]Description|~PCA-DESC$ NPCBasics: --tokenid|~0! --target_list|~1! --emote|~S-CN$ ~2! against ~T-CN$ --format|badguys --name|~3! --['~NPCA-TYPE$' -eq 'ATTACK']leftsub|~4! --['~NPCA-RANGE$' -eq 'ATTACK']rightsub|~5! NPCAttack: --["~NPCA-TYPE$" -eq "ATTACK"]Attack:|[#[ [$Atk] ~0! + ~NPCA-TOHIT$ [Attack Bonus] ]#] vs **AC** [#[~T-AC$]#] --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk < ~T-AC$ ?? !Missed|**The ~NPCA-NAME$ attack missed!** --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] ~NPCA-DAMAGE$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-DAMAGE2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -eq ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage --["~NPCA-TYPE$" -eq "ATTACK" -and "~NPCA-DAMAGETYPE2$" -ne ""]?? $Atk.base == 20 ?? Hit:|[#[ [$Dmg] ~NPCA-CRIT$ ]#] ~NPCA-DAMAGETYPE$ damage and [#[ [$Dmg2] ~NPCA-CRIT2$ ]#] ~NPCA-DAMAGETYPE2$ damage --["~NPCA-TYPE$" -eq "ATTACK"]?? $Atk.base == 1 ?? Fumble|The attack goes horribly wrong! --["~NPCA-DESCRIPTION$" -ne "" ]Description|~NPCA-DESCRIPTION$ CantripAttack: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk -ge ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ~SP-DAMAGETYPE$ ]#] damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -eq 1]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Atk.base == 20 ?? Critical Hit:|[#[ [$CritDmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Crit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq '']?? $Atk.base == 1 ?? !|**Fumble:** Spell goes horribly wrong! --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~S-L$ -lt 4 -and ~SP-MORECANTRIPDAMAGE$ -ne 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 0]?? $Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 4 -and ~S-L$ -lt 12]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 11 -and ~S-L$ -lt 17]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and ~SP-MORECANTRIPDAMAGE$ -eq 1 -and ~S-L$ -gt 16 ]?? $Save < ~S-SSDC$ ?? Save Failed:|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) + (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ avoids the effect of the ~SP-NAME$ --Description|~SP-DESCRIPTION$ SpellCast: --["~1!" -eq "/w gm"]whisper|gm --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -ne 'None' -and '~SP-DAMAGE$' -ne '']Attack:|[#[ [$Atk] ~0! + ~S-SAB$ [Spell Attack] ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-ATTACK$' -eq 'None' -and '~SP-DAMAGE$' -ne '']hroll|[#[ [$Atk] 1d10 + 500 ]#] vs **AC** [#[~T-AC$]#] --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE$' -ne '']?? $Atk < ~T-AC$ ?? !Missed|**You missed!** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -eq '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk >= ~T-AC$ AND $Atk.base <> 20 ?? Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] ~SP-DAMAGETYPE$ damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-DAMAGE2$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Atk.base == 20 ?? Critical Hit:|[#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~SP-DAMAGE$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HLCrit] ]#] ~SP-DAMAGETYPE$ Damage and [#[ [$Dmg2] (~SP-DAMAGE2$) [Base] (~SP-DAMAGE2$) [Crit] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE2$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Strength' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBSTR$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Dexterity' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBDEX$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Constitution' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCON$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Intelligence' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBINT$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Wisdom' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBWIS$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -eq 'Charisma' -and '~SP-DAMAGE$' -ne '']Save|~T-CN$ rolls [[ [$Save] 1d20 + ~T-SBCHA$ ]] on a ~SP-SAVE$ save vs **DC ~S-SSDC$** --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? Save < ~S-SSDC$ ?? Save Failed|~T-CN$ takes [#[ [$Dmg] (~SP-DAMAGE$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] ]#] ~SP-DAMAGETYPE$ damage --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-SAVE$' -ne '' -and '~SP-DAMAGE$' -ne '']?? $Save >= ~S-SSDC$ ?? Save Succeded|~T-CN$ saves for ~SP-SAVESUCCESS$ --['~SP-OUTPUT$' -eq 'ATTACK' -and '~SP-HEALING$' -ne '']Healing:|[#[ [$Heal] (~SP-HEALING$) [Base] + (~S-SAM$ * ~SP-ADDABILITY$) [Ability] + (~SP-HLDICE$*~SSL$)~SP-HLDIETYPE$~SP-HLBONUS$ [HigherLevel] ]#] --Description|~SP-DESCRIPTION$ updated pc attacks macro: !power {{ --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} --replacement|Advantage --replaceattrs|S-|@{selected|character_id} --replaceattrs|T-|@{target|character_id} --template|Basics|@{selected|token_id};@{target|token_id};uses ~PCA-NAME$;~PCA-NAME$;~PCA-ATYPE$;~PCA-RANGE$;@{selected|whispertoggle} --template|PCAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} updated cantrips macro: !power {{ --replacespell|@{selected|character_id}|?{Cantrip to cast|@{selected|cantrip_list}} --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$;Cantrip;~SP-RANGE$;@{selected|whispertoggle} --template|CantripAttack|~@{selected|rtype}$;@{selected|whispertoggle} }} Updated level 1 spells macro: !power {{ --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} --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} }} You'll have to copy and modify this one for higher spell lists yourself... I also made 2 macros for Saving Throws and Skill checks, that follow the gm whisper toggle and the advantage toggle. Both need the Advante replacement from pcmhelper Templates for both: skillcheck: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Skillcheck --~2!|[[~1! + ~3! ]] save: --?! "~0!" -eq "/w gm " !? whisper|gm --name|~4! tries a ~2! Saving Throw --~2!|[#[~1! + ~3! ]#] Skillcheck Macro: !power {{ --replacement|Advantage --inlinereplace|acn|Acrobatics;acs|@{selected|acrobatics_bonus};ahn|Animal Handling;ahs|@{selected|animal_handling_bonus};arn|Arcana;ars|@{selected|arcana_bonus};atn|Athletics;ats|@{selected|athletics_bonus};den|Decpetion;des|@{selected|deception_bonus};hin|History;his|@{selected|history_bonus};isn|Insight;iss|@{selected|insight_bonus};idn|Intimidation;ids|@{selected|intimidation_bonus};ivn|Investigation;ivs|@{selected|investigation_bonus};men|Medicine;mes|@{selected|medicine_bonus};nan|Nature;nas|@{selected|nature_bonus};pen|Perception;pes|@{selected|perception_bonus};pfn|Performance;pfs|@{selected|performance_bonus};psn|Persuasion;pss|@{selected|persuasion_bonus};ren|Religion;res|@{selected|religion_bonus};shn|Sleight of Hand;shs|@{selected|sleight_of_hand_bonus};stn|Stealth;sts|@{selected|stealth_bonus};sun|Survival;sus|@{selected|survival_bonus} --template|skillcheck|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Acrobatics,~acn$;~acs$|Animal Handling,~ahn$;~ahs$|Arcana,~arn$;~ars$|Athletics,~atn$;~ats$|Decpetion,~den$;~des$|History,~hin$;~his$|Insight,~isn$;~iss$|Intimidation,~idn$;~ids$|Investigation,~ivn$;~ivs$|Medicine,~men$;~mes$|Nature,~nan$;~nas$|Perception,~pen$;~pes$|Performance,~pfn$;~pfs$|Persuasion,~psn$;~pss$|Religion,~ren$;~res$|Sleight of Hand,~shn$;~shs$|Stealth,~stn$;~sts$|Survival,~sun$;~sus$};@{selected|character_name} }} Saving Throw Macro: !power {{ --replacement|Advantage --inlinereplace|stn|Strength;sts|@{selected|strength_save_bonus};dxn|Dexterity;dxs|@{selected|dexterity_save_bonus};con|Constitution;cos|@{selected|constitution_save_bonus};inn|Intelligence;ins|@{selected|intelligence_save_bonus};win|Wisdom;wis|@{selected|wisdom_save_bonus};chn|Charisma;chs|@{selected|charisma_save_bonus} --template|save|@{selected|whispertoggle};~@{selected|advantagetoggle}$;?{Skill?|Strength,~stn$;~sts$|Dexterity,~dxn$;~dxs$|Constitution,~con$;~cos$|Intelligence,~inn$;~ins$|Wisdom,~win$;~wis$|Charisma,~chn$;~chs$};@{selected|character_name} }} I'm sure there are people that have better Solutions, but I thought I'd share mine none the less. Sven,   Very cool.  Thank you for sharing these updates. I've got a game coming up on Thursday and I'll try them out. Assuming all goes well, I'll push an update to one-click with these changes. Nice, and thx for your great work here. I should add, that I didn't touch the npc templates, as I didn't need them yet. They will probably need similar fixes at least for the healing part. Basically I added a condition on all Tags to See if SP_DAMAGE is not empty and added a Line that checks for the healing. pretty simple solution over all.
1593083516

Edited 1593086664
Hello everyone. I'm working on a Powercard for a 5e Shadows Strength Drain attack. Its designed to deal damage and lower the targets strength on a hit and all of that works fine. Where I'm running into problems is trying to get it to display how much strength the target has left at the bottom of the card. !power {{ &nbsp;--name|[Strength Drain](<a href="https://blog.flamingtext.com/blog/2020/06/25/flamingtext_com_1593045940_158730107.png" rel="nofollow">https://blog.flamingtext.com/blog/2020/06/25/flamingtext_com_1593045940_158730107.png</a>) &nbsp;--bgcolor|#000000 &nbsp;--corners|10 &nbsp;--The Shadow lashes out at you with dark energy, attempting to feed upon your vitality! &nbsp;--Attack:|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20kh1|w/Disadvantage, 2d20kl1} + 4 ]] vs AC &nbsp;--hroll|[[ [$Cstr] @{target|strength} + 0d0 ]] &nbsp;--?? $Atk &lt; @{target|AC} OR $Atk.base == 1 ?? !Miss:|You missed. &nbsp;--?? $Atk &gt;= @{target|AC} AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? Damage:|[[ [$Dmg] 2d6+2 ]] necrotic damage &nbsp;--?? $Cstr &gt; 0 AND $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? Strength Drain:|[[ [$Strd] 1d4 ]] Strength is drained from the you! You will die if this reduces its Strength to 0! Otherwise, the reduction lasts until the target finishes a short or long rest. &nbsp;--?? $Cstr &lt;= 0 ?? Strength Drained:|The last of your strength has been drained killing you in the process... &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? api_modattr| _silent _charid @{target|character_id} _strength|-[^Strd] &nbsp;--?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d6 + 14]] damage &nbsp;--?? $Atk &gt;= @{target|npc_AC} AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all &nbsp;--?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? vfx_opt|@{target|token_id} @{selected|token_id} ShadowDrain &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|weakened &nbsp;--?? $Cstr &lt;= 0 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|skull &nbsp;--?? $Cstr &gt; 0 AND $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? Strength Remaining:|[[ @{target|strength} - [^Strd] + 0d0 ]] Strength remaining! }} On the bottom like of the card it will show how much Strength the had before the attack happened instead of after. Anyone know how I can get it to show the value after the attack properly?
1593097608
Kurt J.
Pro
API Scripter
David R. said: Hello everyone. I'm working on a Powercard for a 5e Shadows Strength Drain attack. Its designed to deal damage and lower the targets strength on a hit and all of that works fine. Where I'm running into problems is trying to get it to display how much strength the target has left at the bottom of the card. !power {{ &nbsp;--name|[Strength Drain](<a href="https://blog.flamingtext.com/blog/2020/06/25/flamingtext_com_1593045940_158730107.png" rel="nofollow">https://blog.flamingtext.com/blog/2020/06/25/flamingtext_com_1593045940_158730107.png</a>) &nbsp;--bgcolor|#000000 &nbsp;--corners|10 &nbsp;--The Shadow lashes out at you with dark energy, attempting to feed upon your vitality! &nbsp;--Attack:|[[ [$Atk] ?{Attack|Standard, 1d20|w/Advantage, 2d20kh1|w/Disadvantage, 2d20kl1} + 4 ]] vs AC &nbsp;--hroll|[[ [$Cstr] @{target|strength} + 0d0 ]] &nbsp;--?? $Atk &lt; @{target|AC} OR $Atk.base == 1 ?? !Miss:|You missed. &nbsp;--?? $Atk &gt;= @{target|AC} AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? Damage:|[[ [$Dmg] 2d6+2 ]] necrotic damage &nbsp;--?? $Cstr &gt; 0 AND $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? Strength Drain:|[[ [$Strd] 1d4 ]] Strength is drained from the you! You will die if this reduces its Strength to 0! Otherwise, the reduction lasts until the target finishes a short or long rest. &nbsp;--?? $Cstr &lt;= 0 ?? Strength Drained:|The last of your strength has been drained killing you in the process... &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? api_modattr| _silent _charid @{target|character_id} _strength|-[^Strd] &nbsp;--?? $Atk.base == 20 ?? Critical Hit:|[[ [$CritDmg] 2d6 + 14]] damage &nbsp;--?? $Atk &gt;= @{target|npc_AC} AND $Atk.base &lt;&gt; 20 AND $Atk.base &lt;&gt; 1 ?? alterbar1|_target|@{target|token_id} _bar|1 _amount|-[^Dmg] _show|all &nbsp;--?? $Atk.base == 20 ?? alterbar2|_target|@{target|token_id} _bar|1 _amount|-[^CritDmg] _show|all &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? vfx_opt|@{target|token_id} @{selected|token_id} ShadowDrain &nbsp;--?? $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|weakened &nbsp;--?? $Cstr &lt;= 0 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|skull &nbsp;--?? $Cstr &gt; 0 AND $Atk &gt;= @{target|AC} OR $Atk.base == 20 ?? Strength Remaining:|[[ @{target|strength} - [^Strd] + 0d0 ]] Strength remaining! }} On the bottom like of the card it will show how much Strength the had before the attack happened instead of after. Anyone know how I can get it to show the value after the attack properly? One of the most important things to understand with PowerCards is that all Rolls are done prior to any RollIDs being available, so the last line trying to use [^Strd] inside a roll will not work. [^Strd] doesn't have a value when this is evaluated. That doesn't mean what you are trying to do can't be done, though. It is just a little more complicated. I didn't update your macro above but here is an example of how it would need to be handled (I'm just using @selected here so I don't have to pick a target :)) : !power {{ --name|Test --hroll|[[ [$Drain] 1d4 ]] [[ [$M1] @{selected|strength} - 1 + 0d0 ]] [[ [$M2] @{selected|strength} - 2 + 0d0 ]] [[ [$M3] @{selected|strength} - 3 + 0d0 ]] [[ [$M4] @{selected|strength} - 4 + 0d0 ]] --Strength Loss|You lost [^Drain] Strength --OldStrength|You had @{selected|strength} strength --?? $Drain == 1 ??Minus1|New score is [^M1] --?? $Drain == 2 ??Minus2|New score is [^M2] --?? $Drain == 3 ??Minus3|New score is [^M3] --?? $Drain == 4 ??Minus4|New score is [^M4] }} Essentially, the hroll generates 5 RollIDs: $Drain - the amount of strength being drained $M1 - The remaining strength if 1 point was drained. $M2 - The remaining strength if 1 point was drained. $M3 - The remaining strength if 1 point was drained. $M4 - The remaining strength if 1 point was drained. At the end, the conditional lines check to see what the value of $Drain is to determine which of the three $M# numbers to show. You could add more conditionals that check for death (?? $Drain == 1 AND $M1 == 0 ??), (?? $Drain == 2 AND $M2 == 0), etc.
1593097739
Kurt J.
Pro
API Scripter
Elijah L. said: Does anyone know how to deal damage/heal multiple different tokens (with AlterBar API), I'm trying to make a script for Mass Healing Word and can't seem to get it to work. It only heals one of them and not the other 6 Script I got so far(I'm not the best):&nbsp; !power {{ --format|Spells --name|Mass Healing Word --leftsub|Up to 6 creatures in 60 feet --rightsub|Healing --!Stats|~C**Bonus Action** | **V** | **Instantaneous**~C --Description|As you call out words of restoration, up to six creatures of your choice that you can see within range regain hit points equal to 1d4 + your spellcasting ability modifier. This spell has no effect on undead or constructs. --Higher Levels|When you cast this spell using a spell slot of 4th level or higher, the Healing increases by 1d4 for each slot level above 3rd. --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} --hroll|[[ [$Lvl] ?{Level|3|4|5|6|7|8|9} + 0d0]] --?? $Lvl == 3 ?? |~C//**Spell Cast at Lv 3 //**~C ^^ ** @{target|1st|character_name} | @{target|2nd|character_name} | @{target|3rd|character_name} | @{target|4th|character_name} | @{target|5th|character_name} | @{target|6th|character_name}** recovered [[ [$HealthHealedN1] 1d4 + @{selected|wisdom_mod} ]] **Health** --?? $Lvl == 3 ?? alterbar2|_target|@{target|1st|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|2nd|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|3rd|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|4th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|5th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none --?? $Lvl == 3 ?? alterbar2|_target|@{target|6th|token_id} _bar|1 _amount|+[^HealthHealedN1] _show|none }} I can't say for sure that this is the cause of your issue (I don't use alterbars), but all tag names need to be unique. You have the alterbars2 tag six times, so only one of them will execute. Alterbars is a special tag in that it doesn't need the "same tag" modifier and can just have an advancing number afte r it (alterbars1, alterbars2, alterbars3, etc.) because alterbars is another API by the same original author of PowerCards.
I've got a problem with a Power Card that I'd like to use to duplicate the effects of the spell "Steel Wind Strike". Basically the spell allow the selected PC to attack up to 5 different targets, dealing 6d10 damage on a hit or 12d10 damage on a critical hit. My power card macro works fine in getting the targets, works fine for attacks roll and get the targets name right. Wonderful. I want also to use the alterbar script to automatically inflict the damage. And that's working fine too. Also wonderful. What it's not working it's the part where the damage to the target should be displayed in the power card. Something screw things up. I think my macro it's probably not elegant, but i'm a beginner pro user so please forgive me! ;) That's the code: !power {{ --whisper|self --name|Steel Wind Strike --target_list|@{target|1° Bersaglio|token_id} | @{target|2° Bersaglio|token_id} | @{target|3° Bersaglio|token_id} | @{target|4° Bersaglio|token_id} | @{target|5° Bersaglio|token_id} --Attacco:#?{Number of targets|1,1|2,2|3,3|4,4|5,5}|[[ [$Atk] ?{Attack|Normale, 1d20|Vantaggio, 3d20kh1|Svantaggio, 2d20kl1}+@{spell_attack_bonus}]] contro CA **%%bar2%%** (%%token_name%%) --?? $Atk_1 &lt; @{target|1° Bersaglio|bar2} OR $Atk_1.base == 1 ?? Mancato:|L'attacco conto @{target|1° Bersaglio|token_name} va a vuoto! --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg1] 6d10 ]] Danni da forza a @{target|1° Bersaglio|token_name} --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base == 20 ?? Colpo Critico:|[[ [$CritDmg1] 12d10 ]] Danni da forza a @{target|1° Bersaglio|token_name} --?? $Atk_2 &lt; @{target|2° Bersaglio|bar2} OR $Atk_2.base == 1 ?? Mancato:|L'attacco conto @{target|2° Bersaglio|token_name} va a vuoto! --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg2] 6d10 ]] Danni da forza a @{target|2° Bersaglio|token_name} --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base == 20 ?? Colpo Critico:|[[ [$CritDmg2] 12d10 ]] Danni da forza a @{target|2° Bersaglio|token_name} --?? $Atk_3 &lt; @{target|3° Bersaglio|bar2} OR $Atk_3.base == 1 ?? Mancato:|L'attacco conto @{target|3° Bersaglio|token_name} va a vuoto! --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg3] 6d10 ]] Danni da forza a @{target|3° Bersaglio|token_name} --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base == 20 ?? Colpo Critico:|[[ [$CritDmg3] 12d10 ]] Danni da forza a @{target|3° Bersaglio|token_name} --?? $Atk_4 &lt; @{target|4° Bersaglio|bar2} OR $Atk_4.base == 1 ?? Mancato:|L'attacco conto @{target|4° Bersaglio|token_name} va a vuoto! --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg4] 6d10 ]] Danni da forza a @{target|4° Bersaglio|token_name} --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base == 20 ?? Colpo Critico:|[[ [$CritDmg4] 12d10 ]] Danni da forza a @{target|4° Bersaglio|token_name} --?? $Atk_5 &lt; @{target|5° Bersaglio|bar2} OR $Atk_5.base == 1 ?? Mancato:|L'attacco conto @{target|5° Bersaglio|token_name} va a vuoto! --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg5] 6d10 ]] Danni da forza a @{target|5° Bersaglio|token_name} --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base == 20 ?? Colpo Critico:|[[ [$CritDmg5] 12d10 ]] Danni da forza a @{target|5° Bersaglio|token_name} --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base &lt;&gt; 20 ?? alterbar1|_target|@{target|1° Bersaglio|token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base == 20 ?? alterbar2|_target|@{target|1° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg1] _show|all --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base &lt;&gt; 20 ?? alterbar3|_target|@{target|2° Bersaglio|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base == 20 ?? alterbar4|_target|@{target|2° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg2] _show|all --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base &lt;&gt; 20 ?? alterbar5|_target|@{target|3° Bersaglio|token_id} _bar|1 _amount|-[^Dmg3] _show|all --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base == 20 ?? alterbar6|_target|@{target|3° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg3] _show|all --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base &lt;&gt; 20 ?? alterbar7|_target|@{target|4° Bersaglio|token_id} _bar|1 _amount|-[^Dmg4] _show|all --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base == 20 ?? alterbar8|_target|@{target|4° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg4] _show|all --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base &lt;&gt; 20 ?? alterbar9|_target|@{target|5° Bersaglio|token_id} _bar|1 _amount|-[^Dmg5] _show|all --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base == 20 ?? alterbar0|_target|@{target|5° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg5] _show|all }} The green sections are working fine, but the red one got badly screwed and I can't figure out why. My english it's not the best, don't focus on that!
Hi guys it's me again ! So here's my issue ! I test 3 conditions: Fail (No success &lt;=&gt; $Atk.ss == 0) Fumble (same as above PLUS at least a ONE on the dices &lt;=&gt; $Atk.ones ==1) Success In each condition I need to decrease bar1(representing Psi Points) by the cost of the power being used (~9!) As you can see below I tried many ways to decrease that value but none works! --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 0 ?? --api_token-mod|_ids @{selected|token_id} _ignore-selected _set bar1_value|-[[~9!]]&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 1 ?? alterbar1|_target|@{selected||token_id} _bar|1 _amount|-[[~9!]] _show|all&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]]&nbsp; This is an extract of my PC template but my question is fairly simple : Why the heck can't I decrease that f*****g bar where I can through a normal macro !? Is there something in my typo wrong ? Thanks in advance for your help
1593257036
Kurt J.
Pro
API Scripter
Mangouste said: Hi guys it's me again ! So here's my issue ! I test 3 conditions: Fail (No success &lt;=&gt; $Atk.ss == 0) Fumble (same as above PLUS at least a ONE on the dices &lt;=&gt; $Atk.ones ==1) Success In each condition I need to decrease bar1(representing Psi Points) by the cost of the power being used (~9!) As you can see below I tried many ways to decrease that value but none works! --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 0 ?? --api_token-mod|_ids @{selected|token_id} _ignore-selected _set bar1_value|-[[~9!]]&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 1 ?? alterbar1|_target|@{selected||token_id} _bar|1 _amount|-[[~9!]] _show|all&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]]&nbsp; This is an extract of my PC template but my question is fairly simple : Why the heck can't I decrease that f*****g bar where I can through a normal macro !? Is there something in my typo wrong ? Thanks in advance for your help If all three possibilities result in the same decrease in the bar value, why make them conditional at all? simply include the bar decrease as a separate line? Also, this: --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]] will cause problems because the second part of a conditional can't start with -- because it will be treated as a different tag. Leave off the -- in front of api_token-mod or alterbar.
1593257328
Kurt J.
Pro
API Scripter
Marco said: I've got a problem with a Power Card that I'd like to use to duplicate the effects of the spell "Steel Wind Strike". Basically the spell allow the selected PC to attack up to 5 different targets, dealing 6d10 damage on a hit or 12d10 damage on a critical hit. My power card macro works fine in getting the targets, works fine for attacks roll and get the targets name right. Wonderful. I want also to use the alterbar script to automatically inflict the damage. And that's working fine too. Also wonderful. What it's not working it's the part where the damage to the target should be displayed in the power card. Something screw things up. I think my macro it's probably not elegant, but i'm a beginner pro user so please forgive me! ;) That's the code: !power {{ --whisper|self --name|Steel Wind Strike --target_list|@{target|1° Bersaglio|token_id} | @{target|2° Bersaglio|token_id} | @{target|3° Bersaglio|token_id} | @{target|4° Bersaglio|token_id} | @{target|5° Bersaglio|token_id} --Attacco:#?{Number of targets|1,1|2,2|3,3|4,4|5,5}|[[ [$Atk] ?{Attack|Normale, 1d20|Vantaggio, 3d20kh1|Svantaggio, 2d20kl1}+@{spell_attack_bonus}]] contro CA **%%bar2%%** (%%token_name%%) --?? $Atk_1 &lt; @{target|1° Bersaglio|bar2} OR $Atk_1.base == 1 ?? Mancato:|L'attacco conto @{target|1° Bersaglio|token_name} va a vuoto! --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg1] 6d10 ]] Danni da forza a @{target|1° Bersaglio|token_name} --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base == 20 ?? Colpo Critico:|[[ [$CritDmg1] 12d10 ]] Danni da forza a @{target|1° Bersaglio|token_name} --?? $Atk_2 &lt; @{target|2° Bersaglio|bar2} OR $Atk_2.base == 1 ?? Mancato:|L'attacco conto @{target|2° Bersaglio|token_name} va a vuoto! --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg2] 6d10 ]] Danni da forza a @{target|2° Bersaglio|token_name} --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base == 20 ?? Colpo Critico:|[[ [$CritDmg2] 12d10 ]] Danni da forza a @{target|2° Bersaglio|token_name} --?? $Atk_3 &lt; @{target|3° Bersaglio|bar2} OR $Atk_3.base == 1 ?? Mancato:|L'attacco conto @{target|3° Bersaglio|token_name} va a vuoto! --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg3] 6d10 ]] Danni da forza a @{target|3° Bersaglio|token_name} --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base == 20 ?? Colpo Critico:|[[ [$CritDmg3] 12d10 ]] Danni da forza a @{target|3° Bersaglio|token_name} --?? $Atk_4 &lt; @{target|4° Bersaglio|bar2} OR $Atk_4.base == 1 ?? Mancato:|L'attacco conto @{target|4° Bersaglio|token_name} va a vuoto! --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg4] 6d10 ]] Danni da forza a @{target|4° Bersaglio|token_name} --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base == 20 ?? Colpo Critico:|[[ [$CritDmg4] 12d10 ]] Danni da forza a @{target|4° Bersaglio|token_name} --?? $Atk_5 &lt; @{target|5° Bersaglio|bar2} OR $Atk_5.base == 1 ?? Mancato:|L'attacco conto @{target|5° Bersaglio|token_name} va a vuoto! --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base &lt;&gt; 20 ?? Danno:|[[ [$Dmg5] 6d10 ]] Danni da forza a @{target|5° Bersaglio|token_name} --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base == 20 ?? Colpo Critico:|[[ [$CritDmg5] 12d10 ]] Danni da forza a @{target|5° Bersaglio|token_name} --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base &lt;&gt; 20 ?? alterbar1|_target|@{target|1° Bersaglio|token_id} _bar|1 _amount|-[^Dmg1] _show|all --?? $Atk_1 &gt;= @{target|1° Bersaglio|bar2} AND $Atk_1.base == 20 ?? alterbar2|_target|@{target|1° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg1] _show|all --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base &lt;&gt; 20 ?? alterbar3|_target|@{target|2° Bersaglio|token_id} _bar|1 _amount|-[^Dmg2] _show|all --?? $Atk_2 &gt;= @{target|2° Bersaglio|bar2} AND $Atk_2.base == 20 ?? alterbar4|_target|@{target|2° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg2] _show|all --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base &lt;&gt; 20 ?? alterbar5|_target|@{target|3° Bersaglio|token_id} _bar|1 _amount|-[^Dmg3] _show|all --?? $Atk_3 &gt;= @{target|3° Bersaglio|bar2} AND $Atk_3.base == 20 ?? alterbar6|_target|@{target|3° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg3] _show|all --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base &lt;&gt; 20 ?? alterbar7|_target|@{target|4° Bersaglio|token_id} _bar|1 _amount|-[^Dmg4] _show|all --?? $Atk_4 &gt;= @{target|4° Bersaglio|bar2} AND $Atk_4.base == 20 ?? alterbar8|_target|@{target|4° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg4] _show|all --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base &lt;&gt; 20 ?? alterbar9|_target|@{target|5° Bersaglio|token_id} _bar|1 _amount|-[^Dmg5] _show|all --?? $Atk_5 &gt;= @{target|5° Bersaglio|bar2} AND $Atk_5.base == 20 ?? alterbar0|_target|@{target|5° Bersaglio|token_id} _bar|1 _amount|-[^CritDmg5] _show|all }} The green sections are working fine, but the red one got badly screwed and I can't figure out why. My english it's not the best, don't focus on that! I believe the problem is that all of the "Danno" tags (and the crit ones too) have the same tag name, so only one of each is going to end up in the card. They need to be something like Danno*1, Danno*2, etc. Same with Colpo Critco (Colpo Critco*1, Colpo Critco*2, etc.) and Mancato.
Kurt J. said: I believe the problem is that all of the "Danno" tags (and the crit ones too) have the same tag name, so only one of each is going to end up in the card. They need to be something like Danno*1, Danno*2, etc. Same with Colpo Critco (Colpo Critco*1, Colpo Critco*2, etc.) and Mancato. You were right (I had no doubt about it!)! It was just a problem with the repeating "Danno" tag. Thanks a lot man! &lt;3
1593274678

Edited 1593274796
I got a small problem with another macro I'm currently working on...this is in the middle of writing, so a lot isn't yet what I need to focus on, but here's what I have so far: !power {{ --replacesection|@{selected|character_id}|Prodigy|traits|name|TR_ --replaceattrs|S-|@{selected|character_id} --template|FeatO|@{selected|whispertoggle};Meta Magic;1 Sorcery Point;blah }} FeatO: --?! "~0!" -eq "/w gm " !? whisper|gm --?! "~0!" -ne "/w gm " !? tokenid|~S-CID$ --?! "~0!" -ne "/w gm " !? emote|~3! --name|~S-CN$'s ~TR_name$ --txcolor|White --bgcolor|Black --leftsub|~1! --rightsub|~2! --Description|~TR_description$ I added a few line breaks for better readability, those aren't in my macro/template on the server. My problem is the description replacement. it works so far, but the decription contains some line breaks, which completly breaks the replacement. it works fine, when I give the description as an argument to the template, but in this form it looks like the following: As you can see, the Box is completly broken. Maybe I'm overlooking something, but I would prefer to not have to use @{selected|repeating_trait$x_description} as a parameter, bc this way I just have to change the name of the Feat. Edit: when I use @{selected|repeating_trait$x_description} all line breaks get stripped, which makes it work, but much harder to read. I would love to preserve the linebreaks in the description...
1593277956
Kurt J.
Pro
API Scripter
Sven K. said: I got a small problem with another macro I'm currently working on...this is in the middle of writing, so a lot isn't yet what I need to focus on, but here's what I have so far: !power {{ --replacesection|@{selected|character_id}|Prodigy|traits|name|TR_ --replaceattrs|S-|@{selected|character_id} --template|FeatO|@{selected|whispertoggle};Meta Magic;1 Sorcery Point;blah }} FeatO: --?! "~0!" -eq "/w gm " !? whisper|gm --?! "~0!" -ne "/w gm " !? tokenid|~S-CID$ --?! "~0!" -ne "/w gm " !? emote|~3! --name|~S-CN$'s ~TR_name$ --txcolor|White --bgcolor|Black --leftsub|~1! --rightsub|~2! --Description|~TR_description$ I added a few line breaks for better readability, those aren't in my macro/template on the server. My problem is the description replacement. it works so far, but the decription contains some line breaks, which completly breaks the replacement. it works fine, when I give the description as an argument to the template, but in this form it looks like the following: As you can see, the Box is completly broken. Maybe I'm overlooking something, but I would prefer to not have to use @{selected|repeating_trait$x_description} as a parameter, bc this way I just have to change the name of the Feat. Edit: when I use @{selected|repeating_trait$x_description} all line breaks get stripped, which makes it work, but much harder to read. I would love to preserve the linebreaks in the description... This is completely without testing, but one suggestion might be to try enclosing the description in a table with the table symbols: --Description|[TTB][TRB][TDB]~TR_description$[TDE][TRE][TTE] Not sure if that would do it or not, but worth a shot.
1593278683

Edited 1593278807
Kurt J. said: This is completely without testing, but one suggestion might be to try enclosing the description in a table with the table symbols: --Description|[TTB][TRB][TDB]~TR_description$[TDE][TRE][TTE] Not sure if that would do it or not, but worth a shot. I already had that Idea since posting. It doesn't change anything regarding the problem. :( I was planing on adding a Menu, similar to the Spellcasting Makros from PCM Helper for the feats this way, but this won't do. I will contemplate over other options, but this certainly would have been the easiest way. So far the only ways I see is either to make sure to manually remove all line breaks from the Feat/Trait descriptions (which I also tested) or using @{selected|repeating_trait$x_description}, which makes making a menu somewhat more difficult (not impossible though, I think)... Thx anyway
(I’m reposting here following a response to the original query on the general API forum) Hi all. I'm running Earthdawn 4e using the simpler of the two available Roll20 sheets. It does most things, but the Initiative macro doesn't add the tokens to the tracker. I've tried working through the script (below) and seeing where I can add '&amp;{tracker}' to make it work, but I'm at the limit of my ability to read macros here. Is any one able to assist please? (FYI Tallano is the name of the character I'm trying to get into the turn tracker). !power {{ --format|grey --titlefont|arial --titlefontsize|16px --bodyfontsize|12px --charid|@{Tallano|character_id} --name|**@{Tallano|Name} Initiative** --Step|[[ ?{Step|@{Tallano|InitTotal}-@{Tallano|Wounds}} ]] + [[ ?{Karma #|0} ]] Karma, [[ ?{Strain #|0} ]] Strain --Result|&nbsp; **[[ [TRKR] [[{1e3, 8}&lt;[[{?{Step} - 11, 0}kh1 % 11]] + floor([[{?{Step} - 11, 0}kh1]] / 11)]]d20! + [[{2, 4, 5, 6, 7}=[[{?{Step}, 0}kh1 % 11]] + {1, 3}=[[{?{Step}, 0}kh1]] + {1e3, 3}=[[{?{Step} - 11, 0}kh1 % 11]] * 2]]d[[{{(?{Step} - 1) * 2, 4}kh1, {12} }kl1]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * (1 - {3, 6, 10}=[[{?{Step}, 0}kh1 % 11]] + {1, 4, 8}=[[{?{Step}, 0}kh1 % 11]])]]d[[10 - {4, 5, 8, 9}=[[{?{Step}, 0}kh1 % 11]] * 4]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * ({0, 5, 7, 9}=[[{?{Step}, 1}kh1 % 11]] + 2 * {6, 10}=[[{?{Step}, 0}kh1 % 11]])]]d8! - [[{1, 2}=[[{?{Step}, 0}kh1]] * (3 - [[{?{Step}, 0}kh1]])]] + [?{Karma #|0} Karma] [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] + floor([[{@{Tallano|KarmaStep} - 11, 0}kh1]] / 11))]]d20! + [[?{Karma #} * ({2, 4, 5, 6, 7}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 3}=[[{@{Tallano|KarmaStep}, 0}kh1]] + {1e3, 3}=[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] * 2)]]d[[{{(@{Tallano|KarmaStep} - 1) * 2, 4}kh1, {12} }kl1]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * (1 - {3, 6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 4, 8}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d[[10 - {4, 5, 8, 9}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] * 4]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * ({0, 5, 7, 9}=[[{@{Tallano|KarmaStep}, 1}kh1 % 11]] + 2 * {6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d8! - [[?{Karma #} * ({1, 2}=[[{@{Tallano|KarmaStep}, 0}kh1]] * (3 - [[{@{Tallano|KarmaStep}, 0}kh1]]))]] ]]** }} !modattr {{ --silent --charid @{Tallano|character_id} --Karma|-?{Karma #} --Uncon|?{Strain #} }}
Hello, First of all, congratulations for this great script. It's really full of possibilities and I'm really having fun customizing a lot of game elements. However, I'm stuck on one thing in particular. I'm trying to make a classic dice roll with a total to reach (3d6&gt;6) for example) AND to count the even or odd dice on the roll. I've tried using [xpnd], I've also watched rollid.ones... without success. I would like to be able to do for example :&nbsp; 3d6 &gt;6 =&gt; 3, 2, 2 Success (3+2+2 &gt;6) Odd = 1 Even = 2 Does anyone have any leads? Here's my current script !power {{ --name|Aura de confusion --leftsub|Majeur --rightsub|Action non ciblée --Jet : | [[ [$Jet] 4d6cf1cf3cf5cs2cs4cs6 ]] ➤ difficulté de **6** --?? $Jet.base &gt; 6 ?? !Succès : | **Réussite** --?? $Jet.base &lt;= 6 ?? !Echec : | **Echec** --Qualités : | --Niveau actuel : | 1 --Type : |Maintenu (1 passe) --Fréquence : | 1 fois par scène -- Particularités : | Exal lourd --!Description | Tant que l'aura est active toute personne, sauf le Porteur, se trouvant à moins de trois mètres de l'Arme subit un malus de (-1) à toutes ses actions. --Augmentations possibles : | ^^ ★★ Malus augmenté de (-1) (2 fois max) ^^ ★★ +3m de rayon d'action ^^ ★ +1 passe }}
1593306374
Kurt J.
Pro
API Scripter
@OrlanthR said: (I’m reposting here following a response to the original query on the general API forum) Hi all. I'm running Earthdawn 4e using the simpler of the two available Roll20 sheets. It does most things, but the Initiative macro doesn't add the tokens to the tracker. I've tried working through the script (below) and seeing where I can add '&amp;{tracker}' to make it work, but I'm at the limit of my ability to read macros here. Is any one able to assist please? (FYI Tallano is the name of the character I'm trying to get into the turn tracker). !power {{ --format|grey --titlefont|arial --titlefontsize|16px --bodyfontsize|12px --charid|@{Tallano|character_id} --name|**@{Tallano|Name} Initiative** --Step|[[ ?{Step|@{Tallano|InitTotal}-@{Tallano|Wounds}} ]] + [[ ?{Karma #|0} ]] Karma, [[ ?{Strain #|0} ]] Strain --Result|&nbsp; **[[ [TRKR] [[{1e3, 8}&lt;[[{?{Step} - 11, 0}kh1 % 11]] + floor([[{?{Step} - 11, 0}kh1]] / 11)]]d20! + [[{2, 4, 5, 6, 7}=[[{?{Step}, 0}kh1 % 11]] + {1, 3}=[[{?{Step}, 0}kh1]] + {1e3, 3}=[[{?{Step} - 11, 0}kh1 % 11]] * 2]]d[[{{(?{Step} - 1) * 2, 4}kh1, {12} }kl1]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * (1 - {3, 6, 10}=[[{?{Step}, 0}kh1 % 11]] + {1, 4, 8}=[[{?{Step}, 0}kh1 % 11]])]]d[[10 - {4, 5, 8, 9}=[[{?{Step}, 0}kh1 % 11]] * 4]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * ({0, 5, 7, 9}=[[{?{Step}, 1}kh1 % 11]] + 2 * {6, 10}=[[{?{Step}, 0}kh1 % 11]])]]d8! - [[{1, 2}=[[{?{Step}, 0}kh1]] * (3 - [[{?{Step}, 0}kh1]])]] + [?{Karma #|0} Karma] [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] + floor([[{@{Tallano|KarmaStep} - 11, 0}kh1]] / 11))]]d20! + [[?{Karma #} * ({2, 4, 5, 6, 7}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 3}=[[{@{Tallano|KarmaStep}, 0}kh1]] + {1e3, 3}=[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] * 2)]]d[[{{(@{Tallano|KarmaStep} - 1) * 2, 4}kh1, {12} }kl1]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * (1 - {3, 6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 4, 8}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d[[10 - {4, 5, 8, 9}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] * 4]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * ({0, 5, 7, 9}=[[{@{Tallano|KarmaStep}, 1}kh1 % 11]] + 2 * {6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d8! - [[?{Karma #} * ({1, 2}=[[{@{Tallano|KarmaStep}, 0}kh1]] * (3 - [[{@{Tallano|KarmaStep}, 0}kh1]]))]] ]]** }} !modattr {{ --silent --charid @{Tallano|character_id} --Karma|-?{Karma #} --Uncon|?{Strain #} }} What is the actual mechanics method for rolling for initiative? Because if it is that complicated to roll Init, I would hate to see what combat is like in that game :)
1593306734

Edited 1593307026
Kurt J.
Pro
API Scripter
Gabryel said: Hello, First of all, congratulations for this great script. It's really full of possibilities and I'm really having fun customizing a lot of game elements. However, I'm stuck on one thing in particular. I'm trying to make a classic dice roll with a total to reach (3d6&gt;6) for example) AND to count the even or odd dice on the roll. I've tried using [xpnd], I've also watched rollid.ones... without success. I would like to be able to do for example :&nbsp; 3d6 &gt;6 =&gt; 3, 2, 2 Success (3+2+2 &gt;6) Odd = 1 Even = 2 Does anyone have any leads? Here's my current script !power {{ --name|Aura de confusion --leftsub|Majeur --rightsub|Action non ciblée --Jet : | [[ [$Jet] 4d6cf1cf3cf5cs2cs4cs6 ]] ➤ difficulté de **6** --?? $Jet.base &gt; 6 ?? !Succès : | **Réussite** --?? $Jet.base &lt;= 6 ?? !Echec : | **Echec** --Qualités : | --Niveau actuel : | 1 --Type : |Maintenu (1 passe) --Fréquence : | 1 fois par scène -- Particularités : | Exal lourd --!Description | Tant que l'aura est active toute personne, sauf le Porteur, se trouvant à moins de trois mètres de l'Arme subit un malus de (-1) à toutes ses actions. --Augmentations possibles : | ^^ ★★ Malus augmenté de (-1) (2 fois max) ^^ ★★ +3m de rayon d'action ^^ ★ +1 passe }} I don't think there is any way to do this with the current version of PowerCards. I just added it to my development version, though, and it adds .odds and .evens as subsets of the RollIDs. I haven't got a solid plan on the next release, but I'll see what I can pull together.&nbsp; &nbsp;I uploaded this to the development page ( <a href="https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c" rel="nofollow">https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c</a> ) though you would need to manually install it as it isn't part of One-Click. Here is a sample card: !power {{ --name|Test --roll|[[ [$res] 18d6 ]] --res|[^res] --Odds|[^res.odds] --Evens|[^res.evens] --ones|[^res.ones] }}
1593306811

Edited 1593306878
I think you could do it on a single dice with the modulo operator % ie. [[1d6%2]] should return 0 for even and 1 for odd. But I don't think there's a way to go from there, if I understand things correctly. You can't use that result to sum it or use it in another roll, if I understand things correctly. The possibilitie for such operations in the macro language seem to be rather limited. Edit: I'm late to the party...^^
1593307294

Edited 1593348125
Kurt J.
Pro
API Scripter
Development GIST Update - 2020-06-27 (Labeled 3.8.12) It's been a LONG time, but I've uploaded a minor update to the development GIST that adds two additional "fields" that can be accessed from RollIDs : .odds and .evens. The development GIST is located at&nbsp; <a href="https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c" rel="nofollow">https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c</a> &nbsp;and you would need to disable the One-Click version and install this as a new tab in your API scripts. Here is a sample powercard: !power {{ --name|Test --roll|[[ [$res] 18d6 ]] --res|[^res] --Odds|[^res.odds] --Evens|[^res.evens] --ones|[^res.ones] }} Which produces the following:
1593308579

Edited 1593343779
coming Back to my problem with the trait description earlier...any chance you could implement something like string = string . replaceAll ( "\\R" , "&lt;br/&gt;" ); either directly in the fields or as an additional Operator? dunno about the ramifications, but as far as I Inderstand, this should solve the problem... Edit: I played around a bit more. Without at least stripping the linebreaks from the fields any field in a repeating section will even break out of whispers. I didn't check the other replacements, but if they are similar in their implementation, the same would be true there. as a comparison I hardcoded the description and manually replaced line breaks with &lt;br&gt; and got the following. So doing a replacement of all linebreaks with &lt;br&gt; fixed that problem for me. Edit 2: I guess in the API it would be more like string. replace ( / (?: \r \n | \r | \n ) /g , "&lt;br&gt;" ); my example was a more generalized approach I had laying around from java8
Kurt J. said: @OrlanthR said: (I’m reposting here following a response to the original query on the general API forum) Hi all. I'm running Earthdawn 4e using the simpler of the two available Roll20 sheets. It does most things, but the Initiative macro doesn't add the tokens to the tracker. I've tried working through the script (below) and seeing where I can add '&amp;{tracker}' to make it work, but I'm at the limit of my ability to read macros here. Is any one able to assist please? (FYI Tallano is the name of the character I'm trying to get into the turn tracker). !power {{ --format|grey --titlefont|arial --titlefontsize|16px --bodyfontsize|12px --charid|@{Tallano|character_id} --name|**@{Tallano|Name} Initiative** --Step|[[ ?{Step|@{Tallano|InitTotal}-@{Tallano|Wounds}} ]] + [[ ?{Karma #|0} ]] Karma, [[ ?{Strain #|0} ]] Strain --Result|&nbsp; **[[ [TRKR] [[{1e3, 8}&lt;[[{?{Step} - 11, 0}kh1 % 11]] + floor([[{?{Step} - 11, 0}kh1]] / 11)]]d20! + [[{2, 4, 5, 6, 7}=[[{?{Step}, 0}kh1 % 11]] + {1, 3}=[[{?{Step}, 0}kh1]] + {1e3, 3}=[[{?{Step} - 11, 0}kh1 % 11]] * 2]]d[[{{(?{Step} - 1) * 2, 4}kh1, {12} }kl1]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * (1 - {3, 6, 10}=[[{?{Step}, 0}kh1 % 11]] + {1, 4, 8}=[[{?{Step}, 0}kh1 % 11]])]]d[[10 - {4, 5, 8, 9}=[[{?{Step}, 0}kh1 % 11]] * 4]]! + [[{1e3, 8}&lt;[[{?{Step}, 0}kh1]] * ({0, 5, 7, 9}=[[{?{Step}, 1}kh1 % 11]] + 2 * {6, 10}=[[{?{Step}, 0}kh1 % 11]])]]d8! - [[{1, 2}=[[{?{Step}, 0}kh1]] * (3 - [[{?{Step}, 0}kh1]])]] + [?{Karma #|0} Karma] [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] + floor([[{@{Tallano|KarmaStep} - 11, 0}kh1]] / 11))]]d20! + [[?{Karma #} * ({2, 4, 5, 6, 7}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 3}=[[{@{Tallano|KarmaStep}, 0}kh1]] + {1e3, 3}=[[{@{Tallano|KarmaStep} - 11, 0}kh1 % 11]] * 2)]]d[[{{(@{Tallano|KarmaStep} - 1) * 2, 4}kh1, {12} }kl1]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * (1 - {3, 6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] + {1, 4, 8}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d[[10 - {4, 5, 8, 9}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]] * 4]]! + [[?{Karma #} * ({1e3, 8}&lt;[[{@{Tallano|KarmaStep}, 0}kh1]] * ({0, 5, 7, 9}=[[{@{Tallano|KarmaStep}, 1}kh1 % 11]] + 2 * {6, 10}=[[{@{Tallano|KarmaStep}, 0}kh1 % 11]]))]]d8! - [[?{Karma #} * ({1, 2}=[[{@{Tallano|KarmaStep}, 0}kh1]] * (3 - [[{@{Tallano|KarmaStep}, 0}kh1]]))]] ]]** }} !modattr {{ --silent --charid @{Tallano|character_id} --Karma|-?{Karma #} --Uncon|?{Strain #} }} What is the actual mechanics method for rolling for initiative? Because if it is that complicated to roll Init, I would hate to see what combat is like in that game :) Earthdawn uses a step system, where each step is a group of dice (ie step 8 is 2d6, 7 is d12, etc); modifications change the step number, hence the very complex macro...
Development GIST Update - 2020-06-27 (Labeled 3.8.12) It's been a LONG time, but I've uploaded a minor update to the development GIST that adds two additional "fields" that can be accessed from RollIDs : .odds and .evens. The development GIST is located at&nbsp; <a href="https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c" rel="nofollow">https://gist.github.com/kjaegers/7fd81c55517014704b9fe3986660341c</a> &nbsp;and you would need to disable the One-Click version and install this as a new tab in your API scripts. Thank you for such a quick return! The update (DEV) is exactly what I was looking for. I think it will be useful in many cases and for many games. I hope it will serve for many others. Just a quick note: I've noticed that when you use the Roll Modifier [NH] it doesn't work anymore. I post here my powercard and my script. Thanks again Kurt ! !power {{ --name|Aura de confusion --leftsub|Majeur --rightsub|Action non ciblée --Jet : | [[ [$Jet] 5d6 ]] ➤ difficulté de **6**&nbsp; --?? $Jet.base &lt;= 6 ?? !Echec : | **Echec** --?? $Jet.base &gt; 6 AND $Jet.evens == 0 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 1 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 2 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 3 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 4 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 5 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 6 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★ ★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 7 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★ ★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 8 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★ ★★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 9 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★ ★★★★**$$ --?? $Jet.base &gt; 6 AND $Jet.evens == 10 ?? !Succès : | $$#077034|**RÉUSSITE !**$$ **Qualités :** $$#077034|**★★★★★ ★★★★★**$$ --?? $Jet.base &lt;= 6 ?? !Echec : | $$#98111D|**ECHEC !**$$ --Niveau actuel : | 1 --Type : |Maintenu (1 passe) --Fréquence : | 1 fois par scène -- Particularités : | Exal lourd --!Description | Tant que l'aura est active toute personne, sauf le Porteur, se trouvant à moins de trois mètres de l'Arme subit un malus de (-1) à toutes ses actions. --!Augmentations| [TTB 'width=100%'][TRB][TDB align=left colspan=15] **Augmentations possibles**&nbsp; [TDE][TRE][TRB][TDB width='10%' align=right] ★★ [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] Malus augmenté de 1 (2 fois)&nbsp; [TDE][TRE][TRB][TDB width='10%' align=right] ★★&nbsp; [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] +3m de rayon d'action&nbsp; [TDE][TRE][TRB][TDB width='10%' align=right] ★&nbsp; [TDE][TDB width='3%' align=right] [TDE][TDB width='87%'] +1 passe&nbsp; [TDE][TRE][TTE] }}
1593345737
Kurt J.
Pro
API Scripter
Sven K. said: coming Back to my problem with the trait description earlier...any chance you could implement something like string = string . replaceAll ( "\\R" , "&lt;br/&gt;" ); either directly in the fields or as an additional Operator? dunno about the ramifications, but as far as I Inderstand, this should solve the problem... Edit: I played around a bit more. Without at least stripping the linebreaks from the fields any field in a repeating section will even break out of whispers. I didn't check the other replacements, but if they are similar in their implementation, the same would be true there. as a comparison I hardcoded the description and manually replaced line breaks with &lt;br&gt; and got the following. So doing a replacement of all linebreaks with &lt;br&gt; fixed that problem for me. Edit 2: I guess in the API it would be more like string. replace ( / (?: \r \n | \r | \n ) /g , "&lt;br&gt;" ); my example was a more generalized approach I had laying around from java8 The strange thing is, I haven't been able to get this to happen... I've gone in and added line breaks to descriptions on several different kinds of repeating sections and they all come out normally, so I'm not sure where things are going astray :(
1593347029

Edited 1593348126
Kurt J. said: The strange thing is, I haven't been able to get this to happen... I've gone in and added line breaks to descriptions on several different kinds of repeating sections and they all come out normally, so I'm not sure where things are going astray :( This only happens with the --replacesection Tag so far, not when using @{selected|repeating_traits$x_description} Anyway, I took your last version and changed line 2344 from return_set.push(replacementprefix + z.get("name").replace(action_prefix, "") + "|" + z.get("current")); to return_set.push(replacementprefix + z.get("name").replace(action_prefix, "") + "|" + z.get("current").replace(/(?:\r\n|\r|\n)/g, "&lt;br&gt;")); This is the result. Dunno if this breaks something different, but I doubt it would. Edit: Here are the macro and template I'm currently using for that: FeatO: --format|feats --?! "~0!" -eq "/w gm " !? whisper|gm --name|~S-CN$'s ~TR_name$ --leftsub|~TR_source$ --rightsub|~TR_source_type$ --Description|~TR_description$ !power {{ --replacesection|@{selected|character_id}|?{Feat:|Prodigy|Flexible Casting|Metamagic: Subtle Spell|Metamagic: Quickened Spell}|traits|name|TR_ --replaceattrs|S-|@{selected|character_id} --template|FeatO|@{selected|whispertoggle}; }} You can add the names of the Feats you want to the Roll Query to the feats you want to have, and then use it as a token action. I don't think there is a way to automatically build the roll query to include all name fields of the repeating section, is there? I mean, without adding a function for that in the api script...Which would be a nice thing to have, but this works pretty nicely so far :)
1593348093
Kurt J.
Pro
API Scripter
Sven K. said: Kurt J. said: The strange thing is, I haven't been able to get this to happen... I've gone in and added line breaks to descriptions on several different kinds of repeating sections and they all come out normally, so I'm not sure where things are going astray :( This only happens with the --replacesection Tag so far, not when using @{selected|repeating_traits$x_description} Anyway, I took your last version and changed line 2344 from return_set.push(replacementprefix + z.get("name").replace(action_prefix, "") + "|" + z.get("current")); to return_set.push(replacementprefix + z.get("name").replace(action_prefix, "") + "|" + z.get("current").replace(/(?:\r\n|\r|\n)/g, "&lt;br&gt;")); This is the result. Dunno if this breaks something different, but I doubt it would. I did some testing, and it doesn't seem to impact anything I can find. I'll update the dev version with this and another feature I added this morning.
1593349983
Kurt J.
Pro
API Scripter
Development GIST Update - 2020-06-28 (Labeled 3.8.12) Two days, two updates... This time to incorporate the following two changes: - Text containing carriage returns or newlines imported by replacesection will convert those newlines to &lt;br&gt; (Thanks Sven K.) - Another new roll field : .aces. This is terminology from Deadlands, but essentially this will count the number of dice that rolled the highest number on the die. Finally, a note about .ones, .tens, .odds, .evens, and .aces. These currently do no support mixed-dice rolls, so 12d6 + 10d10 will result in bad information for these fields. Here is a sample powercard: !power {{ --name|Test --roll|[[ [$res] 18d6 ]] --res|[^res] --Odds|[^res.odds] --Evens|[^res.evens] --ones|[^res.ones] --aces|[^res.aces] }} Which produces the following:
Kurt J. said: Mangouste said: Hi guys it's me again ! So here's my issue ! I test 3 conditions: Fail (No success &lt;=&gt; $Atk.ss == 0) Fumble (same as above PLUS at least a ONE on the dices &lt;=&gt; $Atk.ones ==1) Success In each condition I need to decrease bar1(representing Psi Points) by the cost of the power being used (~9!) As you can see below I tried many ways to decrease that value but none works! --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 0 ?? --api_token-mod|_ids @{selected|token_id} _ignore-selected _set bar1_value|-[[~9!]]&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 1 ?? alterbar1|_target|@{selected||token_id} _bar|1 _amount|-[[~9!]] _show|all&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]]&nbsp; This is an extract of my PC template but my question is fairly simple : Why the heck can't I decrease that f*****g bar where I can through a normal macro !? Is there something in my typo wrong ? Thanks in advance for your help If all three possibilities result in the same decrease in the bar value, why make them conditional at all? simply include the bar decrease as a separate line? Also, this: --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]] will cause problems because the second part of a conditional can't start with -- because it will be treated as a different tag. Leave off the -- in front of api_token-mod or alterbar. Hi, if I left the 3 versions it's to show that I'd tested pretty much all the options.... Once I find one that works I will obviously get rid of the others ^^ even if I get rid of the 2 "-" in front of api or alterbar it still does nothing !
1593369621
Kurt J.
Pro
API Scripter
Mangouste said: Kurt J. said: Mangouste said: Hi guys it's me again ! So here's my issue ! I test 3 conditions: Fail (No success &lt;=&gt; $Atk.ss == 0) Fumble (same as above PLUS at least a ONE on the dices &lt;=&gt; $Atk.ones ==1) Success In each condition I need to decrease bar1(representing Psi Points) by the cost of the power being used (~9!) As you can see below I tried many ways to decrease that value but none works! --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 0 ?? --api_token-mod|_ids @{selected|token_id} _ignore-selected _set bar1_value|-[[~9!]]&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss == 0 AND $Atk.ones == 1 ?? alterbar1|_target|@{selected||token_id} _bar|1 _amount|-[[~9!]] _show|all&nbsp; --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]]&nbsp; This is an extract of my PC template but my question is fairly simple : Why the heck can't I decrease that f*****g bar where I can through a normal macro !? Is there something in my typo wrong ? Thanks in advance for your help If all three possibilities result in the same decrease in the bar value, why make them conditional at all? simply include the bar decrease as a separate line? Also, this: --?? $Ppr &gt; 0 AND $Atk.ss &gt;= 1 ?? --api_token-mod|_ids @{selected|token_id} _set bar1_value|-[[~9!]] will cause problems because the second part of a conditional can't start with -- because it will be treated as a different tag. Leave off the -- in front of api_token-mod or alterbar. Hi, if I left the 3 versions it's to show that I'd tested pretty much all the options.... Once I find one that works I will obviously get rid of the others ^^ even if I get rid of the 2 "-" in front of api or alterbar it still does nothing ! Can you try taking the [[ and ]] out from around the ~9!? If this is a static number there shouldn't be any need to enclose it in roll notation, and what comes back from the roll might be throwing off alterbar.
Hi Kurt, No change except the message : (from ERROR) : Not a valid Id
Ok, I though I had this working, but this week says otherwise.&nbsp; I was simply trying to set up a macro for Skill checks that also checks if the character is proficient, and if so, prints "Proficient" in the leftsub.&nbsp; So far, I only have it set up for Acrobatics (hence the check for @{acrobatics_prof} in the rightsub to prove whether it returns 0 or not. I kind of have it working correctly if I take off the "--" before the leftsub portion, but it prints it in the body.&nbsp; If I keep "--" before leftsub, it always reads the second conditional (I assume) and always prints "proficient!" in the leftsub, whether they're proficient or not (and when they're not, the rightsub tag always returns 0, as well as the actual attribute @{acrobatics_prof} shows 0 in the character's attributes list.&nbsp; Is this something I need to/am able to address before the conditionals or before the query with a template or replacement or something?&nbsp; What am I missing? !power {{ --format|skill --title| --charid|@{character_id} --name|@{character_name} rolls a skill check... --hroll| [[ [$skilz] 1d0 + ?{Ability|Acrobatics, 0 | Animal Handling, 1 | Arcana, 2 | Athletics, 3 | Deception, 4 | History, 5 | Insight, 6 | Intimidation, 7 | Investigation, 8 | Medicine, 9 | Nature, 10 | Perception, 11 | Performance, 12 | Persuasion, 13 | Religion, 14 | Sleight of Hand, 15 | Stealth, 16 | Survival, 17 | STR, 18 | DEX, 19 | CON, 20 | INT, 21 | WIS, 22 | CHA, 23}]] --rightsub|@{acrobatics_prof} --?? $skilz == 0 AND @{acrobatics_prof} == 0 ?? Acrobatics:|~L[[1d20+@{acrobatics_bonus}]]~L \\ [[1d20+@{acrobatics_bonus}]] --?? $skilz == 0 AND @{acrobatics_prof} &lt;&gt; 0 ?? Acrobatics:|~L[[1d20+@{acrobatics_bonus}]]~L \\ [[1d20+@{acrobatics_bonus}]] --leftsub|proficient! --?? $skilz == 1 ?? Animal Handling:|~L[[1d20+@{animal_handling_bonus}]]~L \\ [[1d20+@{animal_handling_bonus}]] --?? $skilz == 2 ?? Arcana:|~L[[1d20+@{arcana_bonus}]]~L \\ [[1d20+@{arcana_bonus}]] --?? $skilz == 3 ?? Athletics:|~L[[1d20+@{athletics_bonus}]]~L \\ [[1d20+@{athletics_bonus}]] --?? $skilz == 4 ?? Deception:|~L[[1d20+@{deception_bonus}]]~L \\ [[1d20+@{deception_bonus}]] --?? $skilz == 5 ?? History:|~L[[1d20+@{history_bonus}]]~L \\ [[1d20+@{history_bonus}]] --?? $skilz == 6 ?? Insight:|~L[[1d20+@{insight_bonus}]]~L \\ [[1d20+@{insight_bonus}]] --?? $skilz == 7 ?? Intimidation:|~L[[1d20+@{intimidation_bonus}]]~L \\ [[1d20+@{intimidation_bonus}]] --?? $skilz == 8 ?? Investigation:|~L[[1d20+@{investigation_bonus}]]~L \\ [[1d20+@{investigation_bonus}]] --?? $skilz == 9 ?? Medicine:|~L[[1d20+@{medicine_bonus}]]~L \\ [[1d20+@{medicine_bonus}]] --?? $skilz == 10 ?? Nature:|~L[[1d20+@{nature_bonus}]]~L \\ [[1d20+@{nature_bonus}]] --?? $skilz == 11 ?? Perception:|~L[[1d20+@{perception_bonus}]]~L \\ [[1d20+@{perception_bonus}]] --?? $skilz == 12 ?? Performance:|~L[[1d20+@{performance_bonus}]]~L \\ [[1d20+@{performance_bonus}]] --?? $skilz == 13 ?? Persuasion:|~L[[1d20+@{persuasion_bonus}]]~L \\ [[1d20+@{persuasion_bonus}]] --?? $skilz == 14 ?? Religion:|~L[[1d20+@{religion_bonus}]]~L \\ [[1d20+@{religion_bonus}]] --?? $skilz == 15 ?? Sleight of Hand:|~L[[1d20+@{sleight_of_hand_bonus}]]~L \\ [[1d20+@{sleight_of_hand_bonus}]] --?? $skilz == 16 ?? Stealth:|~L[[1d20+@{stealth_bonus}]]~L \\ [[1d20+@{stealth_bonus}]] --?? $skilz == 17 ?? Survival:|~L[[1d20+@{survival_bonus}]]~L \\ [[1d20+@{survival_bonus}]] --?? $skilz == 18 ?? Strength:|~L[[1d20+@{strength_mod}]]~L \\ [[1d20+@{strength_mod}]] --?? $skilz == 19 ?? Dexterity:|~L[[1d20+@{dexterity_mod}]]~L \\ [[1d20+@{dexterity_mod}]] --?? $skilz == 20 ?? Constitution:|~L[[1d20+@{constitution_mod}]]~L \\ [[1d20+@{constitution_mod}]] --?? $skilz == 21 ?? Intelligence:|~L[[1d20+@{intelligence_mod}]]~L \\ [[1d20+@{intelligence_mod}]] --?? $skilz == 22 ?? Wisdom:|~L[[1d20+@{wisdom_mod}]]~L \\ [[1d20+@{wisdom_mod}]] --?? $skilz == 23 ?? Charisma:|~L[[1d20+@{charisma_mod}]]~L \\ [[1d20+@{charisma_mod}]] }}
I don't believe you can control the leftsub work a conditional.&nbsp; So it will always find the --leftsub tag and display it.
1593782309
Kurt J.
Pro
API Scripter
Hrekto said: Ok, I though I had this working, but this week says otherwise.&nbsp; I was simply trying to set up a macro for Skill checks that also checks if the character is proficient, and if so, prints "Proficient" in the leftsub.&nbsp; So far, I only have it set up for Acrobatics (hence the check for @{acrobatics_prof} in the rightsub to prove whether it returns 0 or not. I kind of have it working correctly if I take off the "--" before the leftsub portion, but it prints it in the body.&nbsp; If I keep "--" before leftsub, it always reads the second conditional (I assume) and always prints "proficient!" in the leftsub, whether they're proficient or not (and when they're not, the rightsub tag always returns 0, as well as the actual attribute @{acrobatics_prof} shows 0 in the character's attributes list.&nbsp; Is this something I need to/am able to address before the conditionals or before the query with a template or replacement or something?&nbsp; What am I missing? !power {{ --format|skill --title| --charid|@{character_id} --name|@{character_name} rolls a skill check... --hroll| [[ [$skilz] 1d0 + ?{Ability|Acrobatics, 0 | Animal Handling, 1 | Arcana, 2 | Athletics, 3 | Deception, 4 | History, 5 | Insight, 6 | Intimidation, 7 | Investigation, 8 | Medicine, 9 | Nature, 10 | Perception, 11 | Performance, 12 | Persuasion, 13 | Religion, 14 | Sleight of Hand, 15 | Stealth, 16 | Survival, 17 | STR, 18 | DEX, 19 | CON, 20 | INT, 21 | WIS, 22 | CHA, 23}]] --rightsub|@{acrobatics_prof} --?? $skilz == 0 AND @{acrobatics_prof} == 0 ?? Acrobatics:|~L[[1d20+@{acrobatics_bonus}]]~L \\ [[1d20+@{acrobatics_bonus}]] --?? $skilz == 0 AND @{acrobatics_prof} &lt;&gt; 0 ?? Acrobatics:|~L[[1d20+@{acrobatics_bonus}]]~L \\ [[1d20+@{acrobatics_bonus}]] --leftsub|proficient! --?? $skilz == 1 ?? Animal Handling:|~L[[1d20+@{animal_handling_bonus}]]~L \\ [[1d20+@{animal_handling_bonus}]] --?? $skilz == 2 ?? Arcana:|~L[[1d20+@{arcana_bonus}]]~L \\ [[1d20+@{arcana_bonus}]] --?? $skilz == 3 ?? Athletics:|~L[[1d20+@{athletics_bonus}]]~L \\ [[1d20+@{athletics_bonus}]] --?? $skilz == 4 ?? Deception:|~L[[1d20+@{deception_bonus}]]~L \\ [[1d20+@{deception_bonus}]] --?? $skilz == 5 ?? History:|~L[[1d20+@{history_bonus}]]~L \\ [[1d20+@{history_bonus}]] --?? $skilz == 6 ?? Insight:|~L[[1d20+@{insight_bonus}]]~L \\ [[1d20+@{insight_bonus}]] --?? $skilz == 7 ?? Intimidation:|~L[[1d20+@{intimidation_bonus}]]~L \\ [[1d20+@{intimidation_bonus}]] --?? $skilz == 8 ?? Investigation:|~L[[1d20+@{investigation_bonus}]]~L \\ [[1d20+@{investigation_bonus}]] --?? $skilz == 9 ?? Medicine:|~L[[1d20+@{medicine_bonus}]]~L \\ [[1d20+@{medicine_bonus}]] --?? $skilz == 10 ?? Nature:|~L[[1d20+@{nature_bonus}]]~L \\ [[1d20+@{nature_bonus}]] --?? $skilz == 11 ?? Perception:|~L[[1d20+@{perception_bonus}]]~L \\ [[1d20+@{perception_bonus}]] --?? $skilz == 12 ?? Performance:|~L[[1d20+@{performance_bonus}]]~L \\ [[1d20+@{performance_bonus}]] --?? $skilz == 13 ?? Persuasion:|~L[[1d20+@{persuasion_bonus}]]~L \\ [[1d20+@{persuasion_bonus}]] --?? $skilz == 14 ?? Religion:|~L[[1d20+@{religion_bonus}]]~L \\ [[1d20+@{religion_bonus}]] --?? $skilz == 15 ?? Sleight of Hand:|~L[[1d20+@{sleight_of_hand_bonus}]]~L \\ [[1d20+@{sleight_of_hand_bonus}]] --?? $skilz == 16 ?? Stealth:|~L[[1d20+@{stealth_bonus}]]~L \\ [[1d20+@{stealth_bonus}]] --?? $skilz == 17 ?? Survival:|~L[[1d20+@{survival_bonus}]]~L \\ [[1d20+@{survival_bonus}]] --?? $skilz == 18 ?? Strength:|~L[[1d20+@{strength_mod}]]~L \\ [[1d20+@{strength_mod}]] --?? $skilz == 19 ?? Dexterity:|~L[[1d20+@{dexterity_mod}]]~L \\ [[1d20+@{dexterity_mod}]] --?? $skilz == 20 ?? Constitution:|~L[[1d20+@{constitution_mod}]]~L \\ [[1d20+@{constitution_mod}]] --?? $skilz == 21 ?? Intelligence:|~L[[1d20+@{intelligence_mod}]]~L \\ [[1d20+@{intelligence_mod}]] --?? $skilz == 22 ?? Wisdom:|~L[[1d20+@{wisdom_mod}]]~L \\ [[1d20+@{wisdom_mod}]] --?? $skilz == 23 ?? Charisma:|~L[[1d20+@{charisma_mod}]]~L \\ [[1d20+@{charisma_mod}]] }} So there are a few issues here... First, formatting tags are processed before most other things on the card, so they can't be subject to conditionals. As you speculated, you could use templates and replacements to handle this, as they are processed before formatting tags. Second, both of your Athletics tags have the same name. This is not allowed and will cause only one of them to be processed by the card. Having them conditional might help a bit, but it is still better to use the "same name" tag modifier to give every tag a unique name. Finally, linebreaks don't mean anything to a PowerCard (your whole card could be entered without them, so this line: --?? $skilz == 0 AND @{acrobatics_prof} &lt;&gt; 0 ?? Acrobatics:|~L[[1d20+@{acrobatics_bonus}]]~L \\ [[1d20+@{acrobatics_bonus}]] --leftsub|proficient! is two separate tags. The --leftsub is not impacted by the conditional on the line and will always be processed. The -- sequence delineates the start of a new tag.
Kurt (and others), Is there a way to make *part* of the power card seen only by the GM. I am thinking of actions like the PC attack action.&nbsp; I would love for the party to see the description, and attack but NOT the opposing AC.&nbsp; It would also be nice to hide the damage an NPC does against the player.&nbsp; I am playing with some younger kids, and fudging happens on occasion. Is there a way to make some results shown only to the DM? Orc uses Greataxe against Laurana <div class="userscript-showtip userscript-tipsy" original-title="PowerCard sent by: Don (GM)" style="box-sizing: content-box; min-width: 150px; font-family: georgia; font-size: 1.2em; line-height: 1.2em; font-weight: normal; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; letter-spacing: 2px; vertical-align: middle; margin: 0px; padding: 2px 0px 0px; border: 1px solid rgb(0, 0, 0); border-radius: 5px 5px 0px 0px; color: rgb(255, 255, 255); text-shadow: rgb(0, 0, 0) -1px -1px 0px, rgb(0, 0, 0) 1px -1px 0px, rgb(0, 0, 0) -1px 1px 0px, rgb(0, 0, 0) 1px 1px 0px; background-color: rgb(0, 68, 0); background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));">Greataxe Melee Attack: &nbsp;<span title="Roll: [$Atk] 1d20 + 5 [Attack Bonus] Results: ( 15 ) + 5 = 20" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">20 &nbsp;vs&nbsp; AC &nbsp;<span class="userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: 14 Results: 14 = 14" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">14 Hit: &nbsp;<span title="Roll: [$Dmg] 1d12 + 3 Results: ( 6 ) + 3 = 9" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">?? &nbsp;slashing damage Tanis uses Quarterstaff (One-Handed) against Orc <div class="userscript-showtip userscript-tipsy" original-title="PowerCard sent by: Don (GM)" style="box-sizing: content-box; min-width: 150px; font-family: georgia; font-size: 1.2em; line-height: 1.2em; font-weight: normal; font-style: normal; font-variant-numeric: normal; font-variant-east-asian: normal; letter-spacing: 2px; vertical-align: middle; margin: 0px; padding: 2px 0px 0px; border: 1px solid rgb(0, 0, 0); border-radius: 5px 5px 0px 0px; color: rgb(255, 255, 255); text-shadow: none; background-color: rgb(0, 68, 0); background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));">Quarterstaff (One-Handed) Attack Attack &nbsp;<span class="userscript-inlinerollresult userscript-showtip userscript-tipsy" original-title="Roll: [$Atk] 1d20 + 2 [Attack Bonus] Results: ( 12 ) + 2 = 14" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">14 &nbsp;vs&nbsp; AC &nbsp;<span title="Roll: 13 Results: 13 = 13" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">?? Hit &nbsp;Ket'amsha Erne hits Orc for&nbsp;<span title="Roll: [$Dmg] 1d6 Results: ( 2 ) = 2" class="userscript-inlinerollresult userscript-showtip userscript-tipsy" style="box-sizing: content-box; min-width: 1.75em; text-align: center; display: inline-block; font-weight: bold; height: 1em; margin-top: -1px; margin-bottom: 1px; padding: 0px 2px; border: 1px solid rgb(135, 133, 10); border-radius: 3px; background-color: rgb(255, 254, 162);">2 &nbsp;d6 damage
1593792399
Kurt J.
Pro
API Scripter
Donald K. said: Kurt (and others), Is there a way to make *part* of the power card seen only by the GM. I am thinking of actions like the PC attack action.&nbsp; I would love for the party to see the description, and attack but NOT the opposing AC.&nbsp; It would also be nice to hide the damage an NPC does against the player.&nbsp; I am playing with some younger kids, and fudging happens on occasion. Is there a way to make some results shown only to the DM? Orc uses Greataxe against Laurana Greataxe Melee Attack: &nbsp;<span title="Roll: [$Atk] 1d20 + 5 [Attack Bonus] Results: ( 15 ) + 5 = 20" class="userscript-userscript-inlinerollresult userscript-showtip userscript-tipsy" style="min-width: 1.75em ; text-align: center ; display: inline-block ; font-weight: bold ; height: 1em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid rgb( 135 , 133 , 10 ) ; border-radius: 3px ; background-color: rgb( 255 , 254 , 162 )">20 &nbsp;vs&nbsp; AC &nbsp; 14 Hit: &nbsp;<span title="Roll: [$Dmg] 1d12 + 3 Results: ( 6 ) + 3 = 9" class="userscript-userscript-inlinerollresult userscript-showtip userscript-tipsy" style="min-width: 1.75em ; text-align: center ; display: inline-block ; font-weight: bold ; height: 1em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid rgb( 135 , 133 , 10 ) ; border-radius: 3px ; background-color: rgb( 255 , 254 , 162 )">?? &nbsp;slashing damage Tanis uses Quarterstaff (One-Handed) against Orc Quarterstaff (One-Handed) Attack Attack &nbsp; 14 &nbsp;vs&nbsp; AC &nbsp;<span title="Roll: 13 Results: 13 = 13" class="userscript-userscript-inlinerollresult userscript-showtip userscript-tipsy" style="min-width: 1.75em ; text-align: center ; display: inline-block ; font-weight: bold ; height: 1em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid rgb( 135 , 133 , 10 ) ; border-radius: 3px ; background-color: rgb( 255 , 254 , 162 )">?? Hit &nbsp;Ket'amsha Erne hits Orc for&nbsp;<span title="Roll: [$Dmg] 1d6 Results: ( 2 ) = 2" class="userscript-userscript-inlinerollresult userscript-showtip userscript-tipsy" style="min-width: 1.75em ; text-align: center ; display: inline-block ; font-weight: bold ; height: 1em ; margin-top: -1px ; margin-bottom: 1px ; padding: 0px 2px ; border: 1px solid rgb( 135 , 133 , 10 ) ; border-radius: 3px ; background-color: rgb( 255 , 254 , 162 )">2 &nbsp;d6 damage That is an incredibly cool idea... My initial reaction was "No way... that's crazy talk!" but then I thought about it for a minute :) It actually *is* possible, though it is slightly tricky. You can use the --api_ tag to call PowerCards itself! The nested (whispered to GM) card has to be a bit simpler than a full card, but given the intent, that probably isn't too much of an issue. This quick test (it doesn't use character attributes, etc. for the most part (like adding +5 str hardcoded) but it shows the idea. It also assumes that you use bar2 for AC, but really all of that is details :)) The cool part is that, even with conditionals, it is possible to nest cards that are sent to individuals and still use the results of RollIDs on them: !power {{ --charid|@{selected|character_id} --name|Attack --emote|@{selected|character_name} Attacks @{target|character_name} --Attack|@{selected|character_name} rolls [[ [$atk] 1d20 + 5 [Str] ]] against the @{target|character_name} --hroll|[[ [$dmg] 1d8+5 ]] [[ [$crit] 1d8 ]] --?? $atk &gt; @{target|bar2} and $atk.base &lt;&gt; 20 ?? api_power*1|_whisper|gm _name|@{selected|character_name} attack damage _Damage|The damage was [^dmg] bludgeoning --?? $atk.base == 20 ?? api_power*2|_whisper|gm _name|@{selected|character_name} attack damage _Critical Hit|The damage was [^dmg] + [^crit] bludgeoning }} The key is that (in my brief testing) you can't include rolls in the api command - hence rolling the damage in the hroll. This gets me the following (the first attack is a hit, the second a miss, and the third is a crit): &nbsp;
WOOT! I am glad the idea was well received.&nbsp; Thank you for the reply, and I love what you have hammered out as a proof of concept.&nbsp; I am reading through your wiki, and trying to parse it out (have not really done any programming in years). I would love to see these ideas implemented, and if I can help in anyway I would love to. Thank you again for the enthusiastic response. -Don
1593798195
Kurt J.
Pro
API Scripter
Donald K. said: WOOT! I am glad the idea was well received.&nbsp; Thank you for the reply, and I love what you have hammered out as a proof of concept.&nbsp; I am reading through your wiki, and trying to parse it out (have not really done any programming in years). I would love to see these ideas implemented, and if I can help in anyway I would love to. Thank you again for the enthusiastic response. -Don I didn't make any code changes to make the above card work... that is all possible with the current version of PowerCards. I had just never thought of using --api_ that way :) Let me know if there are limitations you run into and I'll see if I can either find ways around them or come up with edits that will allow them to work.
Update- I have been able to achieve some&nbsp; of the changes I wanted for my game: 1-&nbsp; Players do not see the AC of the opposing targe t.&nbsp; ACHIEVED .&nbsp; I removed the 'vs **AC**' from the PowerCard template in the PCAttack section. 2-&nbsp; Players do not see the damage done by NPCs .&nbsp; ACHIEVED. &nbsp; I removed '[#[ [$Dmg] ~NPCA-DAMAGE$ ]#]' from the PowerCard template in the NPCAttack&nbsp; section (in each of the 4 possible attack options). 3- DM gets a whisper of the damage done to players in the NPCAttack . &nbsp; I am playing with some kiddos, and sometimes need to fudge a die roll.&nbsp; I want them to know they know they are hit, and with what type of damage.&nbsp; Partially achieved. I have been able to add the api_power1|_whisper|gm_name| call and get a whisper, but I am have NOT been able to figure out how to get the syntax correct, and have it actually calculate and display the result of the&nbsp; [#[ [$Dmg] ~NPCA-DAMAGE$ ]#] to me in the whisper. I assume my issue is the nesting of api calls.&nbsp; Is there a reasonable way to achieve this? Thank you! -Don
Hi.&nbsp; I'm new to the api but have come up to speed and watched the tutorials and studied the wiki (a lot). I'm a longtime software developer (just not usually in JavaScript).&nbsp; I absolutely love this script package and love what you have done by adding layers of parameterization bypassing the script parsing limitations, just build your own delegate system, we don't need to C# lambdas! So first and foremost, thank you (click me if you agree). Couple questions: 1. Debugging PCA- pair substitution parse errors. I'm using the default PMHelper PC attack macro.&nbsp; For one player sheet it works.&nbsp; For 4 others it bugs out&nbsp; "Could not determine result type of: [{\"type\":\"M\",\"expr\":1},{\"type\":\"C\",\"text\":\"d20$ + 8 [Attack Bonus] \"}]" Which clearly means it's throwing a parse error on the sub section near [Attack Bonus] labeling which is arg 1. I've ready the PCA- repeating ability section of the wiki times but still can't figure it out.&nbsp; Specifically: Are the PCA- action list pairs in memory or on the char sheet?&nbsp; What generates them? I tried the !PCM and I even have the action/other lists so I don't know how to gen them. As near as I can tell the repeating action blocks are setup correctly.&nbsp; And all work fine for player 1, while none work for players 2 - 4.&nbsp;&nbsp; Note, this was during setup so I suspect chars 2 - 4 have a different install/setup history. Also the NPC attacks work/target fine. 2. Sharing/More Examples I've gathered a fair amount of samples by hunting these threads and watching youtubes. Does anyone have a home of shared macros and abilities? Or Kurt would you consider sharing your&nbsp; PCattack0 etc. It would fast-track me a lot of I can just get samples of tuned ones with the complex damage conditional and api calls to the ability OnHit etc.&nbsp; Also I would love the token mod wiring setups. Specifically, PC attack macros with selected/target logic for effects and token mods. I am DnD 5E default sheet. Side note: I'm one of the gamers who is having a renaissance of role playing with friends online due to the pandemic. So I'm really just getting into online DMing and playing.
1593889017
Kurt J.
Pro
API Scripter
Donald K. said: Update- I have been able to achieve some&nbsp; of the changes I wanted for my game: 1-&nbsp; Players do not see the AC of the opposing targe t.&nbsp; ACHIEVED .&nbsp; I removed the 'vs **AC**' from the PowerCard template in the PCAttack section. 2-&nbsp; Players do not see the damage done by NPCs .&nbsp; ACHIEVED. &nbsp; I removed '[#[ [$Dmg] ~NPCA-DAMAGE$ ]#]' from the PowerCard template in the NPCAttack&nbsp; section (in each of the 4 possible attack options). 3- DM gets a whisper of the damage done to players in the NPCAttack . &nbsp; I am playing with some kiddos, and sometimes need to fudge a die roll.&nbsp; I want them to know they know they are hit, and with what type of damage.&nbsp; Partially achieved. I have been able to add the api_power1|_whisper|gm_name| call and get a whisper, but I am have NOT been able to figure out how to get the syntax correct, and have it actually calculate and display the result of the&nbsp; [#[ [$Dmg] ~NPCA-DAMAGE$ ]#] to me in the whisper. I assume my issue is the nesting of api calls.&nbsp; Is there a reasonable way to achieve this? Thank you! -Don You will need to add an hroll for the damage that is in the main card. It's resultant rollid can then be used in the nested card, but rolls can't be included in the nested card. There may be a workaround syntax for that, but I haven't seen one yet. See the example above for how the hroll can be done and just isn't used if the attack doesn't hit.
1593889516

Edited 1593889750
Kurt J.
Pro
API Scripter
Dan C. said: Hi.&nbsp; I'm new to the api but have come up to speed and watched the tutorials and studied the wiki (a lot). I'm a longtime software developer (just not usually in JavaScript).&nbsp; I absolutely love this script package and love what you have done by adding layers of parameterization bypassing the script parsing limitations, just build your own delegate system, we don't need to C# lambdas! So first and foremost, thank you (click me if you agree). Couple questions: 1. Debugging PCA- pair substitution parse errors. I'm using the default PMHelper PC attack macro.&nbsp; For one player sheet it works.&nbsp; For 4 others it bugs out&nbsp; "Could not determine result type of: [{\"type\":\"M\",\"expr\":1},{\"type\":\"C\",\"text\":\"d20$ + 8 [Attack Bonus] \"}]" Which clearly means it's throwing a parse error on the sub section near [Attack Bonus] labeling which is arg 1. I've ready the PCA- repeating ability section of the wiki times but still can't figure it out.&nbsp; Specifically: Are the PCA- action list pairs in memory or on the char sheet?&nbsp; What generates them? I tried the !PCM and I even have the action/other lists so I don't know how to gen them. As near as I can tell the repeating action blocks are setup correctly.&nbsp; And all work fine for player 1, while none work for players 2 - 4.&nbsp;&nbsp; Note, this was during setup so I suspect chars 2 - 4 have a different install/setup history. Also the NPC attacks work/target fine. 2. Sharing/More Examples I've gathered a fair amount of samples by hunting these threads and watching youtubes. Does anyone have a home of shared macros and abilities? Or Kurt would you consider sharing your&nbsp; PCattack0 etc. It would fast-track me a lot of I can just get samples of tuned ones with the complex damage conditional and api calls to the ability OnHit etc.&nbsp; Also I would love the token mod wiring setups. Specifically, PC attack macros with selected/target logic for effects and token mods. I am DnD 5E default sheet. Side note: I'm one of the gamers who is having a renaissance of role playing with friends online due to the pandemic. So I'm really just getting into online DMing and playing. #1 thing to check: Make sure all the characters you are trying to use the the macro on is set to Advantage Toggle as their roll mode. That is the exact error message you get when the roll mode is not set that way. This is settable on the character sheet on the first page under the gear. In the rightmost settings column near the top is an item for "Roll Queries". This must be "Advantage Toggle" for any of the PCMHelper macros that make attacks to work. As additional information, the PCA- replacements are generated by this line in the macro: --replacepcattack|@{selected|character_id}|?{Select attack to use|@{selected|attacklist}} the replacepcattack tag tells PowerCard to create replacement variables for all of the associated properties of the selected attack. They are pulled from the properties of the repeating attack action on the character sheet, and only exist as long as the card is being processed. The "attacklist" property is generated any time the list of attacks on the charactersheet changes. I'll be creating a new thread this weekend for PowerCard sharing (I'll probably also create a repository on my website, but I think most people will come looking here first). I'll share anything I have that is useful :) [ After re-reading the posting guidelines, I'll need to check to see if this is allowed before I create it (specifically the one-thread-per-script rule)] I had a standing Roll20 game, but most of our gaming was in-person until the lockdowns... now we're on here all the time :)
Hi, I'm using the Roll20 Pathfinder character sheet and am trying to, on a successful ranged touch attack, alter the @{target|strength_bonus} by the amount rolled.&nbsp; Here's what I've got so far but not sure how to structure the last line to make it happen, if it is in fact possible. !power {{ &nbsp;--name|Ray of Enfeeblement &nbsp;--leftsub|Ranged Spell Attack &nbsp;--rightsub|25' + 5' per level. &nbsp;--Attack:|[[ [$Atk] 1d20 + @{selected|dexterity_mod} ]] vs @{target|character_name}'s Touch AC of **@{target|AC_touch}** &nbsp;--?? $Atk &gt;= @{target|AC_touch} ?? Damage:|[[ [$Drain] 1d6+1 ]] &nbsp;--vfx_opt|@{selected|token_id} @{target|token_id} beam-magic &nbsp;--?? $Atk &gt;= @{target|AC_touch} ?? Weakened:|@{target|character_name}'s strength is reduced by [^Drain] points. &nbsp;--?? $Atk &gt;= @{target|AC_touch} ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|strong &nbsp;--?? $Atk &gt;=@{target|AC_touch} ?? @{target|strength_bonus}-[^Drain] }}