NPCs can now carry objects.

This commit is contained in:
Patrick 2024-12-13 21:18:52 +01:00
parent a6c9909f26
commit c0d3c68fb3
8 changed files with 130 additions and 23 deletions

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=9 format=3 uid="uid://cbyee7drds7qu"]
[ext_resource type="Script" path="res://scripts/maps/map.gd" id="1_4npcs"]
[ext_resource type="Script" path="res://scripts/maps/objectives/objective.gd" id="2_yv1d0"]
[ext_resource type="Script" path="res://scripts/maps/objectives/hungry.gd" id="2_qrp84"]
[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"]
@ -34,15 +34,20 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, 15)
[node name="0" type="Node3D" parent="NPCRestPlaces"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 2, -28)
script = ExtResource("2_yv1d0")
script = ExtResource("2_qrp84")
[node name="1" type="Node3D" parent="NPCRestPlaces"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13, 2, -32)
script = ExtResource("2_yv1d0")
script = ExtResource("2_qrp84")
[node name="2" type="Node3D" parent="NPCRestPlaces"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12, 2, -48)
script = ExtResource("2_yv1d0")
script = ExtResource("2_qrp84")
[node name="NPCCarryables" type="Node3D" parent="."]
[node name="Closet" parent="NPCCarryables" instance=ExtResource("2_yvpvm")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29, 10, -30)
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(-0.899519, 0.375, 0.224144, -0.224144, -0.836516, 0.5, 0.375, 0.399519, 0.836516, 0, 0, 0)
@ -50,9 +55,6 @@ transform = Transform3D(-0.899519, 0.375, 0.224144, -0.224144, -0.836516, 0.5, 0
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
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="Npc1" parent="." instance=ExtResource("3_x3gyc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25, 6, -33)

View file

@ -1,15 +1,26 @@
[gd_scene load_steps=3 format=3 uid="uid://bsghm187n6ykx"]
[gd_scene load_steps=5 format=3 uid="uid://bsghm187n6ykx"]
[ext_resource type="Script" path="res://scripts/maps/carryable/carryable.gd" id="1_ma8bn"]
[sub_resource type="BoxMesh" id="BoxMesh_qilbd"]
size = Vector3(1, 2, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_by26a"]
[sub_resource type="BoxShape3D" id="BoxShape3D_2lhrk"]
size = Vector3(1, 2, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_by26a"]
size = Vector3(1.5, 2, 1.5)
[node name="Closet" type="RigidBody3D"]
script = ExtResource("1_ma8bn")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_qilbd")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("BoxShape3D_2lhrk")
[node name="Area3D" type="Area3D" parent="."]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
shape = SubResource("BoxShape3D_by26a")