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

undefined macros appearing?

1696896722

Edited 1696896845
Hi folks, anyone have any idea why all of a sudden my game is automatically creating a bunch of undefined macros? They are growing and growing. I've tried deleting them but they keep coming back one by one. I'm using a bunch of fairly standard APIs. I had just gone into the Macros area and was trying to delete some macros I don't anymore and now it's constantly creating new ones. There are like 50 of them now. :( Edit: It seems if I leave the game and re-launch most are gone, but they immediately start populating again.
Does your game have a base module that was updated? There is a bug that sometimes occurs that causes items to be recreated when a module is patched. Otherwise, it would be helpful if you list which scripts you are using, especially if you have any custom ones or ones that you imported instead of adding through the one-click. If there is a campaign bug then you'll need to submit a help center request to fix it.
Jarren said: Does your game have a base module that was updated? There is a bug that sometimes occurs that causes items to be recreated when a module is patched. Otherwise, it would be helpful if you list which scripts you are using, especially if you have any custom ones or ones that you imported instead of adding through the one-click. If there is a campaign bug then you'll need to submit a help center request to fix it. Hmm, the base module is Wildemount. I'm not sure if it has been updated. How would I figure that out? Scripts: Group Initiative Token Action maker 5E resting in style TokenMod TurnMarker1 libTokenMarkers TokenNameNumber APIHeartBeat 5th Ed OGL ScriptCards CustomCrit (script by Oosh) Custom version of Concentration (only modified to use a different marker)
I'm pretty sure if there was an update that you would have had to manually update, and you should have seen a button like this: When I updated the LMoP on one of my games, I kept getting six blank characters in my Journal every time I opened the game. I realized that one of the things that were the six PreGen characters that came with the module... so I'm pretty sure that there was some conflict with character IDs or something. I submitted a help center request and they copied the game, and fixed the problem in the copy.
Jarren said: I'm pretty sure if there was an update that you would have had to manually update, and you should have seen a button like this: When I updated the LMoP on one of my games, I kept getting six blank characters in my Journal every time I opened the game. I realized that one of the things that were the six PreGen characters that came with the module... so I'm pretty sure that there was some conflict with character IDs or something. I submitted a help center request and they copied the game, and fixed the problem in the copy. Haven't seen that, but perhaps I missed it. I will definitely put in a ticket, thanks!
As I take a closer look at your screenshot, those are definitely coming from APIHeartbeat. I'm guessing you have something configured weird, or a corrupted copy, or something like that. I would suggest removing it, then delete all of the macros, then add APIHeartbeat back again. You may need to fix the State Object in your game (which is beyond my skills, but someone else might be able to help if that's the case). 
You'd need to use something like one of these to fix your State Object: ModState Inspector
Jarren said: As I take a closer look at your screenshot, those are definitely coming from APIHeartbeat. I'm guessing you have something configured weird, or a corrupted copy, or something like that. I would suggest removing it, then delete all of the macros, then add APIHeartbeat back again. You may need to fix the State Object in your game (which is beyond my skills, but someone else might be able to help if that's the case).  I was coming to the same conclusion about it having to do with API HeartBeat. I deleted the script, restarted, and I'm not seeing the same behavior. I don't really need API Heart Beat, so I think I will leave well enough alone and just leave it deleted for now! Thanks so much for your help. No idea what a State Object is, or how I would know if I had to fix it. :)
My amateur explanation: The State Object is a chunk of code that is unique for each game that persists between game sessions, and is accessible to Mod scripts. The sandbox closes and shuts down and doesn’t store anything when the game is closed, so the State Object is where stuff is stored that scripts need to remember between sessions. An example of something that is stored in the State Object for APIHeartbeat is which type of symbol you have selected to be displayed - if there was no State Object (or your choice wasn’t stored there) then you’d have to choose that again each time the sandbox spins up.   I thought it was possible that something had been saved weird in the State Object for your APIHeartbeat, and that was causing the duplicate entries. 
1696945935
timmaugh
Pro
API Scripter
This has happened with APIHeartbeat before. Not sure what the cause was, then, but here's a little scriptlet I wrote to help clean the extra macros up: MacroCleanup To Jarren's point about your state object, the Inspector script will help you to look at it, but I haven't yet built the functionality to change/alter it. So if you want to share what it might look like (and we can tell you if anything looks wrong), install Inspector and run the command: !inspect --state Then post screenshots. I'll ping The Aaron (author of APIHeartbeat) to see if he remembers what happened the previous time APIHeartbeat did this.
Thanks for the offer timmaugh. I guess my question is . . . do I really need to look at anything related to State Object? I was able to clean up the macros last night and things seem stable right now. I'm a little bit nervous to poke around in it any further!
1696947584

Edited 1696947840
The Aaron
Roll20 Production Team
API Scripter
Hmm.   What version of APIHeartbeat are you using? It will print the version info in the console log at the bottom of the Mod (API) Scripts page, it should look something like this: "-=> APIHeartBeat v0.5.2 <=- [Wed Jul 12 2023 23:43:19 GMT+0000 (Coordinated Universal Time)]"
1696948332
timmaugh
Pro
API Scripter
It's up to you, but it could help diagnose what is happening... and the Inspector command is entirely passive observation -- nothing is changed in your State. Aaron said the macro ids should be tracked in the State, so it might help to see what it actually looks like. If you are comfortable with it, run the above command, then find the entry for APIHeartbeat and hit the View button. It could help him get to the root of the issue.
The Aaron said: Hmm.   What version of APIHeartbeat are you using? Unfortunately, I deleted APIHeartbeat, so I think that information is now lost to time. :)
1696950963
The Aaron
Roll20 Production Team
API Scripter
That's fine.  Was it installed from the 1-click, or was it copy/pasted into a script tab?
The Aaron said: That's fine.  Was it installed from the 1-click, or was it copy/pasted into a script tab? One-click, but perhaps a complicating factor is this game was copied from an older game that I was using like almost a year ago.
1696960097
The Aaron
Roll20 Production Team
API Scripter
That probably wouldn't make a difference.  If it was in the 1-click, it was the latest version, which already has a fix for matching macros by ID instead of by name (by name could fail badly and end up with multiple macros).  My guess is you hit the multiple sandboxes issues, which resulted in a race condition to create the macro, and just multiple creations of the macro.  It's odd that it created with an undefined symbol though.  I'm trying to think of a way to address this in the code, since multiple sandboxes should never happen, there isn't any sort of locking/safety factor between sandbox instances, or even the structures necessary to create them in code (easily anyway).  The best I can probably do is figure out a way to uniquely identify all the macros that APIHeartbeat has created, and remove the ones that aren't active (and fix that undefined issue).