From c56a32555e8c06e6db7391f504f18187f0233cfb Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 18 Oct 2026 00:53:22 -0500 Subject: [PATCH 1/4] Add rudimentary dialogue system. --- Dialogue.tscn | 39 +++++++++++++++++++++++++++++++++++++++ OldComputer.tscn | 1 + dialogue.gd | 15 +++++++++++++++ dialogue.gd.uid | 1 + player_2d.gd | 1 + world.tscn | 15 +++++++++++---- 6 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 Dialogue.tscn create mode 100644 dialogue.gd create mode 100644 dialogue.gd.uid diff --git a/Dialogue.tscn b/Dialogue.tscn new file mode 100644 index 0000000..46fabd0 --- /dev/null +++ b/Dialogue.tscn @@ -0,0 +1,39 @@ +[gd_scene format=3 uid="uid://bla1cfndgad0"] + +[ext_resource type="Script" uid="uid://byj4ibepgm6oa" path="res://dialogue.gd" id="1_tgtc2"] + +[node name="Dialogue" type="Control" unique_id=1025022375] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_tgtc2") + +[node name="Panel" type="Panel" parent="." unique_id=1878574619] +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.179 +anchor_top = 0.683 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -230.12001 +offset_top = -493.76 +offset_right = -230.0 +offset_bottom = -494.0 +grow_horizontal = 0 +grow_vertical = 0 + +[node name="Text" type="RichTextLabel" parent="Panel" unique_id=1494828842] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 8.0 +offset_top = 11.0 +offset_right = -11.0 +offset_bottom = 4.0 +grow_horizontal = 2 +grow_vertical = 2 +bbcode_enabled = true diff --git a/OldComputer.tscn b/OldComputer.tscn index 7cf4d16..719c285 100644 --- a/OldComputer.tscn +++ b/OldComputer.tscn @@ -43,6 +43,7 @@ offset_left = 150.0 offset_top = 105.0 offset_right = 1102.0 offset_bottom = 652.0 +bbcode_enabled = true text = ">> Pharaoh OS 2000 Boot Sequence >> WARN: Detected anomalies! >> WARN: Memory integrity at %d%%! diff --git a/dialogue.gd b/dialogue.gd new file mode 100644 index 0000000..ee6c768 --- /dev/null +++ b/dialogue.gd @@ -0,0 +1,15 @@ +class_name Dialogue +extends Control + +func show_text(text: String) -> Dialogue: + visible = true + $Panel/Text.text = "[font_size=28]%s" % text + return self + +func dismiss_after(secs: float) -> Dialogue: + await get_tree().create_timer(secs).timeout + return dismiss() + +func dismiss() -> Dialogue: + visible = false + return self diff --git a/dialogue.gd.uid b/dialogue.gd.uid new file mode 100644 index 0000000..f7b8ea7 --- /dev/null +++ b/dialogue.gd.uid @@ -0,0 +1 @@ +uid://byj4ibepgm6oa diff --git a/player_2d.gd b/player_2d.gd index e25030f..d9cd26e 100644 --- a/player_2d.gd +++ b/player_2d.gd @@ -25,6 +25,7 @@ func _ready() -> void: spawn_point = position DisplayServer.window_set_title("JUMPS EQUALS JUMPS") give_objective("sarc", 0, "Open the Sarcophagus") + %Dialogue.show_text("Hello world!").dismiss_after(2) func refresh_dash(new_dashes): if new_dashes: diff --git a/world.tscn b/world.tscn index fe6ddd2..c9ca9a0 100644 --- a/world.tscn +++ b/world.tscn @@ -18,6 +18,7 @@ [ext_resource type="Script" uid="uid://d3rx82psovcpp" path="res://music_button.gd" id="14_70uel"] [ext_resource type="Script" uid="uid://oyyhhy1gemg0" path="res://objectives_label.gd" id="14_ikiii"] [ext_resource type="PackedScene" uid="uid://dr8h8xij3qw2h" path="res://pharaoh.tscn" id="15_hiqwa"] +[ext_resource type="PackedScene" uid="uid://bla1cfndgad0" path="res://Dialogue.tscn" id="19_26xuy"] [ext_resource type="PackedScene" uid="uid://bcu7ftukipiyy" path="res://OldComputer.tscn" id="19_cbp6q"] [node name="World" type="Node2D" unique_id=1327991900] @@ -406,8 +407,9 @@ script = ExtResource("3_wse8f") anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = 605.0 -offset_bottom = 274.0 +offset_top = 586.0 +offset_right = -1097.0 +offset_bottom = 2.0 grow_horizontal = 2 grow_vertical = 2 bbcode_enabled = true @@ -434,12 +436,17 @@ texture_pressed = ExtResource("13_70uel") texture_disabled = ExtResource("13_70uel") script = ExtResource("14_70uel") -[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")] +[node name="Dialogue" parent="CanvasLayer" unique_id=1025022375 instance=ExtResource("19_26xuy")] unique_name_in_owner = true +offset_left = 228.0 +offset_top = 499.0 +offset_right = 231.0 +offset_bottom = 491.0 + +[node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")] position = Vector2(192, 177.23824) [node name="Pharaoh2" parent="." unique_id=1541178727 instance=ExtResource("15_hiqwa")] -unique_name_in_owner = true position = Vector2(6338, -58.09474) [node name="OldComputer" parent="." unique_id=1951254108 instance=ExtResource("19_cbp6q")] From 775338c4d26275ca29aea3f335300179e5b25d3d Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 18 Oct 2026 00:59:08 -0500 Subject: [PATCH 2/4] fix issue where Open Sarcophagus objective did not complete, among other things --- pharaoh.gd | 9 --------- world.tscn | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/pharaoh.gd b/pharaoh.gd index 7e3cb08..852b55b 100644 --- a/pharaoh.gd +++ b/pharaoh.gd @@ -12,15 +12,6 @@ func _on_interacted() -> void: var wanted_disk = %OldComputer.get_next_disk_num() - if not %Player2D.take_disk(wanted_disk): - if wanted_disk == 1 and not %Player2D.has_objective("disk%d" % wanted_disk): - %OldComputer.open() - %Player2D.give_objective( - "disk%d" % wanted_disk, - wanted_disk, "Locate data disk %d" % wanted_disk - ) - return - if %Player2D.complete_objective("sarc"): %OldComputer.open() %Player2D.give_objective( diff --git a/world.tscn b/world.tscn index fa21aa9..bfe4133 100644 --- a/world.tscn +++ b/world.tscn @@ -32,6 +32,7 @@ scale = Vector2(1, 1.0155824) unique_name_in_owner = true position = Vector2(-4844.9995, 356.44568) rotation = 0.0005533503 +safe_margin = 0.08 [node name="StartingArea" type="Node2D" parent="." unique_id=130240736] position = Vector2(-4673, 390.9087) @@ -465,12 +466,11 @@ script = ExtResource("14_70uel") [node name="Dialogue" parent="CanvasLayer" unique_id=1025022375 instance=ExtResource("19_26xuy")] unique_name_in_owner = true -position = Vector2(55, 111.266205) -rotation = 4.9367074e-05 offset_left = 228.0 offset_top = 499.0 offset_right = 231.0 offset_bottom = 491.0 +rotation = 4.9367074e-05 [node name="Pharaoh" parent="." unique_id=44054531 instance=ExtResource("15_hiqwa")] position = Vector2(192, 177.23824) From f50b7da9eb9bf5a8bc9d3ab4631ce6d1fce76c5d Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 18 Oct 2026 01:01:00 -0500 Subject: [PATCH 3/4] Fix "respawn point set" message triggering even if that sarco is already the respawn point. --- pharaoh.gd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pharaoh.gd b/pharaoh.gd index 852b55b..35e2a16 100644 --- a/pharaoh.gd +++ b/pharaoh.gd @@ -3,12 +3,12 @@ extends Interactable func _on_interacted() -> void: #%OldComputer.open() - if %Player2D.spawn_point != global_position: - %Player2D.spawn_point = global_position - %OldComputer.printline(">> Respawn point set.") - #Accomodate some collision antics. - %Player2D.spawn_point = global_position + Vector2(0,-10) + var new_spawn_point = global_position + Vector2(0,-10) + + if %Player2D.spawn_point != new_spawn_point: + %Player2D.spawn_point = new_spawn_point + %OldComputer.printline(">> Respawn point set to %s" % new_spawn_point) var wanted_disk = %OldComputer.get_next_disk_num() From a3d54fa9d3014d93ba3383ad73babed3e7c4b4c2 Mon Sep 17 00:00:00 2001 From: Gregory Marco Date: Sun, 18 Oct 2026 01:03:03 -0500 Subject: [PATCH 4/4] .. fix indentation --- pharaoh.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pharaoh.gd b/pharaoh.gd index 35e2a16..c3d369a 100644 --- a/pharaoh.gd +++ b/pharaoh.gd @@ -18,7 +18,7 @@ func _on_interacted() -> void: "disk%d" % wanted_disk, wanted_disk, "Locate data disk %d" % wanted_disk ) - return + return if not (%Player2D.take_disk(wanted_disk) and %OldComputer.load_disk(wanted_disk)): return