Hi folks. I’m having some trouble loading resources from file. Consider the code below. It works when I’m testing it within Godot, with “phrases” being an array containing each line from sourceText.txt. After compiling, however, “phrases” returns “”
extends Node
var source = "res://sourceText.txt"
var file = FileAccess.open(source, FileAccess.READ)
var phrases = []
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
while not file.eof_reached():
phrases.append(file.get_line())
Some additional information that may be relevant: I am compiling for windows x32, as my processor is old and doesn’t have “SSE 4.2 instruction set support.” (I live in a remote area and cannot get a better processor in the near future.) I have tried compiling to x64 and sending it to a friend for testing, but the friend reported that the binary crashed before loading the game. As an x32 binary, the “” problem persists whether or not I use an embedded PCK. All other export settings are default. All other aspects of my game are loading properly, including some resources which are loaded from file (although not using the exact same code structure).
So, what could be causing this? And how do I fix it?