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

Power Card Question involving adding two damage variables together

I realize that there is a forum for Power Cards - somewhere but didn't see it.  When I try to create two damage variables and add them together for a total, they add to zero in the output. Does anyone see what is wrong or can anyone direct me to the correct forum to ask this question? !power {{  --name|One Quarterstaff hit w/ Shillelagh and True Strike!  --leftsub|  --rightsub|5 ft Range  --Attack:|[[ [$Atk] 0d0+30 ]] vs AC @{target|AC}  --?? $Atk >= @{target|AC} ?? Damage:|[[ [$Dmg1] (1d8cf<0cs>20[Weapon Damage]+@{selected|AbilityModifier}+?{Enter the number of critical rolls here|0}*8[Critical Max damage die] + ((@{selected|DS}))*1) )]] ``?{Damage type|Force|Bludgeoning}`` damage, PLUS [[ [$Dmg2] ( ((((@{selected|level} + 1) / 6 + 0.5)-1)d6cf<0cs>20 + ((@{selected|DS}))*1) )]] ``Radiant`` damage, for a ***total of [[ 0d0+ [^Dmg1] + [^Dmg2] ]] total damage!*** }} 
1698609586
Andrew R.
Pro
Sheet Author
PowerCards doesn’t have Variables like that, so you can’t use them in an inline roll like that.  ScriptCards has proper Variables like that. I recommend converting to ScriptCards as soon as possible. 
Hey Andrew R., Actually it does. See this piece of script:  --Attack:|[[ [$Atk] 0d0+30 ]] vs AC @{target|AC}  --?? $Atk >= @{target|AC} ?? Damage:|[[ [$Dmg1] (1d8cf<0cs>20[Weapon Damage]+@{selected|AbilityModifier}+?{Enter the number of critical rolls here|0}*8[Critical Max damage die] + ((@{selected|DS}))*1) )]] ``?{Damage type|Force|Bludgeoning}`` damage, PLUS [[ [$Dmg2] ( ((((@{selected|level} + 1) / 6 + 0.5)-1)d6cf<0cs>20 + ((@{selected|DS}))*1) )]] ``Radiant`` damage, for a ***total of [[ 0d0+ [^Dmg1] + [^Dmg2] ]] total damage!***
I am unable to help with your PowerCards issue since I've never used PowerCards unfortunately but I took a quick little stab at converting that to a ScriptCard if you are interested in ScriptCards [link to wiki]  at all. It can be made more concise and compact but I wanted to document some of the sections and I made some things like the attributes variables so that I could test. !scriptcard {{ --/|VARIABLES TO SET --&TargetACAttribute|AC --&DamageAbilityMod|AbilityModifier --&WhateverTheHellDSISAttribute|DS --&WeaponDamageDieSize|8 --&RadiantDamageDieSize|6 --/|ScriptCard settings use # and nominmaxhighlight is like the cf<0cs>20 flags used in the original --#title|One Quarterstaff hit w/ Shillelagh and True Strike! --#rightsub|5 ft Range --#nominmaxhighlight|1 --/|Set the source and target tokens --/|These are used by the [*S] and [*T] to reference attributes --#sourceToken|@{selected|token_id} --#targetToken|@{target|token_id} --/|The original had a static 30 for the attack roll so simulate that with a roll variable --=Atk|30 --/|Output the static Atk roll variable with the target's AC value --+Attack|[$Atk] vs AC [*T:[&TargetACAttribute]] --/|If the Atk variable is less than the target's AC jump to the end of the script and exit --?[$Atk] -lt [*T:[&TargetACAttribute]]|Done --/|If the Atk variable is higher present a button to query for the crit rolls and damage type like the original asks for --iAttack hit and we gather information about damage;Click to provide damage details|q;critrolls;Enter the number of critical rolls here|0||q;weapondmgtype;Damage type|Force|Bludgeoning --=CritDmg|[&WeaponDamageDieSize] * [&critrolls] --=WeaponDmg|1d[&WeaponDamageDieSize] [Weapon Damage] + [*S:[&DamageAbilityMod]] [MOD] + [$CritDmg] [CRIT] + [*S:[&WhateverTheHellDSISAttribute]] [DS] --/|Wasn't really sure about PowerCards math and all the + 1 / 6 + 0.5 - 1 stuff --/|So just kept the divide by 6 and round down for simplicity --=RadiantDice|[*S:level] \ 6 --=RadiantDmg|[$RadiantDice]d[&RadiantDamageDieSize] + [*S:[&WhateverTheHellDSISAttribute]] [DS] --=TotalDmg|[$WeaponDmg] + [$RadiantDmg] --:Display| --+|[$WeaponDmg] [&weapondmgtype] damage plus [$RadiantDmg] Radiant Damage for a [b]total of [$TotalDmg] total damaage![/b] --:Done| }} I wasn't one hundred percent sure about the output you wanted or what some of the PowerCards math actually did so it might need a couple tweaks to work just like you want. If the Atk is greater than the target's AC then it will send a button to prompt with your queries for damage type and crit rolls. The overall output looks like this:
Thank you Joshua N. SO MUCH! This will serve as a template so that I can learn Scriptcards. Thank you very much for your amazing work :))) Barry
I hope that this isn't off topic. Using Scriptcards are there equivalent functions to  --spell_slots|@{selected|character_id} and  --spell_list|@{selected|character_id} from Powercards?
That might be a question better off on its own or in the ScriptCards thread itself  link . Since I've not used PowerCards  So those aren't listed on the  ScriptCards wiki about coming from Powercards . I did take a look at the PowerCards source code and it ScriptCards does not have native functions for those. However, ScriptCards does have the ability to use  ScriptCard Libraries . Kurt J has some libraries already for D&D 5e  and  more system neutral functions . There are also examples in the  ScriptCard working example thread  to look at including  Spellbook example  that would include similar things to what those functions did. You can also write your own libraries for things, I can show a relatively simple example from one of my own libraries: --:Lib5eCasting_GetAvailableSpellSlots|CharacterID;MinimumSpellLevel;ArrayNameToSet   --~|array;define;[%3%]   --%SpellLvlLoop|[%2%];9;1     --?[*[%1%]:lvl[&SpellLvlLoop]_slots_total] -le 0|%!     --?[*[%1%]:lvl[&SpellLvlLoop]_slots_expended] -le 0|%     --~|array;add;[%3%];[&SpellLvlLoop]   --%| --<| That function will return a ScriptCard Array  of spell slots above a minimum spell level available for a character. Then in my ScriptCards, I can include that library and use that function. So while it seems that PowerCards had some 5e OGL specific functions included that ScriptCards did not directly port over, ScriptCards has a lot of examples and can be customized to provide that same functionality.
Thank you Joshua, This is a big help. I am finally starting to convert my Powercard macros to Scriptcard macros and I can see there is a bit of a learning curve that I have to go through. The Spellbook Scriptcard by Will M. solves my immediate problem.