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

Compex macro for unreferenced game system

1615940155

Edited 1615940260
Sup everyone, I try to implement macro buttons on the character sheet to make the rolls easier. The problem is the current macro's options in Roll20 canot make it. The roll system is a bit similar to Earth Dawn. Carac = 2 -> Roll 1d4            Carac = 5-> Roll 1d10        Carac = 8 -> Roll 1d20 Carac = 3 -> Roll 1d6            Carac = 6 -> Roll 1d12       Carac = 8 -> Roll 1d20+1d4 Carac = 4 -> Roll 1d8            Carac = 7 -> Roll 2d8         Etc. (Carrac = 1 no dice) after that, you just add your skill level. For exemple, If you want to fire with a weapon : you have 4 in agility and 3 in firing ability. Roll 1d8 + 3 So my actual (in work) macro : /roll @{selected|AGILITY}d???+ @{selected|FireAbility} (I try with basics macros, i'll make the buttons later) Do you see my problem ? I need to find a way to take the carac value and roll a dice in function of that value. I have basis in JS, but not enough apprently to merge it with Roll20 API system. So, Thanks to any help
If I've understood the roll progression correctly this should work for all carac values starting from 1 for your example /roll [[floor((@{selected|AGILITY}-1)/7)]]d20 + [[{floor(@{selected|AGILITY}%7/2),1}kl1]]d[[@{selected|AGILITY}%7*2]] + [[2 - {@{selected|AGILITY}%7*2,2}kl1]]d8 + @{selected|FireAbility} Note there are four instances of @{selected|AGILITY} that would have to be replaced for other attributes when not using agility
1615951531
timmaugh
Roll20 Production Team
API Scripter
APILogic allows muling of variables on abilities which, among other things, provides a "static" table of options. (Rollable tables being a different thing -- where you can get a random result based on row weighting... a static table is more applicable to a known "given" case, like where you will know your starting figure.) So, if you had a Mule ability named "CaracMule" that had content like: 1=0d0 2=1d4 3=1d6 4=1d8 5=1d10 6=1d12 7=2d8 8=1d20 9=1d20+1d4 ...etc... You could mule that into your roll, defer the roll, and use a 'get' statement: !{& mule CaracMule}[\[\ get.@{selected|AGILITY}+@{selected|FireAbility} \]\] {&simple} ...or, with a little color text: !@{selected|token_name}, like a raging titan of righteous rolling, lets loose with a mighty {& mule CaracMule}[\[\ get.@{selected|AGILITY}+@{selected|FireAbility} \]\] {&simple} (Note: soon, muling will be its own script beside APILogic, but the syntax shouldn't change significantly... just the 'simple' that tells it to output to a flat chat message.)
Thank you it's work perfectly !