Minor world cleanup, again fixed PickupItems item scene instances...

main
Martin Felis 2024-08-16 01:05:43 +02:00
parent 730ee9e69b
commit 71e721cfd4
12 changed files with 890 additions and 166 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,4 +5,4 @@
[node name="ShovelScene" type="Node3D"] [node name="ShovelScene" type="Node3D"]
[node name="tool-shovel2" parent="." instance=ExtResource("1_wx078")] [node name="tool-shovel2" parent="." instance=ExtResource("1_wx078")]
transform = Transform3D(0.752691, 0.658297, 0.0101115, 0, -0.0153582, 0.999882, 0.658374, -0.752602, -0.01156, -0.0324047, -1.19209e-07, 0.116789) transform = Transform3D(1.50538, 1.31659, 0.0202139, -4.63598e-09, -0.0307027, 1.99976, 1.31675, -1.5052, -0.0231097, -0.167481, -1.49011e-07, 0.19021)

View File

@ -0,0 +1,5 @@
~ start
Chloe: [[Hi|Hello|Howdy]], weather seems nice today!
=> END

View File

@ -0,0 +1,15 @@
[remap]
importer="dialogue_manager_compiler_12"
type="Resource"
uid="uid://bx2wi6c0f554"
path="res://.godot/imported/default_dialogue.dialogue-6a352df79fa5cffb2b25f991f789687d.tres"
[deps]
source_file="res://dialogue/default_dialogue.dialogue"
dest_files=["res://.godot/imported/default_dialogue.dialogue-6a352df79fa5cffb2b25f991f789687d.tres"]
[params]
defaults=true

View File

@ -1,11 +1,17 @@
extends Area3D extends Area3D
@export var dialogue_resource: DialogueResource @export var quest_dialogue_resource: DialogueResource
@export var default_dialogue_resource: DialogueResource
@export var dialogue_start: String = "start" @export var dialogue_start: String = "start"
@onready var builder_missing_tool:QuestBuilderMissingTool = %BuilderMissingTool
func action() -> void: func action() -> void:
var balloon = load("res://ui/dialogue/balloon.tscn").instantiate() as DialogueBaloon var balloon = load("res://ui/dialogue/balloon.tscn").instantiate() as DialogueBaloon
get_tree().current_scene.add_child(balloon) get_tree().current_scene.add_child(balloon)
var quest_states = get_tree().get_nodes_in_group("quest_state") var quest_states = get_tree().get_nodes_in_group("quest_state")
balloon.start(dialogue_resource, dialogue_start, quest_states)
if not builder_missing_tool.is_completed:
balloon.start(quest_dialogue_resource, dialogue_start, quest_states)
else:
balloon.start(default_dialogue_resource, dialogue_start, quest_states)

View File

@ -15,6 +15,7 @@ signal item_picked_up(node_path:NodePath)
if editor_child_scene != null: if editor_child_scene != null:
editor_child_scene.queue_free() editor_child_scene.queue_free()
remove_child(editor_child_scene)
if not Engine.is_editor_hint(): if not Engine.is_editor_hint():
return return

View File

@ -1,19 +1,14 @@
[gd_scene load_steps=5 format=3 uid="uid://da5r82nvypfk4"] [gd_scene load_steps=4 format=3 uid="uid://da5r82nvypfk4"]
[ext_resource type="Script" path="res://objects/pickup_item.gd" id="1_1i8k2"] [ext_resource type="Script" path="res://objects/pickup_item.gd" id="1_1i8k2"]
[ext_resource type="Resource" uid="uid://dmjr6pmb17l2y" path="res://data/items/woodplanks.tres" id="2_dph0g"]
[ext_resource type="PackedScene" uid="uid://ysfnsrvgemi6" path="res://assets/resources/wood_planks.tscn" id="3_fvgmq"]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_1ndog"] [sub_resource type="CylinderShape3D" id="CylinderShape3D_1ndog"]
height = 0.2 height = 0.200798
radius = 0.15682 radius = 0.15682
[node name="Item" type="Node3D" groups=["pickup_item"]] [node name="Item" type="Node3D" groups=["pickup_item"]]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00393829, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00393829, 0)
script = ExtResource("1_1i8k2") script = ExtResource("1_1i8k2")
item = ExtResource("2_dph0g")
[node name="Planks" type="Node3D" parent="." instance=ExtResource("3_fvgmq")]
[node name="Area3D" type="Area3D" parent="."] [node name="Area3D" type="Area3D" parent="."]

View File

@ -61,7 +61,7 @@ toggle_inventory={
[internationalization] [internationalization]
locale/translations_pot_files=PackedStringArray("res://dialogue/bridge_builder_missing_tool.dialogue") locale/translations_pot_files=PackedStringArray("res://dialogue/bridge_builder_missing_tool.dialogue", "res://dialogue/default_dialogue.dialogue")
[layer_names] [layer_names]

View File

@ -4,8 +4,7 @@ extends Node
@export var is_wrench_found:bool = false @export var is_wrench_found:bool = false
@export var is_wrench_delivered:bool = false @export var is_wrench_delivered:bool = false
@export var is_bridge_built:bool = false @export var is_bridge_built:bool = false
@export var is_completed:bool = false
@onready var merchant = %Merchant
@onready var bridge = %Bridge @onready var bridge = %Bridge
@ -22,16 +21,25 @@ func _ready():
func on_dialogue_ended(_dialog_resource: DialogueResource) -> void: func on_dialogue_ended(_dialog_resource: DialogueResource) -> void:
if is_completed:
return
if is_wrench_delivered and not is_bridge_built: if is_wrench_delivered and not is_bridge_built:
print ("Will build bridge!") print ("Will build bridge!")
emit_signal("wrench_delivered") emit_signal("wrench_delivered")
func _process(_delta): func _process(_delta):
if is_wrench_delivered:
is_bridge_built = true
bridge.global_transform = _bridge_transform
if is_completed:
return
for item in _player.inventory.get_items(): for item in _player.inventory.get_items():
if item.name == "Wrench": if item.name == "Wrench":
is_wrench_found = true is_wrench_found = true
if is_wrench_delivered: if is_bridge_built:
is_bridge_built = true is_completed = true
bridge.global_transform = _bridge_transform

File diff suppressed because one or more lines are too long