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

Rolls breaks permanently after rolling a large macro

I've noticed some odd behaviour after testing a particularly large macro for magic missile. As Roll20 does not like me trying to post the full code in a forum post (as I think its too long, and it just errors) the code is in the campaign, or can found here: <a href="https://justpaste.it/4m7hm" rel="nofollow">https://justpaste.it/4m7hm</a> After rolling a prior (broken) version of the macro a few times, all subsequent rolls within the campaign are now broken, and will now only spam part of the macro instead of the roll. This includes rolls made from the sheet, token actions, and directly in chat (such as /r 1d20). I've not been able to test API calls as I am not a pro user. I am using the 5e OGL Sheet (but as normal rolls from chat are broken as well, I am not sure this matters). As it was only a test campaign, I can share the link for it below, so you can see the behaviour for yourselves: <a href="https://app.roll20.net/join/4307004/G7_pUQ" rel="nofollow">https://app.roll20.net/join/4307004/G7_pUQ</a>.
1570920703

Edited 1570920787
GiGs
Pro
Sheet Author
API Scripter
Me scrolling through that macro: The problem is your macro is too big, it's breaking the chat archive. Roll20 chat is fragile, and complex macros can break it, and I've never seen one that complex. You need to go to your Campaign Home Page, the one with the Launch Game button it, and in the Settings drop down, select Clear Chat Archive. (I'm being so weirdly specific with these instructions because there's also a clear chat option in the Settings inside your campaign, but that one doesn't fix this.) Then you'll have to abandon using this macro - it's just too big and you'll have this problem occurring over and over.&nbsp; I suggest using a Chat Menu instead. If you upgrade to pro, you can also look into making an API script to replace it. If that macro draws on stats from a character sheet, my Universal Chat Menus script, or Scotts Menu Maker might be a good replacement. Whatever happens, you'll have to abandon using the macro in its current form. It's simply too complex for roll20 - it will keep breaking the chat archive.
1570920720
Kraynic
Pro
Sheet Author
If you go to the game launch page (where the big pink launch button is), you can click on game settings to get the dropdown.&nbsp; In amonst copy and delete game, there will be an option to delete the chat archive.&nbsp; That will probably clear up your chat issue. I took a glance at your macro, and know that I have no intention of wading through that to try to find an error.&nbsp; That is a huge macro!
1570927244
Mike deBoston
Compendium Curator
That macro should be a the BBEG at the climax of a long campaign. Large, mutant, evolved over centuries, and terrible to behold. Finally, it has become to powerful for its host world. Instead of a Dark Lord, you would have a queen, not dark but beautiful and terrible as the dawn! Tempestuous as the sea, and stronger than the foundations of the earth! All shall love me and despair!
1570927920
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It shall diminish, and go into the West, and remain a Chat Menu.
1570940089
GiGs
Pro
Sheet Author
API Scripter
We can joke about it, but I'm amazed by the macro, that took a helluva lot of work to write (and it's just for Magic Missile? what??). Jake, looking at the structure, I'm not going to even attempt to deconstruct it and study it, but I do notice there are ways to simplify it. For example you have the &amp;{template:} section repeated 460 times-&nbsp; that could be moved to the start of the macro, and have the query come after it. That would remove a lot of duplication. You could study the macro and look for ways to build it a bit more efficiently like that and maybe get it to work. But you'd definitely still be better off using a chat menu.
Yep, I know the macro is not perfect - I wrote some code to generate it, hence why its so complicated, and why there are definitely areas where I could simplify it - it was my first attempt at such a complex one. Despite its size, it only allows magic missile to be cast at levels 1 to 5 - I'm effectively filling in all the different branches that a user could choose, in terms of single target, multi-target, and allowing them to allocate a number of missiles per target. It kind of started as me just messing around, and then wondering if I *could* do it, so I didn't really plan it out. This was never really properly planned out, upgrading to pro could be an idea - this is pushing the limits of what can be done without API scripts. I considered chat menus, but I don't really like them as much - the user has to click the macro button, then move to the chat, then move back to the middle of the screen for any other queries (or their chat is spammed with a lot of buttons, as this one would use several steps). Encoding HTML entities (the main benefit of using chat menus) isn't an issue as I've written a script that can automatically trawl a macro and escape the HTML as required, I've posted that on this forum previously. Clearing the chat archive fixed the issue - thanks for the help!
1570970915
GiGs
Pro
Sheet Author
API Scripter
Jake Y. said: Clearing the chat archive fixed the issue - thanks for the help! Just bear in mind if you ever use this macro again, or one like it, you are guaranteed to corrupt your chat archive sooner or later. You can almost certainly create a managable macro to handle magic missile without needing a chat menu, but will have to construct it intelligently instead of automating its creation.
The actual output to the chat log is not much at all, up to 5 templates maximum, and the chances that you are going to target 5 enemies separately with magic missle is quite slim: I would assume that the actual size of the macro does not matter (in terms of corruption), as this would be evaluated locally, and that the only thing that matters is the size of the output to the chat log in the end.
1570974717
GiGs
Pro
Sheet Author
API Scripter
Jake Y. said: The actual output to the chat log is not much at all, up to 5 templates maximum, and the chances that you are going to target 5 enemies separately with magic missle is quite slim: I would assume that the actual size of the macro does not matter (in terms of corruption), as this would be evaluated locally, and that the only thing that matters is the size of the output to the chat log in the end.&nbsp; Unfortunately this is not correct. The whole macro is evaluated server-side, and it is stored in its entirety in the chat log. It's just not visible to the reader.
Good information to know - not something I'd expect. Yeah, I'll stop using this version of the macro.
1570997018
Mike deBoston
Compendium Curator
One thing I've started adding at the bottom of some of my area effect and other multi-target macros is a "roll again" button. So instead of rolling for 8 targets and letting the user keep the first 1–N rolls, I roll for 4 targets and have a "roll again" button at the bottom. That helps reduce the number of 3D dice flying about and the size of the macro.