From eebd26b9110f7a07054999d1a9df7e698e7a6515 Mon Sep 17 00:00:00 2001 From: Joshua Sigona Date: Wed, 5 Jun 2019 16:56:02 +0900 Subject: [PATCH] Added debug overlays and file read/write operations. --- GameMakerStudio2/Bandori/Bandori.yyp | 27 ++++++++++++- .../Bandori/Sekaiwa_Koini_Ochiteru.txt | 7 ++++ .../songdata/Sekaiwa_Koini_Ochiteru.txt | 7 ++++ .../songdata/Sekaiwa_Koini_Ochiteru.txt.yy | 19 ++++++++++ .../objects/background_field/Create_0.gml | 5 ++- .../objects/background_field/Draw_0.gml | 4 ++ .../objects/background_field/KeyPress_114.gml | 3 ++ .../objects/background_field/Mouse_54.gml | 0 .../background_field/background_field.yy | 20 ++++++++++ .../music_selection_controller/Create_0.gml | 2 +- .../song_file_reader1/song_file_reader1.gml | 38 +++++++++++++++++++ .../song_file_reader1/song_file_reader1.yy | 8 ++++ .../song_file_writer/song_file_writer.gml | 27 +++++++++++++ .../song_file_writer/song_file_writer.yy | 8 ++++ .../168f6e4f-30e3-4950-868f-6ea48b36a8d8.yy | 3 +- .../246b6677-8b24-4947-9115-36b8d4fc01e8.yy | 13 +++++++ .../845cdbdd-d4ad-415d-bca7-04f31b6e6c99.yy | 3 +- 17 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 GameMakerStudio2/Bandori/Sekaiwa_Koini_Ochiteru.txt create mode 100644 GameMakerStudio2/Bandori/datafiles/songdata/Sekaiwa_Koini_Ochiteru.txt create mode 100644 GameMakerStudio2/Bandori/datafiles_yy/songdata/Sekaiwa_Koini_Ochiteru.txt.yy create mode 100644 GameMakerStudio2/Bandori/objects/background_field/KeyPress_114.gml create mode 100644 GameMakerStudio2/Bandori/objects/background_field/Mouse_54.gml create mode 100644 GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.gml create mode 100644 GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.yy create mode 100644 GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.gml create mode 100644 GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.yy create mode 100644 GameMakerStudio2/Bandori/views/246b6677-8b24-4947-9115-36b8d4fc01e8.yy diff --git a/GameMakerStudio2/Bandori/Bandori.yyp b/GameMakerStudio2/Bandori/Bandori.yyp index 8924321..adb4874 100644 --- a/GameMakerStudio2/Bandori/Bandori.yyp +++ b/GameMakerStudio2/Bandori/Bandori.yyp @@ -70,6 +70,14 @@ "resourceType": "GMObject" } }, + { + "Key": "246b6677-8b24-4947-9115-36b8d4fc01e8", + "Value": { + "id": "2c0b2a82-5031-41a0-9848-355fad95281c", + "resourcePath": "views\\246b6677-8b24-4947-9115-36b8d4fc01e8.yy", + "resourceType": "GMFolder" + } + }, { "Key": "292c43b1-1f73-4bf1-a374-f7335d04df3f", "Value": { @@ -102,6 +110,14 @@ "resourceType": "GMFolder" } }, + { + "Key": "375a746a-804f-4301-8d8e-7ce40f231c36", + "Value": { + "id": "b22375ab-2b5a-4978-9f37-dd7824dbb249", + "resourcePath": "datafiles_yy\\songdata\\Sekaiwa_Koini_Ochiteru.txt.yy", + "resourceType": "GMIncludedFile" + } + }, { "Key": "3af8c491-95d5-49f2-ad8e-204ee5d672c2", "Value": { @@ -174,6 +190,14 @@ "resourceType": "GMScript" } }, + { + "Key": "57fd057a-79d6-4298-a8d5-807f353ec3b9", + "Value": { + "id": "3c26574d-d36d-46c7-80bc-b0dd47b8dcbc", + "resourcePath": "scripts\\song_file_writer\\song_file_writer.yy", + "resourceType": "GMScript" + } + }, { "Key": "5c8f2a9d-ca8c-4306-81ef-f1172aa12cd5", "Value": { @@ -366,7 +390,8 @@ "9b3969f3-bd44-47ed-9b48-f6c85ded7082", "c0e356fa-e36a-4477-973a-556032ed0262", "d47c7e44-37b2-454b-abcd-743c1820603b", - "008b1512-eed6-4d5f-9207-e064882a4844" + "008b1512-eed6-4d5f-9207-e064882a4844", + "57fd057a-79d6-4298-a8d5-807f353ec3b9" ], "tutorial": "" } \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/Sekaiwa_Koini_Ochiteru.txt b/GameMakerStudio2/Bandori/Sekaiwa_Koini_Ochiteru.txt new file mode 100644 index 0000000..1ced3ff --- /dev/null +++ b/GameMakerStudio2/Bandori/Sekaiwa_Koini_Ochiteru.txt @@ -0,0 +1,7 @@ +SEKAIWA KOINI OCHITERU +Sekaiwa_Koini_Ochiteru +0 +130 +1,2,4.333333333 +1,6,4.333333333 +1,4,5.7777777777777777777777744444444‬ diff --git a/GameMakerStudio2/Bandori/datafiles/songdata/Sekaiwa_Koini_Ochiteru.txt b/GameMakerStudio2/Bandori/datafiles/songdata/Sekaiwa_Koini_Ochiteru.txt new file mode 100644 index 0000000..1ced3ff --- /dev/null +++ b/GameMakerStudio2/Bandori/datafiles/songdata/Sekaiwa_Koini_Ochiteru.txt @@ -0,0 +1,7 @@ +SEKAIWA KOINI OCHITERU +Sekaiwa_Koini_Ochiteru +0 +130 +1,2,4.333333333 +1,6,4.333333333 +1,4,5.7777777777777777777777744444444‬ diff --git a/GameMakerStudio2/Bandori/datafiles_yy/songdata/Sekaiwa_Koini_Ochiteru.txt.yy b/GameMakerStudio2/Bandori/datafiles_yy/songdata/Sekaiwa_Koini_Ochiteru.txt.yy new file mode 100644 index 0000000..aede9f2 --- /dev/null +++ b/GameMakerStudio2/Bandori/datafiles_yy/songdata/Sekaiwa_Koini_Ochiteru.txt.yy @@ -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": "" +} \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/objects/background_field/Create_0.gml b/GameMakerStudio2/Bandori/objects/background_field/Create_0.gml index fc39114..8e729bb 100644 --- a/GameMakerStudio2/Bandori/objects/background_field/Create_0.gml +++ b/GameMakerStudio2/Bandori/objects/background_field/Create_0.gml @@ -55,4 +55,7 @@ FLICKER_TIME = 0 FLICKER_OFFSET = 0.5 //Amount of time in seconds to offset the flicker. Set with END key in EDIT MODE. -LAST_BEAT += FLICKER_OFFSET \ No newline at end of file +LAST_BEAT += FLICKER_OFFSET + +saveactions = "F3 - Save new data." +debugtxt = "" \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/objects/background_field/Draw_0.gml b/GameMakerStudio2/Bandori/objects/background_field/Draw_0.gml index b8c05de..cf6905c 100644 --- a/GameMakerStudio2/Bandori/objects/background_field/Draw_0.gml +++ b/GameMakerStudio2/Bandori/objects/background_field/Draw_0.gml @@ -33,4 +33,8 @@ if (global.mode==1) { draw_set_color(c_white) draw_text(camera_get_view_x(view_camera[0]),0,string(TIME_BETWEEN_BEAT)) draw_text(camera_get_view_x(view_camera[0]),16,string(LAST_BEAT%TIME_BETWEEN_BEAT)) + draw_set_halign(fa_right) + draw_text(camera_get_view_x(view_camera[0])+camera_get_view_width(view_camera[0]),0,saveactions) + draw_text(camera_get_view_x(view_camera[0])+camera_get_view_width(view_camera[0]),string_height(debugtxt),debugtxt) + draw_set_halign(fa_left) } \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/objects/background_field/KeyPress_114.gml b/GameMakerStudio2/Bandori/objects/background_field/KeyPress_114.gml new file mode 100644 index 0000000..88932f6 --- /dev/null +++ b/GameMakerStudio2/Bandori/objects/background_field/KeyPress_114.gml @@ -0,0 +1,3 @@ +/// @description Save data. +song_file_writer("songdata"+audio_get_name(global.music_selection)+".txt") +debugtxt = "Saved Song Data !" \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/objects/background_field/Mouse_54.gml b/GameMakerStudio2/Bandori/objects/background_field/Mouse_54.gml new file mode 100644 index 0000000..e69de29 diff --git a/GameMakerStudio2/Bandori/objects/background_field/background_field.yy b/GameMakerStudio2/Bandori/objects/background_field/background_field.yy index 2f61b55..c5602f9 100644 --- a/GameMakerStudio2/Bandori/objects/background_field/background_field.yy +++ b/GameMakerStudio2/Bandori/objects/background_field/background_field.yy @@ -43,6 +43,26 @@ "enumb": 35, "eventtype": 9, "m_owner": "22998e6f-2f12-4c9e-8ab3-f05bf4af3bf5" + }, + { + "id": "4221f34a-b34a-4d31-83a2-47f038d42159", + "modelName": "GMEvent", + "mvc": "1.0", + "IsDnD": false, + "collisionObjectId": "00000000-0000-0000-0000-000000000000", + "enumb": 54, + "eventtype": 6, + "m_owner": "22998e6f-2f12-4c9e-8ab3-f05bf4af3bf5" + }, + { + "id": "28554264-a583-494b-9ae4-2a870dc8dcb5", + "modelName": "GMEvent", + "mvc": "1.0", + "IsDnD": false, + "collisionObjectId": "00000000-0000-0000-0000-000000000000", + "enumb": 114, + "eventtype": 9, + "m_owner": "22998e6f-2f12-4c9e-8ab3-f05bf4af3bf5" } ], "maskSpriteId": "00000000-0000-0000-0000-000000000000", diff --git a/GameMakerStudio2/Bandori/objects/music_selection_controller/Create_0.gml b/GameMakerStudio2/Bandori/objects/music_selection_controller/Create_0.gml index cce1300..f0a494e 100644 --- a/GameMakerStudio2/Bandori/objects/music_selection_controller/Create_0.gml +++ b/GameMakerStudio2/Bandori/objects/music_selection_controller/Create_0.gml @@ -1,4 +1,4 @@ global.music_selection = Sekaiwa_Koini_Ochiteru global.music_bpm = 130 -song_file_reader("TestSongFormat.txt") +song_file_reader("songdata/"+audio_get_name(global.music_selection)+".txt") room_goto(playfield) \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.gml b/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.gml new file mode 100644 index 0000000..95e743d --- /dev/null +++ b/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.gml @@ -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. + +/* +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); +} \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.yy b/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.yy new file mode 100644 index 0000000..3f985f4 --- /dev/null +++ b/GameMakerStudio2/Bandori/scripts/song_file_reader1/song_file_reader1.yy @@ -0,0 +1,8 @@ +{ + "id": "57fd057a-79d6-4298-a8d5-807f353ec3b9", + "modelName": "GMScript", + "mvc": "1.0", + "name": "song_file_reader1", + "IsCompatibility": false, + "IsDnD": false +} \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.gml b/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.gml new file mode 100644 index 0000000..6ee35ca --- /dev/null +++ b/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.gml @@ -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. + +/* +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) \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.yy b/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.yy new file mode 100644 index 0000000..8bed8c6 --- /dev/null +++ b/GameMakerStudio2/Bandori/scripts/song_file_writer/song_file_writer.yy @@ -0,0 +1,8 @@ +{ + "id": "57fd057a-79d6-4298-a8d5-807f353ec3b9", + "modelName": "GMScript", + "mvc": "1.0", + "name": "song_file_writer", + "IsCompatibility": false, + "IsDnD": false +} \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/views/168f6e4f-30e3-4950-868f-6ea48b36a8d8.yy b/GameMakerStudio2/Bandori/views/168f6e4f-30e3-4950-868f-6ea48b36a8d8.yy index 1118508..88efc88 100644 --- a/GameMakerStudio2/Bandori/views/168f6e4f-30e3-4950-868f-6ea48b36a8d8.yy +++ b/GameMakerStudio2/Bandori/views/168f6e4f-30e3-4950-868f-6ea48b36a8d8.yy @@ -4,7 +4,8 @@ "mvc": "1.1", "name": "168f6e4f-30e3-4950-868f-6ea48b36a8d8", "children": [ - "dc814062-491a-4f3d-9968-41c49ec0a64a" + "dc814062-491a-4f3d-9968-41c49ec0a64a", + "246b6677-8b24-4947-9115-36b8d4fc01e8" ], "filterType": "GMIncludedFile", "folderName": "datafiles", diff --git a/GameMakerStudio2/Bandori/views/246b6677-8b24-4947-9115-36b8d4fc01e8.yy b/GameMakerStudio2/Bandori/views/246b6677-8b24-4947-9115-36b8d4fc01e8.yy new file mode 100644 index 0000000..250dc61 --- /dev/null +++ b/GameMakerStudio2/Bandori/views/246b6677-8b24-4947-9115-36b8d4fc01e8.yy @@ -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": "" +} \ No newline at end of file diff --git a/GameMakerStudio2/Bandori/views/845cdbdd-d4ad-415d-bca7-04f31b6e6c99.yy b/GameMakerStudio2/Bandori/views/845cdbdd-d4ad-415d-bca7-04f31b6e6c99.yy index d216b35..37ba4f7 100644 --- a/GameMakerStudio2/Bandori/views/845cdbdd-d4ad-415d-bca7-04f31b6e6c99.yy +++ b/GameMakerStudio2/Bandori/views/845cdbdd-d4ad-415d-bca7-04f31b6e6c99.yy @@ -10,7 +10,8 @@ "9b3969f3-bd44-47ed-9b48-f6c85ded7082", "c0e356fa-e36a-4477-973a-556032ed0262", "d47c7e44-37b2-454b-abcd-743c1820603b", - "008b1512-eed6-4d5f-9207-e064882a4844" + "008b1512-eed6-4d5f-9207-e064882a4844", + "57fd057a-79d6-4298-a8d5-807f353ec3b9" ], "filterType": "GMScript", "folderName": "scripts",