feat: implemented fire at target action
This commit is contained in:
parent
ffafcac23a
commit
7cf5b128ff
24 changed files with 569 additions and 111 deletions
103
godot/GameObjects/enemy_unit.tscn
Normal file
103
godot/GameObjects/enemy_unit.tscn
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://ba17jrcaduowj"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_va30j"]
|
||||
resource_name = "RESET"
|
||||
length = 0.001
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_opwhc"]
|
||||
resource_name = "fire"
|
||||
step = 0.01
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.04, 0.14),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381), Vector3(-0.363891, 1.24027, 0.199307), Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"fire_at_target"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3jmw4"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_va30j"),
|
||||
"fire_weapon": SubResource("Animation_opwhc")
|
||||
}
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ss47r"]
|
||||
albedo_color = Color(1, 0.24, 0.24, 1)
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_5r0b3"]
|
||||
material = SubResource("StandardMaterial3D_ss47r")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_p8wvo"]
|
||||
size = Vector3(0.2, 0.2, 0.5)
|
||||
|
||||
[node name="Unit" type="Unit"]
|
||||
configure_team = 3
|
||||
collision_layer = 6
|
||||
collision_mask = 0
|
||||
|
||||
[node name="ActorWorldState" type="UnitWorldState" parent="."]
|
||||
|
||||
[node name="Planner" type="Planner" parent="."]
|
||||
|
||||
[node name="EntityHealth" type="EntityHealth" parent="."]
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_3jmw4")
|
||||
}
|
||||
|
||||
[node name="Eyes" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.4512, 0)
|
||||
|
||||
[node name="VisionTarget" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.31501, 0)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_5r0b3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("SphereShape3D_drlm2")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.363891, 1.24027, 0.471381)
|
||||
mesh = SubResource("BoxMesh_p8wvo")
|
||||
|
|
@ -9,7 +9,7 @@ height = 0.1
|
|||
ground_marker_scene = ExtResource("1_t46fa")
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(-1, 7.57103e-08, -4.37114e-08, 0, 0.5, 0.866025, 8.74228e-08, 0.866025, -0.5, 0, 5.86004, -2.59394)
|
||||
transform = Transform3D(-1, 7.57104e-08, -4.37114e-08, 0, 0.5, 0.866025, 8.74228e-08, 0.866025, -0.5, 0, 8.41077, -4.42292)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0494189, 0)
|
||||
|
|
|
|||
106
godot/GameObjects/player_unit.tscn
Normal file
106
godot/GameObjects/player_unit.tscn
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://pme230qx1377"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_va30j"]
|
||||
resource_name = "RESET"
|
||||
length = 0.001
|
||||
loop_mode = 1
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_opwhc"]
|
||||
resource_name = "fire"
|
||||
step = 0.01
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("MeshInstance3D2:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 0.04, 0.14),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Vector3(-0.363891, 1.24027, 0.471381), Vector3(-0.363891, 1.24027, 0.199307), Vector3(-0.363891, 1.24027, 0.471381)]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"fire_at_target"
|
||||
}]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_3jmw4"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_va30j"),
|
||||
"fire_weapon": SubResource("Animation_opwhc")
|
||||
}
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_n4q15"]
|
||||
albedo_color = Color(0.407843, 1, 0.447059, 1)
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_5r0b3"]
|
||||
material = SubResource("StandardMaterial3D_n4q15")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_p8wvo"]
|
||||
size = Vector3(0.2, 0.2, 0.5)
|
||||
|
||||
[node name="Unit" type="Unit"]
|
||||
configure_team = 1
|
||||
collision_layer = 6
|
||||
collision_mask = 0
|
||||
|
||||
[node name="ActorWorldState" type="UnitWorldState" parent="."]
|
||||
|
||||
[node name="Planner" type="Planner" parent="."]
|
||||
actions_inspector = [0, 1, 2]
|
||||
|
||||
[node name="EntityHealth" type="EntityHealth" parent="."]
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
path_height_offset = 0.5
|
||||
debug_enabled = true
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_3jmw4")
|
||||
}
|
||||
|
||||
[node name="Eyes" type="Node3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.49429, 0)
|
||||
|
||||
[node name="VisionTarget" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.39151, 0)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_5r0b3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("SphereShape3D_drlm2")
|
||||
|
||||
[node name="MeshInstance3D2" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.363891, 1.24027, 0.471381)
|
||||
mesh = SubResource("BoxMesh_p8wvo")
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://pme230qx1377"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_n4q15"]
|
||||
albedo_color = Color(0.407843, 1, 0.447059, 1)
|
||||
|
||||
[sub_resource type="CapsuleMesh" id="CapsuleMesh_5r0b3"]
|
||||
material = SubResource("StandardMaterial3D_n4q15")
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_drlm2"]
|
||||
radius = 1.0
|
||||
|
||||
[node name="Unit" type="Unit"]
|
||||
collision_layer = 2
|
||||
collision_mask = 0
|
||||
|
||||
[node name="ActorWorldState" type="UnitWorldState" parent="."]
|
||||
|
||||
[node name="Planner" type="Planner" parent="."]
|
||||
actions = [0, 1, 2]
|
||||
|
||||
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
|
||||
target_desired_distance = 0.25
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
mesh = SubResource("CapsuleMesh_5r0b3")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
||||
shape = SubResource("SphereShape3D_drlm2")
|
||||
Loading…
Add table
Add a link
Reference in a new issue