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

Want to use modified Attack roll for Damage

This is probably a simple problem but I cannot find an answer for it.  My attack roll is D1000, I want to use that roll divided by 100, rounded down for the damage out put.  Basically using the 'one hundreds' die for damage.  Any help would be appreciated.  I've been reading the Wiki's trying to do this on my own... &{template:default} {{name=Melee-Attack}} @{selected|token_name}{{Attack = [[1d1000]] to hit}} {{Damage = [[floor(d1000/100)]]}}  {{Score= [[{@{selected|BODY}}+{@{selected|Strength}}]]}}
1592773580
Ziechael
Forum Champion
Sheet Author
API Scripter
Up until recently, it wasn't really possible but some clever soul discovered how to reuse rolls so the following should do what you want: &{template:default} {{name=Melee-Attack}} [[ floor([[1d1000]]/100) ]] {{Attack = $[[0]] to hit}} {{Damage = $[[1]]}} {{Score= [[ @{selected|BODY}+ @{selected|Strength} ]]}} Note how the actual roll isn't part of the template, this allows us to process the roll and THEN call the inline results as part of your actual output... in your example you had a call for the selected token name but not as part of any output so I'm not sure what you were going for there sorry... possibly as part of the title like below?: &{template:default} {{name= @{selected|token_name}'s Melee-Attack}} [[ floor([[1d1000]]/100) ]] {{Attack = $[[0]] to hit}} {{Damage = $[[1]]}} {{Score= [[ @{selected|BODY}+ @{selected|Strength} ]]}}
Thanks Ziechael so much, that is what I was going for.  Working on this for a project game.  I'm sure I will have more questions but I plan on reading and watching as many vod's as I can handle.  Again, thank you.
A further question if you don't mind my inexperience.  If the damage equals 0 after being divided I want it to show a 10 instead of 0.  Also I want to add a weapon modifier to the damage roll if possible.  I do have a Pro account if this has to use an API.  Here is what I have. &{template:default} {{name=@{selected|token_name}'s Melee-Attack}} [[ floor([[1d1000]]/100) ]] {{Attack = $[[0]] to hit}} {{Damage = $[[1]] +@{selected|knife}}} {{Score= [[ @{selected|BODY}+ @{selected|Strength}+{@{selected|CloseCombat}} ]]}}
1592779941
GiGs
Pro
Sheet Author
API Scripter
If you want to add a damage modifier, you have to add it to this part [[ floor([[1d1000]]/100) +@{selected|knife} ]] Due to technical limitations with roll20 dice roller, you cant do conditional effects, like "if damage is 0, make it 10" If you want to set a minimum of 10 (so any damage result below 10 becomes 10), you can do that: [[ {0d0+10, floor([[1d1000]]/100) +@{selected|knife}}kh1 ]]
I was wondering the same thing
The damage modifier worked perfectly, thank you very much.  The second part I'm starting to think I just need to roll a d10 and a d100.  If I can get them both to show on one line it would work. Attack roll 8   67 I want the d1000 when it rolls a 0XX to show a 10 for the hundreds digit, that's why I think i should look to a d10 & d100. Thoughts?
1592847917
GiGs
Pro
Sheet Author
API Scripter
Using separate d100 and d10 is much simpler. you cant get the 0 to be treated as a 10 any other way (without using the AP). The code is actually simpler: &{template:default} {{name=@{selected|token_name}'s Melee-Attack}} {{Attack = [[1d100]] to hit}} {{Damage = [[1d10+@{selected|knife}]] }} {{Score= [[ @{selected|BODY}+ @{selected|Strength}+{@{selected|CloseCombat}} ]]}}