OverviewFilesCommitsIssuesDocsReleasesPeers

hyper-tps / scenes / player / player.tscn

394 lines · tscn ref:
[gd_scene format=3 uid="uid://player001"]

[ext_resource type="Script" uid="uid://cgwp07f8utdv7" path="res://scenes/player/player.gd" id="1"]
[ext_resource type="Script" uid="uid://bywy70rnemuvf" path="res://scenes/player/player_input.gd" id="2"]
[ext_resource type="AudioStream" uid="uid://d5g4tpemyqp8" path="res://assets/sounds/player/metal_footstep_1.wav" id="snd_foot1"]
[ext_resource type="AudioStream" uid="uid://cnqui1vo7dobs" path="res://assets/sounds/player/metal_footstep_2.wav" id="snd_foot2"]
[ext_resource type="AudioStream" uid="uid://pkepe7pjgc2b" path="res://assets/sounds/player/metal_footstep_3.wav" id="snd_foot3"]
[ext_resource type="AudioStream" uid="uid://lwv4mct14r6h" path="res://assets/sounds/player/fire_grapplinghook.wav" id="snd_grapple_fire"]
[ext_resource type="AudioStream" uid="uid://crima80ie4mle" path="res://assets/sounds/player/release_grapplinghook.wav" id="snd_grapple_release"]
[ext_resource type="AudioStream" uid="uid://dyuehvg24lj03" path="res://assets/sounds/player/generic_robot_jump.wav" id="snd_jump"]
[ext_resource type="AudioStream" uid="uid://gs31vrufsp0c" path="res://assets/sounds/player/generic_robot_land.wav" id="snd_land"]
[ext_resource type="AudioStream" uid="uid://cq1asfkaew4dg" path="res://assets/sounds/player/toggleLight_1.wav" id="snd_light"]
[ext_resource type="PackedScene" uid="uid://dhloxhv87q41u" path="res://assets/models/tumble/tumble.glb" id="tumble_model"]

[sub_resource type="CapsuleShape3D" id="CylinderShape3D_1"]
height = 1.58
radius = 0.3

[sub_resource type="CylinderMesh" id="CylinderMesh_grapple"]
top_radius = 0.01
bottom_radius = 0.01
height = 1.0

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_input"]
properties/0/path = NodePath("InputSync:input_direction")
properties/0/spawn = true
properties/0/replication_mode = 1
properties/1/path = NodePath("InputSync:camera_rotation_y")
properties/1/spawn = true
properties/1/replication_mode = 1
properties/2/path = NodePath("InputSync:camera_pitch")
properties/2/spawn = true
properties/2/replication_mode = 1
properties/3/path = NodePath("InputSync:wants_jump")
properties/3/spawn = true
properties/3/replication_mode = 2

[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_state"]
properties/0/path = NodePath(".:sync_state")
properties/0/spawn = true
properties/0/replication_mode = 1

[sub_resource type="AnimationNodeTransition" id="aim_transition"]
xfade_time = 0.1
input_0/name = "not_aiming"
input_0/auto_advance = false
input_0/break_loop_at_end = false
input_0/reset = true
input_1/name = "aiming"
input_1/auto_advance = false
input_1/break_loop_at_end = false
input_1/reset = true

[sub_resource type="AnimationNodeBlend3" id="air_blend"]

[sub_resource type="AnimationNodeTransition" id="air_transition"]
xfade_time = 0.1
input_0/name = "ground"
input_0/auto_advance = false
input_0/break_loop_at_end = false
input_0/reset = true
input_1/name = "air"
input_1/auto_advance = false
input_1/break_loop_at_end = false
input_1/reset = true

[sub_resource type="AnimationNodeAnimation" id="dive_roll_anim"]
animation = &"dive-roll"

[sub_resource type="AnimationNodeAnimation" id="falling_anim"]
animation = &"falling"

[sub_resource type="AnimationNodeTimeScale" id="falling_scale"]

[sub_resource type="AnimationNodeAnimation" id="idle_anim"]
animation = &"default"

[sub_resource type="AnimationNodeBlend3" id="iwr_blend"]

[sub_resource type="AnimationNodeAnimation" id="jump_anim"]
animation = &"jump"

[sub_resource type="AnimationNodeTimeScale" id="jump_scale"]

[sub_resource type="AnimationNodeAnimation" id="landing_anim"]
animation = &"landing"

[sub_resource type="AnimationNodeTimeScale" id="landing_scale"]

[sub_resource type="AnimationNodeOneShot" id="roll_oneshot"]

[sub_resource type="AnimationNodeTimeScale" id="roll_scale"]

[sub_resource type="AnimationNodeTimeScale" id="run_scale"]

[sub_resource type="AnimationNodeAnimation" id="sprint_anim"]
animation = &"sprint"

[sub_resource type="AnimationNodeAnimation" id="strafe_idle"]
animation = &"default"

[sub_resource type="AnimationNodeAnimation" id="strafe_forward"]
animation = &"walk-forward"

[sub_resource type="AnimationNodeAnimation" id="strafe_right"]
animation = &"strafe-right"

[sub_resource type="AnimationNodeAnimation" id="strafe_diag_right"]
animation = &"walk-diagonal-right"

[sub_resource type="AnimationNodeAnimation" id="strafe_diag_left_back"]
animation = &"walk-diagonal-left-back"

[sub_resource type="AnimationNodeAnimation" id="strafe_backward"]
animation = &"walk-backward"

[sub_resource type="AnimationNodeAnimation" id="strafe_diag_right_back"]
animation = &"walk-diagonal-right-back"

[sub_resource type="AnimationNodeAnimation" id="strafe_left"]
animation = &"strafe-left"

[sub_resource type="AnimationNodeAnimation" id="strafe_diag_left"]
animation = &"walk-diagonal-left"

[sub_resource type="AnimationNodeBlendSpace2D" id="strafe_space"]
blend_point_0/node = SubResource("strafe_idle")
blend_point_0/pos = Vector2(0, 0)
blend_point_1/node = SubResource("strafe_forward")
blend_point_1/pos = Vector2(0, 1)
blend_point_2/node = SubResource("strafe_right")
blend_point_2/pos = Vector2(1, 0)
blend_point_3/node = SubResource("strafe_diag_right")
blend_point_3/pos = Vector2(1, 1.01)
blend_point_4/node = SubResource("strafe_diag_left_back")
blend_point_4/pos = Vector2(1, -1)
blend_point_5/node = SubResource("strafe_backward")
blend_point_5/pos = Vector2(0, -1)
blend_point_6/node = SubResource("strafe_diag_right_back")
blend_point_6/pos = Vector2(-1, -1)
blend_point_7/node = SubResource("strafe_left")
blend_point_7/pos = Vector2(-1, 0)
blend_point_8/node = SubResource("strafe_diag_left")
blend_point_8/pos = Vector2(-1, 1.01)
max_space = Vector2(1.01, 1)

[sub_resource type="AnimationNodeTimeScale" id="strafe_scale"]

[sub_resource type="AnimationNodeAnimation" id="walk_anim"]
animation = &"walk-forward"

[sub_resource type="AnimationNodeTimeScale" id="walk_scale"]

[sub_resource type="AnimationNodeBlend2" id="wall_blend_l"]

[sub_resource type="AnimationNodeBlend2" id="wall_blend_r"]

[sub_resource type="AnimationNodeAnimation" id="wall_grab_l_anim"]
animation = &"wall_grab_l"

[sub_resource type="AnimationNodeAnimation" id="wall_grab_r_anim"]
animation = &"wall_grab_r"

[sub_resource type="AnimationNodeTransition" id="wall_run_transition"]
input_0/name = "not_wall"
input_0/auto_advance = false
input_0/break_loop_at_end = false
input_0/reset = true
input_1/name = "wall_left"
input_1/auto_advance = false
input_1/break_loop_at_end = false
input_1/reset = true
input_2/name = "wall_right"
input_2/auto_advance = false
input_2/break_loop_at_end = false
input_2/reset = true

[sub_resource type="AnimationNodeAnimation" id="wall_run_l_anim"]
animation = &"wall_run_l"

[sub_resource type="AnimationNodeAnimation" id="wall_run_r_anim"]
animation = &"wall_run_r"

[sub_resource type="AnimationNodeBlendTree" id="blend_tree"]
graph_offset = Vector2(113.15613, -206.10767)
nodes/output/position = Vector2(1000, 0)
nodes/idle_anim/node = SubResource("idle_anim")
nodes/idle_anim/position = Vector2(-980, 200)
nodes/walk_anim/node = SubResource("walk_anim")
nodes/walk_anim/position = Vector2(-1000, 400)
nodes/sprint_anim/node = SubResource("sprint_anim")
nodes/sprint_anim/position = Vector2(-1000, 580)
nodes/jump_anim/node = SubResource("jump_anim")
nodes/jump_anim/position = Vector2(-560, -340)
nodes/falling_anim/node = SubResource("falling_anim")
nodes/falling_anim/position = Vector2(-580, -220)
nodes/landing_anim/node = SubResource("landing_anim")
nodes/landing_anim/position = Vector2(-600, -100)
nodes/dive_roll_anim/node = SubResource("dive_roll_anim")
nodes/dive_roll_anim/position = Vector2(-240, 320)
nodes/wall_grab_l_anim/node = SubResource("wall_grab_l_anim")
nodes/wall_grab_l_anim/position = Vector2(180, -180)
nodes/wall_run_l_anim/node = SubResource("wall_run_l_anim")
nodes/wall_run_l_anim/position = Vector2(180, -60)
nodes/wall_grab_r_anim/node = SubResource("wall_grab_r_anim")
nodes/wall_grab_r_anim/position = Vector2(180, -440)
nodes/wall_run_r_anim/node = SubResource("wall_run_r_anim")
nodes/wall_run_r_anim/position = Vector2(160, -320)
nodes/strafe/node = SubResource("strafe_space")
nodes/strafe/position = Vector2(-760, 60)
nodes/wall_blend_l/node = SubResource("wall_blend_l")
nodes/wall_blend_l/position = Vector2(480, -120)
nodes/wall_blend_r/node = SubResource("wall_blend_r")
nodes/wall_blend_r/position = Vector2(480, -360)
nodes/strafe_scale/node = SubResource("strafe_scale")
nodes/strafe_scale/position = Vector2(-480, 80)
nodes/walk_scale/node = SubResource("walk_scale")
nodes/walk_scale/position = Vector2(-640, 360)
nodes/run_scale/node = SubResource("run_scale")
nodes/run_scale/position = Vector2(-640, 500)
nodes/jump_scale/node = SubResource("jump_scale")
nodes/jump_scale/position = Vector2(-380, -360)
nodes/falling_scale/node = SubResource("falling_scale")
nodes/falling_scale/position = Vector2(-360, -220)
nodes/landing_scale/node = SubResource("landing_scale")
nodes/landing_scale/position = Vector2(-380, -80)
nodes/roll_scale/node = SubResource("roll_scale")
nodes/roll_scale/position = Vector2(-60, 280)
nodes/iwr_blend/node = SubResource("iwr_blend")
nodes/iwr_blend/position = Vector2(-400, 200)
nodes/air_blend/node = SubResource("air_blend")
nodes/air_blend/position = Vector2(-100, -160)
nodes/aim_transition/node = SubResource("aim_transition")
nodes/aim_transition/position = Vector2(-240, 107)
nodes/air_transition/node = SubResource("air_transition")
nodes/air_transition/position = Vector2(133, 53)
nodes/roll/node = SubResource("roll_oneshot")
nodes/roll/position = Vector2(380, 140)
nodes/wall_run/node = SubResource("wall_run_transition")
nodes/wall_run/position = Vector2(740, -80)
node_connections = [&"output", 0, &"wall_run", &"wall_blend_l", 0, &"wall_grab_l_anim", &"wall_blend_l", 1, &"wall_run_l_anim", &"wall_blend_r", 0, &"wall_grab_r_anim", &"wall_blend_r", 1, &"wall_run_r_anim", &"strafe_scale", 0, &"strafe", &"walk_scale", 0, &"walk_anim", &"run_scale", 0, &"sprint_anim", &"jump_scale", 0, &"jump_anim", &"falling_scale", 0, &"falling_anim", &"landing_scale", 0, &"landing_anim", &"roll_scale", 0, &"dive_roll_anim", &"iwr_blend", 0, &"idle_anim", &"iwr_blend", 1, &"walk_scale", &"iwr_blend", 2, &"run_scale", &"air_blend", 0, &"jump_scale", &"air_blend", 1, &"falling_scale", &"air_blend", 2, &"landing_scale", &"aim_transition", 0, &"iwr_blend", &"aim_transition", 1, &"strafe_scale", &"air_transition", 0, &"aim_transition", &"air_transition", 1, &"air_blend", &"roll", 0, &"air_transition", &"roll", 1, &"roll_scale", &"wall_run", 0, &"roll", &"wall_run", 1, &"wall_blend_l", &"wall_run", 2, &"wall_blend_r"]

[sub_resource type="StandardMaterial3D" id="Material_grapple_point"]
no_depth_test = true
shading_mode = 0
albedo_color = Color(0.41, 0, 0, 1)

[sub_resource type="SphereMesh" id="SphereMesh_grapple_point"]
radius = 0.025
height = 0.05

[node name="Player" type="CharacterBody3D" unique_id=184249045]
script = ExtResource("1")

[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=77202609]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.79, 0)
shape = SubResource("CylinderShape3D_1")

[node name="Model" type="Node3D" parent="." unique_id=785063191]

[node name="TumbleModel" parent="Model" unique_id=1921823921 instance=ExtResource("tumble_model")]
transform = Transform3D(0.65, 0, 0, 0, 0.65, 0, 0, 0, 0.65, 0, 0, 0)

[node name="GrappleLine" type="MeshInstance3D" parent="Model" unique_id=208219021]
visible = false
mesh = SubResource("CylinderMesh_grapple")

[node name="CameraHead" type="Node3D" parent="." unique_id=1201899570]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)

[node name="CameraPivot" type="Node3D" parent="CameraHead" unique_id=385288402]

[node name="SpringArm3D" type="SpringArm3D" parent="CameraHead/CameraPivot"]
spring_length = 3.0
margin = 0.2
collision_mask = 1

[node name="Camera3D" type="Camera3D" parent="CameraHead/CameraPivot/SpringArm3D" unique_id=1687481161 groups=["player_camera"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0, 0)
fov = 90.0
far = 1000000.0

[node name="GrappleHookCast" type="RayCast3D" parent="CameraHead/CameraPivot" unique_id=396026773]
target_position = Vector3(0, 0, -400)
collision_mask = 2

[node name="OmniLight3D" type="OmniLight3D" parent="." unique_id=21564425]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2, 0)
visible = false
light_energy = 5.194
shadow_enabled = true
omni_range = 2.23

[node name="Sounds" type="Node3D" parent="." unique_id=1570937114]

[node name="Jump" type="AudioStreamPlayer3D" parent="Sounds" unique_id=2006520076]
stream = ExtResource("snd_jump")
max_db = -5.0
bus = &"SFX"
max_polyphony = 3

[node name="Land" type="AudioStreamPlayer3D" parent="Sounds" unique_id=739197967]
stream = ExtResource("snd_land")
max_db = -5.0
bus = &"SFX"
max_polyphony = 3

[node name="Footstep1" type="AudioStreamPlayer3D" parent="Sounds" unique_id=900905518]
stream = ExtResource("snd_foot1")
max_db = -8.0
bus = &"SFX"
max_polyphony = 3

[node name="Footstep2" type="AudioStreamPlayer3D" parent="Sounds" unique_id=222560554]
stream = ExtResource("snd_foot2")
max_db = -8.0
bus = &"SFX"
max_polyphony = 3

[node name="Footstep3" type="AudioStreamPlayer3D" parent="Sounds" unique_id=810048434]
stream = ExtResource("snd_foot3")
max_db = -8.0
bus = &"SFX"
max_polyphony = 3

[node name="GrappleFire" type="AudioStreamPlayer3D" parent="Sounds" unique_id=984492427]
stream = ExtResource("snd_grapple_fire")
bus = &"SFX"
max_polyphony = 3

[node name="GrappleRelease" type="AudioStreamPlayer3D" parent="Sounds" unique_id=664417891]
stream = ExtResource("snd_grapple_release")
bus = &"SFX"
max_polyphony = 3

[node name="ToggleLight" type="AudioStreamPlayer3D" parent="Sounds" unique_id=343936773]
stream = ExtResource("snd_light")
max_db = -3.0
bus = &"SFX"
max_polyphony = 3

[node name="InputSync" type="Node" parent="." unique_id=2026551457]
script = ExtResource("2")

[node name="InputSynchronizer" type="MultiplayerSynchronizer" parent="InputSync" unique_id=1636033528]
root_path = NodePath("../..")
replication_interval = 0.05
replication_config = SubResource("SceneReplicationConfig_input")

[node name="PlayerSync" type="MultiplayerSynchronizer" parent="." unique_id=507058069]
replication_interval = 0.05
replication_config = SubResource("SceneReplicationConfig_state")

[node name="AnimationTree" type="AnimationTree" parent="." unique_id=709521298]
root_node = NodePath("../Model/TumbleModel")
tree_root = SubResource("blend_tree")
parameters/strafe/blend_position = Vector2(0, 0)
parameters/wall_blend_l/blend_amount = 0.0
parameters/wall_blend_r/blend_amount = 0.0
parameters/strafe_scale/scale = 1.0
parameters/walk_scale/scale = 1.0
parameters/run_scale/scale = 1.0
parameters/jump_scale/scale = 2.0
parameters/falling_scale/scale = 1.0
parameters/landing_scale/scale = 1.0
parameters/roll_scale/scale = 1.0
parameters/iwr_blend/blend_amount = -1.0
parameters/air_blend/blend_amount = 0.0
parameters/aim_transition/current_state = "not_aiming"
parameters/aim_transition/transition_request = ""
parameters/aim_transition/current_index = 0
parameters/air_transition/current_state = "ground"
parameters/air_transition/transition_request = ""
parameters/air_transition/current_index = 0
parameters/roll/active = false
parameters/roll/internal_active = false
parameters/roll/request = 0
parameters/wall_run/current_state = "not_wall"
parameters/wall_run/transition_request = ""
parameters/wall_run/current_index = 0

[node name="NameLabel" type="Label3D" parent="." unique_id=448392101]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.0, 0)
billboard = 1
no_depth_test = true
text = ""
font_size = 32
outline_size = 4

[node name="GrapplePoint" type="MeshInstance3D" parent="." unique_id=636587944]
visible = false
material_override = SubResource("Material_grapple_point")
mesh = SubResource("SphereMesh_grapple_point")