generated from krampus/template-godot4
More legs, more shambling
This commit is contained in:
parent
6cad139c64
commit
eeffcc1f96
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -1833,7 +1833,7 @@ _subresources={
|
|||||||
"slice_99/start_frame": 0,
|
"slice_99/start_frame": 0,
|
||||||
"slices/amount": 0
|
"slices/amount": 0
|
||||||
},
|
},
|
||||||
"shamble": {
|
"walk_front": {
|
||||||
"save_to_file/enabled": false,
|
"save_to_file/enabled": false,
|
||||||
"save_to_file/keep_custom_tracks": "",
|
"save_to_file/keep_custom_tracks": "",
|
||||||
"save_to_file/path": "",
|
"save_to_file/path": "",
|
||||||
@ -3632,11 +3632,11 @@ _subresources={
|
|||||||
"slice_99/start_frame": 0,
|
"slice_99/start_frame": 0,
|
||||||
"slices/amount": 0
|
"slices/amount": 0
|
||||||
},
|
},
|
||||||
"step_left": {
|
"walk_rear": {
|
||||||
"save_to_file/enabled": false,
|
"save_to_file/enabled": false,
|
||||||
"save_to_file/keep_custom_tracks": "",
|
"save_to_file/keep_custom_tracks": "",
|
||||||
"save_to_file/path": "",
|
"save_to_file/path": "",
|
||||||
"settings/loop_mode": 0,
|
"settings/loop_mode": 1,
|
||||||
"slice_1/end_frame": 0,
|
"slice_1/end_frame": 0,
|
||||||
"slice_1/loop_mode": 0,
|
"slice_1/loop_mode": 0,
|
||||||
"slice_1/name": "",
|
"slice_1/name": "",
|
||||||
|
@ -218,7 +218,7 @@ metadata/_custom_type_script = "uid://om57w2acvgb7"
|
|||||||
script = ExtResource("11_mbqcc")
|
script = ExtResource("11_mbqcc")
|
||||||
mean_time = 4.0
|
mean_time = 4.0
|
||||||
st_dev_time = 0.6
|
st_dev_time = 0.6
|
||||||
wait_time = 4.5337
|
wait_time = 4.44596
|
||||||
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
||||||
|
|
||||||
[node name="RandomStalkingBehavior" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence/RandomDelay"]
|
[node name="RandomStalkingBehavior" type="Node" parent="GrunkBeastBehavior/StateSelector/StalkingSequence/RandomDelay"]
|
||||||
@ -264,7 +264,7 @@ metadata/_custom_type_script = "uid://cg016dbe7gs1x"
|
|||||||
script = ExtResource("11_mbqcc")
|
script = ExtResource("11_mbqcc")
|
||||||
mean_time = 5.0
|
mean_time = 5.0
|
||||||
st_dev_time = 1.0
|
st_dev_time = 1.0
|
||||||
wait_time = 4.81689
|
wait_time = 6.43523
|
||||||
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
metadata/_custom_type_script = "uid://beyk2xtbjrsg4"
|
||||||
|
|
||||||
[node name="PickRandomLurkTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence/RandomDelay"]
|
[node name="PickRandomLurkTarget" type="Node" parent="GrunkBeastBehavior/StateSelector/LurkSequence/RandomDelay"]
|
||||||
|
@ -5,12 +5,15 @@ const LOOK_TARGET_ACCELERATION := 12.0
|
|||||||
const BLEND_ACCELERATION := 6.0
|
const BLEND_ACCELERATION := 6.0
|
||||||
|
|
||||||
@export var time_scale_factor := 4.0
|
@export var time_scale_factor := 4.0
|
||||||
@export var walk_blend_curve: Curve
|
@export var idle_blend_curve: Curve
|
||||||
|
@export var rear_blend_curve: Curve
|
||||||
|
@export var rear_scale_curve: Curve
|
||||||
@export var walk_scale_curve: Curve
|
@export var walk_scale_curve: Curve
|
||||||
@export var look_accel_curve: Curve
|
@export var look_accel_curve: Curve
|
||||||
|
|
||||||
var look_acceleration := 1.0
|
var look_acceleration := 1.0
|
||||||
var blend_target := 0.0
|
var blend_target := 0.0
|
||||||
|
var blend_input := 0.0
|
||||||
|
|
||||||
@onready var target_theta := global_rotation.y
|
@onready var target_theta := global_rotation.y
|
||||||
|
|
||||||
@ -30,8 +33,8 @@ func set_target_rotation(theta: float) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func set_move_speed(speed: float) -> void:
|
func set_move_speed(speed: float) -> void:
|
||||||
blend_target = walk_blend_curve.sample(speed)
|
blend_target = speed
|
||||||
animation_tree["parameters/shamble_scale/scale"] = (
|
animation_tree["parameters/anim_scale/scale"] = (
|
||||||
walk_scale_curve.sample(speed) * time_scale_factor
|
walk_scale_curve.sample(speed) * time_scale_factor
|
||||||
)
|
)
|
||||||
look_acceleration = look_accel_curve.sample(speed)
|
look_acceleration = look_accel_curve.sample(speed)
|
||||||
@ -44,10 +47,12 @@ func _update_transform() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
var blend: float = animation_tree["parameters/shamble_blend/blend_amount"]
|
blend_input = lerpf(
|
||||||
animation_tree["parameters/shamble_blend/blend_amount"] = lerpf(
|
blend_input, blend_target, 1 - exp(-BLEND_ACCELERATION * delta * time_scale_factor)
|
||||||
blend, blend_target, 1 - exp(-BLEND_ACCELERATION * delta * time_scale_factor)
|
|
||||||
)
|
)
|
||||||
|
animation_tree["parameters/idle_blend/blend_amount"] = idle_blend_curve.sample(blend_input)
|
||||||
|
animation_tree["parameters/rear_scale/scale"] = rear_scale_curve.sample(blend_input)
|
||||||
|
animation_tree["parameters/rear_add/add_amount"] = rear_blend_curve.sample(blend_input)
|
||||||
|
|
||||||
look_target_pivot.global_position = global_position
|
look_target_pivot.global_position = global_position
|
||||||
look_target_pivot.global_rotation.y = lerp_angle(
|
look_target_pivot.global_rotation.y = lerp_angle(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=15 format=3 uid="uid://brrd33217oplv"]
|
[gd_scene load_steps=19 format=3 uid="uid://brrd33217oplv"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://cyqr1ojnddyk0" path="res://assets/npc/shambler/shambler.gltf" id="1_uiw1a"]
|
[ext_resource type="PackedScene" uid="uid://cyqr1ojnddyk0" path="res://assets/npc/shambler/shambler.gltf" id="1_uiw1a"]
|
||||||
[ext_resource type="Material" uid="uid://7xrgrvf3lymv" path="res://assets/npc/shambler/shambler.material" id="2_nayyt"]
|
[ext_resource type="Material" uid="uid://7xrgrvf3lymv" path="res://assets/npc/shambler/shambler.material" id="2_nayyt"]
|
||||||
@ -9,6 +9,16 @@ _limits = [0.0, 1.0, 0.0, 10.0]
|
|||||||
_data = [Vector2(0, 0), 0.0, 0.230666, 0, 0, Vector2(5, 1), 0.0, 0.0, 0, 0, Vector2(10, 1), 0.0, 0.0, 0, 0]
|
_data = [Vector2(0, 0), 0.0, 0.230666, 0, 0, Vector2(5, 1), 0.0, 0.0, 0, 0, Vector2(10, 1), 0.0, 0.0, 0, 0]
|
||||||
point_count = 3
|
point_count = 3
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_xyfav"]
|
||||||
|
_limits = [0.0, 1.0, 0.0, 10.0]
|
||||||
|
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="Curve_lqi3b"]
|
||||||
|
_limits = [0.0, 4.0, 0.0, 10.0]
|
||||||
|
_data = [Vector2(0, 0), 0.0, 0.924, 0, 0, Vector2(4.36728, 4), 0.0, 0.0, 0, 0, Vector2(10, 4), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 3
|
||||||
|
|
||||||
[sub_resource type="Curve" id="Curve_vmxrd"]
|
[sub_resource type="Curve" id="Curve_vmxrd"]
|
||||||
_limits = [0.0, 3.0, 0.0, 10.0]
|
_limits = [0.0, 3.0, 0.0, 10.0]
|
||||||
_data = [Vector2(4, 1), 0.141612, 0.141612, 0, 0, Vector2(5, 1.2), 0.327899, 0.327899, 0, 0, Vector2(10, 3), 0.392484, 0.0, 0, 0]
|
_data = [Vector2(4, 1), 0.141612, 0.141612, 0, 0, Vector2(5, 1.2), 0.327899, 0.327899, 0, 0, Vector2(10, 3), 0.392484, 0.0, 0, 0]
|
||||||
@ -19,44 +29,53 @@ _limits = [0.0, 6.0, 0.0, 10.0]
|
|||||||
_data = [Vector2(2, 1), 0.0, 0.0, 0, 0, Vector2(4, 3), 0.953378, 0.953378, 0, 0, Vector2(10, 6), 0.0, 0.0, 0, 0]
|
_data = [Vector2(2, 1), 0.0, 0.0, 0, 0, Vector2(4, 3), 0.953378, 0.953378, 0, 0, Vector2(10, 6), 0.0, 0.0, 0, 0]
|
||||||
point_count = 3
|
point_count = 3
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_s7rwx"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_vmxrd"]
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nayyt"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nayyt"]
|
||||||
animation = &"idle"
|
animation = &"idle"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nayyt"]
|
[sub_resource type="AnimationNodeBlend2" id="AnimationNodeBlend2_nayyt"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeAdd2" id="AnimationNodeAdd2_lqi3b"]
|
||||||
|
|
||||||
|
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_elp7k"]
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s7rwx"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_s7rwx"]
|
||||||
animation = &"shamble"
|
animation = &"walk_front"
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_vmxrd"]
|
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_elp7k"]
|
||||||
|
animation = &"walk_rear"
|
||||||
[sub_resource type="AnimationNodeOneShot" id="AnimationNodeOneShot_s7rwx"]
|
|
||||||
mix_mode = 1
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vmxrd"]
|
|
||||||
animation = &"step_left"
|
|
||||||
|
|
||||||
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nayyt"]
|
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_nayyt"]
|
||||||
graph_offset = Vector2(-970.678, -40.9846)
|
graph_offset = Vector2(-931.897, 18.4586)
|
||||||
|
nodes/anim_scale/node = SubResource("AnimationNodeTimeScale_s7rwx")
|
||||||
|
nodes/anim_scale/position = Vector2(280, 140)
|
||||||
|
nodes/front_scale/node = SubResource("AnimationNodeTimeScale_vmxrd")
|
||||||
|
nodes/front_scale/position = Vector2(-460, 220)
|
||||||
nodes/idle_anim/node = SubResource("AnimationNodeAnimation_nayyt")
|
nodes/idle_anim/node = SubResource("AnimationNodeAnimation_nayyt")
|
||||||
nodes/idle_anim/position = Vector2(-460, 20)
|
nodes/idle_anim/position = Vector2(-460, 20)
|
||||||
|
nodes/idle_blend/node = SubResource("AnimationNodeBlend2_nayyt")
|
||||||
|
nodes/idle_blend/position = Vector2(-220, 120)
|
||||||
nodes/output/position = Vector2(500, 160)
|
nodes/output/position = Vector2(500, 160)
|
||||||
nodes/shamble_blend/node = SubResource("AnimationNodeBlend2_nayyt")
|
nodes/rear_add/node = SubResource("AnimationNodeAdd2_lqi3b")
|
||||||
nodes/shamble_blend/position = Vector2(20, 180)
|
nodes/rear_add/position = Vector2(60, 180)
|
||||||
nodes/shamble_cycle/node = SubResource("AnimationNodeAnimation_s7rwx")
|
nodes/rear_scale/node = SubResource("AnimationNodeTimeScale_elp7k")
|
||||||
nodes/shamble_cycle/position = Vector2(-460, 280)
|
nodes/rear_scale/position = Vector2(-200, 400)
|
||||||
nodes/shamble_scale/node = SubResource("AnimationNodeTimeScale_vmxrd")
|
nodes/walk_front/node = SubResource("AnimationNodeAnimation_s7rwx")
|
||||||
nodes/shamble_scale/position = Vector2(-220, 280)
|
nodes/walk_front/position = Vector2(-680, 220)
|
||||||
nodes/step_action/node = SubResource("AnimationNodeOneShot_s7rwx")
|
nodes/walk_rear/node = SubResource("AnimationNodeAnimation_elp7k")
|
||||||
nodes/step_action/position = Vector2(260, 140)
|
nodes/walk_rear/position = Vector2(-460, 440)
|
||||||
nodes/step_anim/node = SubResource("AnimationNodeAnimation_vmxrd")
|
node_connections = [&"anim_scale", 0, &"rear_add", &"front_scale", 0, &"walk_front", &"idle_blend", 0, &"idle_anim", &"idle_blend", 1, &"front_scale", &"output", 0, &"anim_scale", &"rear_add", 0, &"idle_blend", &"rear_add", 1, &"rear_scale", &"rear_scale", 0, &"walk_rear"]
|
||||||
nodes/step_anim/position = Vector2(40, 460)
|
|
||||||
node_connections = [&"output", 0, &"step_action", &"shamble_blend", 0, &"idle_anim", &"shamble_blend", 1, &"shamble_scale", &"shamble_scale", 0, &"shamble_cycle", &"step_action", 0, &"shamble_blend", &"step_action", 1, &"step_anim"]
|
|
||||||
|
|
||||||
[sub_resource type="SphereMesh" id="SphereMesh_s7rwx"]
|
[sub_resource type="SphereMesh" id="SphereMesh_s7rwx"]
|
||||||
|
|
||||||
[node name="Shambler" instance=ExtResource("1_uiw1a")]
|
[node name="Shambler" instance=ExtResource("1_uiw1a")]
|
||||||
script = ExtResource("2_s7rwx")
|
script = ExtResource("2_s7rwx")
|
||||||
walk_blend_curve = SubResource("Curve_s7rwx")
|
idle_blend_curve = SubResource("Curve_s7rwx")
|
||||||
|
rear_blend_curve = SubResource("Curve_xyfav")
|
||||||
|
rear_scale_curve = SubResource("Curve_lqi3b")
|
||||||
walk_scale_curve = SubResource("Curve_vmxrd")
|
walk_scale_curve = SubResource("Curve_vmxrd")
|
||||||
look_accel_curve = SubResource("Curve_elp7k")
|
look_accel_curve = SubResource("Curve_elp7k")
|
||||||
|
|
||||||
@ -100,11 +119,11 @@ unique_name_in_owner = true
|
|||||||
root_node = NodePath("%AnimationTree/..")
|
root_node = NodePath("%AnimationTree/..")
|
||||||
tree_root = SubResource("AnimationNodeBlendTree_nayyt")
|
tree_root = SubResource("AnimationNodeBlendTree_nayyt")
|
||||||
anim_player = NodePath("../AnimationPlayer")
|
anim_player = NodePath("../AnimationPlayer")
|
||||||
parameters/shamble_blend/blend_amount = 0.0
|
parameters/anim_scale/scale = 1.0
|
||||||
parameters/shamble_scale/scale = 1.0
|
parameters/front_scale/scale = 1.0
|
||||||
parameters/step_action/active = false
|
parameters/idle_blend/blend_amount = 0.0
|
||||||
parameters/step_action/internal_active = false
|
parameters/rear_add/add_amount = 1.0
|
||||||
parameters/step_action/request = 0
|
parameters/rear_scale/scale = 1.0
|
||||||
|
|
||||||
[node name="LookTargetPivot" type="Node3D" parent="." index="3"]
|
[node name="LookTargetPivot" type="Node3D" parent="." index="3"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user