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

Macros question again)

Hello devs and players. I have made many things in my game wich i realli like, but i have a problem now implementing xbows (crossbows) I want them to ignore armor. So my question is is there a module factor (i really bad remember math maybe it wasn't called module) So here is what i use in usual damage calculation Weapoon 1 is characters weapoon damage  BossArmor is boss resistance like *1,*0.5 or *1.5 etc Defence - Targets defence DMG = [[floor(@{weapoon1}@{target|Target1|BossArmor})-@{target|Target1|Defence}]] Now i want to give an armor reduction of 10, so i write DMG = [[floor(@{weapoon1}@{target|Target1|BossArmor})-(@{target|Target1|Defence}-10)]] It warks nice if target has 10 or more armor, but if target doesn't have armor (0 - Defence) it give extra 10 dmg and i want to just decrease armor, if target has 0 armor so dmg would't increase, is there a command like floor() or something to not let number in () become negative, so that (10-11) = (0, not -1)
1476457466
The Aaron
Roll20 Production Team
API Scripter
So, what you want is a minimum of 0 armor? Something like this should work: DMG = [[ {0d0,(floor(@{weapoon1}@{target|Target1|BossArmor})-10)d1}kh1 -(@{target|Target1|Defence})]] If you can be sure that @{weapoon1}@{target|Target1|BossArmor} will always be a number (no dice rolls involved, you can simplify to: DMG = [[ {0,(floor(@{weapoon1}@{target|Target1|BossArmor})-10)}kh1 -(@{target|Target1|Defence})]] or if you know that it will always have dice rolls, you can use: DMG = [[ {0d0,(floor(@{weapoon1}@{target|Target1|BossArmor})-10)}kh1 -(@{target|Target1|Defence})]] See: <a href="https://wiki.roll20.net/Dice_Reference#Drop.2FKeep" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Drop.2FKeep</a> See:&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Grouping_Ro" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Grouping_Ro</a>...
1476464414

Edited 1476465667
I want that armor reduction wouldn't effect damage Example: 1) I&nbsp;deal 1d10 dmg to a target wich has 10 armor and i have 10 armor reduction, so all 10 armor doesnt count and i deal 1d10 dmg 2) I deal 1d10 dmg to a target wich has 5 armor and i have 10 armor reduction, so 5 armor doest count and i deal 1d10 dmg (in my current attack if target has less armor than my armor reduction, armor reduction increses dealt dmg, so i get 1d10dmg+5dmg from armor reduction) So i want a formula to&nbsp;forbid negative numbers and if you get negative number it would become 0&nbsp; (10-70) = 0 not -60 Right now i am checking the formula you gave me *kh* should pick the higest roll, so it roles 2 dices 1) 0d0 that is always 0 2) any stat i input kh1 so if second part is negative, it picks 0 coz its higer. Am i correct? I am just questioning, coz i need to understand how it works) IF it is correct, thank you it is what i needed)
GM said: is there a command like&nbsp;floor() or something to not let number in () become negative, so that (10-11) = (0, not -1) Check out Aaron's links and then change (@{target|Target1|Defence}-10) to {@{target|Target1|Defence} - 10, 0}kh1
1476469636
The Aaron
Roll20 Production Team
API Scripter
Ah, good catch Silvyre, I misunderstood the original formula. =D
Ok so i made it look like this&nbsp;[[ {0d0,((@{target|Target1|Defence})-10)d1}kh1]]&nbsp; Seems it works like i need to, thank you.
1476473343

Edited 1476473435
Ok one more question there is a realli nice function /r 2d12&gt;3 and it says how many rolls it had there &gt;3 and i realli like it, but than i write more complicated macro it seems to lose function of &gt; can you please see it and give me a comment, how to fix it. This is my hit macro&nbsp; [[floor((1d40)+(1d(@{Agi}*2)))]] &gt; [[floor((1d40)+1d(@{target|Target1|Agi})+1d(@{target|Target1|Def}))]] i tried stupid things like&nbsp; /r 10d([[floor((1d40)+(1d(@{Agi}*2)))]] &gt; [[floor((1d40)+1d(@{target|Target1|Agi})+1d(@{target|Target1|Def}))]]) /r 10d([[floor((1d40)+(1d(@{Agi}*2)))]])&gt;([[floor((1d40)+1d(@{target|Target1|Agi})+1d(@{target|Target1|Def}))]]) etc. there are just skill, that should try to hit twice and i want to know, how many of them got the hit, that is my goal.
1476473771
Finderski
Pro
Sheet Author
Compendium Curator
Just to clarify, do you mean to multiply your Agi number by 2 to get the die type? &nbsp;What I mean is: [[floor((1d40)+(1d(@{Agi}*2)))]] If your Agi = 1, then it's rolling a d2 (or if it's 8, then it's rolling a d16, etc) and adding result of a d40 roll to it. Is that the intent?&nbsp;
1476478946

Edited 1476479219
Yes, it is. The atacker has 1d40 roll + 1d Agility*2 &nbsp;versus &nbsp;defenders 1d40 roll + 1d Agility*1 + 1d Defence I kinda made my own game stats skills magic and battle system it is such a pain in the ass and now i am rewriting skills, thats why have so many questions to make them better) coz old system was just roll &gt;11 to score a hit and it was boring) BTW i see you are a pro user, how is the dinamic light system is it nice? wanna test it but paying 5$ evry month is not wise for me coz we play 4 games / m now because of job(
1476481131

Edited 1476481252
The Aaron
Pro
API Scripter
It's wickedly awesome. :) Check out this thread:&nbsp;<a href="https://app.roll20.net/forum/post/3304165/dynamic-lighting-share-your-most-dynamic-setup/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/3304165/dynamic-lighting-share-your-most-dynamic-setup/?pagenum=1</a>
1476483513

Edited 1476483717
really nice need to test it a bit later now i need to finish skills)&nbsp; WOW definetly need to test this )