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

Making a Macro with Multiple Options

I am a PTU player, and I'm trying to make a macro that will let me select what kind of Pokeball I'm using, roll my "attack" roll, and then let me select appropriate modifiers for that roll. I kind of suspect I'm going to have to make a separate macro for each Pokeball, but I was wondering if there was a way to take what I've made so far: /me throws a ?{Ball?:|Basic Ball|Great Ball|Ultra Ball|Master Ball|Safari Ball|Level Ball|Lure Ball|Moon Ball|Friend Ball|Love Ball|Heavy Ball|Fast Ball|Sport Ball|Premier Ball|Repeat Ball|Timer Ball|Nest Ball|Net Ball|Dive Ball|Luxury Ball} at ?{Target?} And have each selected option, say a Great Ball, autofill that ball's modifiers into the next part of the macro (so in the case of a Great Ball, it would be /roll 1d100-5-@{Kiran Markel|level}) Or would I have to have each Pokeball point to a different macro which would roll the To Hit and whatever the appropriate modifiers are for that ball?
1625645323
Ziechael
Forum Champion
Sheet Author
API Scripter
Here is one solution that might be a bit too much set up effort given the variety of balls in your game: <a href="https://app.roll20.net/forum/post/8838977/ptu-pokeball-selection-macro" rel="nofollow">https://app.roll20.net/forum/post/8838977/ptu-pokeball-selection-macro</a> There are also ways you can nest the rest of your output into the ball selection query to produce the overall look you want too, if the above doesn't cut it let me know and we'll take it to the next level ;)
1625694542

Edited 1625695018
I've figured out a solution... it's not the neatest, but it works. I would like to make a couple changes, though, if you wouldn't mind helping me. So, the Heavy Ball's modifier changes based on how heavy the Pokemon is.So right now, nested among all the different ball options when selecting an appropriate modifier, there are 7 different options for Heavy Balls, to get the right modifier. Is there a way to nest in among the answers so that it will ask me what the weight of the Pokemon is, and fill the correct modifier based on the answer (For example, Weight Class 2 is a -5, it would ask me the Weight Class, I would put it in, and it would apply the -5). Instead of me having 7 separate entries for Heavy Balls. Also, all ball modifiers are -x, except for Timer Balls, which if thrown on the first turn is +5. How can I get it to do that instead of subtracting? I'm not PLANNING on using a Timer Ball on the first turn, but I want to have it ready just in case.
1625730555
Ziechael
Forum Champion
Sheet Author
API Scripter
Anything and everything is possible if you are willing to submit to the madness ;) Could you share whatever you have now and I'm more than happy to see how we can add the requested functionality?
I can absolutely share what I have now, but I want to apologize, because it's absolutely hideous... /me throws a ?{Ball?:|Basic Ball|Great Ball|Ultra Ball|Master Ball|Safari Ball|Level Ball|Lure Ball|Moon Ball|Friend Ball|Love Ball|Heavy Ball|Fast Ball|Sport Ball|Premier Ball|Repeat Ball|Timer Ball|Nest Ball|Net Ball|Dive Ball|Luxury Ball|Heal Ball|Quick Ball|Dusk Ball|Cherish Ball|Park Ball} at ?{Target?} with a [[d20+2]] to hit and [[d100-?{Ball Modifier?:|Basic Ball,0|Great Ball,10|Ultra Ball,15|Master Ball,100|Safari Ball,0|Level Ball &gt;2,20|Level Ball &lt;2,0|Lure Ball without Food,0|Lure Ball with Food,20|Moon Ball and Stone,20|Moon Ball without Stone,0|Friend Ball,5|Love Ball with Opposite Gender,30|Love Ball without Modifier,0|Heavy Ball 1,0|Heavy Ball 2,5|Heavy Ball 3,10|Heavy Ball 4,15|Heavy Ball 5,20|Heavy Ball 6,25|Heavy Ball 7,30|Fast Ball Fast,20|Fast Ball Slow,0|Sport Ball,0|Premier Ball,0|Repeat Ball Repeat,20|Repeat Ball New,0|Timer Ball 2,0|Timer Ball 3,5|Timer Ball 4,10|Timer Ball 5,15|Timer Ball 6+,20|Nest Ball small,10|Nest Ball strong,0|Net Ball Bug/Water,20|Net Ball Other,0|Dive Ball Below,20|Dive Ball Above,0|Luxury Ball,5|Heal Ball,5|Quick Ball Immediate,20|Quick Ball 1,15|Quick Ball 2,10|Quick Ball 3+,0|Dusk Ball Dark,20|Dusk Ball Light,0|Cherish Ball,5|Park Ball,5}-?{Net?:|Yes,20|No,0}-?{Snare?:|Yes,10|No,0}-@{Kiran Markel|level}]] to catch
1625822869
Ziechael
Forum Champion
Sheet Author
API Scripter
Nothing hideous about that at all... you want hideous, I'll show you hideous ;) /me has just got to catch 'em all! &amp;{template:default} {{name=?{Ball|Basic,Basic Ball&amp;#125;&amp;#125; [[ 1d100 - 0|Great,Great Ball&amp;#125;&amp;#125; [[ 1d100 - 10|Ultra,Ultra Ball&amp;#125;&amp;#125; [[ 1d100 - 15|Master,Master Ball&amp;#125;&amp;#125; [[ 1d100 - 100|Safari,Safari Ball&amp;#125;&amp;#125; [[ 1d100 - 0|Level,?{Type&amp;#124;&gt;2&amp;#44;Level Ball (&gt;2)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;&lt;2&amp;#44;Level Ball (&lt;2)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Lure,?{Type&amp;#124;Without food&amp;#44;Lure Ball (without food)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#124;With food&amp;#44;Lure Ball (with food)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#125;|Moon,?{Type&amp;#124;Without stone&amp;#44;Moon Ball (without stone)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#124;With stone&amp;#44;Moon Ball (with stone)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#125;|Friend,Friend Ball&amp;#125;&amp;#125; [[ 1d100 - 5|Love,?{Type&amp;#124;Opposite gender&amp;#44;Love Ball (opposite gender)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 30&amp;#124;No modifier&amp;#44;Love Ball (no modifier)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Heavy,?{Type&amp;#124;1&amp;#44;Heavy Ball (1)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#124;2&amp;#44;Heavy Ball (2)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 5&amp;#124;3&amp;#44;Heavy Ball (3)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 10&amp;#124;4&amp;#44;Heavy Ball (4)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 15&amp;#124;5&amp;#44;Heavy Ball (5)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;6&amp;#44;Heavy Ball (6)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 25&amp;#124;7&amp;#44;Heavy Ball (7)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 30&amp;#125;|Fast,?{Type&amp;#124;Fast&amp;#44;Fast Ball (fast)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;Slow&amp;#44;Fast Ball (slow)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Sport,Sport Ball&amp;#125;&amp;#125; [[ 1d100 - 0|Premier,Premier Ball&amp;#125;&amp;#125; [[ 1d100 - 0|Repeat,?{Type&amp;#124;Repeat&amp;#44;Repeat Ball (repeat)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;New&amp;#44;Repeat Ball (new)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Timer,?{Turn&amp;#124;1&amp;#44;Timer Ball (1)&amp;amp;#125;&amp;amp;#125; [[ 1d100 + 5&amp;#124;2&amp;#44;Timer Ball (2)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#124;3&amp;#44;Timer Ball (3)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 5&amp;#124;4&amp;#44;Timer Ball (4)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 10&amp;#124;5&amp;#44;Timer Ball (5)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 15&amp;#124;6+&amp;#44;Timer Ball (6+)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#125;|Nest,?{Type&amp;#124;Small&amp;#44;Nest Ball (small)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 10&amp;#124;Strong&amp;#44;Nest Ball (strong)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Net,?{Type&amp;#124;Bug/Water&amp;#44;Net Ball (bug/water)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;Other&amp;#44;Net Ball (other)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Dive,?{Type&amp;#124;Below&amp;#44;Dive Ball (below)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;Above&amp;#44;Dive Ball (above)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Luxury,Luxury Ball&amp;#125;&amp;#125; [[ 1d100 - 5|Heal,Heal Ball&amp;#125;&amp;#125; [[ 1d100 - 5|Quick,?{Type&amp;#124;Immediate&amp;#44;Quick Ball (immediate)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;1&amp;#44;Quick Ball (1)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 15&amp;#124;2&amp;#44;Quick Ball (2)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 10&amp;#124;3+&amp;#44;Quick Ball (3+)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Dusk,?{Type&amp;#124;Dark&amp;#44;Dusk Ball (dark)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 20&amp;#124;Light&amp;#44;Dusk Ball (light)&amp;amp;#125;&amp;amp;#125; [[ 1d100 - 0&amp;#125;|Cherish,Cherish Ball&amp;#125;&amp;#125; [[ 1d100 - 5|Park,Park Ball&amp;#125;&amp;#125; [[ 1d100 - 5} - ?{Net|Yes,20|No,0} - ?{Snare|Yes,10|No,0} - @{Kiran Markel|level} ]] {{To hit vs @{target|token_name}= [[ 1d20+2 ]] }} {{To catch= $[[0]]}} I tidied up the list a bit to make it easier to select the base ball first and then ask for additional info if required (ie. heavy ball type). I also added the Timer Ball (1) option to add 5 to the roll as requested. Some additional features could be easily added if needed but since I don't know the system... is the catch roll acceptable as a negative or should it bottom out at 0? Are nets and snares regularly used or would it be preferential to default them to no?
Net and snare are commonly used by me specifically, because I am a Capture Specialist. Snare isn't even a thing for anyone else. So having them default to no would be fine. And yes, the capture roll can be negative. I like when it's negative.
1625878506
Oosh
Sheet Author
API Scripter
Ziechael said: Nothing hideous about that at all... you want hideous, I'll show you hideous ;) Pffft.... That's barely a 3.6 on the Ziechael scale.
1626021402
Ziechael
Forum Champion
Sheet Author
API Scripter
Kyozoku said: Net and snare are commonly used by me specifically, because I am a Capture Specialist. Snare isn't even a thing for anyone else. So having them default to no would be fine. And yes, the capture roll can be negative. I like when it's negative. In that case, you should be good to go, no further edits required :) Oosh said: Ziechael said: Nothing hideous about that at all... you want hideous, I'll show you hideous ;) Pffft.... That's barely a 3.6 on the Ziechael scale. To be fair, this one is only 'Green Hag' compared to some of the Cthuloid horrors I'm guilty of... still not pretty to look at though!
1626023077
GiGs
Pro
Sheet Author
API Scripter
Kyozoku said: I can absolutely share what I have now, but I want to apologize, because it's absolutely hideous... /me throws a ?{Ball?:|Basic Ball|Great Ball|Ultra Ball|Master Ball|Safari Ball|Level Ball|Lure Ball|Moon Ball|Friend Ball|Love Ball|Heavy Ball|Fast Ball|Sport Ball|Premier Ball|Repeat Ball|Timer Ball|Nest Ball|Net Ball|Dive Ball|Luxury Ball|Heal Ball|Quick Ball|Dusk Ball|Cherish Ball|Park Ball} at ?{Target?} with a [[d20+2]] to hit and [[d100-?{Ball Modifier?:|Basic Ball,0|Great Ball,10|Ultra Ball,15|Master Ball,100|Safari Ball,0|Level Ball &gt;2,20|Level Ball &lt;2,0|Lure Ball without Food,0|Lure Ball with Food,20|Moon Ball and Stone,20|Moon Ball without Stone,0|Friend Ball,5|Love Ball with Opposite Gender,30|Love Ball without Modifier,0|Heavy Ball 1,0|Heavy Ball 2,5|Heavy Ball 3,10|Heavy Ball 4,15|Heavy Ball 5,20|Heavy Ball 6,25|Heavy Ball 7,30|Fast Ball Fast,20|Fast Ball Slow,0|Sport Ball,0|Premier Ball,0|Repeat Ball Repeat,20|Repeat Ball New,0|Timer Ball 2,0|Timer Ball 3,5|Timer Ball 4,10|Timer Ball 5,15|Timer Ball 6+,20|Nest Ball small,10|Nest Ball strong,0|Net Ball Bug/Water,20|Net Ball Other,0|Dive Ball Below,20|Dive Ball Above,0|Luxury Ball,5|Heal Ball,5|Quick Ball Immediate,20|Quick Ball 1,15|Quick Ball 2,10|Quick Ball 3+,0|Dusk Ball Dark,20|Dusk Ball Light,0|Cherish Ball,5|Park Ball,5}-?{Net?:|Yes,20|No,0}-?{Snare?:|Yes,10|No,0}-@{Kiran Markel|level}]] to catch You can format it a little less hideously by adding a linebreak after each | (not those inside attributes), like /me throws a ?{Ball?:| Basic Ball| Great Ball| Ultra Ball| Master Ball| Safari Ball| Level Ball| Lure Ball| Moon Ball| Friend Ball| Love Ball| Heavy Ball| Fast Ball| Sport Ball| Premier Ball| Repeat Ball| Timer Ball| Nest Ball| Net Ball| Dive Ball| Luxury Ball| Heal Ball| Quick Ball| Dusk Ball| Cherish Ball| Park Ball} at ?{Target?} with a [[d20+2]] to hit and [[d100-?{Ball Modifier?:| Basic Ball,0| Great Ball,10| Ultra Ball,15| Master Ball,100| Safari Ball,0| Level Ball &gt;2,20| Level Ball &lt;2,0| Lure Ball without Food,0| Lure Ball with Food,20| Moon Ball and Stone,20| Moon Ball without Stone,0| Friend Ball,5| Love Ball with Opposite Gender,30| Love Ball without Modifier,0| Heavy Ball 1,0| Heavy Ball 2,5| Heavy Ball 3,10| Heavy Ball 4,15| Heavy Ball 5,20| Heavy Ball 6,25| Heavy Ball 7,30| Fast Ball Fast,20| Fast Ball Slow,0| Sport Ball,0| Premier Ball,0| Repeat Ball Repeat,20| Repeat Ball New,0| Timer Ball 2,0| Timer Ball 3,5| Timer Ball 4,10| Timer Ball 5,15| Timer Ball 6+,20| Nest Ball small,10| Nest Ball strong,0| Net Ball Bug/Water,20| Net Ball Other,0| Dive Ball Below,20| Dive Ball Above,0| Luxury Ball,5| Heal Ball,5| Quick Ball Immediate,20| Quick Ball 1,15| Quick Ball 2,10| Quick Ball 3+,0| Dusk Ball Dark,20| Dusk Ball Light,0| Cherish Ball,5| Park Ball,5}-?{Net?:| Yes,20| No,0}-?{Snare?:| Yes,10| No,0}-@{Kiran Markel|level}]] to catch The shorter queries at the end might be left unchanged. Also since you have the a query for the same thing twice, it can be handy to know how to extend queries so you can do just one query. But since nesting queries is tricky, it's best to rearrange it a bit. How are the modifiers used? Do they add to the attack roll?
Okay, I tried doing it myself, but every attempt to do this myself has resulted in a broken macro. How would I modify the d20 roll so that it queried if you have Tools of the Trade (+2 if yes, +0 if no) and if you used AP (+1 if yes, +0 if no)? I want to make this usable for my whole group, but I'm the only one who gets that +2, and the AP is available to everyone as a consumable resource if they want to use it. So if I make it query these two modifiers, it makes it usable for everyone, not just me. I mean, it IS usable for everyone if the GM wants to share it (can the GM share a player's macro?), but I want to make the modifiers appropriate for everyone, instead of people having to remember to modify whatever comes up.
Not sure if this is a related problem so if this isn't the place to ask please tell where to go. I am trying to make a token action button for the longbow that accounts for changing variables for example if I add bless and sharpshooter but don't want to add sneak attack... how do I make the options clickable in their various fields without rewriting my macro every time I make a change?
1626319511
GiGs
Pro
Sheet Author
API Scripter
You cant make options clickable in an action button - you have to present queries for players to either enter a number or select from a dropdown. The more options you have, the more queries players will have to answer each time they use the action.
1626355247
Ziechael
Forum Champion
Sheet Author
API Scripter
Kyozoku said: Okay, I tried doing it myself, but every attempt to do this myself has resulted in a broken macro. How would I modify the d20 roll so that it queried if you have Tools of the Trade (+2 if yes, +0 if no) and if you used AP (+1 if yes, +0 if no)? I want to make this usable for my whole group, but I'm the only one who gets that +2, and the AP is available to everyone as a consumable resource if they want to use it. So if I make it query these two modifiers, it makes it usable for everyone, not just me. I mean, it IS usable for everyone if the GM wants to share it (can the GM share a player's macro?), but I want to make the modifiers appropriate for everyone, instead of people having to remember to modify whatever comes up. If you change the&nbsp; [[ 1d20+2 ]] attack roll in my macro to: [[ 1d20 + ?{Tools of the trade|No,0|Yes,2} + ?{AP|No,0|Yes,1} ]] you should be sorted (i assumed the +2 from the original was your perma-tools of the trade?)
Yes, thanks so much for all your help Ziechael.