diff --git a/Babushka.sln.DotSettings.user b/Babushka.sln.DotSettings.user
index aa9f6ba..2de0701 100644
--- a/Babushka.sln.DotSettings.user
+++ b/Babushka.sln.DotSettings.user
@@ -1,6 +1,12 @@
ForceIncluded
ForceIncluded
+ ForceIncluded
+ ForceIncluded
+ ForceIncluded
ForceIncluded
ForceIncluded
- ForceIncluded
\ No newline at end of file
+ ForceIncluded
+ ForceIncluded
+ ForceIncluded
+ ForceIncluded
\ No newline at end of file
diff --git a/dialog/Scene1_farm_outside/yeli_intro_05.dtl b/dialog/Scene1_farm_outside/yeli_intro_05.dtl
index 9ed1bbd..2daadc0 100644
--- a/dialog/Scene1_farm_outside/yeli_intro_05.dtl
+++ b/dialog/Scene1_farm_outside/yeli_intro_05.dtl
@@ -1,6 +1,8 @@
+[quest_complete quest_resource="res://resources/quests/demo/7_talk_yeli_inside_1.tres"]
join Yeli center
-Yeli: Thank you for your help out there.
+Yeli: Thank you for your help out there.
Yeli: You must be tired. Please rest. I prepared a bed for you. It's in the room to the left.
Yeli: There is nothing interesting to see here.
leave Yeli
+[quest_activate quest_resource="res://resources/quests/demo/8_goto_bed.tres"]
[end_timeline]
diff --git a/dialog/quests/forest/quest5_forest_start.dtl b/dialog/quests/forest/quest5_forest_start.dtl
index cf402f6..5c78e6f 100644
--- a/dialog/quests/forest/quest5_forest_start.dtl
+++ b/dialog/quests/forest/quest5_forest_start.dtl
@@ -1,3 +1,4 @@
+[quest_complete quest_resource="res://resources/quests/demo/9_talk_to_chuga.tres"]
join vesna center
join Chuga center
Chuga: Look who it is!
@@ -19,4 +20,5 @@ Chuga: So, listen\: “I wear a crown, but I’m no king.” Vesna, what am I?
- Soup
Chuga: Hate the player, not the game.
Chuga: Here you go!
+[quest_activate quest_resource="res://resources/quests/demo/10_fight_the_monsters.tres"]
[end_timeline]
diff --git a/prefabs/UI/Inventory/Inventory.tscn b/prefabs/UI/Inventory/Inventory.tscn
index 2c32f88..780c512 100644
--- a/prefabs/UI/Inventory/Inventory.tscn
+++ b/prefabs/UI/Inventory/Inventory.tscn
@@ -1,7 +1,7 @@
[gd_scene load_steps=11 format=3 uid="uid://cgjc4wurbgimy"]
[ext_resource type="Script" uid="uid://hg7jay2kt441" path="res://scripts/CSharp/Common/Inventory/InventoryUi.cs" id="1_6wusm"]
-[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="1_l3npx"]
+[ext_resource type="Script" path="res://scripts/GdScript/dialogic_toggle.gd" id="1_l3npx"]
[ext_resource type="Texture2D" uid="uid://3ln8aleyxgp1" path="res://art/ui/UI/UI_bag_export_01.png" id="3_vvo7l"]
[ext_resource type="Texture2D" uid="uid://u0dku75l17re" path="res://art/ui/UI/UI_bag_export_highlight_01.png" id="5_df8i8"]
[ext_resource type="PackedScene" uid="uid://c0kmdjeqkqrwv" path="res://prefabs/UI/Inventory/Slot.tscn" id="5_u7kje"]
@@ -458,7 +458,6 @@ expand_mode = 1
[node name="QuestLogRoot" parent="." instance=ExtResource("7_vvo7l")]
[node name="Control" type="Control" parent="."]
-visible = false
layout_mode = 3
anchors_preset = 2
anchor_top = 1.0
diff --git a/prefabs/characters/Player2D.tscn b/prefabs/characters/Player2D.tscn
index 86da4af..4b40bba 100644
--- a/prefabs/characters/Player2D.tscn
+++ b/prefabs/characters/Player2D.tscn
@@ -473,7 +473,7 @@
[ext_resource type="Texture2D" uid="uid://x8hr8287ff2n" path="res://art/farm/farming/farmobjekte/tools atlas.png" id="816_1a3c1"]
[ext_resource type="Script" uid="uid://bcskt5ckh3rqa" path="res://scripts/CSharp/Common/Farming/FarmingControls2D.cs" id="817_6nrw3"]
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/tomato_field.tscn" id="818_16w6h"]
-[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="819_4na52"]
+[ext_resource type="Script" path="res://scripts/GdScript/dialogic_toggle.gd" id="819_4na52"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ssqtd"]
radius = 110.018
@@ -2071,7 +2071,7 @@ y_sort_enabled = true
script = ExtResource("1_yd5ep")
_farmingControls = NodePath("FarmingControls")
_player2d = NodePath("CharacterBody2D")
-_vesnaAnimations = NodePath("CharacterBody2D/visuals/Animated Sprites")
+_vesnaAnimations = NodePath("CharacterBody2D/visuals")
[node name="CharacterBody2D" type="CharacterBody2D" parent="." groups=["PlantGrowing"]]
position = Vector2(0, 374)
diff --git a/project.godot b/project.godot
index f145cf9..8c08406 100644
--- a/project.godot
+++ b/project.godot
@@ -110,6 +110,7 @@ translation/locales=["de", "en"]
text/autopauses={}
glossary/glossary_files=["res://dialog/farming_equipment_glossary.tres"]
directories/tres_directory={
+"10_fight_the_monsters": "res://resources/quests/demo/10_fight_the_monsters.tres",
"1_talk_yeli_1": "res://resources/quests/demo/1_talk_yeli_1.tres",
"2_collect_ducks": "res://resources/quests/demo/2_collect_ducks.tres",
"3_talk_yeli_2": "res://resources/quests/demo/3_talk_yeli_2.tres",
@@ -117,6 +118,8 @@ directories/tres_directory={
"5_talk_yeli_3": "res://resources/quests/demo/5_talk_yeli_3.tres",
"6_till_and_water": "res://resources/quests/demo/6_till_and_water.tres",
"7_talk_yeli_inside_1": "res://resources/quests/demo/7_talk_yeli_inside_1.tres",
+"8_goto_bed": "res://resources/quests/demo/8_goto_bed.tres",
+"9_talk_to_chuga": "res://resources/quests/demo/9_talk_to_chuga.tres",
"Babushka_NPC_Namebox_background": "res://dialog/Babushka_NPC_Namebox_background.tres",
"InputFieldsStyle": "res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres",
"MainTheme": "res://addons/dialogic/Editor/Theme/MainTheme.tres",
diff --git a/resources/quests/demo/10_fight_the_monsters.tres b/resources/quests/demo/10_fight_the_monsters.tres
new file mode 100644
index 0000000..f0a38a7
--- /dev/null
+++ b/resources/quests/demo/10_fight_the_monsters.tres
@@ -0,0 +1,10 @@
+[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://cv3wtnn0138ax"]
+
+[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_m0nkd"]
+
+[resource]
+script = ExtResource("1_m0nkd")
+id = "10_fight_the_monsters"
+title = "Fight the monsters"
+description = "A dangerous path leys before you. Be brave and slay the monsters, to reach the other side."
+metadata/_custom_type_script = "uid://vji5lp4qc8pp"
diff --git a/resources/quests/demo/8_goto_bed.tres b/resources/quests/demo/8_goto_bed.tres
new file mode 100644
index 0000000..f316787
--- /dev/null
+++ b/resources/quests/demo/8_goto_bed.tres
@@ -0,0 +1,10 @@
+[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://csj15gnlx1jmx"]
+
+[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_y6h00"]
+
+[resource]
+script = ExtResource("1_y6h00")
+id = "8_goto_bed"
+title = "Go to sleep"
+description = "Go into Vesnas room on the left of the house. Go to bed to unexaust you."
+metadata/_custom_type_script = "uid://vji5lp4qc8pp"
diff --git a/resources/quests/demo/9_talk_to_chuga.tres b/resources/quests/demo/9_talk_to_chuga.tres
new file mode 100644
index 0000000..193e3e8
--- /dev/null
+++ b/resources/quests/demo/9_talk_to_chuga.tres
@@ -0,0 +1,10 @@
+[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://c3mwhrvk12oml"]
+
+[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_hrrlk"]
+
+[resource]
+script = ExtResource("1_hrrlk")
+id = "9_talk_to_chuga"
+title = "Talk to Chuga"
+description = "A strange creature is standing infront of you. Go talk to him. I promise, he won't hurt you... for now."
+metadata/_custom_type_script = "uid://vji5lp4qc8pp"
diff --git a/scenes/Babushka_scene_farm_outside_2d.tscn b/scenes/Babushka_scene_farm_outside_2d.tscn
index 050d83d..b1c5d97 100644
--- a/scenes/Babushka_scene_farm_outside_2d.tscn
+++ b/scenes/Babushka_scene_farm_outside_2d.tscn
@@ -2332,9 +2332,6 @@ offset_top = 0.228533
offset_right = -456.339
offset_bottom = 30.2285
-[node name="Control" parent="CanvasLayer" index="3"]
-visible = true
-
[node name="Audio" type="Node" parent="."]
[node name="Background Music Ramp up" type="AudioStreamPlayer2D" parent="Audio"]
diff --git a/scenes/Babushka_scene_forest_fight_1_2d.tscn b/scenes/Babushka_scene_forest_fight_1_2d.tscn
index df7d2c8..3b1e17b 100644
--- a/scenes/Babushka_scene_forest_fight_1_2d.tscn
+++ b/scenes/Babushka_scene_forest_fight_1_2d.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=70 format=3 uid="uid://bb6r385qvyoba"]
+[gd_scene load_steps=72 format=3 uid="uid://bb6r385qvyoba"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_vl6d5"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="3_jrqoq"]
@@ -28,7 +28,7 @@
[ext_resource type="PackedScene" uid="uid://hk8ahyp6dgl6" path="res://prefabs/fight/fight_base_scene.tscn" id="27_55b52"]
[ext_resource type="PackedScene" uid="uid://bp64p6y72j71w" path="res://prefabs/fight/fighters/enemy_blob_fighter.tscn" id="27_hfhye"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="29_3jjxs"]
-[ext_resource type="PackedScene" path="res://prefabs/characters/Chugar.tscn" id="29_26tkn"]
+[ext_resource type="PackedScene" uid="uid://ddpl8cbck7e6s" path="res://prefabs/characters/Chugar.tscn" id="29_26tkn"]
[ext_resource type="PackedScene" uid="uid://cr66tpdr5rma5" path="res://prefabs/fight/fighters/enemy_mavkha_fighter.tscn" id="29_hfhye"]
[ext_resource type="Resource" uid="uid://dlcmqfjvgphqu" path="res://resources/items/rake.tres" id="30_l10vl"]
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/wateringcan.tres" id="31_c2gvt"]
@@ -48,7 +48,9 @@
[ext_resource type="Script" uid="uid://clxb3n668oud3" path="res://scripts/CSharp/Common/Audio/AudioDebugger.cs" id="52_x1mmf"]
[ext_resource type="AudioStream" uid="uid://vcftvrpi6c7k" path="res://audio/sfx/Farming/SFX_Harke_03_Solo.wav" id="54_4l7ky"]
[ext_resource type="AudioStream" uid="uid://bxh5m04vdo0sr" path="res://audio/sfx/Farming/SFX_Harke_04_Solo.wav" id="55_dk5xw"]
+[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="55_ub0r7"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer.cs" id="56_bjj0f"]
+[ext_resource type="Resource" uid="uid://c3mwhrvk12oml" path="res://resources/quests/demo/9_talk_to_chuga.tres" id="56_q833x"]
[ext_resource type="AudioStream" uid="uid://dapsknn486aee" path="res://audio/sfx/Farming/SFX_WateringPlants_01.wav" id="57_ehh6a"]
[ext_resource type="AudioStream" uid="uid://dnyne8wov50so" path="res://audio/sfx/Farming/SFX_WateringPlants_02.wav" id="58_mfld1"]
[ext_resource type="AudioStream" uid="uid://fsiypqhql67w" path="res://audio/sfx/Farming/SFX_GettingWater_01.wav" id="59_soiyx"]
@@ -2064,7 +2066,7 @@ region_rect = Rect2(1483.92, 1280.2, 1139.55, 367.598)
[node name="BorderCollisionBody" type="StaticBody2D" parent="YSorted/ForestVisuals"]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="YSorted/ForestVisuals/BorderCollisionBody"]
-polygon = PackedVector2Array(5543, 1787, 8663, 1938, 15008, 1914, 15121, 2882, 15601, 3074, 15636, 3574, 14122, 3569, 12930, 3737, 11502, 3599, 9887, 3658, 7936, 3924, 7712, 2967, 4629, 2917, 3880, 3351, 3891, 3646, 3919, 4843, 7970, 4459, 16532, 4289, 16365, 821, 1765, 1202, 1437, 4559, 3142, 4814, 3154, 4225, 2749, 3323, 2196, 2523, 2379, 1787)
+polygon = PackedVector2Array(5543, 1787, 8663, 1938, 15008, 1914, 15121, 2882, 15601, 3074, 15636, 3574, 14122, 3569, 12930, 3737, 11502, 3599, 9887, 3658, 7936, 3924, 7712, 2967, 4629, 2917, 3880, 3351, 3891, 3646, 3919, 4843, 7970, 4459, 16532, 4289, 16365, 821, 1765, 1202, 1437, 4559, 3849, 4849, 3860, 4193, 3304, 4193, 2749, 3323, 2196, 2523, 2379, 1787)
[node name="Blocker" type="Node2D" parent="YSorted"]
@@ -2178,6 +2180,14 @@ max_distance = 2e+07
playback_type = 2
script = ExtResource("56_bjj0f")
+[node name="SpecialQuestNodes" type="Node" parent="."]
+
+[node name="InstantStartQuest" type="Node" parent="SpecialQuestNodes"]
+script = ExtResource("55_ub0r7")
+questResource = ExtResource("56_q833x")
+toStatus = 1
+makeCurrent = true
+
[connection signal="body_entered" from="Fight1/FightStarter/TriggerArea" to="Fight1/FightStarter" method="Start"]
[connection signal="FightEnded" from="Fight1/FightBaseScene" to="YSorted/Vesna" method="show"]
[connection signal="FightEnded" from="Fight1/FightBaseScene" to="YSorted/Vesna" method="EnableMovement"]
@@ -2194,6 +2204,7 @@ script = ExtResource("56_bjj0f")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"]
[connection signal="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
+[connection signal="ready" from="SpecialQuestNodes/InstantStartQuest" to="SpecialQuestNodes/InstantStartQuest" method="Trigger"]
[editable path="Fight1/FightBaseScene"]
[editable path="Fight2/FightBaseScene"]
diff --git a/scenes/Babushka_scene_indoor_vesnas_room.tscn b/scenes/Babushka_scene_indoor_vesnas_room.tscn
index 685d0e5..d5097bf 100644
--- a/scenes/Babushka_scene_indoor_vesnas_room.tscn
+++ b/scenes/Babushka_scene_indoor_vesnas_room.tscn
@@ -1,8 +1,10 @@
-[gd_scene load_steps=11 format=3 uid="uid://ceaa2qj2bmw43"]
+[gd_scene load_steps=13 format=3 uid="uid://ceaa2qj2bmw43"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_c6eln"]
[ext_resource type="Texture2D" uid="uid://cugtxcfuds31r" path="res://art/indoor/Babushka_bg_01.png" id="2_j25a2"]
+[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="8_j25a2"]
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interactions/interaction_area_2d.tscn" id="8_phqdf"]
+[ext_resource type="Resource" uid="uid://csj15gnlx1jmx" path="res://resources/quests/demo/8_goto_bed.tres" id="9_heyef"]
[ext_resource type="Texture2D" uid="uid://cop1vjvhwlsec" path="res://art/indoor/room export/Room_01_shelf.png" id="13_11fdt"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="18_3gevq"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="23_408bg"]
@@ -100,6 +102,11 @@ _useOutline = false
_useSprite = false
_id = 1
+[node name="QuestCompleter" type="Node" parent="BedInteraction"]
+script = ExtResource("8_j25a2")
+questResource = ExtResource("9_heyef")
+toStatus = 2
+
[node name="DoorInteraction" parent="." instance=ExtResource("8_phqdf")]
position = Vector2(777, 201)
_useOutline = false
@@ -109,6 +116,7 @@ _id = 0
[node name="CollisionShape3D" parent="DoorInteraction/Area2D" index="0"]
shape = SubResource("CircleShape2D_2spkc")
+[connection signal="Interacted" from="BedInteraction" to="BedInteraction/QuestCompleter" method="Trigger"]
[connection signal="InteractedTool" from="BedInteraction" to="." method="LoadSceneAtIndex"]
[connection signal="Interacted" from="DoorInteraction" to="." method="LoadScene"]
diff --git a/scripts/CSharp/Common/Quest/QuestDescriptionUi.cs b/scripts/CSharp/Common/Quest/QuestDescriptionUi.cs
index 46cf256..7a36699 100644
--- a/scripts/CSharp/Common/Quest/QuestDescriptionUi.cs
+++ b/scripts/CSharp/Common/Quest/QuestDescriptionUi.cs
@@ -1,6 +1,6 @@
using Godot;
-using System;
-using Babushka.scripts.CSharp.Common.Util;
+
+namespace Babushka.scripts.CSharp.Common.Quest;
public partial class QuestDescriptionUi : RichTextLabel
{
@@ -8,4 +8,4 @@ public partial class QuestDescriptionUi : RichTextLabel
{
Text = questLog.currentDetailQuest?.description ?? "";
}
-}
+}
\ No newline at end of file
diff --git a/scripts/CSharp/Common/Quest/QuestListItemUi.cs b/scripts/CSharp/Common/Quest/QuestListItemUi.cs
index 3ac9aef..d6832b5 100644
--- a/scripts/CSharp/Common/Quest/QuestListItemUi.cs
+++ b/scripts/CSharp/Common/Quest/QuestListItemUi.cs
@@ -26,9 +26,8 @@ public partial class QuestListItemUi : Control
UpdateCircled(questResource == QuestManager.Instance.GetFollowQuest());
ShowName(name);
- TitleButton.Pressed += ClickedTitleButton;
-
}
+
private void UpdateCircled(bool value)
{
CircleTexture.Visible = value;
diff --git a/scripts/CSharp/Common/Quest/QuestLog.cs b/scripts/CSharp/Common/Quest/QuestLog.cs
index 8893dd8..d0f6542 100644
--- a/scripts/CSharp/Common/Quest/QuestLog.cs
+++ b/scripts/CSharp/Common/Quest/QuestLog.cs
@@ -1,18 +1,16 @@
#nullable enable
using Godot;
-using System;
-using Babushka.scripts.CSharp.Common.Quest;
+
+namespace Babushka.scripts.CSharp.Common.Quest;
public partial class QuestLog : Control
{
[Signal]
public delegate void DetailQuestChangedEventHandler(QuestLog questLog);
- [Export]
- private Vector2 _closedPos;
-
- [Export]
- private Vector2 _openedPos;
+ [Export] private Vector2 _closedPos;
+
+ [Export] private Vector2 _openedPos;
private bool _isClosed = true;
private Tween? _closeOpenTween;
@@ -29,16 +27,26 @@ public partial class QuestLog : Control
public override void _EnterTree()
{
- QuestManager.Instance!.QuestsChanged += () => EmitSignalDetailQuestChanged(this);
+ QuestManager.Instance!.QuestsChanged += OnQuestsChanged;
+ }
+
+ public override void _ExitTree()
+ {
+ QuestManager.Instance!.QuestsChanged -= OnQuestsChanged;
+ }
+
+ private void OnQuestsChanged()
+ {
+ EmitSignalDetailQuestChanged(this);
}
public override void _Input(InputEvent inputEvent)
{
if (inputEvent.IsActionPressed("ui_inventory_journal_open_close"))
{
- if(_closeOpenTween != null)
+ if (_closeOpenTween != null)
_closeOpenTween.Kill();
-
+
_isClosed = !_isClosed;
_closeOpenTween = GetTree().CreateTween();
@@ -48,6 +56,4 @@ public partial class QuestLog : Control
.SetTrans(Tween.TransitionType.Cubic);
}
}
-
- //private QuestResource? _currentDetailQuestBacking;
-}
+}
\ No newline at end of file
diff --git a/scripts/CSharp/Common/Quest/QuestMessagePopup.cs b/scripts/CSharp/Common/Quest/QuestMessagePopup.cs
index 4f0e76a..896d749 100644
--- a/scripts/CSharp/Common/Quest/QuestMessagePopup.cs
+++ b/scripts/CSharp/Common/Quest/QuestMessagePopup.cs
@@ -20,6 +20,7 @@ public partial class QuestMessagePopup : Control
public override void _EnterTree()
{
QuestManager.Instance!.QuestsChanged += NewActiveQuest;
+ NewActiveQuest();
}
public override void _ExitTree()