diff --git a/client/scripts/autoloads/game_state.gd b/client/scripts/autoloads/game_state.gd index 05cacc630..e9998fd57 100644 --- a/client/scripts/autoloads/game_state.gd +++ b/client/scripts/autoloads/game_state.gd @@ -100,7 +100,8 @@ var character_archetype: String = "detective" # #705: Character visual descriptor — set by character_creation.gd on confirmation. # Passed to EntityRenderer for the player entity's CharacterVisual on game start. # Null when no custom appearance has been selected (fallback: default descriptor). -var character_visual_descriptor: CharacterVisualDescriptor = null +# Type is CharacterVisualDescriptor — untyped to avoid autoload parse-order issue. +var character_visual_descriptor = null # #646: AI-Enhanced Dialogue enabled state (D-138). # Runtime toggle — true means the LLM re-voicing pipeline should run (server-side). @@ -366,7 +367,8 @@ func apply_snapshot(snapshot: Dictionary) -> void: # Server persists the descriptor and includes it in ObserverSnapshot after load. # Only update when field is present (null means no change). if snapshot.has("character_visual_descriptor") and snapshot.character_visual_descriptor is Dictionary: - var restored := CharacterVisualDescriptor.from_dict(snapshot.character_visual_descriptor) + var CVD := load("res://scripts/rendering/character_visual_descriptor.gd") + var restored = CVD.from_dict(snapshot.character_visual_descriptor) if restored != null: character_visual_descriptor = restored diff --git a/client/scripts/autoloads/sim_bridge.gd b/client/scripts/autoloads/sim_bridge.gd index e09bf99aa..8154886bb 100644 --- a/client/scripts/autoloads/sim_bridge.gd +++ b/client/scripts/autoloads/sim_bridge.gd @@ -5,7 +5,8 @@ enum ConnectionState { DISCONNECTED, CONNECTING, HANDSHAKING, CONNECTED, ERROR } var state: ConnectionState = ConnectionState.DISCONNECTED var test_mode: bool = OS.get_environment("SR_LIVE") != "1" # SR_LIVE=1 connects to real server -var harness: TestHarness = null # Test simulation (D-020: game logic lives outside production client) +# Type is TestHarness — untyped to avoid autoload parse-order issue. +var harness = null # Test simulation (D-020: game logic lives outside production client) var _last_snapshot: Variant = null # Most recent decoded snapshot (consumed by poll_snapshot) var _outbound_buffer: Array[Dictionary] = [] # Raw inputs awaiting batch encode + transport @@ -33,7 +34,7 @@ signal handshake_failed(reason: String) func _ready() -> void: if test_mode: - harness = TestHarness.new() + harness = load("res://scripts/protocol/test_harness.gd").new() print("SimBridge: Running in test mode (dynamic snapshot)") diff --git a/client/scripts/autoloads/ui_strings.gd b/client/scripts/autoloads/ui_strings.gd index 95dd4e6d5..00da195a0 100644 --- a/client/scripts/autoloads/ui_strings.gd +++ b/client/scripts/autoloads/ui_strings.gd @@ -51,4 +51,4 @@ func reload() -> void: ## Returns flat Dictionary with dotted keys: { "section.sub.key": "value" }. ## Delegates to YamlParser.parse_flat() (#560). static func _parse_yaml(text: String) -> Dictionary: - return YamlParser.parse_flat(text) + return load("res://scripts/util/yaml_parser.gd").parse_flat(text) diff --git a/client/scripts/protocol/protocol.gd b/client/scripts/protocol/protocol.gd index 60be0a6ba..93a25a2f1 100644 --- a/client/scripts/protocol/protocol.gd +++ b/client/scripts/protocol/protocol.gd @@ -516,8 +516,8 @@ static func encode_startup_message(world_seed: int, character_archetype: String "world_seed": world_seed, "character_archetype": archetype_variant, } - if character_visual != null and character_visual is CharacterVisualDescriptor: - msg["character_visual_descriptor"] = (character_visual as CharacterVisualDescriptor).to_dict() + if character_visual != null and character_visual.has_method("to_dict"): + msg["character_visual_descriptor"] = character_visual.to_dict() var result = Messagepack.encode(msg) if result.status != null: push_error("Protocol: startup message encode failed: %s" % result.status) diff --git a/client/ui/main_menu.gd b/client/ui/main_menu.gd index 992aea439..e50a83c14 100644 --- a/client/ui/main_menu.gd +++ b/client/ui/main_menu.gd @@ -62,7 +62,7 @@ func _show_character_creation() -> void: _char_creation.creation_cancelled.connect(_on_creation_cancelled) -func _on_creation_confirmed(descriptor: CharacterVisualDescriptor) -> void: +func _on_creation_confirmed(descriptor) -> void: if _char_creation != null and is_instance_valid(_char_creation): _char_creation.queue_free() _char_creation = null