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

Macro Assistance Request

I'm trying to work out a macros that will roll a d20 to determine if an encounter happens, then query me to roll on an encounter table I created or not, and then tell me how many hours until the next encounter check. IE i'd like a cleaner result that does not show a rolled encounter result, I want to check if I should produce the random encounter first and not roll if it does not work. The Macro I worked out kinda works, but the roll query occurs before I see the rest of the text output whispered to myself in the chat window.  IE I don't know if I want to roll on the encounter table because I can't see the result of the first roll. I have this so far: /w GM ----------------------------------------------------------------------- /w GM Random encounter check every 1d4 hours. /w GM While Resting / hiding / or just slowly exploring: /w GM ----------------------------------------------------------------------- /w GM Roll d20. On 18 or higher Encounter is triggered. /w GM /w GM [[1d20]] /w GM ?{Encounter Rolled? |No,/w GM No Encounter |Yes,/w GM [[1t[Encounters-Sewer]]] } /w GM /w GM Next Encounter Check in: /w GM [[1d4]] Hours
Any assistance appreciated, thanks!
I broke it out into two separate buttons which worked okay, though one button would be nicer. Button 1: /w GM ------------------------------------------------ /w GM Random encounter check every 1d4 hours. While Resting, hiding, or just slowly exploring: /w GM Encounter is triggered on 18+ RESULT: [[1d20]] /w GM ------------------------------------------------ /w GM Next Encounter Check in [[1d4]] Hours Button 2: /w GM Encounter Result ?{Encounter Rolled? |No,/w GM No Encounter |Yes,/w GM [[1t[Encounters-Sewer]]] }
1650309400
GiGs
Pro
Sheet Author
API Scripter
Scott said: The Macro I worked out kinda works, but the roll query occurs before I see the rest of the text output whispered to myself in the chat window.  IE I don't know if I want to roll on the encounter table because I can't see the result of the first roll. That's a limitation of the macro system - all queries are presented first, one after the other, and then output is posted in chat. The best way to do this would be to have the roll for whether an encounter happens, and the rest of the rolls, to be in separate macros.
Oh that was silly, should test before posting. Button2 is now simply: /w GM Encounter Roll: [[1t[Encounters-Sewer]]]
1650309493
GiGs
Pro
Sheet Author
API Scripter
Ninja's hehe - and the solution you found is the only one that will work. At pro subscriber level you have access to Scripts which are more powerful than Macros, and can get around this problem, but without scripts the only solution is to split it into two macros as you have done.
Ah, that's what I ended up doing, so guess that confirms the answer - thanks! GiGs said: Scott said: The Macro I worked out kinda works, but the roll query occurs before I see the rest of the text output whispered to myself in the chat window.  IE I don't know if I want to roll on the encounter table because I can't see the result of the first roll. That's a limitation of the macro system - all queries are presented first, one after the other, and then output is posted in chat. The best way to do this would be to have the roll for whether an encounter happens, and the rest of the rolls, to be in separate macros.
I’m on mobile so I can’t test or confirm right away, but there are a couple tricks you should be able to use: If you rename your table to be something like 1Encounters-Sewer and create another table that is named 0Encounters-Sewer with a single entry of “No encounter rolled”, then you should be able to use a Success Roll  to make a single entry with no query. It would be something like: [[1t[[1d20>18]]Encounters-Sewer]]   There is also a trick to wrap a message in double or triple brackets to only use a single /w GM command.  There may be some specific interactions or syntax you’ll need to play around with as again I’m on mobile so I can’t verify at the moment. 
LOL, I need  like button - thanks @Jarren (and GiGs as well of course).