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

Loading 1099 translation strings to worker...

I'm trying to run a super simple script to test out the mod making api. log('Starting'); on('ready',function(){ log('Ready.'); }); This is what I get in the Mod Output Console after it running it for a few hours: "Starting" "Loading character sheet data..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "%cRoll20 Kingmaker Module log| kScaffold Loaded" "Roll20 Environment: Web" "Starting" "Loading character sheet data..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "%cRoll20 Kingmaker Module log| kScaffold Loaded" "Roll20 Environment: Web" etc.etc. Info: Pro account 2014 character sheet Not Jumpgate No mods enabled, just this 1 script. Questions: When will it finally hit the 'ready' event? Why does it keep mentioning kScaffold Loaded? Why would it keep printing out my 'Starting' console log? Is the main runner reloading my untitled.js each time it loads tasks to the workers? That seems inefficient
As a follow up. ----------------------------------------- I restarted the script, and it finally hit the 'ready' event, but the log says it took 60.86 seconds which is not even close to the correct time. It was closer to 6 minutes (log below). Looking through the logs it appears that the timer resets when my untiltled.js is reloaded. So that is worrisome as a dev. "Roll20 Environment: Web" "Ready." "##########> Sandbox [DEFAULT 2025-09-22] : Ready fired after 60.86s, 7402 objects." So I started it again, and after running it for at least 10 minutes, I have not hit the 'ready' event yet. ----------------------------------------- I also wanted to test the reloading of my script each time the runner loads tasks to the workers. if (typeof createTestVar1 === 'undefined' || createTestVar1 === null) { log("createTestVar1 is not declared"); } else { log(createTestVar1); } var createTestVar1 = true; if (createTestVar1) { log("createTestVar1 is true"); createTestVar1 = false; } else { log("createTestVar1 is false"); } on('ready',function(){ log('Ready.'); }); Proved that assumption as correct. "createTestVar1 is not declared" "createTestVar1 is true" "Loading character sheet data..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "%cRoll20 Kingmaker Module log| kScaffold Loaded" "Roll20 Environment: Web" "createTestVar1 is not declared" "createTestVar1 is true" "Loading character sheet data..." When it reloads my script does the runner restart the worker's workload from scratch? I can see an issue if you are checking for any changes, and if you see a change, then you are recreating the entire workload. In my example you might be seeing createTestVar1 going from undefined -> true -> false. I kinda want to know why it could take anywhere from 5 minutes to hours in testing a script before I spend any more time developing on this platform or implement any mods.
1761071496
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Hmm, that definitely shouldn't be taking that long to load. From the logs you are using the R20 pf2 or 5e (2014) sheets (they both have the kingmaker module). Testing in my script dev game with the 5e (2014) game, it takes ~2s for the api server to restart. At least that's the reported time and it's pretty close to the amount of time from "detected currently running sandbox... restarting" appearing, and the load text being displayed. Some things to check: how "big" is your game? approximate number of pages, characters, handouts, etc. Do you have any other scripts installed and enabled? What API server type are you using? Experimental or Production? Does it behave the same way in a new game with the same character sheet installed?
It would be great if I could export my data to analyze it, but my best guess is: Pages: < 40 Handouts: ~150  Magical Items: ~100? - Most of the WoTC releases. Creatures: A few hundred? Thousands? - Most of the WoTC releases. Rollable Tables: ~50 The log I posted above did say:  Ready fired after 60.86s, 7402 objects.  So... Maybe 7402? No other scripts are enabled. I tried to use 'MapChange' previously, and I ran into the same loading time problems. It has been disabled for a while. API Sandbox Version: Default (from the drop down). I have not tried it in a different game, and not interested in trying it in a new game. It took too long to set this one up. I've ran a bunch campaigns to completion since 2020 on Roll20 (I have over 5000 hours on here), but this is the first time I'm trying to use some of the API features. I'm 2 sessions into this new campaign. I have some tech-savvy players in this campaign, so I'm trying to create some cool features for them. As a software guy, the difference between 5 minutes and more than 3 hours in loading a ~5 line script is very intriguing, and I'm very interest in hearing the responses to my questions.
1761075556
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
For your three questions: It should hit the ready event very quickly (~2s in my test game) The K-scaffold is a sheet framework that was used to build the Kingmaker sheet module for the pf and 5e sheets It keeps printing the starting log because the api server is starting multiple times and/or the first one is left over from the initial start up (depends on what order you opened the api page and the game in). The API server can sometimes run twice when restarting frequently; it's a pain during script development. As for game size, this may be an issue with your game's size or with too many items in your game. If you have every creature from the WoTC compendiums, that alone might cause your game to slog. The recommended use is to only import items from the compendium that you are actually going to use; the compendium should be used as the source for dragging things in when you need them.
1761075680
timmaugh
Forum Champion
API Scripter
Nothing in the number of game objects you mention should get you into trouble. To be sure those counts are correct, though, you can load them into your script and dump counts to the console log. Or, if you want to use an existing script, you can grab Inspector and do something like: !inspect --type page That will get you a list of page returns (that you can drill down on). Other types work the same.
Scott C. said: For your three questions: It should hit the ready event very quickly (~2s in my test game) The K-scaffold is a sheet framework that was used to build the Kingmaker sheet module for the pf and 5e sheets It keeps printing the starting log because the api server is starting multiple times and/or the first one is left over from the initial start up (depends on what order you opened the api page and the game in). The API server can sometimes run twice when restarting frequently; it's a pain during script development. As for game size, this may be an issue with your game's size or with too many items in your game. If you have every creature from the WoTC compendiums, that alone might cause your game to slog. The recommended use is to only import items from the compendium that you are actually going to use; the compendium should be used as the source for dragging things in when you need them. It's odd to me that an API server would even restart at all while it's processing incoming data, let alone every ~minute(s). Unless it's making foundational changes to the API as it's receiving the calls, which would also be an odd API approach architecturally, IMO. I have tried both ways in regards to having the game open first vs the sandbox opened first, and I haven't noticed a difference. I have always been the only person in the game, and I haven't made any changes to the game state, players state, or dm state (same map, no tokens moved, etc) while the mod output console is running. And I've always disabled and reenabled  my script, and start with the "error no mods found" (or whatever the default message is)  so the logs don't overlap. As for the game slogging. There has been no noticeable issues in any of the campaigns I've ran, and most of the other campaigns have had more entries in the journal. Honestly, using this Mod/Script system is the only time I have struggled with Roll20. As a side note, the last time I reset the sandbox  to time it (about 3 hours ago) just finished. It took somewhere between 2-3 hours, and the logs were printed 30 times, so I'm assuming the API reset 30 times on that run through.
timmaugh said: Nothing in the number of game objects you mention should get you into trouble. To be sure those counts are correct, though, you can load them into your script and dump counts to the console log. Or, if you want to use an existing script, you can grab Inspector and do something like: !inspect --type page That will get you a list of page returns (that you can drill down on). Other types work the same. Thanks for the info. I took a look at your repo to understand the Roll20 API documentation better. I can't seem to get the getAllObjs() function to work in the sandbox.&nbsp; The docs do not mention anything else is needed other than calling the function. Docs: <a href="https://help.roll20.net/hc/en-us/articles/360037772833-API-Function-Documentation#API:FunctionDocumentation-getAllObjs" rel="nofollow">https://help.roll20.net/hc/en-us/articles/360037772833-API-Function-Documentation#API:FunctionDocumentation-getAllObjs</a> My Code: var everything = getAllObjs(); log(everything); log(everything.length); Mod Output Console: [] 0 "Loading character sheet data..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "%cRoll20 Kingmaker Module log| kScaffold Loaded" "Roll20 Environment: Web" [] 0 "Loading character sheet data..." etc.
1761082650
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I was not saying that the API server is supposed to restart multiple times. It's a bug that has been around for years that the API server starts itself several times occasionally after restarting, resulting in parallel instances of the sandbox running. As Tim said, based on the raw counts of objects your game should not be lagging; however it obviously is.&nbsp; However, your game taking several hours to start the api sandbox leads me to believe that there is something fundamentally broken in your game; a section of corrupted data, a journal entry that was created using some third party tool that did it incorrectly, etc. I would recommend creating a new game, putting your test script in there and then moving items from the problem game into the new one via the transmogrifier in batches. Test the api restart after each batch. That should find the problem game object. Note that there are some game objects that cannot be transmogrified; you'll have to move these manually. A manual check like this is not ideal, but your API experience is so far out of normal that I'm not even sure what could be causing it and it's something that I don't think I've ever even heard of happening.
1761089166
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Survey mod script can give a detailed count of the different objects in your game, but if the sandbox is already malfunctioning, it's probably not going to help much...&nbsp; : /
1761132971
timmaugh
Forum Champion
API Scripter
Display_Name_Here said: My Code: var everything = getAllObjs(); log(everything); log(everything.length); Mod Output Console: [] 0 "Loading character sheet data..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "Starting webworker script..." "Loading 1099 translation strings to worker..." "%cRoll20 Kingmaker Module log| kScaffold Loaded" "Roll20 Environment: Web" [] 0 "Loading character sheet data..." etc. I would not necessarily trust the result of the getAllObs() function until after the on-ready event fires... but if it was at least in an on-ready wrapper and this is the result you got, then something is definitely wrong with that game. In the context of your original post (learning about the API system), this game is sounding like a terrible representation to demonstrate what you should expect.
1761133312
timmaugh
Forum Champion
API Scripter
Display_Name_Here said: Is the main runner reloading my untitled.js each time it loads tasks to the workers? That seems inefficient I hadn't picked this up on first read of your post, but I *have* seen (one time in the past, which prompted me to change my behavior) weird sandbox behavior when the default name of a script is never changed. It was like the sandbox didn't know what to do with my script file when it concatenated all of the javascript. I didn't test it too far... a script file can definitely be named "untitled.js"... so maybe it was only if the field was never clicked into (so it only had "placeholder" text of the "untitled.js" name when it tried to save)? You could probably test this by deleting your script, letting the sandbox reboot -- and confirming that it should only take seconds -- and then dropping your script in again and making sure that you change the name. Then let the sandbox reboot again and see if it performs better.