godot-wild-jam-66/npc/FullEmployee.tscn
2024-02-18 18:25:36 +01:00

95 lines
4.2 KiB
Text

[gd_scene load_steps=9 format=3 uid="uid://dr0fywxv7c0c"]
[ext_resource type="Script" path="res://npc/NavmeshAgent.gd" id="1_kf6pf"]
[ext_resource type="Script" path="res://npc/StateMachine/StateMachine.gd" id="2_rkkfj"]
[ext_resource type="Script" path="res://npc/StateMachine/NpcPatrol.gd" id="3_nalmh"]
[ext_resource type="Script" path="res://npc/StateMachine/NpcWait.gd" id="4_npcrq"]
[ext_resource type="Script" path="res://npc/StateMachine/NpcChase.gd" id="5_hjqdb"]
[ext_resource type="PackedScene" uid="uid://4y2uas5rrqh6" path="res://npc/BasicEmployee.tscn" id="6_1uhj2"]
[sub_resource type="BoxShape3D" id="BoxShape3D_v3wll"]
size = Vector3(0.4, 1.8, 0.255)
[sub_resource type="CylinderShape3D" id="CylinderShape3D_reox5"]
height = 1.8
[node name="FullEmployee" type="CharacterBody3D" node_paths=PackedStringArray("navigation_agent")]
collision_mask = 3
floor_block_on_wall = false
script = ExtResource("1_kf6pf")
navigation_agent = NodePath("NavigationAgent3D")
patrol_speed = 1.0
wait_time = 5.0
chase_speed = 2.0
[node name="State Machine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
script = ExtResource("2_rkkfj")
initial_state = NodePath("PatrolState")
[node name="PatrolState" type="Node" parent="State Machine" node_paths=PackedStringArray("parent", "raycaster")]
script = ExtResource("3_nalmh")
parent = NodePath("../..")
raycaster = NodePath("../../BasicEmployee")
[node name="WaitState" type="Node" parent="State Machine" node_paths=PackedStringArray("parent", "raycaster")]
script = ExtResource("4_npcrq")
parent = NodePath("../..")
raycaster = NodePath("../../BasicEmployee")
wait_time = 5.0
[node name="ChaseState" type="Node" parent="State Machine" node_paths=PackedStringArray("parent", "navigation_agent", "raycaster")]
script = ExtResource("5_hjqdb")
parent = NodePath("../..")
navigation_agent = NodePath("../../NavigationAgent3D")
raycaster = NodePath("../../BasicEmployee")
[node name="LastPos" type="Marker3D" parent="State Machine/ChaseState"]
[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."]
path_desired_distance = 0.25
target_desired_distance = 0.25
path_max_distance = 1.01
[node name="BasicEmployee" parent="." instance=ExtResource("6_1uhj2")]
[node name="SfxNoticed" type="FmodEventEmitter3D" parent="BasicEmployee"]
event_name = "event:/ALERT_NOTICED"
event_guid = "{ee65606c-dc86-43d9-9ec3-c3d9ba4b3c34}"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="SfxChaseStart" type="FmodEventEmitter3D" parent="BasicEmployee"]
event_name = "event:/NPC/SFX_NPC_CHASESTART"
event_guid = "{6c667adf-1a47-4f2e-9b30-468163b01127}"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="SfxChaseEnd" type="FmodEventEmitter3D" parent="BasicEmployee"]
event_name = "event:/NPC/SFX_NPC_CHASEEND"
event_guid = "{0afc656d-41bf-4ec2-b514-365acdad5688}"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="SfxLostTrack" type="FmodEventEmitter3D" parent="BasicEmployee"]
event_name = "event:/NPC/SFX_NPC_LOSTTRACK"
event_guid = "{8a571240-dce1-4dbe-9a1f-41887d6bb629}"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="SfxPlayerCaught" type="FmodEventEmitter3D" parent="BasicEmployee"]
event_name = "event:/NPC/SFX_NPC_PLAYERCAUGHT"
event_guid = "{0d581eb2-59b9-43f6-b5b9-9eac681cf3bd}"
process_mode = 3
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.885937, 0)
shape = SubResource("BoxShape3D_v3wll")
[node name="CatchArea" type="Area3D" parent="."]
collision_mask = 2
[node name="CollisionShape3D" type="CollisionShape3D" parent="CatchArea"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.9, 0)
shape = SubResource("CylinderShape3D_reox5")
[connection signal="alerted" from="State Machine/PatrolState" to="BasicEmployee/SfxNoticed" method="play"]
[connection signal="chase_end" from="State Machine/ChaseState" to="BasicEmployee/SfxChaseEnd" method="play"]
[connection signal="chase_start" from="State Machine/ChaseState" to="BasicEmployee/SfxChaseStart" method="play"]
[connection signal="lost_track" from="State Machine/ChaseState" to="BasicEmployee/SfxLostTrack" method="play"]