Failing to get .tres files to load

I’m using Godot v4.2.2-stable_win_64

I’m trying to get a resource file to hold information for multiple scenes, but always get Error constructing a GDScriptInstance when trying to load it. I’ve been trying to get it work for hours without making any progress so I’m guessing there’s some kind of fundamental problem in my understanding of how to use Resources. The relevant code I’m trying to run is.

Here’s the relevant code

@tool
extends Sprite2D #Sprite used on the map for the city

const cityclass = preload("res://Resources/Cities/CityClass.gd")
const rhoclass = preload("res://Resources/RHO.gd") #Resourse hand off variable, trying to just pass a single string with it
@export var the_cruciable = City.new("The Cruciable", "res://Resources/Cities/TheCruciable.gd")
@export var CityEntered : RHO 

func _on_area_2d_area_entered(area):
	if area.name == "PMSArea": #Detecting if Player's Map Sprite's Area entered the city
		$CruciableEnterBut.visible = true	#Make button to enter city visible
		CityEntered.handoff = the_cruciable.this_city #Transfer the string stored in var the_cruciable's this_city var
		ResourceSaver.save(CityEntered, "res://Resources/CityEntered.tres") #Save the this_city string for my CityMenu script to read which city was entered

func _on_area_2d_area_exited(area):
	if area.name == "PMSArea": #Detecting if Player Map Sprite's Area has left the city
		$CruciableEnterBut.visible = false #Remove the button to enter the city
		CityEntered.handoff = "null" #Clear the .handoff string from City Enetered when player leaves city
		ResourceSaver.save(CityEntered, "res://Resources/CityEntered.tres") #Clear the string from the resource

extends Resource #Rho class definition

class_name RHO

@export var handoff: String

func _init(init_handoff: String):
		self.handoff = init_handoff

extends Resource #City class definition

class_name City

@export var display_name : String
@export var this_city : String

func _init(init_display_name: String, init_this_city: String):
	self.display_name = init_display_name
	self.this_city = init_this_city
extends CanvasLayer #CityMenu script

const cityclass = preload("res://Resources/Cities/CityClass.gd")
const rhoclass = preload("res://Resources/RHO.gd")

func _on_visibility_changed():
	var city_entered = load("res://Resources/CityEntered.tres") as RHO

I’ve been able to verity with the @tool function that I can get the resource file to both be created from scratch and to be filled with the expected string, but I’ve never been able to get a the load operation to successfully load it. Also I’ve had issues with trying to replace the Resource with the “null” string, although that’s not really an issue.

I’ve resolved this issue. there was indeed a fundamental issue with my understanding of resources. As far as I can tell resource loading is incompatible with classes that include the _init function. Which I’m hoping is wrong and I just don’t know how to implement them to be compatible with each other. If anyone cares about seeing the code changes that got everything working properly I’ll include them below.

extends Sprite2D #sprite 2d use on the map for the city

var the_cruciable = ResourceLoader.load("res://Resources/Cities/TheCruciable.res")
var city_entered = RHO.new()

##### Example of how I initialize my resource files
#func _ready():
#	the_cruciable.display_name = "The Cruciable"
#	the_cruciable.this_city = "res://Resources/Cities/TheCruciable.res"
#	ResourceSaver.save(the_cruciable, "res://Resources/Cities/TheCruciable.res")

# When player map sprite area enters the city's area on the map make enter 
# button visible and store the handoff var for the city for CityMenu to recall
func _on_area_2d_area_entered(area):
	if area.name == "PMSArea":
		$CruciableEnterBut.visible = true
		city_entered.handoff = the_cruciable.this_city
		ResourceSaver.save(city_entered, "res://Resources/CityEntered.res")
		
# When player map sprite area leaves the city's area on the map hide enter
# button, null the value in resource hand off function.		
func _on_area_2d_area_exited(area):
	if area.name == "PMSArea":
		$CruciableEnterBut.visible = false
		city_entered.handoff = "null"
		ResourceSaver.save(city_entered, "res://Resources/CityEntered.res")
extends CanvasLayer #CityMenu

var city_entered : RHO
var city : City

# Load the resource file delivered by the handoff varialbe and then display and 
# then display the entered city's name on a label.
func _on_visibility_changed():
	city_entered = ResourceLoader.load("res://Resources/CityEntered.res")
	city = ResourceLoader.load(city_entered.handoff)
	$CityName.text = city.display_name
#Updated City class without the _init function so it's loadable
class_name City extends Resource 

@export var display_name : String
@export var this_city : String
#Updated Resource Handoff Class without _init function
class_name RHO extends Resource

@export var handoff: String