How do i make Friday night funkin' notes with json?

0 favourites
From the Asset Store
A fun horror zombie game you can upload to your website
  • sorry if i didn't explain clearly in the title since this is my first time on the forum

    I've been trying for the past week to make a Friday night funkin' game but i am having trouble with creating the notes

    i am using in-game .json files to create the notes but i cant figure out how to make it work

    i think it should work like this

    i get first array number which should be "sectionNotes[0]" or "sectionNotes.0"

    (i think its "sectionNotes.0" since i looked at the documentation)

    then i check if the "sectionNotes.0" is the current audio time then i do some math to get the current audio time in milliseconds

    then check if the second number is 0, 1, 2, or 3 then create a note

    then my second problem

    it is an array in array and im not sure how to get the values unless i need to edit them

  • Isn't the example "Rythm game" simpler to work with ?

    What "documentation" are you referring to ?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • the documentation i am refering to is https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/json

    and i looked at the rhythm game template and it doesnt seem like it would work with the json files that Friday night funkin' uses

  • Oh now I understand your issue.

    You are using an external format, in .JSON files and want to parse it in Construct to make your own engine using those files as data.

    You can see how you can use the "For each entry" condition in the JSON example in the start page of Construct.

    As you can notice, your "sectionNotes" array is at the same level as the "authors" array in the example.

    You can indeed check paths that will give something like

    notes.sectionNotes.X in your case (X being 0, 1, 2...)

    The issue is perhaps not with JSON, but with your time elapsed comparison.

    I assume for notes.sectionNotes.1 that you compare your time variable to be equal 600, when it would be more accurate to check if it is equal or greater than.

    This is only an assumption though, consider posting your actual project for us to be able to see what might be going wrong in your implementation.

  • Oh now I understand your issue.

    You are using an external format, in .JSON files and want to parse it in Construct to make your own engine using those files as data.

    You can see how you can use the "For each entry" condition in the JSON example in the start page of Construct.

    As you can notice, your "sectionNotes" array is at the same level as the "authors" array in the example.

    You can indeed check paths that will give something like

    notes.sectionNotes.X in your case (X being 0, 1, 2...)

    The issue is perhaps not with JSON, but with your time elapsed comparison.

    I assume for notes.sectionNotes.1 that you compare your time variable to be equal 600, when it would be more accurate to check if it is equal or greater than.

    This is only an assumption though, consider posting your actual project for us to be able to see what might be going wrong in your implementation.

  • here is my game: https://www.mediafire.com/file/lg6vvexvxhxt383/Game.c3p/file

    i also am pretty sure that the first number in the array is in milliseconds and im not sure how to check audio.currentTime as millisecnds

  • I was wondering has anybody figured this out I would like to make a game with fnf Json files but I do not know how to.

  • i think my game is broken actually because even when i make it create the note in each entry of "song.notes.sectionNotes"

    it does not create the object at the position

  • According to my tests checking types, the content of "Notes" is not an array, but objects.

    As far as I'm aware, Construct is not meant to read objects.

    I'm not sure the format of files you are attempting to read can fit Construct's JSON object.

  • use javascript to convert it into construct sprites and objects you can manipulate with events

  • i can get the song.notes.sectionNotes through json.get() expression

    i think my one of my main problems is getting audio time in milliseconds

    and then checking the time

  • Audio.PlaybackTime("tag")*1000 will return your song time in milliseconds

  • And in your code do not use "song time = elapsed time" but "song time >= elapsed time"

  • i have gotten it to work now! thank you!

    but i still have 1 problem, all of the objects are spawning at once

    how would i fix this?

    code:

  • i have figured almost everything out but im still having trouble syncing the notes to the music

    im not sure if i should compare the json key "sectionNotes.0" to the audio time or put a wait action at the "for each entry in .sectionNotes"

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)