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 help

Alright, sorry guys, I'm exceptionally tired and just not at the level I usually am so I'm getting beat up by this macro. I bet it's something stupid too like, "don't have a space there" or something. But anyway, I have this macro:  /w gm ?{GM or Player|GM,  #AllDiceGM |Player,  #AllDicePC } And it's supposed to either run the gm macro, or the pc macro version. But I keep getting results like so: Instead of like this: Any idea? I'm missing something small and stupid aren't I? Blah
1478768284
Tetsuo
Forum Champion
The problem is that you need to HTML escape entities in the called macros for AllDiceGM and AllDicePC.  See Here for more info 
1478790309

Edited 1478793553
Franky H. said: The problem is that you need to HTML escape entities in the called macros for AllDiceGM and AllDicePC.  See Here for more info  Okkkkkkkkkkkkkkk, that was one heavy read to understand lol.  It took me awhile but I finally figured it out, thanks for the link Franky! I'll do a mini-ELI5 if for no other reason than I'm proud I figured it out lol (and to make sure my understanding is correct) -So if you have a macro call inside of a roll query, the entire macro is then 'expanded' (called) before the roll query can finish running. Because this happens, you need to make sure that any syntax that the roll query uses (inside of the macro) is replaced with it's corresponding html entities (edit: Quote: Ziechael: " Unless it is part of an attribute call such as @{target... or @{selected..."). In other words, every "}"  "|" or "," needs to be replaced with it's corresponding html entity INSIDE of the called macro. This prevents the roll query from using those characters to 'finish' the roll query early. I think that's about right, yeah?
1478791117
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, it's due to the order operations, which you pretty much summed up. The full order of operations wiki entry:&nbsp;<a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a>
Scott C. said: Yep, it's due to the order operations, which you pretty much summed up. The full order of operations wiki entry:&nbsp; <a href="https://wiki.roll20.net/Dice_Reference#Order_of_Operations" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Order_of_Operations</a> Perfect.&nbsp; Thanks for the help guys &nbsp;: )
1478793403
Ziechael
Forum Champion
Sheet Author
API Scripter
eastwood said: you need to make sure that any syntax that the roll query uses (inside of the macro) is replaced with it's corresponding html entities. Unless &nbsp;it is part of an attribute call such as @{target... or @{selected... ;)
Ziechael said: eastwood said: you ... entities. Unless &nbsp;it is part of an attribute call such as @{target... or @{selected... ;) Oh man...haha&nbsp; There is a lot to learn &nbsp;: - )
1478796598
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You may find&nbsp; this&nbsp;thread useful for creating things to nest in roll queries. The sheet linked to in there is designed for nesting roll queries within each other, but you can easily adapt it to creating html escaped macros. Also, keep in mind that it is best to create your html escaped macros in a character as an ability instead of as a global macro because reopening and then re-saving the global macros will parse the html escapes while the escapes are stable in character abilities. A good way to make macros for all players to use is to make a character and name it something like "macros" and give all players control of it. Make all your player accessible macros that contain html escapes in this character's abilities section, and then archive the character. Your players (or you in another macro) can access the macros via %{macros|name of the macro}, but your players won't be able to actually open the character and futz with the macros (because they don't have direct access to the archived journal entries).
1478796801

Edited 1478797216
Scott C. said: reopening and then re-saving the global macros will parse the html escapes Ahhh. I was wondering how I'd get around that without just keeping a journal entry for the whole macro (with the html entities) and re-pasting it every time I open the macro.&nbsp; Thanks for the tip! EDIT: &nbsp;Wow! That google sheet you made in that thread is awesome! That will save a lot of work. You da man!&nbsp;