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

5E Cleric's Destroy Undead macro help

1689582373

Edited 1689582506
Hello, I'm trying to figure out a way to automate this macro line so I don't have to click the answer to a query. It spits out the CR threshold for destroy undead for a certain cleric level. "-1" is a placeholder for "you can't destroy undead yet". ?{Cleric level|1-4,-1|5-7, 1/2|8-10, 1|11-13, 2|14-16, 3|17-20, 4} Ideally it would be a series of if-then statements (If cleric level is between 5 and 7, then you can destroy CR 1/2 undead), which I'm aware can only be done with a pro account. But I'm hoping that someone out there has come up with a clever solution that doesn't require paying money. For reference, here is the whole macro right now. I have bolded the fragment I want replaced. --- &{template:traits} {{name=TURN OR DESTROY UNDEAD}} {{source=Class: Cleric}} {{description=Kolve screams "BURN IN THE RADIANCE OF ARKAN!" as he defiantly brandishes his holy symbol, which now shines with a harsh golden light.  Each undead within 30 feet of Kolve that can hear him must make a DC [[8+@{kolve|PB} [PB] +@{kolve|wisdom_mod} [WIS mod] ]] Wisdom saving throw. On a failed save, the creature is turned for 1 minute or until it takes damage. If a creature fails its saving throw and its challenge rating is less than or equal to [[ ?{Cleric level|1-4,-1|5-7, 1/2|8-10, 1|11-13, 2|14-16, 3|17-20, 4} ]], the creature is instantly destroyed.  }} --- Thanks
1689604149
Gauss
Forum Champion
Yes this can be done with a free account.  [[{@{level},0}>1*(-1) +  {@{level},0}>5*(1.5) +  {@{level},0}>8*(0.5) +  {@{level},0}>11*(1) +  {@{level},0}>14*(1) +  {@{level},0}>17*(1)]] This gives you: 1-4 = -1 5-7 = -1 + 1.5 = 0.5 8-10 = -1 + 1.5 + 0.5 = 1 11-13 = -1 + 1.5 + 0.5 + 1 = 2 14-16 = -1 + 1.5 + 0.5 + 1 + 1 = 3 17+  = -1 + 1.5 + 0.5 + 1 + 1 + 1 = 4
Wow, yeah. Thank you. It seems to work but I don't understand how. The output data doesn't actually show me what's happening. I get the additive properties but I guess I don't understand the scripting logic? Specifically this part -  {@{level},0} . What is happening there? It might just be a "shh... it just works" situation but I'd like to understand each piece so that I can use it for other applications in the future. Would you mind explaining that to me?
1689610965

Edited 1689611035
Gauss
Forum Champion
Basically I am doing a check to see if something is equal to a criteria. That acts as a 0 or 1 switch. There are two ways to do this, the Success/Failure  method and Grouped Rolls + the Success/Failure method.  Success/failure requires a dice roll, so I opted for Grouped Rolls which doesn't (saves me 2 characters). Success/failure in this example would look like: {X+1d0}>Z Grouped Rolls look like this: {X,Y} Grouped Rolls + Success/Failure look like this: {X,Y}>Z In this example: X = the @{level} Y = some number that will never be a success. In this case, 0.  Z = the success criteria (minimum level for it to be a success) Thus we have {@{level},0}>Z Next we multiply that by whatever number we want if it is a success.