SO if you ever need to take individual characters from a line in a file using text_read, beware! There are random "0" characters(as in, the character value of 0).
for example, if you load the settings for a game using a single line:line = file_text_read_string(file);for (z=0; z<=string_length(line); z+=1) {array_character[z] = string_char_at(line,z+1);}Keep in mind this is using a file generated from GM's file_text_write_string , so that may be a possible cause. Also, it is using string_char_at, however string_copy does return a 0 value also.It is easy to combat though. Just check with this:if (ord(string_char_at(line,z+1)) != 0) {//set in array}but it will save that in the array which may mess up your values. so the easiest way is to do this. heres the whole code:L=0;for (z=0; z<=string_length(line); z+=1) {if (ord(string_char_at(line,z+1)) != 0) {array_character[L] = string_char_at(line,z+1);L+=1;}}I know most peeps would not need to adress this problem or even use GM anymore, but i posted it for shits.…and it was pissing me off cause i didnt know what was wrong! lol >:(
can you give us an example cuz I don't know wtf you're talkin'bout.
o.o I've never heard of that problem
This is weirder than that time I had diarrhea and shat myself while I was sleeping.
Omg this is really useful for me thanks! :D
Never used text_read, so I mostly don't know what you're talking about. I am well aware, however, that GM gives you a lot of zeroes when it tries to interpret number variables as strings.
Something sounds strange. It's been a while since I've done anything with files in GM, but I don't remember encountering such a problem.
Maybe the issue is with the code you're using to create the file?8-3
"Propane and propane accessories."