As stated in the title, they get the following error:
############################################################################################ FATAL ERROR in action number 1 of Other Event: Game Start for object obj_music_controller: ds_map_find_value argument 1 incorrect type (undefined) expecting a Number (YYGI32) at gml_Script_scr_checkLastLoggedInJson ############################################################################################ -------------------------------------------------------------------------------------------- stack frame is gml_Script_scr_checkLastLoggedInJson (line -1) gml_Object_obj_music_controller_Other_2 The function ds_map_find_value() is not being called in the script scr_checkLastLoggedInJson(). (Even if it was, how could it be happening at line -1?)
Nor is it called in the Game Start event of the obj_music_controller object. I also checked every use of ds_map_find_value() in the entire game and they are all fine.
Furthermore, this is only happening with 1 person. And they have tried uninstalling it and re-downloading. Even after i uploaded a new version of the game, this still happened to them and only them.
EDIT: scr_checkLastLoggedInJson()
var result = false; if (file_exists("saveJson.json")) { var saveJson = scr_loadJSONFromFile("saveJson.json");//ds_map var saveJsonNames = saveJson[? "Names"]; //ds_list var userSaveData = noone; var saveJsonSaves = noone; if (ds_list_size(saveJsonNames) == 1) //If there is only 1 user, that is the one to load. { result = true; var username = saveJsonNames[| 0]; global.username = username; } else { //Find the user who was last logged in and assign them to global.username. for (var i = 0; i < ds_list_size(saveJsonNames); i++) { var username = saveJsonNames[| i]; saveJsonSaves = saveJson[? "Saves"];//ds_map if (!is_undefined(username)) { userSaveData = saveJsonSaves[? username]; //ds_map if (userSaveData[? "Last Logged In"]) { result = true; global.username = username; ds_map_destroy(userSaveData); ds_map_destroy(saveJsonSaves); break; } } } } if (ds_exists(userSaveData, ds_type_map)) { ds_map_destroy(userSaveData); } if (ds_exists(saveJsonSaves, ds_type_map)) { ds_map_destroy(saveJsonSaves); } ds_list_destroy(saveJsonNames); ds_map_destroy(saveJson); } return result;
ds_map_find_valueis called anytime you referencesaveJason[? "Some string here"], because you're finding the value associated with that input string. In some case it's undefined. It might be where you find a username, then look up a save with that name? \$\endgroup\$[?and identified all places where I used this accessor with a variable (like[? username]in the example above). I then enclosed it and all code related to it in anifwith a condition like!is_undefined(username). But this didn't fix the problem. \$\endgroup\$ds_map_find_value argument 1 incorrect type (undefined) expecting a Number (YYGI32)is referring to the ds_map argument of ds_map_find_value(ds_map, value). Because i know GMS starts indexing at 1 instead of 0 for some things and maybe this is one of those things. Furthermore, the ds_map argument would have to always be a number because it is the ID of a ds_map, whereas the second argument can be a string so I will look for places in the code where the map being searched doesnt actually exist. \$\endgroup\$