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 How To: Adding Strength and a Half to your Damage Macro

1381041732

Edited 1381043799
It took me a few hours to get this right, and I'm sure this has already been said sometime, but being new to the roll20 community and wanting to help other new players like myself, I decided to share this. Okay, so say you wanna add your strength and a half to an attack roll? Simple. Say, for example, you do something the following with a Half-Dragon's bite damage macro: /roll 1d6+@{Strength}*1.5 I'm gonna use the macro for a Half-Dragon's bite attack I made for an example: My dice roll landed on four, as you can see. Adding my Strength and a Half, the result should be 14. However, notice that I have a .5 beside my total when I use the above macro. While most people simply ignore this, there is a cure to get rid of that .5 in the total. How? Easy! Use the following formula instead: /roll 1d6 + floor(@{Strength}*1.5) Again, I'm using the macro for a Half-Dragon's bite attack I made for an example: As you can see, the .5 has disappeared. Why? The command floor(@{Strength}*1.5) rounds 7 to the nearest even number, rounded down. This means that, due to the Strength being 7, it is rounded down to 6. Half of 6 is 3, so 7 + 3 = 10. However, If you use the word ceil instead of floor in the above command, it rounds 7 to the nearest even number, rounded up. This means that 7 is rounded up to 8. Half of 8 is 4, so using this command, you will get 7 + 4 = 11. I hope this helps anyone having trouble with the formula for adding strength and a half. Also, you can use this with any of your other attributes, such as Dexterity, Constitution, whatever. It'll work the same way!
1381071617

Edited 1381071724
Lithl
Pro
Sheet Author
API Scripter
Necra M. said: As you can see, the .5 has disappeared. Why? The command floor(@{Strength}*1.5) rounds 7 to the nearest even number, rounded down. This means that, due to the Strength being 7, it is rounded down to 6. Half of 6 is 3, so 7 + 3 = 10. However, If you use the word ceil instead of floor in the above command, it rounds 7 to the nearest even number, rounded up. This means that 7 is rounded up to 8. Half of 8 is 4, so using this command, you will get 7 + 4 = 11. No. Floor simply rounds the entire result down (14.5 becomes 14) while ceil rounds the entire result up (14.5 becomes 15). It had nothing to do with the 7 or even/odd numbers. (Also: while floor and ceil are exceptionally useful parts of the dice rolling system, they are not directly connected to the API)
... *Facepaws*