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 .
×

Macro négative numbers

1584316462

Edited 1584316893
Hello I use this macro for my JDR and I would like my throw result to show 0 instead of -X. Here's what I have at the moment: !power {{ --bgcolor|#040659 --tokenid|@{selected|token_id} --emote|**@{selected|token_name}** Attaque  @{target|character_name} --target_list|@{target|token_id} --name|Ashura --leftsub|Action --rightsub|Cac --Attaque|[[ [$Atk] 1d100 + ?{bonus d'attaque ?| 0} ]] **C/ ACC** --?? $Atk.base >= 95 ?? !Cmiss:|**Echec Critique**. --?? $Atk.base <= 95 AND $Atk.total > @{target|accuracy} ?? !Miss:|Echec. --?? $Atk.total <= @{target||accuracy} AND $Atk.base > 5 AND $Atk.base < 95 ?? Dégâts :|[[ [$Dmg] 1d6 + @{selected|strength} + ?{bonus de dégâts ?| 0} -@{selected|armor} ]] Dommage Tranchant --?? $Atk <= @{target||accuracy} AND $Atk.base < 95 AND $Dmg >= 0 ?? alterbar1|_target|@{target||token_id} _bar|1 _amount|-[^Dmg] _show|all --?? $Atk.base <= 5 ?? Coup critique :|[[ [$CritDmg] {1d6 +@{selected|strength}}*2 + ?{bonus de dégâts ?| 0 } -@{selected|armor} ]] Dommage Tranchant --?? $Atk.base <= 5 AND $CritDmg >= 0 ??alterbar2|_target|@{target||token_id} _bar|1 _amount|-[^CritDmg] _show|all --?? $Atk <= @{target|accuracy} ?? vfx_opt|@{target|token_id} glow-blood }} Thank you for helping me figure out where my mistake is.
1584354698
Ziechael
Forum Champion
Sheet Author
API Scripter
To prevent values from being negative you can use the kh/kl syntax along with the roll grouping option : {-10,0}kh1 will resolve to 0, the -10 can naturally be a calculation but it is worth noting that the syntax expects the 'roll types' to be the same so if you have a roll in the left side you need a roll in the right side: {1d1-10,0d0}kh1