No dependencies or owners are shown in Godot.
I tried to deeply look into how this error works and I found the following things:
Whenever any .gdfile is moved in editor, just by drag and drop, as shown on the video above, I get an Output error:
ERROR: Another resource is loaded from path 'res://scripts/player_data/puzzle.gd' (possible cyclic resource inclusion).
Regardless of the machine I tested it on, the message is the same with only the path changing to whatever folder the file was moved to. It doesn’t cause any errors during gameplay unless one of the three scripts that extend from resource are moved: player_data_resource.gd, puzzle_data_resource.gd, or puzzle_stats.gd.
All three of these are used by Autoloads. player_data_resource.gd is referenced by player_data.gd, puzzle_data_resource.gd is referenced by puzzle_stats, and puzzle_stats.gd is referenced by puzzle_data.gd.
On game start, the same 5 errors will appear in the Debugger. If the game reaches the line of code where any of these two (puzzle_data and player_data) Autoloads are referenced, the game will stop with a null reference error.
E 0:00:01:129 puzzle_data.gd:21 @ load_data(): Attempt to open script 'res://scripts/stats/resources/puzzle_stats.gd' resulted in error 'File not found'.
<C++ Error> Condition "err" is true. Returning: err
<C++ Source> modules/gdscript/gdscript.cpp:1127 @ load_source_code()
<Stack Trace> puzzle_data.gd:21 @ load_data()
puzzle_data.gd:10 @ _ready()
E 0:00:01:129 puzzle_data.gd:21 @ load_data(): Failed loading resource: res://scripts/stats/resources/puzzle_stats.gd.
<C++ Error> Condition "found" is true. Returning: Ref<Resource>()
<C++ Source> core/io/resource_loader.cpp:343 @ _load()
<Stack Trace> puzzle_data.gd:21 @ load_data()
puzzle_data.gd:10 @ _ready()
E 0:00:01:129 puzzle_data.gd:21 @ load_data(): user://puzzle_data.tres:62 - Parse Error: [ext_resource] referenced non-existent resource at: res://scripts/stats/resources/puzzle_stats.gd.
<C++ Source> scene/resources/resource_format_text.cpp:40 @ _printerr()
<Stack Trace> puzzle_data.gd:21 @ load_data()
puzzle_data.gd:10 @ _ready()
E 0:00:01:129 puzzle_data.gd:21 @ load_data(): user://puzzle_data.tres:62 - Parse Error: [ext_resource] referenced non-existent resource at: res://scripts/stats/resources/puzzle_stats.gd.
<C++ Source> scene/resources/resource_format_text.cpp:40 @ _printerr()
<Stack Trace> puzzle_data.gd:21 @ load_data()
puzzle_data.gd:10 @ _ready()
E 0:00:01:129 puzzle_data.gd:21 @ load_data(): Failed loading resource: user://puzzle_data.tres.
<C++ Error> Condition "found" is true. Returning: Ref<Resource>()
<C++ Source> core/io/resource_loader.cpp:343 @ _load()
<Stack Trace> puzzle_data.gd:21 @ load_data()
puzzle_data.gd:10 @ _ready()
Now I didn’t think it would be revelant until then, but here’s how puzzle_data.gd references puzzle_stats.gd.
extends Node
var puzzle_statistics: PuzzleStatistics
var _save_file_path = "user://puzzle_data.tres"
func _ready() -> void:
# Load data
puzzle_statistics = load_data()
func save_data(data: PuzzleDataResource):
puzzle_statistics.stats.push_back(data)
ResourceSaver.save(puzzle_statistics, _save_file_path)
func load_data():
# Load save file, if it exists
if ResourceLoader.exists(_save_file_path):
var _resource = load(_save_file_path)
return _resource
var _new_resource = PuzzleStatistics.new()
return _new_resource
func count_completed(result: bool) -> int:
var _amount: int = 0
for i in puzzle_statistics.stats.size():
if puzzle_statistics.stats[i].completed == result:
_amount += 1
return _amount
func count_difficulties(difficulty: Puzzle.PuzzleDifficulty):
var _amount: int = 0
for i in puzzle_statistics.stats.size():
if puzzle_statistics.stats[i].difficulty == difficulty:
_amount += 1
return _amount
puzzle_stats.gd:
extends Resource
class_name PuzzleStatistics
@export var stats: Array[PuzzleDataResource]
puzzle_data_resource.gd:
extends Resource
class_name PuzzleDataResource
# Player data
@export var puzzle_name: String
@export var difficulty: Puzzle.PuzzleDifficulty
@export var completed: bool
@export var completion_time: int
Keep in mind that these scripts did not cause any errors beforehand in these forms though, so I don’t think the problem is with the code itself.
Now about how we handle PRs according to the Tech Guide I wrote. I will add however that aforementioned Autoloads were written by me, so I also don’t think it’s something that any of the other developers done:
When starting your work on the project, follow these steps:
-
Create a new branch with the name of the feature
- You do not need to publish the branch unless you leave work or someone asks to work on it
-
Commit changes regularly and when taking a break
-
Finish work on the feature
-
Make a pull request
- At this point the branch needs to be published
-
Wait till your request is approved by two other developers
- Fix or adress any requested changed
-
Squash-merge the branch into develop
I apologize if this is a lot, but I wanted to give as much explanation as possible to the issue.