Ok, I think I've narrowed down the issue. It's not what I thought. Parsing together the file paths works fine when I isolate that, but it breaks down when I retrieve info from my speech file. I have a JSON that contains all of the words and sentences with text to display on the screen, filenames, and various attributes of how I want the sound to play. It seems that the JSON isn't loading or the dictionary that's parsed from the JSON isn't being read properly. Any ideas on what could go wrong loading a JSON with HTML export? Here's my code for loading the JSON:
extends Node
var SpeechPath = "res://Data/Speech.json"
var DungeonSpeechPath = "res://Data/DungeonSpeech - Sheet1.json"
var SpeechData = {}
var DungeonData = {}
func _ready():
SpeechData = Load_JSON(SpeechPath)
DungeonData = Load_JSON(DungeonSpeechPath)
func Load_JSON(path):
var speech_file = File.new()
speech_file.open(path, File.READ)
var speech_json = JSON.parse(speech_file.get_as_text())
speech_file.close()
var data = speech_json.result
return data