diff --git a/assets/npc/shambler/animations/anim_walk_front.tres b/assets/npc/shambler/animations/anim_walk_front.tres index 5871133..525ddd5 100644 --- a/assets/npc/shambler/animations/anim_walk_front.tres +++ b/assets/npc/shambler/animations/anim_walk_front.tres @@ -389,3 +389,31 @@ tracks/54/path = NodePath("Armature/Skeleton3D:BackLeg.R.003") tracks/54/interp = 1 tracks/54/loop_wrap = true tracks/54/keys = PackedFloat32Array(0, 1, 1.31588e-07, -3.86601e-07, 1.59693e-07, 0.433333, 1, -2.64853e-07, -4.32595e-08, -1.39598e-07, 0.466667, 1, 0.000703992, -0.000411179, 0.000925207, 0.5, 1, 0.00352074, -0.00205441, 0.00462661, 0.533333, 1, 0.0153793, -0.00901154, 0.0202124, 0.566667, 1, 0.00734322, -0.00430337, 0.00965081, 0.6, 1, 5.63296e-06, -3.40606e-06, 7.20036e-06, 1.25, 1, 6.73511e-08, -3.80592e-07, 4.05452e-07) +tracks/55/type = "method" +tracks/55/imported = false +tracks/55/enabled = true +tracks/55/path = NodePath("Armature/Skeleton3D/SleeveL/LeftDebris") +tracks/55/interp = 1 +tracks/55/loop_wrap = true +tracks/55/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"spawn" +}] +} +tracks/56/type = "method" +tracks/56/imported = false +tracks/56/enabled = true +tracks/56/path = NodePath("Armature/Skeleton3D/SleeveR/RightDebris") +tracks/56/interp = 1 +tracks/56/loop_wrap = true +tracks/56/keys = { +"times": PackedFloat32Array(0.633333), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"spawn" +}] +} diff --git a/src/effects/grunk_debris.tscn b/src/effects/grunk_debris.tscn new file mode 100644 index 0000000..0c4b3ad --- /dev/null +++ b/src/effects/grunk_debris.tscn @@ -0,0 +1,35 @@ +[gd_scene load_steps=4 format=3 uid="uid://cf1o33mq2hxjx"] + +[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_s7rwx"] +lifetime_randomness = 0.71 +direction = Vector3(0, 1, 0) +initial_velocity_min = 3.0 +initial_velocity_max = 3.0 +attractor_interaction_enabled = false +collision_mode = 1 +collision_friction = 1.0 +collision_bounce = 0.0 + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_s7rwx"] +vertex_color_use_as_albedo = true +albedo_color = Color(0, 0.101961, 0.301961, 1) +texture_filter = 0 +billboard_mode = 3 +billboard_keep_scale = true +particles_anim_h_frames = 1 +particles_anim_v_frames = 1 +particles_anim_loop = false + +[sub_resource type="QuadMesh" id="QuadMesh_vmxrd"] +material = SubResource("StandardMaterial3D_s7rwx") +size = Vector2(0.1, 0.1) + +[node name="ArmDebrisEmitter" type="GPUParticles3D"] +process_mode = 3 +emitting = false +lifetime = 2.0 +one_shot = true +preprocess = 0.1 +explosiveness = 0.87 +process_material = SubResource("ParticleProcessMaterial_s7rwx") +draw_pass_1 = SubResource("QuadMesh_vmxrd") diff --git a/src/effects/particle_spawner.gd b/src/effects/particle_spawner.gd new file mode 100644 index 0000000..8548641 --- /dev/null +++ b/src/effects/particle_spawner.gd @@ -0,0 +1,25 @@ +class_name ParticleSpawner extends Node3D +## Utility effect node for dynamically spawning a particle emitter instance on command. + +@export var particle_scene: PackedScene + +@export var lifetime_override := -1.0 + + +func _get_lifetime(particle_instance: Node3D) -> float: + if lifetime_override > 0: + return lifetime_override + if particle_instance is GPUParticles3D: + (particle_instance as GPUParticles3D).emitting = true + return (particle_instance as GPUParticles3D).lifetime + if particle_instance is CPUParticles3D: + (particle_instance as CPUParticles3D).emitting = true + return (particle_instance as CPUParticles3D).lifetime + + return -1.0 + + +func spawn() -> void: + var instance: Node3D = particle_scene.instantiate() + add_child(instance) + get_tree().create_timer(_get_lifetime(instance), true).timeout.connect(instance.queue_free) diff --git a/src/effects/particle_spawner.gd.uid b/src/effects/particle_spawner.gd.uid new file mode 100644 index 0000000..b6f1d79 --- /dev/null +++ b/src/effects/particle_spawner.gd.uid @@ -0,0 +1 @@ +uid://cuqr167olan8n diff --git a/src/world/grunk_beast/shambler/shambler.tscn b/src/world/grunk_beast/shambler/shambler.tscn index f878c36..074a575 100644 --- a/src/world/grunk_beast/shambler/shambler.tscn +++ b/src/world/grunk_beast/shambler/shambler.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=39 format=3 uid="uid://brrd33217oplv"] +[gd_scene load_steps=23 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="Material" uid="uid://7xrgrvf3lymv" path="res://assets/npc/shambler/shambler.material" id="2_nayyt"] [ext_resource type="Script" uid="uid://bueq1q2qva7gs" path="res://src/world/grunk_beast/shambler/shambler.gd" id="2_s7rwx"] -[ext_resource type="Texture2D" uid="uid://dy1b3rv3b473p" path="res://assets/particles/dust/dust_2.png" id="4_vmxrd"] +[ext_resource type="Script" uid="uid://cuqr167olan8n" path="res://src/effects/particle_spawner.gd" id="4_elp7k"] +[ext_resource type="PackedScene" uid="uid://cf1o33mq2hxjx" path="res://src/effects/grunk_debris.tscn" id="5_lqi3b"] [sub_resource type="Curve" id="Curve_s7rwx"] _limits = [0.0, 1.0, 0.0, 10.0] @@ -30,107 +31,6 @@ _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] point_count = 3 -[sub_resource type="Curve" id="Curve_c7m4v"] -_data = [Vector2(0.484065, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), -1.42259, 0.0, 0, 0] -point_count = 2 - -[sub_resource type="CurveTexture" id="CurveTexture_vru5p"] -curve = SubResource("Curve_c7m4v") - -[sub_resource type="Curve" id="Curve_xlxrx"] - -[sub_resource type="Curve" id="Curve_6bdpa"] -_limits = [-2.0, 0.0, 0.0, 1.0] -_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(0.141289, -1.67748), -2.40482, -2.40482, 0, 0, Vector2(0.240439, -2), 0.0, 0.0, 0, 0, Vector2(0.702195, -1.4748), 2.64323, 2.64323, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] -point_count = 5 - -[sub_resource type="Curve" id="Curve_cp8sw"] - -[sub_resource type="CurveXYZTexture" id="CurveXYZTexture_c7m4v"] -curve_x = SubResource("Curve_xlxrx") -curve_y = SubResource("Curve_6bdpa") -curve_z = SubResource("Curve_cp8sw") - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_elp7k"] -lifetime_randomness = 0.5 -emission_shape = 6 -emission_ring_axis = Vector3(0, 1, -0.22) -emission_ring_height = 0.01 -emission_ring_radius = 0.75 -emission_ring_inner_radius = 0.0 -emission_ring_cone_angle = 90.0 -direction = Vector3(0, -1, 0) -spread = 0.0 -directional_velocity_min = 0.999984 -directional_velocity_max = 0.999984 -directional_velocity_curve = SubResource("CurveXYZTexture_c7m4v") -gravity = Vector3(0, 0, 0) -attractor_interaction_enabled = false -scale_min = 0.2 -alpha_curve = SubResource("CurveTexture_vru5p") -hue_variation_min = -2.23517e-08 -hue_variation_max = 0.1 -collision_mode = 1 -collision_friction = 0.0 -collision_bounce = 0.0 -sub_emitter_mode = 3 -sub_emitter_amount_at_collision = 1 - -[sub_resource type="Curve" id="Curve_o6myl"] -_data = [Vector2(0, 0), 0.0, 35.9454, 0, 0, Vector2(0.0724026, 1), 0.0, 0.0, 0, 0, Vector2(0.293182, 0.536532), -1.90991, -1.90991, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] -point_count = 4 - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_xlxrx"] -transparency = 1 -cull_mode = 2 -vertex_color_use_as_albedo = true -albedo_color = Color(0, 0.101961, 0.301961, 1) -billboard_mode = 2 -billboard_keep_scale = true -use_particle_trails = true - -[sub_resource type="RibbonTrailMesh" id="RibbonTrailMesh_6bdpa"] -material = SubResource("StandardMaterial3D_xlxrx") -shape = 0 -size = 0.1 -sections = 8 -section_segments = 4 -curve = SubResource("Curve_o6myl") - -[sub_resource type="Curve" id="Curve_vru5p"] -_data = [Vector2(0, 0.515938), 0.0, 0.0, 0, 0, Vector2(0.129958, 1), 0.0, 0.0, 0, 0, Vector2(0.63704, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] -point_count = 4 - -[sub_resource type="CurveTexture" id="CurveTexture_10hsf"] -curve = SubResource("Curve_vru5p") - -[sub_resource type="Curve" id="Curve_0bwtl"] -_data = [Vector2(0, 0.443555), 0.0, 0.0, 0, 0, Vector2(0.166785, 1), 0.0, 0.0, 0, 0, Vector2(0.552054, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0] -point_count = 4 - -[sub_resource type="CurveTexture" id="CurveTexture_e8o6m"] -curve = SubResource("Curve_0bwtl") - -[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_vmxrd"] -gravity = Vector3(0, 0, 0) -attractor_interaction_enabled = false -scale_curve = SubResource("CurveTexture_e8o6m") -alpha_curve = SubResource("CurveTexture_10hsf") - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_elp7k"] -transparency = 1 -cull_mode = 2 -vertex_color_use_as_albedo = true -albedo_color = Color(0, 0.101961, 0.301961, 1) -albedo_texture = ExtResource("4_vmxrd") -roughness = 0.4 -texture_filter = 0 - -[sub_resource type="QuadMesh" id="QuadMesh_lqi3b"] -material = SubResource("StandardMaterial3D_elp7k") -size = Vector2(0.5, 0.5) -orientation = 1 - [sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_s7rwx"] [sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vmxrd"] @@ -210,27 +110,27 @@ symmetry_limitation = true primary_limit_angle = 1.5708 primary_damp_threshold = 0.7 -[node name="BoneAttachment3D" type="BoneAttachment3D" parent="Armature/Skeleton3D" index="2"] -transform = Transform3D(1, 4.26326e-14, 1.66895e-06, 1.64426e-06, 0.171372, -0.985207, -2.86011e-07, 0.985206, 0.171372, -1.88872e-13, 2.89043, -0.625428) -bone_name = "Spine.004" -bone_idx = 4 +[node name="SleeveL" type="BoneAttachment3D" parent="Armature/Skeleton3D" index="2"] +transform = Transform3D(0.0438309, 3.03611e-07, -0.999039, 0.871667, 0.488605, 0.0382428, 0.488135, -0.872506, 0.0214158, 1.63061, 0.0124237, 2.89069) +bone_name = "Sleeve.L" +bone_idx = 27 -[node name="DripParticles" type="GPUParticles3D" parent="Armature/Skeleton3D/BoneAttachment3D" index="0"] -process_mode = 3 -transform = Transform3D(1.25, 2.05405e-06, -3.58605e-07, 1.29369e-09, 0.214215, 1.23151, 2.08511e-06, -1.23151, 0.214215, -1.73335e-06, 0.540511, 1.0372) -amount = 3 -sub_emitter = NodePath("SplatParticles") -lifetime = 4.0 -trail_enabled = true -trail_lifetime = 1.9 -process_material = SubResource("ParticleProcessMaterial_elp7k") -draw_pass_1 = SubResource("RibbonTrailMesh_6bdpa") +[node name="LeftDebris" type="Node3D" parent="Armature/Skeleton3D/SleeveL" index="0"] +transform = Transform3D(-4.37114e-08, 1, 1.49012e-09, -1, -4.37114e-08, 0, 6.51351e-17, -1.49012e-09, 1, 0.1, 0.3, 0) +script = ExtResource("4_elp7k") +particle_scene = ExtResource("5_lqi3b") +metadata/_custom_type_script = "uid://cuqr167olan8n" -[node name="SplatParticles" type="GPUParticles3D" parent="Armature/Skeleton3D/BoneAttachment3D/DripParticles" index="0"] -amount = 32 -lifetime = 2.0 -process_material = SubResource("ParticleProcessMaterial_vmxrd") -draw_pass_1 = SubResource("QuadMesh_lqi3b") +[node name="SleeveR" type="BoneAttachment3D" parent="Armature/Skeleton3D" index="3"] +transform = Transform3D(0.043831, -1.41561e-07, 0.999039, -0.999039, 9.59262e-08, 0.0438309, -3.1665e-08, -1, -1.11759e-07, -1.63061, 0.0124235, -1.70549) +bone_name = "Sleeve.R" +bone_idx = 31 + +[node name="RightDebris" type="Node3D" parent="Armature/Skeleton3D/SleeveR" index="0"] +transform = Transform3D(-4.37114e-08, -1, 2.98022e-09, 1, -4.37114e-08, 2.28676e-14, -2.27374e-14, 2.98022e-09, 1, -0.1, 0.3, -1.19209e-07) +script = ExtResource("4_elp7k") +particle_scene = ExtResource("5_lqi3b") +metadata/_custom_type_script = "uid://cuqr167olan8n" [node name="AnimationPlayer" parent="." index="1"] unique_name_in_owner = true @@ -260,5 +160,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10) mesh = SubResource("SphereMesh_s7rwx") [node name="GPUParticlesCollisionBox3D" type="GPUParticlesCollisionBox3D" parent="." index="4"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0) -size = Vector3(4, 1, 4) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.25, 0) +size = Vector3(6, 0.5, 6)