how can I load a fnf chart (json) into godot?

I want to try to make fnf in godot only with gd script, but I still don’t know how to load json charts (in the sense that each note loads as a node)

It would be very helpful if someone could help me with this

mind explain what is fnf chart?
if it’s a json, then you can just load the json from FileAccess to read it, then navigate the open’d json file just like dictionary/array

1 Like

To open a json file you need to use JSON and FileAccess classes:

func _ready():
	# Open the file
	var file = FileAccess.open("file_path", FileAccess.READ)
	# Get the content as text
	var text = file.get_as_text()
	# Convert the text to json
	var json_result = JSON.parse_string(text)
2 Likes

Basically it would be a json that contains information for a song in fnf (Friday Night Funkin’) such as the bpm, speed, the time in which each note appears, what note it is (left, down, up or right), the section between opponent and player, the song used, etc

An example of what an FNF chart looks like is this:

{
	"song": {
		"speed": 1,
		"stage": "stage",
		"player1": "bf",
		"player2": "dad",
		"events": [],
		"notes": [
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [
					[
						12800,
						0,
						0
					],
					[
						13200,
						1,
						0
					],
					[
						13600,
						2,
						0
					],
					[
						14000,
						3,
						0
					]
				],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": false
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [
					[
						14400,
						0,
						0
					],
					[
						14800,
						1,
						0
					],
					[
						15200,
						2,
						0
					],
					[
						15600,
						3,
						0
					]
				],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			},
			{
				"gfSection": false,
				"altAnim": false,
				"typeOfSection": 0,
				"sectionNotes": [],
				"bpm": 150,
				"sectionBeats": 4,
				"changeBPM": false,
				"mustHitSection": true
			}
		],
		"splashSkin": "noteSplashes",
		"validScore": false,
		"gfVersion": "gf",
		"bpm": 150,
		"arrowSkin": "",
		"needsVoices": true,
		"song": "Test"
	}
}

sorry if it’s confusing