Mobile game crashes on interaction with an Autoload/Global script that stores variables

Godot Version

Godot_v4.5-stable_win64.exe

Question

How should I go about with loading variables from an autoload or resource script?

So the game is for mobile and i’m using one click deploy to test it on my phone. The game stores some variables in a couple autoloads and whenever I click a button that mentions the autoload name, the game crashes. On my laptop it runs just fine. I read around and found out that an autoload creates a new node for that script and I’m assuming since the node is never properly loaded(?) i guess? into the scene tree, the game just crashes because of the error break.

How should I go about with loading variables from an autoload or resource script?

for a bit more context: before i turned it into an autoload it was previously a .gd file for a .tres file. And what was loaded into the game was the .tres file but even then on mobile it was causing the crashes but i dont know for what reason.

go easy on me guys. i’ve no clue what i’m doing here nor what’s happening, just pseudocode imagination

edit: bit of a mistake, ever since it’s an autoload, it just crashes the app on open. so yea i’m pretty sure it’s something to do with how the autoload is loaded

guys i might be dumb. so i had another autoload that WASN’T causing any problems and when i took to compare, i noticed the one that was causing the crashes contained LOAD() METHOD BECAUSE IT FUNCTIONED AS A SCENE STORAGE CONTAINER TYPA THING AIbufaiofbaofibowqifboqifboq :sob::sob::sob:

ts been wracking my head for 3 days…

ok so i just changed the load()s to strings on the Global/Autoload script, and on the scripts that call for it changed from GlobalName.scene[num] to load(str(GlobalName.scene[num])) and besides some other things i need to rework because of this, this solved the issue omg i’m so smart :peanuts: :brain: :wilted_flower: