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

Taking the highest attribute?

Hello there! I'm using a sheet that isn't available on roll20 using the attributes+abilities system and I would need to take the highest roll between two different attributes to then add a flat number for the result, I tried by googling a bit and i found the k1 command to take the highest roll, but I tried all sort of syntax and it didn't seem to work, the macro would look like this for now: /roll @{Attr1}+@{Attr2}+15 I tried to do {@{Attr1}+{Attr2}k1}+15 but it doesn't work of course. Where do I need to write it? Thank you in advance!
1661049501

Edited 1661049675
Gauss
Forum Champion
Try this: {@{Attr1}, {Attr2}}k1+15 "+" becomes "," (without quotes) move the "}" inside the k1 not outside (without quotes)
1661049966

Edited 1661050068
Sadly, it doesn't seem to work EDIT: Oh, I didn't check the edited post, yes it does work now, thanks a ton!
1661050355
Gauss
Forum Champion
Maronn E. said: Sadly, it doesn't seem to work EDIT: Oh, I didn't check the edited post, yes it does work now, thanks a ton! Yeah, I didn't catch you had the } on the wrong side of k1 to begin with. Hence the edit. 
Sorry but, since we're here, if I had to cut the final result in half while also displaying it (Like a life drain skill that does damage and heals you an amount equal to half the damage dealt) how can I make it work? Thanks again.
1661052743
Gauss
Forum Champion
What is the entire macro so far?
/roll {@{Attr1}, @{Attr2}}k1+15 , nothing different, aside from some extra text (like some description)
1661054516
Gauss
Forum Champion
/roll {@{Attr1}, @{Attr2}}k1+15  /roll ( {@{Attr1}, @{Attr2}}k1+15)/2 OR you can inline one or both sections.  Maronn uses their life drain skill and gets a [[ {@{Attr1}, @{Attr2}}k1+15]] while healing [[ ( {@{Attr1}, @{Attr2}}k1+15)/2]]
While great, this solution has a problem on its own, I would need the first result to be halved not a different one to be calculated and cut in half, but I'm starting to believe that it's not possible without using variables.
1661068965

Edited 1661075526
Hi, not good at this, but the second part, would substituting the bit before /2 with $[[0]] work if you played with it - I can get it to output the result from one, but not get it to then divide by two, as I said, not my forte but maybe a nudge in a helpful direction? Belay the last, it appears you cannot perform any calculation to $[[0]], though I did find this worked (I just used 1d8 as my variable) Maronn heals   [[ [[1d8]] *0.5]], after causing $[[0]] damage
1661069958

Edited 1661070131
Gauss
Forum Champion
Maronn E. said: While great, this solution has a problem on its own, I would need the first result to be halved not a different one to be calculated and cut in half, but I'm starting to believe that it's not possible without using variables. Unless the first result is a variable in some way, calculating it out a second time will result in a correct answer. Unless I am missing something about your Attributes? Are they more complicated than a simple value?
Gauss said: Maronn E. said: While great, this solution has a problem on its own, I would need the first result to be halved not a different one to be calculated and cut in half, but I'm starting to believe that it's not possible without using variables. Unless the first result is a variable in some way, calculating it out a second time will result in a correct answer. Unless I am missing something about your Attributes? Are they more complicated than a simple value? Well no, the result is just the product of 2 attributes (two dice being rolled), then you add 15 to the highest roll, that's your damage. The healing is equivalent to half of that. example: 1d10, 1d8> 7, 3> 7+15=22 damage, then 11 would be the healing amount. If I do like you wrote it would be 7, 3 > 7+15=22 damage then you do an entire new roll to enstablish healing that is no way related to the 22 damage. Hope this clears up. Simon G. said: Hi, not good at this, but the second part, would substituting the bit before /2 with $[[0]] work if you played with it - I can get it to output the result from one, but not get it to then divide by two, as I said, not my forte but maybe a nudge in a helpful direction? Belay the last, it appears you cannot perform any calculation to $[[0]], though I did find this worked (I just used 1d8 as my variable) Maronn heals   [[ [[1d8]] *0.5]], after causing $[[0]] damage What does $[[0]] stand for? Also, thanks for your contribution
1661109723

Edited 1661110256
Gauss
Forum Champion
Ahhh ok, didn't know your attributes had dice in them. Short of using the API I do not think there is a way to have a total that is also part of another equation. 
1661110416

Edited 1661110528
Gauss
Forum Champion
Scratch that, I think I solved it for you:  George rolls [[floor([[{@{Attr1}+@{Attr2}}kh1+15]]/2)]] healing and $[[0]] damage! Healing must be in front, since you cannot do any math to the $[[0]].  $[[0]] is a reference to the first inline roll in the roll. 
Gauss said: Scratch that, I think I solved it for you:  George rolls [[floor([[{@{Attr1}+@{Attr2}}kh1+15]]/2)]] healing and $[[0]] damage! Healing must be in front, since you cannot do any math to the $[[0]].  $[[0]] is a reference to the first inline roll in the roll.  Oh I just tried it and it works flawlessly, thanks you a ton for your help sir, that's great!