Skip to main content

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

[Fixed] Room Reloading Issues

A topic by ScottGrogin created Aug 07, 2022 Views: 432 Replies: 3
Viewing posts 1 to 2

Hello!

I’m having trouble getting live room reloading to work. After following the documentation, I kept getting the error below when the game started.


_________________________________________

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

ERROR in

action number 1

of Create Event

for object <undefined>:

room_goto argument 1 incorrect type (undefined) expecting a Number (YYGI32)

 at gml_Script_room_goto_live (line 3124) -               room_goto(l_rm);

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

gml_Script_room_goto_live (line 3124)

gml_GlobalScript_scr_room_updated (line 24) - room_goto_live(argument0);

I found that if instead of having room_goto_live(argument0) in the scr_room_updated script, I wrote the function below in the script,


function scr_room_updated(arg){

     room_goto_live(arg);

}

then the game could transition to the live room, but when it was updated, the game would crash with


___________________________________________

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

ERROR in

action number 1

of Async Event: HTTP

for object obj_gmlive:

Unable to find a handler for exception { value : Please add a completely empty room, add live_room_start(); to it's Creation Code, and assign it to live_blank_room in obj_gmlive's create event., message : Please add a completely empty room, add live_room_start(); to it's Creation Code, and assign it to live_blank_room in obj_gmlive's create event., longMessage : , script : , stacktrace : [ "gml_Script_gml_std_haxe_Exception_thrown:2961","gml_Script_room_goto_live:3120","gml_Script_live_gmlive_asset_api_room_updated_impl:3130","gml_Script_live_async_http_1:152","gml_Script_live_async_http:244","gml_Object_obj_gmlive_Other_62:1",0 ], h_native : { value : "Please add a completely empty room, add live_room_start(); to it's Creation Code, and assign it to live_blank_room in obj_gmlive's create event.", message : "Please add a completely empty room, add live_room_start(); to it's Creation Code, and assign it to live_blank_room in obj_gmlive's create event.", longMessage : "", script : "", stacktrace : [ "gml_Scrip

 at gml_Script_room_goto_live (line 3120) -                      if(!room_exists(live_gmlive_asset_api_blank_room))throw gml_std_haxe_Exception_thrown("Please add a completely empty room, add live_room_start(); to it's Creation Code, and assign it to live_blank_room in obj_gmlive's create event.");

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

gml_Script_room_goto_live (line 3120)

gml_Script_live_gmlive_asset_api_room_updated_impl (line 3130) -        room_goto_live(l_rm);

gml_Script_live_async_http_1 (line 152) -                      live_gmlive_asset_api_room_updated(l_rq);

gml_Script_live_async_http (line 244) -               live_async_http_1(l_map);

gml_Object_obj_gmlive_Other_62 (line 1) - live_async_http();



My runtime version is 2022.6.1.40

I can also send a sample project that reproduces the issue if needed.

Developer (1 edit)

When documentation says “and have the script do”, that usually means “add to the function”, not “add the code outside of the function”, so your updated code is correct. I can probably update the documentation to have a fully copy-paste-able example now that I no longer update the 2.2.5 version of GMLive.

Unable to find a handler for exception { value : Please add a completely empty room, add live_room_start(); to it’s Creation Code, and assign it to live_blank_room in obj_gmlive’s create event.

The error kind of speaks for itself, but any additional code goes after live_init call, just in case. The next release will have this error slightly more readable (I found a way to get rid of {} in the error message)

(+1)

Thanks for getting back so quickly!

I triple-checked and I definitely have everything that the error message is asking for. I ended up fixing my issue after poking around in the source code and finding the variables live_gmlive_asset_api_blank_object and live_gmlive_asset_api_blank_room; I used those in the create event and it started working.

live_init(1, "http://localhost:5100", "");
live_gmlive_asset_api_blank_object = obj_blank
live_gmlive_asset_api_blank_room = rm_blank

Developer(+1)

Oh, that’s no good - I have now published a version that fixes that.