with(instance_find(Player,0)){
y = (global.room_ySize*16)-10;
}
saveRoom();
global.room_y -= 1;It updates. The problem, like I said in my edit above, is the loading script itself. Hopefully I can make it work, updates if I make any progress.
EDIT: Fixed, with a few small bugs. Everything is now perfectly persistent. I totally rewrote the loading code, but used the same principles as before. Here it is.
theX = argument0;
theY = argument1;
//get the file, read it into arrays of strings
fileId = file_text_open_read(working_directory + "\tempFiles\" + string(global.playId) + "_" + string(theX) + "_" + string(theY) + ".txt");
for(y1=0; y1<global.room_ySize; y1+=1){
theString = file_text_read_string(fileId);
theBaseStrings[y1] = theString;
file_text_readln(fileId);
}
file_text_readln(fileId);
for(y1=0; y1<global.room_ySize; y1+=1){
theString = file_text_read_string(fileId);
theOverlayStrings[y1] = theString;
file_text_readln(fileId);
}
file_text_close(fileId);
//break up the strings, read into maps
for(y1=0; y1<global.room_ySize; y1+=1){
x1 = 0;
theTileString = "";
for(stringPos=0; stringPos < string_length(theBaseStrings[y1]); stringPos+=1){
theChar = string_char_at(theBaseStrings[y1],stringPos);
if(theChar != ","){
theTileString += theChar;
}
else{
theTile = real(theTileString);
global.baseMap[x1,y1] = theTile;
theTileString = "";
x1 += 1;
}
}
}
for(y1=0; y1<global.room_ySize; y1+=1){
x1 = 0;
theTileString = "";
for(stringPos=0; stringPos < string_length(theOverlayStrings[y1]); stringPos+=1){
theChar = string_char_at(theOverlayStrings[y1],stringPos);
if(theChar != ","){
theTileString += theChar;
}
else{
theTile = real(theTileString);
global.overlayMap[x1,y1] = theTile;
theTileString = "";
x1 += 1;
}
}
}EDIT2: For the curious, the original reason for my problem was a combination of the filename thing and the fact I didn't insert the file_text_readln() function after I'd retrieved each line from my save file. This meant that it read to the end of the first line then gave up, loading only the top part of each screen and keeping the rest the same as any previous screen. Most of the other changes to the code were just to make it easier to understand and read.



Find content
Not Telling
