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

Fighting Style Macro - double d6 rule

Hi Everyone I'm trying to work on a Macro so I don't always have to add numbers by hand and could just change the Macro if my Weapon changes. Its in 'Das Schwarze Auge 5 Official'. My Character is using a fighting style, where I roll 2d6 for damage. If both dice show the same number they are added together, if they are not the same, take the higher number. It's an unarmed style where I chose between unarmed and e.g. Brass Knuckles as a dropdown (different damage bonus) I tried with AI to get the Macro I need. The dropdown and damage bonus seems to work, but the if/then doesn't seem to work and it just spits out the second part of the macro. for your understanding, there are some German words in there. Schaden=damage, Pasch-Regel=double-Rule, Waffenlos=Unarmed, Schlagring=Brass Knuckles This is the Macro: &{template:default} {{name=Schaden (Pasch-Regel)}}  {{Waffe=?{Waffe|Waffenlos,0|Schlagring,2}}} {{TP-Bonus=[[?{Waffe|Waffenlos,0|Schlagring,2}]]}} {{W1=[[1d6]]}} {{W2=[[1d6]]}} {{TP (Pasch-Regel)=[[ { $[[1]], $[[2]] }kh1 + floor(1/(abs($[[1]]-$[[2]])+1)) * { $[[1]], $[[2]] }kl1 ]]}} {{Gesamt-TP=[[ $[[0]] + $[[3]] ]]}} this is what it spits out: Schaden (Pasch-Regel) {{Waffe=0}} {{TP-Bonus= 0 }} {{W1= 2 }} {{W2= 1 }} {{TP (Pasch-Regel)=[[ { $[[1]], $[[2]] }kh1 + floor(1/(abs($[[1]]-$[[2]])+1)) * { $[[1]], $[[2]] }kl1 ]]}} {{Gesamt-TP=[[ $[[0]] + $[[3]] ]]}} Is there anyone who can help me with my bad marching? Would be highly appreciated. Best Regards Thiak
1772463646
timmaugh
Pro
API Scripter
The basic issue you're running into, regarding your roll equation, is that you can't reuse rolls outside of the roll stack where they are generated... that is, you can't use the rolls for a total in one place, then use them for a keep-high mechanic somewhere else. ...unless you have some of RainbowEncoder's magic that lets you, by some parser chicanery, get a little more crazy with the Cheez Whiz. I'll ping them to see if they have a minute to offer some help. The other thing you have going is that your template statement can't break across lines *between* template parts. The text you offered as the "what it spits out" is the subsequent lines AFTER your initial template tag is consumed. The tag is consumed separate from the template parts because they are on another line and not considered part of the same message, as far as Roll20 is concerned. To fix that, you can put everything on the same line, or you can break *just after* the opening double brace of a template part: &{template:default} {{ name=Proof of Concept}} {{ Field=Value}} {{ Field2=Value 2}} I personally don't like that choice with the default template because of the new lines it inserts into the output (you can see an example of this in the screenshots, below). I prefer to have the template command all on one line so that the output is tighter, but YMMV. Also, one other thing to point out is that after the first appearance of a query,  you don't have to include all of the options beyond the query prompt. So when you have your Waffe query, the first time you would include all of the options: &{template:default} {{name=Schaden (Pasch-Regel)}} {{ Waffe=?{Waffe|Waffenlos,0|Schlagring,2}}} ...but the next time, you only need the prompt. Based on the prompt, Roll20 will sub in the choice you made previously: &{template:default} {{name=Schaden (Pasch-Regel)}} {{ Waffe=?{Waffe|Waffenlos,0|Schlagring,2}}} {{ TP-Bonus=[[?{Waffe}]] }} {{ If Scripts are Available If the owner of the game is a Pro or Elite level of member, they have the ability to add scripts to games. In that case, if they were to add the MetascriptToolbox, then the following command will work (screenshots follow). Here is the command as multiple lines: !&{template:default} {{name=Schaden (Pasch-Regel)}} {&r} [[?{Waffe|Waffenlos,0|Schlagring,2}]] + {&r}[[ {[[1d6]],[[1d6]]}kh1 ]] + {$[[1]], $[[2]]}mt * $[[1]]{&/r}{&/r} {{ Waffe={&cr}?{Waffe}}} {{ TP-Bonus={&cr}$[[0]]}} {{ W1={&cr}$[[1]]}} {{ W2={&cr}$[[2]]}} {{ TP (Pasch-Regel)={&cr}$[[4]]}} {{ Gesamt-TP={&cr}$[[5]]}} {&simple} ...and again as a single line: !&{template:default} {{name=Schaden (Pasch-Regel)}} {&r} [[?{Waffe|Waffenlos,0|Schlagring,2}]] + {&r}[[ {[[1d6]],[[1d6]]}kh1 ]] + {$[[1]], $[[2]]}mt * $[[1]]{&/r}{&/r} {{Waffe=?{Waffe}}} {{TP-Bonus=$[[0]]}} {{W1=$[[1]]}} {{W2=$[[2]]}} {{TP (Pasch-Regel)=$[[4]]}} {{Gesamt-TP=$[[5]]}} {&simple} Here are sample outputs from the single-line version, showing a "non-matching, keep-high" output, then showing a "rolls match, add together" output: And more sample outputs, this time picking "Schlagring" from the query and getting the +2 bonus at the end. First with no matching dice, then with matching dice: And finally, just to show the output of having the template parts break across multiple command lines, here's what that looks like. This is a similar output of "no match" in the first output, then "match" in the second... all after selecting "Waffelos" from the query. I didn't bother generating similar output for the "Schlargring" choice because I just find the extra space in the output annoying (it's so big I can't get it in a single screenshot):
Looks like my DM should get Pro or Elite, we already talked aboud sponsoring him :-) Thanks a lot for the answer, helps a lot. Cheers
It is achievable without scripts with some shenanigans &{template:default} {{name=Schaden (Pasch-Regel) }} {{Waffe TP-Bonus=[[?{Waffe|Waffenlos,0|Schlagring,2}]] }} {{W1=$[[1.computed]] }} {{W2=$[[2.computed]] }} {{TP (Pasch-Regel)=$[[6.computed]] }} {{Gesamt-TP=[[ [[ [[ 2*[[1+0.5*{2,10,20,100,200,1000,2000,10000,20000,100000,200000}<[[10**([[1d6]]-1) + 10**([[1d6]]-1)]] ]].0 /2 +1 ]] - 1 ]] + ?{Waffe} ]]}} 
Amazing, thanks a lot!