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

Query (in query (in query))

1508184282

Edited 1508184680
I'm working on an initiative system based on Mike Mearl's ideas on different actions having different initiative dice. The first query is Action, which allows the player to choose between Attack, Cast Spell, or Other. The second query is Move, where the player states if he will move or not. The third is Bonus Action, where the player states if he will use a Bonus Action or not. I've gotten the queries to work, but I'm having two problems which I feel are related. Sending the result to the initiative tracker ( &{tracker} ) Using any form of /me or /desc as outcome. This is the code for the Attack option where I've tried adding the tracker: Would greatly appreciate some input, thanks!
1508192528

Edited 1508192589
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
So, I think you could actually simplify this by pulling the move and bonus action queries out of the nesting, since it looks like the additional options just add additional dice: [[?{Standard Action|Melee Attack,1d8|Ranged Attack,1d4|Cast a Spell,1d10|No Action,0}+?{Movement|Yes,1d6|No,0}+?{Bonus Action|Melee Attack,1d8|Ranged Attack,1d4|Cast a Spell,1d10|No Action,0|Movement,1d6} &{tracker}]] I just did a quick scan through of the unearthed arcana that this was in, so I may have the dice wrong, but should give you the guide to getting it to work. EDIT: Added the &{tracker} syntax.
Thanks for the reply, Scott! A reason (I think) I need the nested version is because I'd like to add a description showing the player's choice (problem 2). This way if a player forgets what action he chose he can scroll back up and check the chat. Your code looks elegant and way easier to handle, would there be a way to make that summarize the player's choice and show it as a result along with the number? If not I don't see any other way to go than down the nested rabbit hole.
1508194422
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I can see a couple possibilities, let me do some testing and get back to you.
It's not the prettiest fix but after the rolls you could put [<desc>] so when you highlight your mouse over the roll it will tell you which actions were selected. For example 1d8[Melee Action] and 1d4[Ranged Action] and so on.
1508198068
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, Mattias, I've got something for you: /em @{selected|token_name} took the following actions: /em Standard Action: ?{Standard Action|Melee Attack, Melee Attack [[1d8 &{tracker}]]|Ranged Attack,Ranged Attack [[1d4 &{tracker}]]|Cast a Spell,Cast a Spell [[1d10 &{tracker}]]|No Action, Nothing [[0 &{tracker}]]} /em ?{Movement|No,Did Not Move [[0 &{tracker:+}]]|Yes,Moved [[1d6 &{tracker:+}]]} /em Bonus Action: ?{Bonus Action|Melee Attack,Melee Attack [[1d8 &{tracker:+}]]|Ranged Attack,Ranged Attack [[1d4 &{tracker:+}]]|Cast a Spell,Cast a Spell [[1d10 &{tracker:+}]]|No Action,No Action [[0 &{tracker:+}]]|Movement,Moved [[1d6 &{tracker:+}]]} You could pretty the output up some more by putting it all in a roll template, and I'll be the first to admit that I may have missed some syntax.
1508198157
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I would also highly recommend making the above as a character ability instead of a global macro as the global macro editor will eat the html codes if you open it and resave it.
1508199462

Edited 1508199590
That's gold, Scott. I like the adding to the tracker for every additional action. Thank you kindly! Now we'll be able to try the new initiative next session. And thanks for the input Kyle, luckily there was a pretty fix after all.
1508199842
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Happy Rolling :)
You can also avoid using HTML entities by factoring out the &{tracker} roll option, e.g. /em @{selected|token_name} took the following actions: /em Standard Action: ?{Standard Action|Melee Attack, Melee Attack [[1d8|Ranged Attack, Ranged Attack [[1d4|Cast a Spell, Cast a Spell [[1d10|No Action, Nothing [[0} &{tracker}]] /em ?{Movement|No, Did Not Move [[0|Yes, Moved [[1d6} &{tracker:+}]] /em Bonus Action: ?{Bonus Action|Melee Attack, Melee Attack [[1d8|Ranged Attack, Ranged Attack [[1d4|Cast a Spell, Cast a Spell [[1d10|No Action, No Action [[0|Movement, Moved [[1d6} &{tracker:+}]]
1508253041
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, good call Silvyre.