P
Potatoverse
Guest
Hello this is my first post on this website. I've been trying to make a functional saving system but when I try to destroy the "wrapper" this error shows up. Here is my code:
the error that shows up is called "I32 argument is array" and I dont understand why this error would show up because the argument that I put in is clearly a map and not an array or maybe I'm understanding something incorrectly? Full error message:
Any help is appreciated.
Code:
var root = ds_list_create();
with(obj_psvng) {
var map = ds_map_create();
ds_list_add(root,map);
ds_list_mark_as_map(root,ds_list_size(root)-1);
ds_map_add(map,"obj",object_get_name(object_index));
ds_map_add(map,"x",x);
ds_map_add(map,"y",y);
ds_map_add(map,"image_index",image_index);
ds_map_add(map,"depth",depth);
ds_list_add(root,inv,invcnt);
ds_list_mark_as_map(root,ds_list_size(root)-1);
ds_list_mark_as_map(root,ds_list_size(root)-2);
}
var wrapper = ds_map_create();
ds_map_add_list(wrapper,"root", root);
var text = json_encode(wrapper);
Write("world.pot",text)
ds_map_destroy(wrapper)
show_debug_message("yo dude I got your data!")
Code:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Key Press Event for <Enter> Key
for object obj_svng:
I32 argument is array
at gml_Script_Saving (line 28) - ds_map_destroy(wrapper)
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_Saving (line 28)
called from - gml_Object_obj_svng_KeyPress_13 (line 1) - Saving();