In my Fire Emblem Tabletop Script , for convenience' sake when testing it on my own, I have all the functions divided up separately into different files. Let's say I declare a global variable in one file. var queue = ; Can this variable be accessed from another separate script in some way, or are all scripts sandboxed separately, making that impossible? My goal is to make a global queue that can be accessed from all scripts, though I don't know if that's possible.
That's weird, though, since if I declare queue on the first line of the first script and try to log it on the first line of the second script, it immediately throws a reference error.
When you say you get an immediate reference error, are you talking about when you put the scripts in roll20, or in something else like a local sandbox for testing or the like?
In Roll20, that is. It automatically gives me ReferenceError: queue is not defined when I attempt to save, presumably because the scope for error scanning is only limited to the current API script?
How are you defining the variable? Can we see it's code?
It's literally just Script 1: var queue = ; Script 2: log(queue); That's it.
Okay, so it seems to have a problem with this when I use a pre-existing game, but I get no such error when I make a new game and type up the exact same thing, which is weird. Edit: Nevermind, the problem solved itself?
Is it possible that the problem occurred because you didn't save the first script before writing the second script?
That's probably it, yeah. ^^