It is as simple as reading the text file and parsing (i.e. "exploding") the string.
Something like this:
var file; //Open the text file file = file_text_open_read("song.osu"); //Read lines until hit end of file while (file_text_eof(file) == false){ var str; //Read the whole line str = file_text_read_string(file); file_text_readln(file); //Check if it's a block identifier with [ beginning if (string_char_at(str,0) == "["){ continue; } //Split the string int x, y , time, type, hitSound; var addition; int pos; //You should maybe check with string_count() to see if the file is not corrupt and there really is 5 commas (",") pos = string_pos(",",str); x = real(string_copy(str,0,pos)); str = string_delete(str, 0, pos); pos = string_pos(",",str); y = real(string_copy(str,0,pos)); str = string_delete(str, 0, pos); pos = string_pos(",",str); time = real(string_copy(str,0,pos)); str = string_delete(str, 0, pos); pos = string_pos(",",str); type = real(string_copy(str,0,pos)); str = string_delete(str, 0, pos); pos = string_pos(",",str); hitSound = real(string_copy(str,0,pos)); str = string_delete(str, 0, pos); addition = str; show_message("Loaded:# x="+string(x)+"# y="+string(y)+"# time="+string(time)+"# type="+string(type)+"# hitSound="+string(hitSound)+"# addition="+addition); } There are many ways to actually do this in ENIGMA (or any tool/programming language). Like this is possibility one of the slowest. A faster way is to go trough the string by character, so you don't copy and delete string all the time.
|