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
This post has been closed. You can still view previous posts, but you can't post any new replies.

NESTED INLINE ROLLS or BETTER HELPER FUNCTIONS

March 12 (10 years ago)

Edited March 12 (10 years ago)
Falcon
Pro
Sheet Author
To be able to have an inline roll and then another inline roll inside it would be great in many circumstances - most notably in the 1D20CS or 1D20CF functionality.

For example I could do [[1D20CS>[[@{Crit}+@{Keen}]]]]

it would simply calculate the first inline then calculate the next inline and so forth.

OR you could have CS and CF take formulas so we can really use those functionalities.
March 12 (10 years ago)
Diana P
Pro
Sheet Author
Definately would like nested inline rolls. That would help with calculations for spells and other things as well!
March 13 (10 years ago)

Edited March 13 (10 years ago)
vÍnce
Pro
Sheet Author
I just used my spare vote last night... damn you Black Falcon. Damn you.

Great idea.
March 13 (10 years ago)
Falcon
Pro
Sheet Author
LOL - I used my last vote to post it!!!
I think this would be amazing. Even just 1 level of nesting would allow for some intriguing ability to consolidate macros. Like for example, being able to use a ?{} markup inside of a @{} markup to select a roll you want to make... hmm that was surprisingly vague. Let me give an example:

Say for example the following is true:
you have an attribute @{Longsword} with a value of "2d6" for damage and @{Longsword|Max} with a value of "+ 1" for its enhancement
you have an attribute @{Mace} with a value of "1d8" for damage and @{Mace|Max} with a value of "+ 3" for its enhancement
you have an ability %{Attack} which rolls the following:
Attack [[1d20 + @{Selected|[[?{Weapon}]]|Max}]]

[[@{Selected|[[?{Weapon}]]}|Max]] is used in this example to bring up the roll query box where you would type in Longsword and it would then return a completed roll of 1d20+1 (the d20 roll and the weapon's +1 enhancement bonus). Where as if you type in Mace it would return a completed roll of 1d20+3 (the d20 roll and the weapon's enhancement bonus). Allowing you to attack with any of your weapons by simply pressing your token action button [Attack]. Of course there are a great many other applications of doing the same sort of nesting and this is just a very simplistic example. With more complex roll parsing you could very easily set up your macro to ask you which weapon you're attacking with, whether you're applying a feat or ability to it, and so on.

This would allow not-so-clever dm's like myself to create 1 touch macros for their newer players so they can focus more on performing their actions and less on double checking their character sheets. And, likely dm's far more clever than myself could probably pull off minor miracles I couldn't even imagine with something as simple as a single level of nesting of inline rolls. Or even just the ability to nest an ability/attribute/query inside of another ability/attribute/query.

Well I typed more than I had intended to, I think my inner salesman came out there for a moment... excuse me while I go put that FoP back in his cage to play music like the good little minstrel I am retraining him into.

This wishlist item has my vote... if that wasn't obvious already!
March 13 (10 years ago)
Falcon
Pro
Sheet Author
I couldn't agree with you more - what is even more cool is if we could ?{Weapon} to instead be a drop down box so the players couldn't type the wrong thing in like Longsord and then crash the macro...
I couldn't agree more! By the way I posted a work around for your specific problem elsewhere on the patchnotes place.
March 13 (10 years ago)
Falcon
Pro
Sheet Author
Yeah - I responded!! LOL :)
This would be immensely helpful for creating some more complicated macros.
March 13 (10 years ago)
The lack of nesting makes handling complex macros involving dice pools a living hell. The order of operations is wonky and since parentheses don't override everything (like forcing one dice roll to go before another dice roll) this is necessary for handling more complex systems.

On a related note, temporary macro variables. Being able to refer to the same roll several times in a single macro would be pretty handy.
March 13 (10 years ago)
Falcon
Pro
Sheet Author
Helmic - Totally agree. I have been asking for Macro variables for quite a while as well.
March 17 (10 years ago)
Roger A.
Sheet Author
I would love this so much.
April 08 (10 years ago)
Riley D.
Roll20 Team

Black Falcon said:

Helmic - Totally agree. I have been asking for Macro variables for quite a while as well.

What's an example of this that you want to see? Like, assume you could assign the overall total result of an inline roll to a temporary name, and then you could re-use that name in the same roll command (after that nested roll has been processed). What's a real-world example where that would be useful I can use as a test-case?
April 08 (10 years ago)

Edited April 08 (10 years ago)
Falcon
Pro
Sheet Author
Riley,

Here is an example of a real test case:
Macro:
To hit = [[D20]]
@{ToHit_Modifiers} =[[@{STRMOD}+@{magicweapon}+@{other attributes}+?{Modifiers}]]
{{&default}}{{Attack=[[$To hit+@{ToHit_Modifiers}]]}}

This is a simple example that would clean up the result so that it wouldn't have to show all the attributes (which is really messy on the Pathfinder and 5e sheets) that make up "to hit". You could also do this if we had some type of order of operations using nested inlines.

The real power of the macro variables though is putting an attack result or damage result in a temporary name so that you can make additional modifications to it.In some games you would like to take an attack roll and subtract it from the result roll. But you STILL want to display the attack roll. Here is an example:
attack = [[D100+?{Modifiers}]]
Result = ?{score needed} - attack
Damage = D10 + Result

@{{default}}{{Attack Roll=[[attack]]}}{{Damage=Damage}}

OR
Damage = [[1D10+?{STRMOD}+?{other modifiers}]]
Critical Damage = [[Damage * 2]]

Then you can use the CS helper command but don't have to re-roll damage, you can just multiple the existing damage.

Give me a few hours and I can think of some additional ones. These were just off the top of my head.

April 08 (10 years ago)
Falcon
Pro
Sheet Author
Just thought of this. It would also cure my other issue which is having a variable after the CS helper function. For example:

$critical_chance = [[20-@{keen}-@{weaponthreat}]]

Attack:
[[1D20cs>$critical_chance]]

You could kill 2 birds with one stone, so to speak. Let me pull up my character sheets and think of others...
April 08 (10 years ago)
Falcon
Pro
Sheet Author
This is where it all started. In my Star Frontiers game, I was using a multiple success based on one roll. Since I couldn't keep the roll, I couldn't really do it. What I wanted to do was:

attack = [[1D100cs>05cf<95]]
{{Minor Success}}
attack<(@{success_chance}*.50)
{{/Minor Success}}
{{Major Success}}
attack<(@{Success_chance}*.20)
{{/Major Success}

You get the idea. I can take result of the attack roll and apply it to multiple tests.

Then the helper functions came up and the ability to clean up the attributes when rolling, it seemed more and more relevant. As long as the number could stay around long enough to check successes use it for helper functions in roll templates and Power Cards, it would be immensely helpful.

Rilley - is this helpful or do you want more examples?


April 08 (10 years ago)

Riley D. said:

Black Falcon said:

Helmic - Totally agree. I have been asking for Macro variables for quite a while as well.

What's an example of this that you want to see? Like, assume you could assign the overall total result of an inline roll to a temporary name, and then you could re-use that name in the same roll command (after that nested roll has been processed). What's a real-world example where that would be useful I can use as a test-case?
Right now, I'm using an API script to accomplish this. This is the syntax I'm using:

[code][[20-3d6]]{attack} attack, [[6d6]]{[!attack]} damage[/code]

20-3d6 is rolled, then [[20-3d6]]{attack} and all instances of [!attack] are substituted with the result. This means the damage roll then looks like [[6d6]]{10}, which is ran through Brian's reroll script (modified to add togetther rather than list all results) to roll 6d6+6d6+6d6+6d6+6d6+6d6+6d6+6d6+6d6+6d6. All of this is necessary to handle a basic combat roll in a modern GURPS setting with automatic firearms.

Other uses include listing showing all rolls that go into a calculation in a neater format, like in a roll template. Any system where you'll roll to see how much to roll (number of hits then damage, how much a bonus you just got to your dice pool, general Shadowrun nonsense) benefits.

For dice pools, this is currently the ONLY way they'll calculate correctly because Roll20's wonky order of operations can't be overridden except by inline rolls and the API - /r [[complicated dice roll]]d6>5 might work, but that prevents it from being used in a roll template or using too many levels of nesting.
April 09 (10 years ago)
Falcon
Pro
Sheet Author
This is live and working in DEV!!! Awesome
April 27 (10 years ago)
Stephen Koontz
Forum Champion
Marketplace Creator
Sheet Author
API Scripter
Compendium Curator
This is now on live, with some polishing touches coming in the next couple weeks.