freemode fishing tekton autoplay + static tekton throw fix

- Added tekton_fishing_autoplay.gd: plays both GLB animations simultaneously, looped
- Attached autoplay script to 3 fishing tekton instances in freemode.tscn
- Fixed static tekton throw: faces throw direction + plays throw animation
- Fixed AnimationPlayer path in tekton.gd for static turrets
- Fixed animation names (tekton_throw_tile -> ted_bones_001|Tekton Throwing Tiles|Anima_Layer)
- Fixed static_tekton_controller.gd idle resume
- Rebuilt animation-pack.res with new animations (holding_1, put_1, stun_1, etc.)
- Fixed GutBottomPanel.tscn broken UID
This commit is contained in:
2026-06-15 18:15:39 +08:00
parent 844ec194cb
commit 5354d8b30f
25 changed files with 242 additions and 156 deletions
+9 -5
View File
@@ -20,8 +20,9 @@ func _ready():
enhanced_gridmap = main.get_node_or_null("EnhancedGridMap")
# Initial State
if tekton.has_method("play_animation"):
tekton.play_animation("tekton_idle")
# No idle anim for static tekton mesh, just ensure stopped
var ap = tekton.get_node_or_null("Visuals/tekton/AnimationPlayer")
if ap: ap.stop()
# Setup Timer
timer = Timer.new()
@@ -69,7 +70,7 @@ func _attempt_throw():
# 2. Play Animation
if tekton.has_method("play_animation_rpc") and tekton.has_method("can_rpc") and tekton.can_rpc():
tekton.rpc("play_animation_rpc", "tekton_throw_tile")
tekton.rpc("play_animation_rpc", "ted_bones_001|Tekton Throwing Tiles|Anima_Layer")
# 3. Create Projectile Visual (Synced)
if tekton.has_method("spawn_projectile_rpc") and tekton.has_method("can_rpc") and tekton.can_rpc():
@@ -86,8 +87,11 @@ func _attempt_throw():
# 5. Resume Idle
await get_tree().create_timer(0.5).timeout # Small delay after throw
if tekton.has_method("play_animation_rpc") and tekton.has_method("can_rpc") and tekton.can_rpc():
tekton.rpc("play_animation_rpc", "tekton_idle")
# No idle anim for static tekton mesh, just stop
if tekton.has_method("can_rpc") and tekton.can_rpc():
# Stop animation on all peers via a direct call (AnimationPlayer.stop is visual-only, safe)
var ap = tekton.get_node_or_null("Visuals/tekton/AnimationPlayer")
if ap: ap.stop()
_start_timer()
+9 -6
View File
@@ -439,10 +439,12 @@ func spawn_tiles_around(count: int = 4):
play_animation("tekton_idle")
)
elif is_static_turret and not is_carried and not is_thrown:
play_animation("Armature|tekton_throw_tile")
play_animation("ted_bones_001|Tekton Throwing Tiles|Anima_Layer")
get_tree().create_timer(1.0).timeout.connect(func():
if not is_moving and not is_carried and not is_thrown:
play_animation("Armature|tekton_idle")
# No idle anim in static_tekton_mesh, just stop
var ap = get_node_or_null("Visuals/tekton/AnimationPlayer")
if ap: ap.stop()
)
print("[Tekton] Spawning %d tiles around %s" % [count, current_position])
@@ -557,12 +559,13 @@ func spawn_projectile_rpc(target_pos: Vector3, duration: float):
func play_animation(anim_name: String):
# Try specific user path first
var anim_player = get_node_or_null("Visuals/tekton/Armature/AnimationPlayer")
if is_static_turret:
anim_player = get_node_or_null("Visuals/static_tekton_mesh/tekton_throwing_tiles/AnimationPlayer")
# static_tekton_mesh.tscn has AnimationPlayer at root level
anim_player = get_node_or_null("Visuals/tekton/AnimationPlayer")
if not anim_player:
anim_player = get_node_or_null("Visuals/tekton_throwing_tiles/AnimationPlayer") # Check direct child just in case
anim_player = get_node_or_null("Visuals/AnimationPlayer")
# If not found, try finding recursive
if not anim_player:
anim_player = find_child("AnimationPlayer", true, false)
+25
View File
@@ -0,0 +1,25 @@
extends Node3D
## Autoplays all animations in the AnimationPlayer simultaneously and loops them.
## Attach to any node that has an AnimationPlayer child (e.g. tekton_fishing_animation instances).
@onready var anim_player: AnimationPlayer = $AnimationPlayer
func _ready() -> void:
if not anim_player:
push_warning("tekton_fishing_autoplay: No AnimationPlayer found")
return
# Wait one frame for the scene tree to settle
await get_tree().process_frame
# Play every animation simultaneously, all looping
for anim_name in anim_player.get_animation_list():
anim_player.play(anim_name)
anim_player.advance(0.0) # ensure it starts
# Set all to loop
for anim_name in anim_player.get_animation_list():
var anim: Animation = anim_player.get_animation(anim_name)
if anim:
anim.loop_mode = Animation.LOOP_LINEAR
+1
View File
@@ -0,0 +1 @@
uid://dcnuf06soevte