So I've been working trying to use ModPE.savedata to work.
For a while, I've placed save data and read data in the code, but I've just noticed it have been bugging out since I added a new feature.
The issue is that whenever I exit blocklauncher and reenter it, the read data fails, and it work perfectly fine if I just exit the world instead of exiting out of the launcher itself.
Code:
var example=0;
Function newLevel(){
ModPE.readData("example")
}
Function leaveGame(){
ModPE.saveData("example",example)
}
I noticed the issue and made an GUI that detects how much is a variable, and after I exit and reenter, if variable example read 3 before, it read 0 when I exit and reenter into Block Launcher
is this just a bug or is there a problem with my code
nvm, its a block launcher bug, I looked at older post of ModPE.saveData, there is a bug with block launcher that whenever its closed, the variables reset with or without save data
nvm, its a block launcher bug, I looked at older post of ModPE.saveData, there is a bug with block launcher that whenever its closed, the variables reset with or without save data
nvm, its a block launcher bug, I looked at older post of ModPE.saveData, there is a bug with block launcher that whenever its closed, the variables reset with or without save data
A while back I was angry at ModPE.saveData and MAY have been cursing at it.... I did manage to get it work though.
var example = 0;
function newLevel(){
example = ModPE.readData("example");
}
function leaveGame(){
ModPE.saveData("example",example);
}
If this doesn't work, there is another way but it is a pain...
For a while, I've placed save data and read data in the code, but I've just noticed it have been bugging out since I added a new feature.
The issue is that whenever I exit blocklauncher and reenter it, the read data fails, and it work perfectly fine if I just exit the world instead of exiting out of the launcher itself.
Code:
var example=0; Function newLevel(){ ModPE.readData("example") } Function leaveGame(){ ModPE.saveData("example",example) }is this just a bug or is there a problem with my code
nvm, its a block launcher bug, I looked at older post of ModPE.saveData, there is a bug with block launcher that whenever its closed, the variables reset with or without save data
ok
A while back I was angry at ModPE.saveData and MAY have been cursing at it.... I did manage to get it work though.
var example = 0; function newLevel(){ example = ModPE.readData("example"); } function leaveGame(){ ModPE.saveData("example",example); }If this doesn't work, there is another way but it is a pain...
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Soo whats the more complicated way??? I am trying to go for this way: http://www.minecraftforum.net/topic/2756930-create-file-and-read-data/