Why does one resource know its type and the other does not????

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By monsterousoperandi

Parent class :

extends Resource
class_name Character

@export_category( "Bio" )
@export var character_name : String 
@export var rank : String
@export var _faction = "None"
@export var _is_dead : bool = false 
@export_multiline var _desc : String : get = get_desc

func get_desc() -> String :
return _desc

Child 1 works :

extends Character
class_name Monster

@export_category( "Events" )
@export_file var victory_passage 

func _init():
	rank = "Monster"
	_faction = "Monster"

child 2 does not :

extends Character
class_name NonPlayerChar

func _init(): 
	_faction = "NPC"

@export_category( "NPC" )
@export var affection : int = 0
@export var sudonym : String 
@export var name_is_known : bool

When I try to get

When I call get desc from a monster it work fine. When I try it from an npc I get an error that get_desc() is a non existent function in base ‘Resource’.

var monster : Monster = preload( "res://Characers/Monster/MonsterPrefabs/monster.tres" ) : set = set_monster, get = get_monster
var test_npc: NonPlayerChar = preload(  "res://Characers/NPC/MCs/test_npc.tres" ) : set = set_test_npc, get = get_test_npc

func get_monster() -> Monster :
return monster

func set_monster( _monster : Monster ) -> void : 
monster = _monster

func set_test_npc( _npc: NonPlayerChar ) -> void :
test_npc = _npc

func get_test_npc() -> NonPlayerChar :
return test_npc

I get the error and I look in the debugger. When I look at the monster object it shows all the fields.
when I look at the NPC object all I get is a reference to the resource. WHY?!!! what the crap is the difference? Monster knows its a child of Character but NonPlayerChar thinks it a Resource.
I’ve tried adding @tool to NonPlayerChar
no difference
But its not in Monster so I’m not really sure that should mater since monster works just fine.
its driving me insane!

:bust_in_silhouette: Reply From: monsterousoperandi

So the issue remains unknown but it seems it was a bug of some kind
I upgraded to Gd 4 Rc2
That didn’t’ fix it.
I deleted the existing class script and duped the working monster script, renaming it
That didn’t work
Then I deleted the broken class script again
reloaded the project
created a new one and named it something different
reloaded the project again
created a new resource from the new class script
reloaded again
and it worked… sigh.