Hello Roll20 Working on a character sheet that include some rather large orbjects for holding data on ability scores and the like. I have a player who was worried that running multiple sheets in a game (up to 150) would eat up all his RAM on his PC. So If I have a large object defined in my sheetworker javascript do I need to check that it is not already defined in the javascript engine, or does Roll20 handle that for me? Here is an example: I have added this object in my script section simply as <script type="text/worker">
const strengthTable = {}; ... // a lot of static data
</script> Do I need to wrap this object in an if statement to avoid loading it twice if it is already loaded? Ie. <script type="text/worker"> if (strengthTable === undefined) { const strengthTable = {}; ... // a lot of static data }
</script> Or does Roll20 handle that for me, in the way they handle sheet worker code? My gut feeling is that Roll20 handles the load, because when ever I use the log, Ie. console.log(); I only ever see my log messages once, when the game opens and then not again, indicating that all sheetworker data is loaded once per game, and not once per sheet.