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:
@@ -3,6 +3,8 @@
|
||||
[ext_resource type="PackedScene" uid="uid://b1l0x4yf3lbx8" path="res://assets/models/arena/free_mode/Terrainv2.gltf" id="1_37t6b"]
|
||||
[ext_resource type="Material" uid="uid://xifgjdr8285d" path="res://assets/models/arena/free_mode/water_shader.tres" id="2_bw67x"]
|
||||
[ext_resource type="Texture2D" uid="uid://dep1ng3aqb2jw" path="res://assets/models/arena/free_mode/sky_sea_01.png" id="3_8esiu"]
|
||||
[ext_resource type="PackedScene" uid="uid://cuporokvsp4ml" path="res://assets/characters/tektons/tekton_fishing_animation.glb" id="4_xj13a"]
|
||||
[ext_resource type="Script" path="res://scripts/tekton_fishing_autoplay.gd" id="5_fish"]
|
||||
|
||||
[sub_resource type="PlaneMesh" id="PlaneMesh_8esiu"]
|
||||
material = ExtResource("2_bw67x")
|
||||
@@ -39,3 +41,15 @@ shadow_normal_bias = 5.0
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=936572897]
|
||||
environment = SubResource("Environment_8v6kw")
|
||||
|
||||
[node name="tekton_fishing_animation1" parent="." unique_id=1803834250 instance=ExtResource("4_xj13a")]
|
||||
script = ExtResource("5_fish")
|
||||
transform = Transform3D(-0.0012733412, 0, 0.0015422717, 0, 0.002, 0, -0.0015422717, 0, -0.0012733412, 0.04044947, 0.02995101, -0.059924163)
|
||||
|
||||
[node name="tekton_fishing_animation2" parent="." unique_id=376449997 instance=ExtResource("4_xj13a")]
|
||||
script = ExtResource("5_fish")
|
||||
transform = Transform3D(-0.0017457078, 0, 0.0009759627, 0, 0.0019999999, 0, -0.0009759627, 0, -0.0017457078, -0.11821492, 0.006670659, 0.040420167)
|
||||
|
||||
[node name="tekton_fishing_animation3" parent="." unique_id=1696737351 instance=ExtResource("4_xj13a")]
|
||||
script = ExtResource("5_fish")
|
||||
transform = Transform3D(-0.0012249037, 0, 0.0015810153, 0, 0.002, 0, -0.0015810153, 0, -0.0012249037, 0.035826474, 0.008033583, 0.0059019327)
|
||||
|
||||
+30
-11
@@ -418,6 +418,7 @@ func _init_managers():
|
||||
movement_manager.name = "MovementManager"
|
||||
add_child(movement_manager)
|
||||
movement_manager.initialize(self , enhanced_gridmap)
|
||||
movement_manager.movement_finished.connect(_on_movement_finished)
|
||||
|
||||
race_manager = load("res://scripts/managers/player_race_manager.gd").new()
|
||||
race_manager.name = "RaceManager"
|
||||
@@ -646,8 +647,10 @@ const ANIMATION_SPEED: float = 2.0
|
||||
|
||||
func play_walk_animation() -> void:
|
||||
"""Play walking animation at increased speed."""
|
||||
if is_carrying_tekton and anim_player and anim_player.has_animation("animation-pack/holding_1"):
|
||||
return # Let dasher_hold keep playing
|
||||
if is_carrying_tekton:
|
||||
if anim_player and anim_player.has_animation("animation-pack/holding_walk"):
|
||||
anim_player.play("animation-pack/holding_walk", -1, ANIMATION_SPEED)
|
||||
return
|
||||
if anim_player and anim_player.has_animation("animation-pack/walk_forward"):
|
||||
anim_player.play("animation-pack/walk_forward", -1, ANIMATION_SPEED)
|
||||
|
||||
@@ -668,11 +671,16 @@ func play_special_animation() -> void:
|
||||
|
||||
func play_idle_animation() -> void:
|
||||
"""Play idle animation at normal speed."""
|
||||
if is_carrying_tekton and anim_player and anim_player.has_animation("animation-pack/holding_1"):
|
||||
return # Let dasher_hold keep playing
|
||||
if is_carrying_tekton:
|
||||
if anim_player and anim_player.has_animation("animation-pack/holding_1"):
|
||||
anim_player.play("animation-pack/holding_1")
|
||||
return
|
||||
if anim_player and anim_player.has_animation("animation-pack/idle"):
|
||||
anim_player.play("animation-pack/idle")
|
||||
|
||||
func _on_movement_finished() -> void:
|
||||
play_idle_animation()
|
||||
|
||||
# =============================================================================
|
||||
# Network-Synced Animation Functions
|
||||
# =============================================================================
|
||||
@@ -2378,6 +2386,8 @@ func grab_tekton():
|
||||
if tekton:
|
||||
if is_multiplayer_authority() and can_rpc():
|
||||
rpc("sync_grab_tekton", tekton.get_path())
|
||||
elif is_multiplayer_authority():
|
||||
sync_grab_tekton(tekton.get_path())
|
||||
|
||||
func snatch_tekton(target_carrier: Node3D):
|
||||
if not is_multiplayer_authority() or not target_carrier.is_carrying_tekton:
|
||||
@@ -2387,6 +2397,8 @@ func snatch_tekton(target_carrier: Node3D):
|
||||
if tekton:
|
||||
if is_multiplayer_authority() and can_rpc():
|
||||
rpc("sync_snatch_tekton", target_carrier.get_path(), tekton.get_path())
|
||||
elif is_multiplayer_authority():
|
||||
sync_snatch_tekton(target_carrier.get_path(), tekton.get_path())
|
||||
|
||||
@rpc("any_peer", "call_local", "reliable")
|
||||
func sync_snatch_tekton(carrier_path: NodePath, tekton_path: NodePath):
|
||||
@@ -2487,16 +2499,23 @@ func sync_throw_tekton(target_pos: Vector2i):
|
||||
tekton.set_thrown(true)
|
||||
else:
|
||||
tekton.set_carried(false)
|
||||
|
||||
# Face tekton toward throw direction
|
||||
var end_world_pos = Vector3(
|
||||
target_pos.x * cell_size.x + cell_size.x * 0.5,
|
||||
cell_size.y,
|
||||
target_pos.y * cell_size.z + cell_size.z * 0.5
|
||||
) + cell_offset
|
||||
tekton.look_at(Vector3(end_world_pos.x, tekton.global_position.y, end_world_pos.z), Vector3.UP)
|
||||
|
||||
# Play throw animation on the tekton
|
||||
if tekton.has_method("play_animation"):
|
||||
tekton.play_animation("ted_bones_001|Tekton Throwing Tiles|Anima_Layer")
|
||||
|
||||
# Visual Arc Tween
|
||||
var start_pos = tekton.global_position
|
||||
# Target world position
|
||||
var end_world_pos = Vector3(
|
||||
target_pos.x * cell_size.x + cell_size.x * 0.5,
|
||||
cell_size.y, # Floor Y
|
||||
target_pos.y * cell_size.z + cell_size.z * 0.5
|
||||
) + cell_offset
|
||||
|
||||
# end_world_pos already computed above for facing
|
||||
|
||||
var mid_pos = (start_pos + end_world_pos) / 2.0
|
||||
mid_pos.y += 4.0 # Arc height
|
||||
|
||||
|
||||
Reference in New Issue
Block a user