Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 · By YellowAfterlife

[SOLVED] Fatal error when updating variables of an instance using a live room.

A topic by John Peppermint created Feb 20, 2022 Views: 283 Replies: 4
Viewing posts 1 to 4
(3 edits)

Hello! I'm using a live room and there's an instance that follows a path, when I update the path speed of the instance using the instance variables this error happens, I wonder if I'm doing something wrong or it's just a limitation of GMLive. Cheers! 

___________________________________________

############################################################################################

FATAL ERROR in Room Creation Code for room rm_live

Variable <unknown_object>.trace(101818, -2147483648) not set before reading it.

 at gml_Script_live_room_loader_add_layer (line 311) -               default:trace("src/live/RoomLoader.hx:397:","Unknown layer type "+gml_std_Std_stringify(l_ql[?"modelName"]));

############################################################################################

gml_Script_live_room_loader_add_layer (line 311)

gml_Script_live_room_loader_run_impl2 (line 329) -               live_room_loader_add_layer(ds_list_find_value(l_lrs,l_lrk));

gml_Script_live_room_start (line 406) -               live_room_loader_run_impl2(l_rm2);

gml_Room_rm_live_Create (line 1) - live_room_start();

Developer(+1)

You’d want to add a script like this

/// @description  trace(...)
/// @param ...
function trace() {
	var r = string(argument[0]);
	for (var i = 1; i < argument_count; i++) {
	    r += " " + string(argument[i]);
	}
	show_debug_message(r);
}

However, the actual deal is that a layer isn’t recognized - I thought I’ve had everything covered (including effect layers) in the most recent version, so a sample wouldn’t hurt.

(1 edit)

Wow, it works now! Thank you so much! I also noticed that if I update the path itself with new nodes or different positions it doesn't get updated in the live room, is there a solution for that or am I doing something wrong? I'm using path layers. 

Developer (1 edit) (+1)

A path layer isn’t much of a layer - no points are stored in the room file.

I can potentially add path reloading in future - this doesn’t sound too bad, but there currently is a lot going on with Ukraine so it might take some time.

As a workaround, you can try disabling file system sandbox, loading the path YY file from project directory with a function like this

function file_get_contents(s) {
	var b = buffer_load(s);
	if (buffer_get_size(b) == 0) return "";
	var r = buffer_read(b, buffer_string);
	buffer_delete(b);
	return r;
}

and then parsing the contents with json_parse and re-populating path points using the various path_ functions.

Ooh path reloading would be so cool and a tremendous help for my project, I would try doing what you suggest but I think my skills are not up the task yet, heheh. I understand that the situation is very troublesome in Ukraine, I hope you and your family are okay.