Initial setup for NPCs and their pathfinding.

This commit is contained in:
Patrick 2024-12-11 22:23:58 +01:00
parent 0fa362aed4
commit 1ca0a2bdc0
6 changed files with 204 additions and 7 deletions

View file

@ -1,17 +1,24 @@
[gd_scene load_steps=4 format=3 uid="uid://cbyee7drds7qu"]
[gd_scene load_steps=8 format=3 uid="uid://cbyee7drds7qu"]
[ext_resource type="Script" path="res://scripts/maps/map.gd" id="1_4npcs"]
[ext_resource type="PackedScene" uid="uid://bsghm187n6ykx" path="res://scenes/objects/closet.tscn" id="2_yvpvm"]
[ext_resource type="PackedScene" uid="uid://cvnjpnvchvakj" path="res://scenes/entities/npc.tscn" id="3_x3gyc"]
[sub_resource type="Environment" id="Environment_pq0iv"]
[sub_resource type="NavigationMesh" id="NavigationMesh_hqhxb"]
vertices = PackedVector3Array(-49.5, 1, -49.5, -49.5, 1, 49.5, 49.5, 1, 49.5, 49.5, 1, -49.5)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="BoxMesh" id="BoxMesh_kw2od"]
size = Vector3(100, 1, 100)
[sub_resource type="BoxShape3D" id="BoxShape3D_rnmx0"]
size = Vector3(100, 1, 100)
[node name="Testmap" type="Node3D"]
script = ExtResource("1_4npcs")
[node name="CSGBox3D" type="CSGBox3D" parent="."]
use_collision = true
size = Vector3(50, 1, 50)
[node name="PlayerSpawn" type="Node3D" parent="."]
[node name="0" type="Node3D" parent="PlayerSpawn"]
@ -31,3 +38,51 @@ environment = SubResource("Environment_pq0iv")
[node name="Closet" parent="." instance=ExtResource("2_yvpvm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2, 10, 2)
[node name="Npc7" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 30, 0)
[node name="Npc8" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 30, -40)
[node name="Npc9" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 30, -40)
[node name="Npc10" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40, 30, -40)
[node name="Npc11" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40, 30, 40)
[node name="Npc12" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 30, 40)
[node name="Npc6" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 20, 0)
[node name="Npc5" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 20, -40)
[node name="Npc4" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 20, -40)
[node name="Npc3" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40, 20, -40)
[node name="Npc2" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -40, 20, 40)
[node name="Npc1" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 40, 20, 40)
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
navigation_mesh = SubResource("NavigationMesh_hqhxb")
[node name="StaticBody3D" type="StaticBody3D" parent="NavigationRegion3D"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationRegion3D/StaticBody3D"]
mesh = SubResource("BoxMesh_kw2od")
skeleton = NodePath("../..")
[node name="CollisionShape3D" type="CollisionShape3D" parent="NavigationRegion3D/StaticBody3D"]
shape = SubResource("BoxShape3D_rnmx0")