Fix ESC-crashes-the-game, avatar facing backward, invisible build stamp
checkpoint / checkpoint (push) Successful in 1m47s
checkpoint / checkpoint (push) Successful in 1m47s
ESC: player.gd changed scene directly while game.gd._exit_tree closed the socket, which re-fired server_disconnected -> _on_server_lost ran mid- teardown (add_child on an exiting node, await on a null get_tree(), a second change_scene_to_file). Moved ESC to game.gd as one ordered path: _leave_world() sets a _leaving guard, disconnects the _on_server_lost handlers before closing the connection, then changes scene. _on_server_lost and _exit_tree now respect the guard. Verified headless: ESC -> world_list, no errors; 2p multiplayer still connects. Avatar faced +Z but a Godot node's forward is -Z, so walking forward showed the character its own face. Rebuilt the placeholder facing -Z (face plates, eyes, jaw, toes, and front-mounted attachments all moved to negative Z; backpack/ponytail to +Z). The procedural walk was already written for -Z forward, so it's unchanged. Build stamp was there but tiny/low-contrast bottom-left -- bumped to 20px opaque yellow with a heavy outline, moved to the top-left strip. limb_animator: guard _process with is_instance_valid(_skel) so a frame landing during avatar teardown can't touch a freed skeleton. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015jtxAiu5dAW4WxCNdGkrkJ
This commit is contained in:
@@ -17,6 +17,8 @@ const OUT_DIR := "res://assets/avatars/"
|
||||
|
||||
# Canonical rig -- must match avatar_loader.gd CANONICAL_BONES. Each entry:
|
||||
# name -> [parent_name, global_rest_position] (A-pose, arms down, Y-up, metres)
|
||||
# The character faces -Z (Godot's node "forward"), so the face, toes and
|
||||
# front-mounted attachments live at negative Z.
|
||||
const BONES := {
|
||||
"Root": ["", Vector3(0.00, 0.00, 0.00)],
|
||||
"Hips": ["Root", Vector3(0.00, 0.76, 0.00)],
|
||||
@@ -25,9 +27,9 @@ const BONES := {
|
||||
"Neck": ["Chest", Vector3(0.00, 1.50, 0.00)],
|
||||
"Head": ["Neck", Vector3(0.00, 1.58, 0.00)],
|
||||
"HeadTop": ["Head", Vector3(0.00, 2.00, 0.00)],
|
||||
"Jaw": ["Head", Vector3(0.00, 1.64, 0.16)],
|
||||
"LeftEye": ["Head", Vector3(0.12, 1.76, 0.27)],
|
||||
"RightEye": ["Head", Vector3(-0.12, 1.76, 0.27)],
|
||||
"Jaw": ["Head", Vector3(0.00, 1.64, -0.16)],
|
||||
"LeftEye": ["Head", Vector3(0.12, 1.76, -0.27)],
|
||||
"RightEye": ["Head", Vector3(-0.12, 1.76, -0.27)],
|
||||
"LeftShoulder": ["Chest", Vector3(0.42, 1.50, 0.00)],
|
||||
"LeftUpperArm": ["LeftShoulder", Vector3(0.60, 1.44, 0.00)],
|
||||
"LeftLowerArm": ["LeftUpperArm", Vector3(0.60, 1.14, 0.00)],
|
||||
@@ -38,10 +40,10 @@ const BONES := {
|
||||
"RightHand": ["RightLowerArm", Vector3(-0.60, 0.82, 0.00)],
|
||||
"LeftUpperLeg": ["Hips", Vector3(0.21, 0.74, 0.00)],
|
||||
"LeftLowerLeg": ["LeftUpperLeg", Vector3(0.21, 0.38, 0.00)],
|
||||
"LeftFoot": ["LeftLowerLeg", Vector3(0.21, 0.05, 0.06)],
|
||||
"LeftFoot": ["LeftLowerLeg", Vector3(0.21, 0.05, -0.06)],
|
||||
"RightUpperLeg": ["Hips", Vector3(-0.21, 0.74, 0.00)],
|
||||
"RightLowerLeg": ["RightUpperLeg", Vector3(-0.21, 0.38, 0.00)],
|
||||
"RightFoot": ["RightLowerLeg", Vector3(-0.21, 0.05, 0.06)],
|
||||
"RightFoot": ["RightLowerLeg", Vector3(-0.21, 0.05, -0.06)],
|
||||
}
|
||||
|
||||
# Order matters: parents before children.
|
||||
@@ -70,10 +72,10 @@ const PARTS := [
|
||||
["RightUpperArm", Vector3(-0.58, 1.14, 0.00), Vector3(0.34, 0.78, 0.40), C_SKIN],
|
||||
["LeftUpperLeg", Vector3(0.21, 0.38, 0.00), Vector3(0.40, 0.78, 0.40), C_PANTS],
|
||||
["RightUpperLeg", Vector3(-0.21, 0.38, 0.00), Vector3(0.40, 0.78, 0.40), C_PANTS],
|
||||
# painted-on face -- thin plates on the front of the head (+Z), rigged to Head
|
||||
["Head", Vector3(0.13, 1.78, 0.28), Vector3(0.09, 0.12, 0.02), C_FACE],
|
||||
["Head", Vector3(-0.13, 1.78, 0.28), Vector3(0.09, 0.12, 0.02), C_FACE],
|
||||
["Head", Vector3(0.00, 1.64, 0.28), Vector3(0.32, 0.05, 0.02), C_FACE],
|
||||
# painted-on face -- thin plates on the front of the head (-Z), rigged to Head
|
||||
["Head", Vector3(0.13, 1.78, -0.28), Vector3(0.09, 0.12, 0.02), C_FACE],
|
||||
["Head", Vector3(-0.13, 1.78, -0.28), Vector3(0.09, 0.12, 0.02), C_FACE],
|
||||
["Head", Vector3(0.00, 1.64, -0.28), Vector3(0.32, 0.05, 0.02), C_FACE],
|
||||
]
|
||||
|
||||
# Attachments: id -> [Mesh, local_offset_from_mount_bone, colour]
|
||||
@@ -81,17 +83,17 @@ const PARTS := [
|
||||
const ATTACHMENTS := {
|
||||
"head_cyber_01": ["head", Vector3(0, 0.04, 0.0), Color(0.20, 0.85, 0.95)],
|
||||
"hair_mohawk_01": ["mohawk", Vector3(0, 0.0, 0.0), Color(0.90, 0.20, 0.35)],
|
||||
"hair_ponytail_01": ["ponytail", Vector3(0, -0.06, -0.16), Color(0.45, 0.30, 0.15)],
|
||||
"face_glasses_01": ["glasses", Vector3(0, 0.12, 0.16), Color(0.10, 0.10, 0.12)],
|
||||
"hair_ponytail_01": ["ponytail", Vector3(0, -0.06, 0.16), Color(0.45, 0.30, 0.15)],
|
||||
"face_glasses_01": ["glasses", Vector3(0, 0.12, -0.16), Color(0.10, 0.10, 0.12)],
|
||||
"chest_bandit_01": ["torso", Vector3(0, -0.12, 0.0), Color(0.55, 0.20, 0.20)],
|
||||
"back_backpack_01": ["box", Vector3(0, -0.06, -0.28), Color(0.30, 0.35, 0.25)],
|
||||
"back_backpack_01": ["box", Vector3(0, -0.06, 0.28), Color(0.30, 0.35, 0.25)],
|
||||
"pants_cargo_01": ["hips", Vector3(0, -0.04, 0.0), Color(0.30, 0.35, 0.45)],
|
||||
"left_hand_glove_01": ["blob", Vector3(0, 0.0, 0.0), Color(0.15, 0.15, 0.18)],
|
||||
"right_hand_glove_01": ["blob", Vector3(0, 0.0, 0.0), Color(0.15, 0.15, 0.18)],
|
||||
"left_foot_boot_01": ["boot", Vector3(0, -0.02, 0.05), Color(0.12, 0.10, 0.09)],
|
||||
"right_foot_boot_01": ["boot", Vector3(0, -0.02, 0.05), Color(0.12, 0.10, 0.09)],
|
||||
"left_foot_boot_01": ["boot", Vector3(0, -0.02, -0.05), Color(0.12, 0.10, 0.09)],
|
||||
"right_foot_boot_01": ["boot", Vector3(0, -0.02, -0.05), Color(0.12, 0.10, 0.09)],
|
||||
"accessory_belt_01": ["belt", Vector3(0, 0.74, 0.0), Color(0.20, 0.18, 0.12)],
|
||||
"accessory_necklace_01": ["necklace", Vector3(0, 1.34, 0.10), Color(0.85, 0.75, 0.20)],
|
||||
"accessory_necklace_01": ["necklace", Vector3(0, 1.34, -0.10), Color(0.85, 0.75, 0.20)],
|
||||
}
|
||||
|
||||
var _fail := 0
|
||||
|
||||
Reference in New Issue
Block a user