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

Select a value based on the existence of another value

Here is the situation: I am going to be running a Savage Worlds based game. What I need is a macro that will roll 2 values and keep the highest, an attribute and a second die. HOWEVER, if a value for the attribute is not present, the attribute roll should default to 1d4-2 and the second die should default to 1d6-2. I have seen that you can specify a default value for an attribute, but I also need the default for the other die or at least apply -2 if the attribute doesn't have a value specified. Hopefully this makes sense...
Here is the basic roll as it is set up now (incorrectly): /r {@{Fighting}!,1d6!}k1 It needs to be something like: /r {@{Fighting|1d4-2}!,{1d6|1d6-2}!}k1 Maybe there's a way to do nesting?
1392972909
Alex L.
Pro
Sheet Author
Nick C. said: Here is the basic roll as it is set up now (incorrectly): /r {@{Fighting}!,1d6!}k1 It needs to be something like: /r {@{Fighting|1d4-2}!,{1d6|1d6-2}!}k1 Maybe there's a way to do nesting? This is a little to much for macros you would have to use the API.
I have made a workaround, using the Max value column for Attributes. Unskilled Attributes are d4-2 and d6-2, keeping the better of the 2 and both explode: Attribute: Fighting d4 Max: -2 /r {@{Fighting}! + @{CharacterName|Fighting|max},1d6! + @{CharacterName|Fighting|max}}k1 For skilled Attributes, set Max to 0, or whatever modifiers may apply.
1392993091

Edited 1392993369
You could just use a variable for an overall macro, add +?{Modifier|0} to the end of your macro. Youd have to add up your modifiers manually but this would allow you to have any additional modifiers for range, wounds or fatigue also subtracted from the total. I typically only use 1 macro for all my rolls in savage worlds. it has 2 variables in it, one for modifiers, and a second for the die size of whatever trait you are using. I also GM so having fewer buttons on the bar is somewhat important for me. /roll {1d?{trait_die|0}!,1d6!}k1 +?{Modifier|0}
I'm a programmer, and my mentality is to hide as much of the logic from the end users as possible, so I have set up buttons to make just about every roll players will need to roll during a game. We'll just have to apply situational modifiers as they come, since they aren't static. Now that I've figured out how to use the Max column for modifers, it is working out well.
Ah well in that case you should still be able shorten your macros a little by combining terms and you could also add in your wound and fatigue modifiers if you track those in the character sheets. That way you'd only need to adjust by situational modifiers. /r {@{Fighting}!,1d6!}k1 + @{CharacterName|Fighting|max}+{@{CharacterName|Wounds}-3}-{@{CharacterName|Fatigue} Specifics might change if you count up from 0 or down from 3/2.
I feel stupid now, thanks for pointing that out cursingbulldog! I was too busy focusing on how to get the modifier and not on how to best implement it. So now I'll use: /em makes a Fighting Roll of [[{@{Fighting}!,1d6!}k1 + @{CharacterName|Fighting|max} - @{Wounds} - @{Fatigue}]].