jackrucel
Member
Hello, in the following example:
I would like to skip the first three lines without changing them, but change the fourth line to "Debugtest999", but what happens however is that the first 3 lines will be blank in .txt and the fourth line is changed.
I would like to change the fourth line without changing the first three, how do I do this with .txt files?
Thank you.
Additional information that is not required for the question:
Edit:
Thread solved.
Code:
//Creat:
var ifile;
ifile = file_text_open_write("Debug.txt")
file_text_write_string(ifile,"Debugtest01")
file_text_writeln(ifile)
file_text_write_string(ifile,"Debugtest02")
file_text_writeln(ifile)
file_text_write_string(ifile,"Debugtest03")
file_text_writeln(ifile)
file_text_write_string(ifile,"Debugtest04")
file_text_writeln(ifile)
file_text_close(ifile)
//Step:
var ifile;
if keyboard_check_pressed(ord("Q")) {
if file_exists("Debug.txt"){
ifile = file_text_open_write("Debug.txt")
file_text_writeln(ifile)
file_text_writeln(ifile)
file_text_writeln(ifile)
file_text_write_string(ifile,"Debugtest999")
file_text_close(ifile) } }
I would like to change the fourth line without changing the first three, how do I do this with .txt files?
Thank you.
Additional information that is not required for the question:
It has to be .txt since I am not willing to use .bin and what I want to do is too big for .ini.
what am I doing:
I am making a chunks system to save the information of my world, first I create a 100x100 array to format the continent, then for each cell marked "continent" I create another 99x99 array to store information like appearance of grass, stones, etc ...
the problem is that when I tried to put all the chunks in a single array, it took forever, however, if for each chunk I create an obj and have this obj create a 99x99 array, the delay drops to maybe 30 seconds.
however creating an obj for each chunk and limiting the number of chunks to about 1800, the fps drops from 6k to 300-600, but if I only display the 9 chunks closest to the player and delete the rest I get the 6k fps back , however to delete them I need to save them so that any changes made by the player remain.
1800 chunks is not much, in my last test using 1 .txt for each chunk the following numbers will appear.
approximately 1800 .txt
approximately 300mb of ram
approximately 34mb of the hard drive
300MB ram and 34mb hard drive is nothing, my problem is the drop from 6k fps to 200-300 and the 1800 files created.
Thank you.
what am I doing:
I am making a chunks system to save the information of my world, first I create a 100x100 array to format the continent, then for each cell marked "continent" I create another 99x99 array to store information like appearance of grass, stones, etc ...
the problem is that when I tried to put all the chunks in a single array, it took forever, however, if for each chunk I create an obj and have this obj create a 99x99 array, the delay drops to maybe 30 seconds.
however creating an obj for each chunk and limiting the number of chunks to about 1800, the fps drops from 6k to 300-600, but if I only display the 9 chunks closest to the player and delete the rest I get the 6k fps back , however to delete them I need to save them so that any changes made by the player remain.
1800 chunks is not much, in my last test using 1 .txt for each chunk the following numbers will appear.
approximately 1800 .txt
approximately 300mb of ram
approximately 34mb of the hard drive
300MB ram and 34mb hard drive is nothing, my problem is the drop from 6k fps to 200-300 and the 1800 files created.
Thank you.
Edit:
Thread solved.
Last edited: