Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Error: gml_compile_init not set before reading it.

A topic by bowsette_game created Jun 18, 2023 Views: 441 Replies: 11
Viewing posts 1 to 2

I get the following error when attempting to run my project:

Variable <unknown_object>.gml_compile_init(116068, -2147483648) not set before reading it.
 at gml_GlobalScript_GMLive (line 5483) - if(live_enabled)gml_compile_curr_script=gml_compile_init();
############################################################################################
gml_GlobalScript_GMLive (line 5483)

I'm using version 1.0.71 for GMS2.3 and GMS2022+. I could not find the gml_compile_init function anywhere in the code. The GMLive_Compiler file is empty - not sure if this is related.
Developer(+2)

You have been sabotaged by GameMaker - re-import the extension.

Thanks. I had to re-import the extension over 10 times, but it eventually worked. :p

I am having same issue but re-import did not solved the problem, I did it more then 50 times in 3 different projects and restarted game maker some times too…

Developer(+1)

If automatic import doesn’t work, you can rename the downloaded YYMPS file to a ZIP, open the script in question (that’s GMLive_compiler in this case), and copy the code to a same-named script in your project.

After some debug I discovered that 3 scripts inside gamemaker were empty, GMLive_vm, GMLive_roomLoader and GMLive_compiler. Opening the files directly its contents were there, so I copy/paste it inside gamemaker. Now it returns another error that I don’t how to fix hehe:

script_get_name argument 1 invalid reference to (script)
 at gml_Script_live_preinit_init_funcs (line 19) - 		var l_name=script_get_name(l_scr);
############################################################################################
gml_Script_live_preinit_init_funcs (line 19)
gml_Script_live_preinit_api (line 1357) - 		live_preinit_init_funcs();
gml_GlobalScript_GMLive (line 5731) - 	live_preinit_api();
Developer

That’s not an error message that I’ve seen before. Is this on the beta or something?

Yes, I’m on linux and the beta is the only release available right now…

Developer (1 edit) (+1)

Upon closer inspection it would appear like the recent beta has accidentally destroyed ability to get script name from a numeric ID, which GMLive relies on to make project scripts callable. So this will no longer work:

for (var k = 100_000; k < 200_000; k++) {
	if (!script_exists(k)) break;
	var name = script_get_name(k);
	show_debug_message(name);
}

and the line from your error now has to be:

try { var l_name=script_get_name(l_scr); } catch (_) break;

The workarounds for this are generally insane (such as assigning an asset tag to every single script in the project and changing live_bits_gmlive_indexer_add_scripts to get scripts using tag_get_asset_ids) so I can only suggest switching to an older beta runtime that doesn’t have this change.

(+1)

I rollback it to release 2023.400.0.324 and it worked, thanks for the support.

This seems to be a bug in runtime, as script_get_name(Script1); also breaks games…

(+2)

I’ve just checked IDE v2023.800.0.402 Beta Runtime v2023.800.0.423 and it seems that GMLive works there again.