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

Need help with Macro template results (Traveller)

1680465837

Edited 1680466298
I want to create a macro or roll for the game Traveller, it has a system where any result over the success it calculated as the "Effect" of the roll. For example (succeeding on 6) rolling 2D6=7 will produce an Effect of 1. Rolling 2D6=12 would be an effect of 6 Is there any way I can display the effect in the result template.  I am building the whole sheet from scratch in HTML for the first time so any help would be greatly appreciated, if I have to code it in HTML using helper functions could that possibly work?   &{template:default} {{name=Test Attack}} {{attack=[[2D6+@{mod}]]}} {{effect=???????}}
1680468455

Edited 1680468578
Gauss
Forum Champion
I cannot help with the sheet, but if it is a macro issue I might be able to.  Note: there are extra tools for sheetworkers so there may be a solution there I am unaware of.  Is the "effect" is just a statement? Not part of another calculation?  If it is just a statement you can use a template.  [[1t[[[2d6]]Effect]]] Next you create 12 templates, one for each possible result.  1Effect 2Effect 3Effect and so on.  Each template has one result, name the result the name of the Effect.  For example:  7Effect would have the result of "1".  Note: if the 2d6 is actually 2d6+modifier then that will probably not work, unless the modifier has a top limit. It would increase the number of templates required significantly.  If the effects are used in a calculation then the options become more difficult, I would need information on each possible outcome. There may be a mathematical representation that would work. 
Hay thank you for replying much appreciated. yes the effect is simply a statement to represent the value of the Roll over the success difficulty.  I want the results to read like this  Attack roll total [ ] Effect of the roll []   I don't mind writing a load of temples if it works!  I think I am following you but struggling a bit Do you mean  [1t[[[2D6]]]effect]][[1effect]][[2effect]]... And so on?
1680478928
Gauss
Forum Champion
Ok, step 1:  Create a macro. Name it.  Put this as the macro:  [[1t[[[2d6]]Effect]]] Step 2:  Click on the Collection tab (top right corner of the game) Scroll down Add a Rollable Template Click on it to open it Name it (exactly): 1Effect Click "Add Item" Put the name as whatever the name of your effect is.  Click Save Changes Click Save Changes (the second window) Step 3: Repeat Step 2 but instead of 1Effect put 2Effect, 3Effect, etc. until you reach 12Effect.  You should now have 12 Rollable Templates named:  1Effect 2Effect 3Effect 4Effect 5Effect 6Effect 7Effect 8Effect 9Effect 10Effect 11Effect 12Effect Final step: Test the macro. 
1680479030

Edited 1680479043
Gauss
Forum Champion
How it works:  [[1t[[[2d6]]Effect]]] will roll the 2d6 first, lets say we got a 4.  That produces:  [[1t[4Effect]]] Now, the game rolls the table named "4Effect", and it spits out the result of that table.  Since "4Effect" only has one entry, the answer will always be that entry. Whatever you name you put in for that table. 
Wow that's actually genius and it did actually work! Thanks so much. I can definitely use this. Is there any way to show the results of the 2D6 also? Or is it not possible 
1680486524
Gauss
Forum Champion
David said: Wow that's actually genius and it did actually work! Thanks so much. I can definitely use this. Is there any way to show the results of the 2D6 also? Or is it not possible  Here you go: &{template:default} {{name=whatever you want}} [[1t[[[2d6]]Effect]]] {{Roll=$[[0]]}} {{Effect=$[[1]]}}
Thank you sir you are a wizard!