parent
8009b927c8
commit
eebd26b911
@ -0,0 +1,19 @@ |
|||||||
|
{ |
||||||
|
"id": "375a746a-804f-4301-8d8e-7ce40f231c36", |
||||||
|
"modelName": "GMIncludedFile", |
||||||
|
"mvc": "1.0", |
||||||
|
"name": "Sekaiwa_Koini_Ochiteru.txt", |
||||||
|
"CopyToMask": -1, |
||||||
|
"exists": false, |
||||||
|
"exportAction": 0, |
||||||
|
"exportDir": "", |
||||||
|
"fileName": "Sekaiwa_Koini_Ochiteru.txt", |
||||||
|
"filePath": "datafiles\\songdata", |
||||||
|
"freeData": false, |
||||||
|
"origName": "", |
||||||
|
"overwrite": false, |
||||||
|
"removeEnd": false, |
||||||
|
"size": 0, |
||||||
|
"store": false, |
||||||
|
"tags": "" |
||||||
|
} |
@ -0,0 +1,3 @@ |
|||||||
|
/// @description Save data. |
||||||
|
song_file_writer("songdata"+audio_get_name(global.music_selection)+".txt") |
||||||
|
debugtxt = "Saved Song Data !" |
@ -1,4 +1,4 @@ |
|||||||
global.music_selection = Sekaiwa_Koini_Ochiteru |
global.music_selection = Sekaiwa_Koini_Ochiteru |
||||||
global.music_bpm = 130 |
global.music_bpm = 130 |
||||||
song_file_reader("TestSongFormat.txt") |
song_file_reader("songdata/"+audio_get_name(global.music_selection)+".txt") |
||||||
room_goto(playfield) |
room_goto(playfield) |
@ -0,0 +1,38 @@ |
|||||||
|
/// @function song_file_reader(filename) |
||||||
|
/// @description Reads a song file and creates the appropriate playfield for the song. |
||||||
|
/// @param filename The file to read from. |
||||||
|
|
||||||
|
/*<FILE START> |
||||||
|
TITLE |
||||||
|
SONGID |
||||||
|
OFFSET |
||||||
|
BPM |
||||||
|
NOTETYPE |
||||||
|
NOTETYPE,NOTEDATA,TIMING*/ |
||||||
|
|
||||||
|
global.SONG_file = file_text_open_read(argument0); |
||||||
|
global.SONG_title = file_text_read_string(global.SONG_file); |
||||||
|
global.SONG_songid = file_text_read_real(global.SONG_file); |
||||||
|
global.SONG_offset = file_text_read_string(global.SONG_file); |
||||||
|
global.SONG_bpm = file_text_read_real(global.SONG_file); |
||||||
|
if (global.SONG_timeline!=-1 && timeline_exists(global.SONG_timeline)) { |
||||||
|
timeline_clear(global.SONG_timeline); |
||||||
|
} |
||||||
|
global.SONG_timeline = timeline_add(); |
||||||
|
var i=0; |
||||||
|
while (!file_text_eof(global.SONG_file)) { |
||||||
|
global.SONG_note[i]=file_text_read_string(global.SONG_file); |
||||||
|
if (string_count(",",global.SONG_note[i])==3) { |
||||||
|
str1 = string_copy(global.SONG_note[i],0,string_pos(",",global.SONG_note[i])); |
||||||
|
temp1 = string_copy(global.SONG_note[i],string_pos(",",global.SONG_note[i]),string_length(global.SONG_note[i])-string_pos(",",global.SONG_note[i])); |
||||||
|
str2 = string_copy(str1,0,string_pos(",",str1)); |
||||||
|
temp2 = string_copy(str1,string_pos(",",str1),string_length(str1)-string_pos(",",str1)); |
||||||
|
str3 = string_copy(str2,0,string_pos(",",str2)); |
||||||
|
note = instance_create_layer(0,0,playfield,music_note) |
||||||
|
note.val1=real(str1); |
||||||
|
note.val2=real(str2); |
||||||
|
note.val3=real(str3); |
||||||
|
} |
||||||
|
i+=1; |
||||||
|
file_text_readln(global.SONG_file); |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"id": "57fd057a-79d6-4298-a8d5-807f353ec3b9", |
||||||
|
"modelName": "GMScript", |
||||||
|
"mvc": "1.0", |
||||||
|
"name": "song_file_reader1", |
||||||
|
"IsCompatibility": false, |
||||||
|
"IsDnD": false |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
/// @function song_file_reader(filename) |
||||||
|
/// @description Reads a song file and creates the appropriate playfield for the song. |
||||||
|
/// @param filename The file to read from. |
||||||
|
|
||||||
|
/*<FILE START> |
||||||
|
TITLE |
||||||
|
SONGID |
||||||
|
OFFSET |
||||||
|
BPM |
||||||
|
NOTETYPE |
||||||
|
NOTETYPE,NOTEDATA,TIMING*/ |
||||||
|
|
||||||
|
global.SONG_file = file_text_open_write(argument0); |
||||||
|
file_text_write_string(global.SONG_file,global.SONG_title); |
||||||
|
file_text_writeln(global.SONG_file); |
||||||
|
file_text_write_real(global.SONG_file,global.SONG_songid); |
||||||
|
file_text_writeln(global.SONG_file); |
||||||
|
file_text_write_string(global.SONG_file,global.SONG_offset); |
||||||
|
file_text_writeln(global.SONG_file); |
||||||
|
file_text_write_real(global.SONG_file,global.SONG_bpm); |
||||||
|
file_text_writeln(global.SONG_file); |
||||||
|
var i=0; |
||||||
|
while (global.SONG_note[i]!=0) { |
||||||
|
global.SONG_note[i]=file_text_write_string(global.SONG_file,global.SONG_note[i]); |
||||||
|
file_text_writeln(global.SONG_file); |
||||||
|
} |
||||||
|
file_text_close(global.SONG_file) |
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"id": "57fd057a-79d6-4298-a8d5-807f353ec3b9", |
||||||
|
"modelName": "GMScript", |
||||||
|
"mvc": "1.0", |
||||||
|
"name": "song_file_writer", |
||||||
|
"IsCompatibility": false, |
||||||
|
"IsDnD": false |
||||||
|
} |
@ -0,0 +1,13 @@ |
|||||||
|
{ |
||||||
|
"id": "246b6677-8b24-4947-9115-36b8d4fc01e8", |
||||||
|
"modelName": "GMFolder", |
||||||
|
"mvc": "1.1", |
||||||
|
"name": "246b6677-8b24-4947-9115-36b8d4fc01e8", |
||||||
|
"children": [ |
||||||
|
"375a746a-804f-4301-8d8e-7ce40f231c36" |
||||||
|
], |
||||||
|
"filterType": "GMIncludedFile", |
||||||
|
"folderName": "songdata", |
||||||
|
"isDefaultView": false, |
||||||
|
"localisedFolderName": "" |
||||||
|
} |
Loading…
Reference in new issue