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

!Scripcard cantrip help request

I'm trying to script a macro that calculates the number of dice rolled based for the damage output, on the macro progression of 5e. It ALMOST works but outputs a zero. Anyone see what is wrong? Thank you! :) !scriptcard {{     --#whisper|gm     --/|VARIABLES TO SET     --&TargetACAttribute|AC     --&DamageAbilityMod|Wisdom_Mod     --&AutoApplyDamage|true     --&HPBar|1     --&WeaponDamageDieSize|d10     --&PoisonDamageDieSize|0     --/|ScriptCard settings use # and nominmaxhighlight is like the cf<0cs>20 flags used in the original and is coded as --#nominmaxhighlight|1     --#title|Club attack!     --#rightsub|          --/|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}     --=Atk|?{Attack|Standard,1d20|Advantage,2d20kh1|Standard,1d20|Disadvantage,2d20kl1} + [*S:[&DamageAbilityMod]] [Ability] + @{selected|pb} [PB]     --/|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 --/USE THIS LINE BELOW TO CHANGE NUMBER OF MAIN ATTACK DICE ROLLED:     --=WeaponDmg|((((@{selected|level} + 1) / 6 + 0.5) ))d[&WeaponDamageDieSize] --?[$Atk.Base] -eq 20|[   --=CritDmg|[&WeaponDamageDieSize] * [&critrolls]   --=WeaponDmg|[$WeaponDmg] + [*S:[&DamageAbilityMod]] + [$CritDmg] [CRIT] --]|      --/USE THIS LINE BELOW TO CHANGE NUMBER OF SECONDARY ATTACK DICE ROLLED:          --=PoisonDice|0     --=PoisonDmg|[$PoisonDice]d[&PoisonDamageDieSize]     --=TotalDmg|[$WeaponDmg] + [$PoisonDmg] --:Display| --+|[$WeaponDmg] [&weapondmgtype] [b]necrotic[/b] damage plus [$PoisonDmg] [b]secondary damage[/b] Damage for [b]total of [$TotalDmg] total damage![/b]  --?"[&AutoApplyDamage]" -ne "true"|Done --!t:[*T:t-id]|bar[&HPBar]_value:-=[$TotalDmg] --:Done| }}
Hey Barry. I see that you have both  --=PoisonDice|0 and  --&PoisonDamageDieSize|0 set to 0 and I don't see anywhere else you are trying to override or calculate those. Can you talk me through what you are trying to do there? You mention 5e and cantrips. Are you trying to do cantrip scaling like 1d8 from levels 1-4, 2d8 from 5 to 10, 3d8 11 to 16, and 4d8 17+? That sort of cantrip scaling?
Hello Joshua, I am using a template that was given to me for the cantrip scaling you referred to. The scaling uses the following line: --=WeaponDmg|((((@{selected|level} + 1) / 6 + 0.5) ))d[&WeaponDamageDieSize] which references the d10 variable at the top of the macro.   Thank you for your help!
Oh you are talking about the WeaponDmg line. Roll variables don't use parenthesis. ScriptCards doesn't honor parenthesis and processes roll variable statements left to right regardless of math order of operations stuff. So having parenthesis will just make things 0. This came up in  this thread previously . So that statement might work in other macros but ScriptCards would need a different way of processing all that. One option would be to split that calculation to its own line like so: --=NumWeaponDice|[*S:level] + 1 \ 6 + 0.5 {ROUND} --=WeaponDmg|[$NumWeaponDice]d[&WeaponDamageDieSize] ScriptCards wiki  has more information on Roll variable options like the \ which means integer division rounded down and math functions like {ROUND} used here.
Thank you Joshua :))