Jihl
Member
Hey fellas!
I am using GM ds_map_secure_save function and I'm struggling to have maps inside other maps.
I need to store some maps inside other maps so I can hold all the data needed for every client and character of my game, it's an Online RPG.
Everything goes well while the game is on and I can manipulate the maps freely, but when I shut down the game and open it again, some of the values are shown as undefined, even when they werent before the shut down.
Some code I am using:
For example in this code I am registering an account, but after I shut down the game and open it up again, if I show up the username and password on the console it tells me it is undefined.
Do you have a better way to handle this? Or do you know what am I missing here?
Could it be that it goes undefined because I am using a local variable to create the maps? Does destroying the map that I have just created destroy the data that's inside the global.save_load_map?
Thanks alot!
Jihl
I am using GM ds_map_secure_save function and I'm struggling to have maps inside other maps.
I need to store some maps inside other maps so I can hold all the data needed for every client and character of my game, it's an Online RPG.
Everything goes well while the game is on and I can manipulate the maps freely, but when I shut down the game and open it again, some of the values are shown as undefined, even when they werent before the shut down.
Some code I am using:
Code:
// Get arguments
var username = argument0
var password = argument1
// Add to registered accounts number
global.save_load_map[? "Registered Accounts"]+= 1
// Create map
var map = ds_map_create()
ds_map_add_map(global.save_load_map, username, map)
// Set values
map[? ds_client.username] = username
map[? ds_client.password] = password
// Create characters map
var map2 = ds_map_create()
ds_map_add_map(map, ds_client.characters, map2)
Do you have a better way to handle this? Or do you know what am I missing here?
Could it be that it goes undefined because I am using a local variable to create the maps? Does destroying the map that I have just created destroy the data that's inside the global.save_load_map?
Thanks alot!
Jihl