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

Enforcing a minimum of 0 in roll templates?

Okay, so Google didn't help me here, as the only thing I found (the kh1 formatting) got angry whenever something was negative. I'm assisting in making a Fire Emblem tabletop, and I'm trying to enforce a minimum of 0 in a roll to allow for numbers to be added to the end result within the template (as well as look less sloppy). &{template:default} {{name=Attack}} {{damage=[[(@{Str}+@{Might}-@{target|Def}+?{Triangle?|No,0|Win,1|Lose,-1})+?{Modifiers|0}]]}} {{hit=[[@{Acc}+@{Hit}-@{target|Eva}+?{Triangle?|No,0|Win,15|Lose,-15}]]}} {{crit=[[@{Crt}+@{WCrt}-@{target|Lck}]]}} {{speed=[[@{Spd}+@{EffSpd}]] vs [[@{target|Spd}]]}} To split up the relevant parts into a readable format: {{damage=[[     (@{Strength} + @{Might}) - @{target|Defense} + ?{Weapon Triangle? | Neutral, 0 | Advantage, 1 | Disadvantage, -1}) + ?{Modifiers | 0} ]]}} {{hit=[[     @{Accuracy} + @{Hit} - @{target|Evasion} + ?{Weapon Triangle? | Neutral, 0 | Advantage, 15 | Disadvantage, -15} ]]}} {{crit=[[     @{Crit} + @{WeaponCrit} - @{target|Luck} ]]}} I want each of these to enforce a minimum of 0. In particular, this part:     (@{Strength} + @{Might}) - @{target|Defense} + ?{Weapon Triangle? | Neutral, 0 | Advantage, 1 | Disadvantage, -1}) so that I can add the modifiers to 0 instead of a negative number. How would I do this?
Hey, Leafia B. I want each of these to enforce a minimum of 0. In particular, this part:     (@{Strength} + @{Might}) - @{target|Defense} + ?{Weapon Triangle? | Neutral, 0 | Advantage, 1 | Disadvantage, -1}) so that I can add the modifiers to 0 instead of a negative number. How would I do this? As long as we're just dealing with numbers here (and not dice), you could insert all of that right into {here, 0}kh1 (as per 17.5.1 Keep / Drop khN/klN/dhN/dlN ). On a different note, I notice that you're attempting to get different values out of two Roll Queries with the same name (?{Triangle?}) twice. However, when you Submit a Roll Query (i.e. assign it a value), every following Roll Query that shares the same name is parsed to the value of the first. e.g. If you Submit the initial value of ?{Save|STR|DEX|CON}, all future Roll Queries named Save will be parsed to STR, regardless of the contents of the dropdown fields. That said, I recommend replacing "?{Triangle?|No,0|Win,15|Lose,-15}" with "?{Triangle?}*15".
Silvyre said: Hey, Leafia B. I want each of these to enforce a minimum of 0. In particular, this part:     (@{Strength} + @{Might}) - @{target|Defense} + ?{Weapon Triangle? | Neutral, 0 | Advantage, 1 | Disadvantage, -1}) so that I can add the modifiers to 0 instead of a negative number. How would I do this? As long as we're just dealing with numbers here (and not dice), you could insert all of that right into {here, 0}kh1 (as per 17.5.1 Keep / Drop khN/klN/dhN/dlN ). Huh. That does work. I must have been mistyping it somehow in my testing. On a different note, I notice that you're attempting to get different values out of two Roll Queries with the same name (?{Triangle?}) twice. However, when you Submit a Roll Query (i.e. assign it a value), every following Roll Query that shares the same name is parsed to the value of the first. e.g. If you Submit the initial value of ?{Save|STR|DEX|CON}, all future Roll Queries named Save will be parsed to STR, regardless of the contents of the dropdown fields. That said, I recommend replacing "?{Triangle?|No,0|Win,15|Lose,-15}" with "?{Triangle?}*15". Ooh, thanks. I knew it parsed the same answer after only asking once, I didn't know it KEPT the answer.