Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

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

Bug Report - live_live_rooms_start and live_live_rooms_stop

A topic by Slyddar created Sep 21, 2021 Views: 150 Replies: 2
Viewing posts 1 to 3
(1 edit)

Just a heads up, I've had instances of these lines causing crashes when I exit the game. (live_live_rooms_start and live_live_rooms_stop)

ERROR!!! :: ############################################################################################
ERROR in
action number 1
of  Step Event0
for object obj_gmlive:
Data structure with index does not exist.
 at gml_Script_live_update (line 367) - var l_rln=ds_list_size(l_rl);
############################################################################################
gml_Script_live_update (line 367)
gml_Object_obj_gmlive_Step_0 (line 1) - live_update();
gml_Script_live_update (line 367) gml_Object_obj_gmlive_Step_0 (line 1) - live_update();

It appears live_live_rooms_start and live_live_rooms_stop are not always defined as ds_lists, so I've added a simple ds_exists check first, which solved the problem as below.  Might be something you want to include, unless you can address the issue when they are created.

if ds_exists(live_live_rooms_stop, ds_type_list) {
    var l_rl=live_live_rooms_stop;
    var l_rln=ds_list_size(l_rl);
    if(l_rln>0){
        l_url+="&rooms"+string(0)+"="+room_get_name(ds_list_find_value(l_rl,0));
        var l_i=1;
        for(var l__g1=l_rln;l_i<l__g1;l_i++){
            l_url+="+"+room_get_name(ds_list_find_value(l_rl,l_i));
        }
    ds_list_clear(l_rl);
    }
}
if ds_exists(live_live_rooms_start, ds_type_list) {
    var l_rl=live_live_rooms_start;
    var l_rln=ds_list_size(l_rl);
    if(l_rln>0){
        l_url+="&rooms"+string(1)+"="+room_get_name(ds_list_find_value(l_rl,0));
        var l_i=1;
        for(var l__g1=l_rln;l_i<l__g1;l_i++){
            l_url+="+"+room_get_name(ds_list_find_value(l_rl,l_i));
        }
        ds_list_clear(l_rl);
    }
}
Developer

Unless GameMaker is corrupting the data structures on decode or you have code that accidentally destroys them between initial decode and processing, they cannot possibly be non-lists - the server response contains arrays of strings (or empty arrays)

(2 edits) (+1)

I guess Gamemaker is doing something wacky, as there is no code interfering with any parts of GMLive, that I am aware of at least.  Considering the additional check solves the issue, I'll just leave it in and let it be.  Thanks for the reply.

Also I'm working on UI and menu positioning and wanted to praise your work on GMLive and give a huge thank you for making it.  It just makes life with such things sooooo much easier.  Appreciate you continuing to support it too, it really is an invaluable addition to GMS.