L
LUCAITA
Guest
Hi, I need help for saving the "permadeath" of mobs.
I use this code for permadeath:
in create of mob1stat
in step event of mob1
now my problem its how to save the matrix in file. I've tried with ds_grid_create but I've failed
can someone help me?
I use this code for permadeath:
in create of mob1stat
GML:
for ( var i = 1 ; i <= 30; i++) {
for (var j = Room2; j<=Room1;j++)
{
enemy[j,i] = false
}
}
Code:
if num == 0 { // fare solo se num è = 0
mob1stat.num +=1
num = mob1stat.num
}
if hp <= 0 {
mob1stat.nemici[room,num]= true
instance_destroy()
}
if (mob1stat.nemici[room,num] == true) {
instance_destroy()
}
Code:
var save_data = ds_map_create() {
save_data[?"MONEY"] = statuser.money
save_data[?"provenineza"] = statuser.provenienza
save_data[?"userhp"] = statuser.userhp
..... ..... .....
save_data[?"level"] = statuser.level
var save_string = json_encode(save_data)
ds_map_destroy(save_data)
save_string = base64_encode(save_string)
var file = file_text_open_write(working_directory + "tutorial.txt")
file_text_write_string(file, save_string)
file_text_close(file)