Skip to main content

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

GMLive not working after GM update

A topic by pauper-prince created 51 days ago Views: 326 Replies: 10
Viewing posts 1 to 9

Hi, I'm on IDE 11.0.179, Runtime 11.0.226, and since the update GMLive won't work if any assets are referenced in the event (it seems to interpret objects and sprites as undeclared variables). Here is a typical error:

"

[GMLive][1/14/2025 5:46:25 PM][ERROR] Runtime error: [error] `instance#ref instance 107658(obj_DemoWindow)` (instance of obj_DemoWindow) does not have a variable `obj_Selector`.

 called from obj_DemoWindow:Draw_0 [line 10, col 21]

"

When this error occurs, drawing in the event stops. This never happened with previous GM version (8.something).

Thanks!

Developer

Doesn’t seem to be as simple as that?

Send me a sample project if you can reproduce this in a new one

(1 edit)

I am also getting this issue after updating to the most recent runtime.  It will start fine, but fails on trying to update.

However, when trying to make a new project to send, it did NOT fail, duplicating your findings.

^ Yes that's exactly what's happening with me too - thanks for the screenshot - I should have included one. 

Developer

If you do

for (var i = 0; object_exists(i); i++) {
	show_debug_message(object_get_name(i));
}

(or sprite_exists / sprite_get_name for sprites)

Does this show all of your objects/sprites, or does it stop before the one you’re trying to use?

Huh. Yeah it stops before the one I'm trying to use. It lists my objects alphabetically and stops at obj_crt.... and yeah the objects I've been using GMLive in are after that.

Developer

And if you do show_debug_message(asset_get_ids(asset_object)), does the object show up in there?

The result looks like this: 

[ ref object 0,ref object 1,ref object 2,ref object 3,ref object 4,ref object 5,ref object 6,ref object 7,ref object 8,ref object 9,ref object 10,ref object 11,ref object 12,ref object 13,ref object 14,ref object 15,ref object 16,ref object 17,ref object 18, .....


And it continues to "... ref object 308 ]". I've determined I do have exactly 309 objects in my project.

Developer (1 edit)

I suppose you can do this then (at the end of obj_gmlive’s Create event):

var _register = function(_type, _get_name) {
	var _ids = asset_get_ids(_type);
	for (var i = 0, n = array_length(_ids); i < n; i++) {
		var _id = _ids[i];
		var _name = _get_name(_id);
		live_constant_add(_name, _id);
	}
}
_register(asset_sprite, sprite_get_name);
_register(asset_sound, audio_get_name);
_register(asset_object, object_get_name);
_register(asset_room, room_get_name);

And I’ll fix this in the next release.

A little concerning though, isn’t it? There have not been gaps in asset IDs ever since GameMaker: Studio released, almost a decade and half ago.

I just started testing this out and it seems to be working! 

Thank you so much for the fix!!!!

I'm experiencing the same issue, but if I untick 'Automatically remove unused assets when compiling' - the issue disappears. Seems to be the best way to solve it for now.