I found something, but no solution.
When i create a new resource, from my npc_properties.gd.
extends Resource
class_name NPCProperties
## for npcs
signal npc_died
@export var name: String = ""
@export var health: int
@export var max_health: int
@export var attack_strenght: int
@export var defense_strenght: int
@export var attack_speed: float
@export var angry: bool
@export var shedule: Dictionary[int,StringName]
#@export var appereance: Dictionary ##
@export var current_activity: String
@export var current_map: String
@export var activity_start_time: float
@export var current_position: Vector2
@export var current_path: Array
@export var managed_by_npc_manager: bool
@export var controlled_by_limbo: bool = false
@export var shedule_pause: bool = false
@export var guard_position: Vector2
@export var movement_queue: Dictionary
@export var movement_queue_order: Dictionary
@export var current_queue_id: int
@export var current_path_segment: int
@export var progress_segment: float
@export var dnd: bool ## is set by npc manager, while sleeping it is true f.e.
func _init() -> void:
_set_name()
##Call to set NPC name instead of doing by hand.
func _set_name() -> void:
var path_len = len("res://resources/npc_properties/")
var name_len = len(resource_path) - (path_len + 5)
name = resource_path.substr(path_len, name_len)
#print("NP PROP LOADED. \nRes path: ", resource_path," \nName: ", name)
it looks like this in the .tres:
[gd_resource type="Resource" script_class="NPCProperties" format=3 uid="uid://d20r4gtsd5ipx"]
[ext_resource type="Script" uid="uid://bgnyysqx4wtd7" path="res://resources/npc_properties/npc_properties.gd" id="1_boxro"]
[resource]
script = ExtResource("1_boxro")
metadata/_custom_type_script = "uid://bgnyysqx4wtd7"
If i add a property, like the dict for the movement_queue within the inspector, save the file, then adding another entry into the dict via the plugin works.
So Godot needs to have the variables set before.
But as long there is no empty variable set before, the plugin cannot write to it.
With Godot 4.4 a newly created resource looks like this:
[gd_resource type="Resource" script_class="NPCProperties" load_steps=2 format=3 uid="uid://d20r4gtsd5ipx"]
[ext_resource type="Script" uid="uid://bgnyysqx4wtd7" path="res://resources/npc_properties/npc_properties.gd" id="1_boxro"]
[resource]
script = ExtResource("1_boxro")
name = ""
health = 0
max_health = 0
attack_strenght = 0
defense_strenght = 0
attack_speed = 0.0
angry = false
shedule = Dictionary[int, StringName]({})
current_activity = ""
current_map = ""
activity_start_time = 0.0
current_position = Vector2(0, 0)
current_path = []
managed_by_npc_manager = false
controlled_by_limbo = false
shedule_pause = false
guard_position = Vector2(0, 0)
movement_queue = {}
movement_queue_order = {}
current_queue_id = 0
current_path_segment = 0
progress_segment = 0.0
dnd = false
metadata/_custom_type_script = "uid://bgnyysqx4wtd7"
So the question is, why in v.4.6.3 a newly .tres is just empty, without my variables?