Compare commits

...

3 Commits

Author SHA1 Message Date
Jonathan c3fbfe9df1 Added more quest stuff including dialogic quest condition 2025-08-06 17:20:11 +02:00
cblech b6373e6a2b Added first quests 2025-07-23 20:48:56 +02:00
cblech 6050f3c297 Dialogic quest addition and plugin fix 2025-07-23 20:46:33 +02:00
54 changed files with 852 additions and 61 deletions
+2
View File
@@ -95,6 +95,8 @@ func _make_visible(visible:bool) -> void:
func _save_external_data() -> void: func _save_external_data() -> void:
if _editor_view_and_manager_exist(): if _editor_view_and_manager_exist():
editor_view.editors_manager.save_current_resource() editor_view.editors_manager.save_current_resource()
DialogicResourceUtil.update_directory('.tres')
func _get_unsaved_status(for_scene:String) -> String: func _get_unsaved_status(for_scene:String) -> String:
@@ -0,0 +1,55 @@
@tool
extends DialogicEvent
class_name DialogicQuestActivateEvent
# Define properties of the event here
var quest_resource: String
func _execute() -> void:
var resource = ResourceLoader.load(quest_resource)
QuestManager.ChangeQuestStatus(resource,QuestEventUtils.QuestStatus.AVAILABLE)
QuestManager.SetFollowQuest(resource)
finish() # called to continue with the next event
#region INITIALIZE
################################################################################
# Set fixed settings of this event
func _init() -> void:
event_name = "Activate Quest"
event_category = "Quest"
#endregion
#region SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "quest_activate"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"quest_resource" : {"property": "quest_resource", "default": ""},
}
# You can alternatively overwrite these 3 functions: to_text(), from_text(), is_valid_event()
#endregion
#region EDITOR REPRESENTATION
################################################################################
func build_event_editor() -> void:
add_header_label("Activate Quest")
add_header_edit(
"quest_resource",
ValueType.DYNAMIC_OPTIONS,
{
"mode":2,
"suggestions_func":QuestEventUtils.quest_resource_suggestrions
})
#endregion
@@ -0,0 +1 @@
uid://br3a7napsjmg3
@@ -0,0 +1,55 @@
@tool
extends DialogicEvent
class_name DialogicQuestCompleteEvent
# Define properties of the event here
var quest_resource: String
func _execute() -> void:
var resource = ResourceLoader.load(quest_resource)
QuestManager.ChangeQuestStatus(resource,QuestEventUtils.QuestStatus.DONE)
QuestManager.SetFollowQuest(null)
finish() # called to continue with the next event
#region INITIALIZE
################################################################################
# Set fixed settings of this event
func _init() -> void:
event_name = "Complete Quest"
event_category = "Quest"
#endregion
#region SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "quest_complete"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"quest_resource" : {"property": "quest_resource", "default": ""},
}
# You can alternatively overwrite these 3 functions: to_text(), from_text(), is_valid_event()
#endregion
#region EDITOR REPRESENTATION
################################################################################
func build_event_editor() -> void:
add_header_label("Complete Quest")
add_header_edit(
"quest_resource",
ValueType.DYNAMIC_OPTIONS,
{
"mode":2,
"suggestions_func":QuestEventUtils.quest_resource_suggestrions
})
#endregion
@@ -0,0 +1 @@
uid://c8mtjwpe7c0h
@@ -0,0 +1,163 @@
@tool
extends DialogicEvent
class_name DialogicQuestConditionEvent
## Event that allows branching a timeline based on a condition.
#enum ConditionTypes {IF, ELIF, ELSE}
### Settings
## condition type (see [ConditionTypes]). Defaults to if.
#var condition_type := ConditionTypes.IF
## The condition as a string. Will be executed as an Expression.
#var condition := ""
var quest_resource: String
var compare_status: QuestEventUtils.QuestStatusOrActive
################################################################################
## EXECUTE
################################################################################
func _execute() -> void:
var resource = ResourceLoader.load(quest_resource)
var result: bool
if compare_status == QuestEventUtils.QuestStatusOrActive.ACTIVE:
result = QuestManager.GetFollowQuest() == resource
elif compare_status == QuestEventUtils.QuestStatusOrActive.NOT_ACTIVE:
result = QuestManager.GetFollowQuest() != resource
else:
result = QuestManager.GetQuestStatus(resource).status == compare_status
if not result:
var idx: int = dialogic.current_event_idx
var ignore := 1
while true:
idx += 1
if not dialogic.current_timeline.get_event(idx) or ignore == 0:
break
elif dialogic.current_timeline.get_event(idx).can_contain_events:
ignore += 1
elif dialogic.current_timeline.get_event(idx) is DialogicEndBranchEvent:
ignore -= 1
dialogic.current_event_idx = idx-1
finish()
## only called if the previous event was an end-branch event
## return true if this event should be executed if the previous event was an end-branch event
func should_execute_this_branch() -> bool:
return true
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "Quest Condition"
set_default_color('Color3')
event_category = "Quest"
event_sorting_index = 1
can_contain_events = true
# return a control node that should show on the END BRANCH node
func get_end_branch_control() -> Control:
return load(get_script().resource_path.get_base_dir().path_join('ui_quest_condition_end.tscn')).instantiate()
################################################################################
## SAVING/LOADING
################################################################################
func to_text() -> String:
return 'ifquest ' + quest_resource + ', ' + str(compare_status) + ':'
func from_text(string:String) -> void:
#if string.strip_edges().begins_with('if'):
# condition = string.strip_edges().trim_prefix('if ').trim_suffix(':').strip_edges()
# condition_type = ConditionTypes.IF
var strings:Array[String]
strings.assign(string.strip_edges().trim_prefix('ifquest ').trim_suffix(':').strip_edges().split(','))
quest_resource = strings[0].strip_edges()
var compare_string: String = strings[1].strip_edges()
if compare_string.is_valid_int():
compare_status = compare_string.to_int()
else:
compare_status = QuestEventUtils.QuestStatusOrActive.get(compare_string)
func is_valid_event(string:String) -> bool:
if string.strip_edges().begins_with('ifquest '):
return true
return false
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor() -> void:
add_header_label("IF")
add_header_edit(
"quest_resource",
ValueType.DYNAMIC_OPTIONS,
{
"mode":2,
"suggestions_func":QuestEventUtils.quest_resource_suggestrions
})
add_header_label("IS")
add_header_edit("compare_status",ValueType.FIXED_OPTIONS,{
'options': [
{
'label': 'HIDDEN',
'value': QuestEventUtils.QuestStatusOrActive.HIDDEN,
},
{
'label': 'AVAILABLE',
'value': QuestEventUtils.QuestStatusOrActive.AVAILABLE,
},
{
'label': 'DONE',
'value': QuestEventUtils.QuestStatusOrActive.DONE,
},
{
'label': 'CANCLED',
'value': QuestEventUtils.QuestStatusOrActive.CANCLED,
},
{
'label': 'ACTIVE',
'value': QuestEventUtils.QuestStatusOrActive.ACTIVE,
},
{
'label': 'NOT_ACTIVE',
'value': QuestEventUtils.QuestStatusOrActive.NOT_ACTIVE,
}
]})
func _get_icon() -> Resource:
return load("res://addons/dialogic/Modules/Condition/icon.svg")
####################### CODE COMPLETION ########################################
################################################################################
func _get_code_completion(CodeCompletionHelper:Node, TextNode:TextEdit, line:String, _word:String, symbol:String) -> void:
pass
func _get_start_code_completion(_CodeCompletionHelper:Node, TextNode:TextEdit) -> void:
TextNode.add_code_completion_option(CodeEdit.KIND_PLAIN_TEXT, 'ifquest', 'ifquest ', TextNode.syntax_highlighter.code_flow_color)
#################### SYNTAX HIGHLIGHTING #######################################
################################################################################
func _get_syntax_highlighting(Highlighter:SyntaxHighlighter, dict:Dictionary, line:String) -> Dictionary:
var word := line.get_slice(' ', 0)
dict[line.find(word)] = {"color":Highlighter.code_flow_color}
dict[line.find(word)+len(word)] = {"color":Highlighter.normal_color}
dict = Highlighter.color_condition(dict, line)
return dict
@@ -0,0 +1 @@
uid://b2ggc2f5kh61j
@@ -0,0 +1,43 @@
@tool
class_name QuestEventUtils
enum QuestStatus{
HIDDEN = 0,
AVAILABLE = 1,
DONE = 2,
CANCLED = 3
}
enum QuestStatusOrActive{
HIDDEN = 0,
AVAILABLE = 1,
DONE = 2,
CANCLED = 3,
ACTIVE = 4,
NOT_ACTIVE = 5
}
static func quest_resource_suggestrions(search_text:String) -> Dictionary:
var ret_val = {}
var quest_paths = get_all_file_paths("res://resources/quests")
for path in quest_paths:
var res = ResourceLoader.load(path)
ret_val[res.id]= {"value":path, "tooltip":res.title + "\n\n" + res.description}
return ret_val
static func get_all_file_paths(path: String) -> Array[String]:
var file_paths: Array[String] = []
var dir = DirAccess.open(path)
dir.list_dir_begin()
var file_name = dir.get_next()
while file_name != "":
var file_path = path + "/" + file_name
if dir.current_is_dir():
file_paths += get_all_file_paths(file_path)
else:
file_paths.append(file_path)
file_name = dir.get_next()
return file_paths
@@ -0,0 +1 @@
uid://d1x2343wpkdku
+9
View File
@@ -0,0 +1,9 @@
@tool
extends DialogicIndexer
func _get_events() -> Array:
return [
this_folder.path_join('event_quest_activate.gd'),
this_folder.path_join('event_quest_complete.gd'),
this_folder.path_join('event_quest_condition.gd')
]
@@ -0,0 +1 @@
uid://wup1fvm05rqv
@@ -0,0 +1,51 @@
@tool
extends HBoxContainer
var parent_resource: DialogicEvent = null
func _ready() -> void:
$AddElif.button_up.connect(add_elif)
$AddElse.button_up.connect(add_else)
func refresh() -> void:
if parent_resource is DialogicQuestConditionEvent:
# hide add elif and add else button on ELSE event
$AddElif.visible = false# parent_resource.condition_type != DialogicConditionEvent.ConditionTypes.ELSE
$AddElse.visible = true# parent_resource.condition_type != DialogicConditionEvent.ConditionTypes.ELSE
$Label.text = "End of If Quest" #"End of "+["IF", "ELIF", "ELSE"][parent_resource.condition_type]+" ("+parent_resource.condition+")"
# hide add add else button if followed by ELIF or ELSE event
var timeline_editor := find_parent('VisualEditor')
if timeline_editor:
var next_event: DialogicEvent = null
if timeline_editor.get_block_below(get_parent()):
next_event = timeline_editor.get_block_below(get_parent()).resource
if next_event is DialogicConditionEvent:
if next_event.condition_type != DialogicConditionEvent.ConditionTypes.IF:
$AddElse.hide()
#if parent_resource.condition_type == DialogicConditionEvent.ConditionTypes.ELSE:
# $Label.text = "End of ELSE"
else:
hide()
func add_elif() -> void:
var timeline := find_parent('VisualEditor')
if timeline:
var resource := DialogicConditionEvent.new()
resource.condition_type = DialogicConditionEvent.ConditionTypes.ELIF
timeline.add_event_undoable(resource, get_parent().get_index()+1)
timeline.indent_events()
timeline.something_changed()
func add_else() -> void:
var timeline := find_parent('VisualEditor')
if timeline:
var resource := DialogicConditionEvent.new()
resource.condition_type = DialogicConditionEvent.ConditionTypes.ELSE
timeline.add_event_undoable(resource, get_parent().get_index()+1)
timeline.indent_events()
timeline.something_changed()
@@ -0,0 +1 @@
uid://dlrnhnnonum4o
@@ -0,0 +1,20 @@
[gd_scene load_steps=2 format=3 uid="uid://dnrpcgjkyoiau"]
[ext_resource type="Script" uid="uid://dlrnhnnonum4o" path="res://addons/dialogic_additions/Quest/ui_condition_end.gd" id="1_f3miq"]
[node name="Condition_End" type="HBoxContainer"]
offset_right = 90.0
offset_bottom = 23.0
script = ExtResource("1_f3miq")
[node name="Label" type="Label" parent="."]
layout_mode = 2
text = "End of condition X"
[node name="AddElif" type="Button" parent="."]
layout_mode = 2
text = "Add Elif"
[node name="AddElse" type="Button" parent="."]
layout_mode = 2
text = "Add Else"
+2
View File
@@ -1,3 +1,5 @@
join vesna center join vesna center
[quest_complete quest_resource="res://resources/quests/demo/2_collect_ducks.tres"]
Thats the last one. I should get back to Yeli. Thats the last one. I should get back to Yeli.
[quest_activate quest_resource="res://resources/quests/demo/3_talk_yeli_2.tres"]
[end_timeline] [end_timeline]
+2
View File
@@ -1,8 +1,10 @@
join Yeli right join Yeli right
join vesna left join vesna left
[quest_complete quest_resource="res://resources/quests/demo/1_talk_yeli_1.tres"]
Yeli (_part_side): Come here, you little quacking beast! Yeli (_part_side): Come here, you little quacking beast!
- What a mess! - What a mess!
- You havent called me that way yet. - You havent called me that way yet.
Yeli (_part_side): Vesna, oh, thank goodness! Yeli (_part_side): Vesna, oh, thank goodness!
Yeli (_part_side): Please could you get the runner ducks back into their coop? Yeli (_part_side): Please could you get the runner ducks back into their coop?
[quest_activate quest_resource="res://resources/quests/demo/2_collect_ducks.tres"]
[end_timeline] [end_timeline]
+2
View File
@@ -1,5 +1,6 @@
join Yeli center join Yeli center
join Vesna2 center join Vesna2 center
[quest_complete quest_resource="res://resources/quests/demo/5_talk_yeli_3.tres"]
Yeli (_part_side): Great! Now I need you to plant some tomatoes! Yeli (_part_side): Great! Now I need you to plant some tomatoes!
label plant tomatoes label plant tomatoes
Yeli (_part_side): Use the hoe to break up the soil. Then plant the seeds and water the fields. Yeli (_part_side): Use the hoe to break up the soil. Then plant the seeds and water the fields.
@@ -7,4 +8,5 @@ Yeli (_part_side): Got it?
- Of course! - Of course!
- Wait … How do I plant the tomatoes again? - Wait … How do I plant the tomatoes again?
jump plant tomatoes jump plant tomatoes
[quest_activate quest_resource="res://resources/quests/demo/6_till_and_water.tres"]
[end_timeline] [end_timeline]
+3 -1
View File
@@ -1,10 +1,12 @@
join Yeli center join Yeli center
join Vesna2 center join Vesna2 center
[quest_complete quest_resource="res://resources/quests/demo/3_talk_yeli_2.tres"]
Yeli (_part_side): Thank you, my child! Your Yeli is not so agile anymore. Yeli (_part_side): Thank you, my child! Your Yeli is not so agile anymore.
Vesna2: But youre diligent! Youve started with the preparation for dinner. Vesna2: But youre diligent! Youve started with the preparation for dinner.
Yeli (_part_side): Indeed, I have. Yeli (_part_side): Indeed, I have.
Yeli (_part_side): But, oh my, those ducks messed up the tomatos. Yeli (_part_side): But, oh my, those ducks messed up the tomatos.
Yeli (_part_side): Oh, would you like to assist me? Yeli (_part_side): Oh, would you like to assist me?
Vesna2: What do I have to do? Vesna2: What do I have to do?
Yeli (_part_side): First, take the hoe and watering can over there! Then come back to me! Yeli (_part_side): First, take the hoe and watering can over there! Then come back to me!
[quest_activate quest_resource="res://resources/quests/demo/4_collect_tools.tres"]
[end_timeline] [end_timeline]
+15
View File
@@ -0,0 +1,15 @@
Quest\: {ACTIVEQUEST}
ifquest res://resources/quests/test/test_01.tres, 4:
Test 1 active
else:
Test 1 is not active
ifquest res://resources/quests/test/test_01.tres, 1:
But its available
else:
And not available
ifquest res://resources/quests/test/test_02.tres, 4:
Test 2 active
ifquest res://resources/quests/test/test_02.tres, 1:
And Available
else:
Else 2
+1
View File
@@ -0,0 +1 @@
uid://xfkdvitmhgln
+8
View File
@@ -0,0 +1,8 @@
if {ACTIVEQUEST} == "1_talk_yeli_1":
jump quest1_ducks_start/
elif {ACTIVEQUEST} == "3_talk_yeli_2":
jump quest2_tomatoes_start/
elif {ACTIVEQUEST} == "5_talk_yeli_3":
jump quest2_tomatoes_interim/
else:
No Dialog for active quest "{ACTIVEQUEST}"
+1
View File
@@ -0,0 +1 @@
uid://do3c5uofv5m7b
@@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://bworek1jcmq0e"]
[ext_resource type="Script" uid="uid://dl2uhq12p3qks" path="res://scripts/CSharp/Common/Quest/QuestManager.cs" id="1_anowe"]
[ext_resource type="Script" path="res://scripts/GdScript/dialogic_var_setter.gd" id="4_v86gc"]
[node name="QuestManager" type="Node"]
script = ExtResource("1_anowe")
[node name="DialogicRelay" type="Node" parent="."]
script = ExtResource("4_v86gc")
[connection signal="DialogicActiveQuest" from="." to="DialogicRelay" method="_SetActiveQuestVar"]
+58 -3
View File
@@ -27,9 +27,9 @@ buses/default_bus_layout="uid://b6dwkmkyb0axk"
SceneTransition="*res://scenes/SceneTransition.tscn" SceneTransition="*res://scenes/SceneTransition.tscn"
Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd" Dialogic="*res://addons/dialogic/Core/DialogicGameHandler.gd"
InventoryManager="*res://scripts/CSharp/Common/Inventory/InventoryManager.cs" InventoryManager="*res://scripts/CSharp/Common/Inventory/InventoryManager.cs"
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"
QuestManager="*res://scripts/CSharp/Common/Quest/QuestManager.cs"
FightManagerAutoload="*res://prefabs/fight/fight_manager_autoload.tscn" FightManagerAutoload="*res://prefabs/fight/fight_manager_autoload.tscn"
QuestManager="*res://prefabs/quests/quest_manager_autoload.tscn"
Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd"
[dialogic] [dialogic]
@@ -58,14 +58,17 @@ directories/dtl_directory={
"quest5_forest_start": "res://dialog/quest5_forest_start.dtl", "quest5_forest_start": "res://dialog/quest5_forest_start.dtl",
"semi_cat": "res://dialog/semi_cat.dtl", "semi_cat": "res://dialog/semi_cat.dtl",
"talk_to_plant": "res://dialog/talk_to_plant.dtl", "talk_to_plant": "res://dialog/talk_to_plant.dtl",
"test_1": "res://dialog/testing/test_1.dtl",
"test_time_line": "res://dialog/test_time_line.dtl", "test_time_line": "res://dialog/test_time_line.dtl",
"yeli_intro_01": "res://dialog/yeli_intro_01.dtl", "yeli_intro_01": "res://dialog/yeli_intro_01.dtl",
"yeli_intro_02": "res://dialog/yeli_intro_02.dtl", "yeli_intro_02": "res://dialog/yeli_intro_02.dtl",
"yeli_intro_03": "res://dialog/yeli_intro_03.dtl", "yeli_intro_03": "res://dialog/yeli_intro_03.dtl",
"yeli_intro_04": "res://dialog/yeli_intro_04.dtl", "yeli_intro_04": "res://dialog/yeli_intro_04.dtl",
"yeli_intro_05": "res://dialog/yeli_intro_05.dtl" "yeli_intro_05": "res://dialog/yeli_intro_05.dtl",
"yeli_quest_select": "res://dialog/yeli_quest_select.dtl"
} }
variables={ variables={
"ACTIVEQUEST": "none",
"MAGICWORD": "Hokus Pokus!s", "MAGICWORD": "Hokus Pokus!s",
"PLAYERMOOD": "Good", "PLAYERMOOD": "Good",
"SHOW": "IGF" "SHOW": "IGF"
@@ -105,6 +108,58 @@ translation/id_counter=22
translation/locales=["de", "en"] translation/locales=["de", "en"]
text/autopauses={} text/autopauses={}
glossary/glossary_files=["res://dialog/farming_equipment_glossary.tres"] glossary/glossary_files=["res://dialog/farming_equipment_glossary.tres"]
directories/tres_directory={
"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",
"4_collect_tools": "res://resources/quests/demo/4_collect_tools.tres",
"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",
"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",
"NPC_narrative": "res://dialog/NPC_narrative.tres",
"New_File": "res://addons/dialogic/New_File.tres",
"PickerTheme": "res://addons/dialogic/Editor/Theme/PickerTheme.tres",
"ResourceMenuHover": "res://addons/dialogic/Editor/Events/styles/ResourceMenuHover.tres",
"ResourceMenuNormal": "res://addons/dialogic/Editor/Events/styles/ResourceMenuNormal.tres",
"ResourceMenuPanelBackground": "res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres",
"SectionPanel": "res://addons/dialogic/Editor/Events/styles/SectionPanel.tres",
"SimpleButtonHover": "res://addons/dialogic/Editor/Events/styles/SimpleButtonHover.tres",
"SimpleButtonNormal": "res://addons/dialogic/Editor/Events/styles/SimpleButtonNormal.tres",
"TextBackground": "res://addons/dialogic/Editor/Events/styles/TextBackground.tres",
"TitleBgStylebox": "res://addons/dialogic/Editor/Common/TitleBgStylebox.tres",
"beet": "res://resources/items/beet.tres",
"beetRoot": "res://resources/quests/beetRoot.tres",
"choice_panel_focus": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_focus.tres",
"choice_panel_hover": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_hover.tres",
"choice_panel_normal": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Choices/choice_panel_normal.tres",
"default_bus_layout": "res://audio/default_bus_layout.tres",
"default_stylebox": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_SpeakerPortraitTextbox/default_stylebox.tres",
"default_vn_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_VN_Default/default_vn_style.tres",
"farming_equipment_glossary": "res://dialog/farming_equipment_glossary.tres",
"hoe": "res://resources/items/hoe.tres",
"preview_character": "res://addons/dialogic/Modules/Character/preview_character.tres",
"rake": "res://resources/items/rake.tres",
"scythe": "res://resources/items/scythe.tres",
"selected_styleboxflat": "res://addons/dialogic/Editor/Events/styles/selected_styleboxflat.tres",
"shovel": "res://resources/items/shovel.tres",
"simple_fade": "res://addons/dialogic/Modules/Background/Transitions/Defaults/simple_fade.tres",
"simple_swipe_gradient": "res://addons/dialogic/Modules/Background/Transitions/simple_swipe_gradient.tres",
"speaker_textbox_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_SpeakerTextbox/speaker_textbox_style.tres",
"speechbubble": "res://dialog/speechbubble.tres",
"test": "res://resources/items/test.tres",
"test/test_01": "res://resources/quests/test/test_01.tres",
"test/test_02": "res://resources/quests/test/test_02.tres",
"test/test_03": "res://resources/quests/test/test_03.tres",
"textbubble_style": "res://addons/dialogic/Modules/DefaultLayoutParts/Style_TextBubbles/textbubble_style.tres",
"tomato": "res://resources/items/tomato.tres",
"tomato_seed": "res://resources/items/tomato_seed.tres",
"unselected_stylebox": "res://addons/dialogic/Editor/Events/styles/unselected_stylebox.tres",
"vn_textbox_default_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_default_panel.tres",
"vn_textbox_name_label_panel": "res://addons/dialogic/Modules/DefaultLayoutParts/Layer_VN_Textbox/vn_textbox_name_label_panel.tres",
"wateringcan": "res://resources/items/wateringcan.tres"
}
[display] [display]
+10
View File
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://cm8kftow8br00"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_xjwrv"]
[resource]
script = ExtResource("1_xjwrv")
id = "1_talk_yeli_1"
title = "Talk to Yeli"
description = ""
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://cy0na3ukvpoou"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_wactd"]
[resource]
script = ExtResource("1_wactd")
id = "2_collect_ducks"
title = "Collect the Ducks"
description = "Collect all 6 ducks running around the farm by aporaching them and pressing [E]"
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
+10
View File
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://mf0rdejw8fuk"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_70pjl"]
[resource]
script = ExtResource("1_70pjl")
id = "3_talk_yeli_2"
title = "Talk to Yeli again"
description = "All ducks are collected. Head back to yeli."
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://d2swjixbnqkbw"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_e51xd"]
[resource]
script = ExtResource("1_e51xd")
id = "4_collect_tools"
title = "Collect the farm tools"
description = "Collect the Watering Can next to the well and the Hoe by the fence."
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
+10
View File
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://5t8g0firdif0"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_x7fvu"]
[resource]
script = ExtResource("1_x7fvu")
id = "5_talk_yeli_3"
title = "Talk to Yeli again"
description = "After the long and agonizing task of finding and collecting two tools, go talk to Yeli once again."
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
@@ -0,0 +1,10 @@
[gd_resource type="Resource" script_class="QuestResource" load_steps=2 format=3 uid="uid://h05jgxqtq37m"]
[ext_resource type="Script" uid="uid://vji5lp4qc8pp" path="res://scripts/CSharp/Common/Quest/QuestResource.cs" id="1_745w5"]
[resource]
script = ExtResource("1_745w5")
id = "6_till_and_water"
title = "Till and water the fields"
description = "Use the hoe to break up the soil. Then plant the seeds and water the fields."
metadata/_custom_type_script = "uid://vji5lp4qc8pp"
+41 -2
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=105 format=3 uid="uid://gigb28qk8t12"] [gd_scene load_steps=113 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"] [ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/characters/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"] [ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@@ -65,6 +65,12 @@
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="52_lwk6t"] [ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="52_lwk6t"]
[ext_resource type="PackedScene" uid="uid://sbf12hin4kes" path="res://prefabs/Interactables/trash_object.tscn" id="53_ycj14"] [ext_resource type="PackedScene" uid="uid://sbf12hin4kes" path="res://prefabs/Interactables/trash_object.tscn" id="53_ycj14"]
[ext_resource type="PackedScene" uid="uid://muuxxgvx33fp" path="res://prefabs/farm/duck.tscn" id="62_i36hd"] [ext_resource type="PackedScene" uid="uid://muuxxgvx33fp" path="res://prefabs/farm/duck.tscn" id="62_i36hd"]
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="66_2065p"]
[ext_resource type="Resource" uid="uid://cm8kftow8br00" path="res://resources/quests/demo/1_talk_yeli_1.tres" id="67_tm0yg"]
[ext_resource type="Script" uid="uid://c741nyedy26mx" path="res://scripts/CSharp/Common/QuestBehaviour/DetectInventoryContains.cs" id="68_hux6i"]
[ext_resource type="Resource" uid="uid://d2swjixbnqkbw" path="res://resources/quests/demo/4_collect_tools.tres" id="68_lbnqo"]
[ext_resource type="Script" uid="uid://be54lnb6gg81f" path="res://scripts/CSharp/Common/Inventory/ItemInstance.cs" id="69_4rgbr"]
[ext_resource type="Resource" uid="uid://5t8g0firdif0" path="res://resources/quests/demo/5_talk_yeli_3.tres" id="69_l4wxt"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_wtdui"]
shader = ExtResource("13_7p0hq") shader = ExtResource("13_7p0hq")
@@ -258,6 +264,18 @@ stream_0/stream = ExtResource("39_di1ed")
stream_1/stream = ExtResource("40_ceriq") stream_1/stream = ExtResource("40_ceriq")
stream_2/stream = ExtResource("49_d77e7") stream_2/stream = ExtResource("49_d77e7")
[sub_resource type="Resource" id="Resource_y820s"]
script = ExtResource("69_4rgbr")
blueprint = ExtResource("28_ipqaa")
amount = 1
metadata/_custom_type_script = "uid://be54lnb6gg81f"
[sub_resource type="Resource" id="Resource_50loj"]
script = ExtResource("69_4rgbr")
blueprint = ExtResource("28_6b2nr")
amount = 1
metadata/_custom_type_script = "uid://be54lnb6gg81f"
[node name="BabushkaSceneFarmOutside2d" type="Node2D"] [node name="BabushkaSceneFarmOutside2d" type="Node2D"]
script = ExtResource("34_e5b7x") script = ExtResource("34_e5b7x")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_common_room.tscn") _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_indoor_common_room.tscn")
@@ -1019,7 +1037,8 @@ y_sort_enabled = true
[node name="Yeli" parent="YSorted" instance=ExtResource("24_wtdui")] [node name="Yeli" parent="YSorted" instance=ExtResource("24_wtdui")]
position = Vector2(6403, 3362) position = Vector2(6403, 3362)
_timelinesToPlay = PackedStringArray("quest1_ducks_start", "quest2_tomatoes_start", "quest2_tomatoes_interim", "quest2_tomatoes_end") _timelinesToPlay = PackedStringArray("yeli_quest_select")
_retriggerSameTimeline = true
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")] [node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")]
z_index = 1 z_index = 1
@@ -2253,6 +2272,9 @@ offset_top = 0.228533
offset_right = -456.339 offset_right = -456.339
offset_bottom = 30.2285 offset_bottom = 30.2285
[node name="Control" parent="CanvasLayer" index="3"]
visible = true
[node name="Audio" type="Node" parent="."] [node name="Audio" type="Node" parent="."]
[node name="Background Music Ramp up" type="AudioStreamPlayer2D" parent="Audio"] [node name="Background Music Ramp up" type="AudioStreamPlayer2D" parent="Audio"]
@@ -2294,6 +2316,22 @@ max_distance = 2e+07
playback_type = 2 playback_type = 2
script = ExtResource("40_w3jkj") script = ExtResource("40_w3jkj")
[node name="SpeicialQuestTrigger" type="Node" parent="."]
[node name="QuestInstantStart" type="Node" parent="SpeicialQuestTrigger"]
[node name="QuestTrigger" type="Node" parent="SpeicialQuestTrigger/QuestInstantStart"]
script = ExtResource("66_2065p")
questResource = ExtResource("67_tm0yg")
toStatus = 1
makeCurrent = true
[node name="ToolsCollectedTrigger" type="Node" parent="SpeicialQuestTrigger"]
script = ExtResource("68_hux6i")
_itemsToContain = Array[Resource]([SubResource("Resource_y820s"), SubResource("Resource_50loj")])
_onActiveQuest = ExtResource("68_lbnqo")
_toNextQuest = ExtResource("69_l4wxt")
[connection signal="FilledWateringCan" from="YSorted/Vesna" to="Audio/SFX/FillWater SFX2" method="PlayOneShot"] [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="WateringField" from="YSorted/Vesna/FarmingControls" to="Audio/SFX/Watering SFX" method="PlayOneShot"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"] [connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
@@ -2311,6 +2349,7 @@ script = ExtResource("40_w3jkj")
[connection signal="DuckCollected" from="YSorted/ducks/Duck7" to="YSorted/ducks" method="Increment"] [connection signal="DuckCollected" from="YSorted/ducks/Duck7" to="YSorted/ducks" method="Increment"]
[connection signal="Dialogue" from="YSorted/ducks/DialogicToggle" to="YSorted/ducks/dialogic starter" method="open"] [connection signal="Dialogue" from="YSorted/ducks/DialogicToggle" to="YSorted/ducks/dialogic starter" method="open"]
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"] [connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
[connection signal="ready" from="SpeicialQuestTrigger/QuestInstantStart" to="SpeicialQuestTrigger/QuestInstantStart/QuestTrigger" method="Trigger"]
[editable path="YSorted/Vesna"] [editable path="YSorted/Vesna"]
[editable path="YSorted/Brünnen/InteractionArea"] [editable path="YSorted/Brünnen/InteractionArea"]
@@ -1,4 +1,4 @@
[gd_scene load_steps=100 format=3 uid="uid://cic8y0mdk3vd2"] [gd_scene load_steps=103 format=3 uid="uid://cic8y0mdk3vd2"]
[ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_gwe0p"] [ext_resource type="Script" uid="uid://cssdu8viimwm6" path="res://scripts/CSharp/Common/SceneTransition.cs" id="1_gwe0p"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="2_1kqg8"] [ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="2_1kqg8"]
@@ -151,11 +151,23 @@ size = Vector2(1041, 368)
resource_local_to_scene = true resource_local_to_scene = true
radius = 371.058 radius = 371.058
[sub_resource type="CircleShape2D" id="CircleShape2D_2nee2"] [sub_resource type="CircleShape2D" id="CircleShape2D_tkk2w"]
resource_local_to_scene = true resource_local_to_scene = true
radius = 300.0 radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_ipqaa"] [sub_resource type="CircleShape2D" id="CircleShape2D_gwe0p"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_1kqg8"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_6nf5r"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_2532c"]
resource_local_to_scene = true resource_local_to_scene = true
radius = 300.0 radius = 300.0
@@ -1044,8 +1056,8 @@ position = Vector2(6095, 2087)
[node name="SpawnWithItem" parent="YSorted/HoeGenericPickup" index="0"] [node name="SpawnWithItem" parent="YSorted/HoeGenericPickup" index="0"]
_blueprint = ExtResource("34_n176s") _blueprint = ExtResource("34_n176s")
[node name="CollisionShape3D" parent="YSorted/HoeGenericPickup/InteractionArea2/Area2D" index="0"] [node name="CollisionShape3D" parent="YSorted/HoeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_2nee2") shape = SubResource("CircleShape2D_tkk2w")
[node name="CanGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")] [node name="CanGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")]
position = Vector2(8192, 3507) position = Vector2(8192, 3507)
@@ -1053,11 +1065,8 @@ position = Vector2(8192, 3507)
[node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"] [node name="SpawnWithItem" parent="YSorted/CanGenericPickup" index="0"]
_blueprint = ExtResource("30_te7n5") _blueprint = ExtResource("30_te7n5")
[node name="InteractionArea2" parent="YSorted/CanGenericPickup" index="3"] [node name="CollisionShape3D" parent="YSorted/CanGenericPickup/PickupInteractionArea/Area2D" index="0"]
position = Vector2(0, -159) shape = SubResource("CircleShape2D_gwe0p")
[node name="CollisionShape3D" parent="YSorted/CanGenericPickup/InteractionArea2/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa")
[node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")] [node name="RakeGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")]
position = Vector2(8391, 2060) position = Vector2(8391, 2060)
@@ -1065,8 +1074,8 @@ position = Vector2(8391, 2060)
[node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"] [node name="SpawnWithItem" parent="YSorted/RakeGenericPickup" index="0"]
_blueprint = ExtResource("29_36k8l") _blueprint = ExtResource("29_36k8l")
[node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/InteractionArea2/Area2D" index="0"] [node name="CollisionShape3D" parent="YSorted/RakeGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa") shape = SubResource("CircleShape2D_1kqg8")
[node name="ScytheGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")] [node name="ScytheGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")]
visible = false visible = false
@@ -1075,8 +1084,8 @@ position = Vector2(15642, 2158)
[node name="SpawnWithItem" parent="YSorted/ScytheGenericPickup" index="0"] [node name="SpawnWithItem" parent="YSorted/ScytheGenericPickup" index="0"]
_blueprint = ExtResource("35_p4sr7") _blueprint = ExtResource("35_p4sr7")
[node name="CollisionShape3D" parent="YSorted/ScytheGenericPickup/InteractionArea2/Area2D" index="0"] [node name="CollisionShape3D" parent="YSorted/ScytheGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa") shape = SubResource("CircleShape2D_6nf5r")
[node name="ShovelGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")] [node name="ShovelGenericPickup" parent="YSorted" instance=ExtResource("33_tml8r")]
visible = false visible = false
@@ -1085,8 +1094,8 @@ position = Vector2(5454, 2049)
[node name="SpawnWithItem" parent="YSorted/ShovelGenericPickup" index="0"] [node name="SpawnWithItem" parent="YSorted/ShovelGenericPickup" index="0"]
_blueprint = ExtResource("36_vri5g") _blueprint = ExtResource("36_vri5g")
[node name="CollisionShape3D" parent="YSorted/ShovelGenericPickup/InteractionArea2/Area2D" index="0"] [node name="CollisionShape3D" parent="YSorted/ShovelGenericPickup/PickupInteractionArea/Area2D" index="0"]
shape = SubResource("CircleShape2D_ipqaa") shape = SubResource("CircleShape2D_2532c")
[node name="Farm visuals" type="Node2D" parent="YSorted"] [node name="Farm visuals" type="Node2D" parent="YSorted"]
position = Vector2(-60, 122) position = Vector2(-60, 122)
@@ -2247,25 +2256,19 @@ script = ExtResource("59_0knno")
[connection signal="FieldCreated" from="YSorted/Farm visuals/FieldParent" to="Audio/SFX/Farming SFX" method="PlayOneShot"] [connection signal="FieldCreated" from="YSorted/Farm visuals/FieldParent" to="Audio/SFX/Farming SFX" method="PlayOneShot"]
[connection signal="input_event" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Vesna/FarmingControls" method="InputEventPressedOn"] [connection signal="input_event" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Vesna/FarmingControls" method="InputEventPressedOn"]
[connection signal="GoalReached" from="YSorted/ducks" to="YSorted/ducks/DialogicToggle" method="ToggleDialogue"] [connection signal="GoalReached" from="YSorted/ducks" to="YSorted/ducks/DialogicToggle" method="ToggleDialogue"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck2" to="YSorted/ducks" method="Increment"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck3" to="YSorted/ducks" method="Increment"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck4" to="YSorted/ducks" method="Increment"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck5" to="YSorted/ducks" method="Increment"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck6" to="YSorted/ducks" method="Increment"]
[connection signal="DuckCollected" from="YSorted/ducks/Duck7" to="YSorted/ducks" method="Increment"]
[connection signal="Dialogue" from="YSorted/ducks/DialogicToggle" to="YSorted/ducks/dialogic starter" method="open"] [connection signal="Dialogue" from="YSorted/ducks/DialogicToggle" to="YSorted/ducks/dialogic starter" method="open"]
[connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"] [connection signal="finished" from="Audio/Background Music Ramp up" to="Audio/Background Music loop" method="PlayFromOffset"]
[editable path="YSorted/Vesna"] [editable path="YSorted/Vesna"]
[editable path="YSorted/Brünnen/InteractionArea"] [editable path="YSorted/Brünnen/InteractionArea"]
[editable path="YSorted/HoeGenericPickup"] [editable path="YSorted/HoeGenericPickup"]
[editable path="YSorted/HoeGenericPickup/InteractionArea2"] [editable path="YSorted/HoeGenericPickup/PickupInteractionArea"]
[editable path="YSorted/CanGenericPickup"] [editable path="YSorted/CanGenericPickup"]
[editable path="YSorted/CanGenericPickup/InteractionArea2"] [editable path="YSorted/CanGenericPickup/PickupInteractionArea"]
[editable path="YSorted/RakeGenericPickup"] [editable path="YSorted/RakeGenericPickup"]
[editable path="YSorted/RakeGenericPickup/InteractionArea2"] [editable path="YSorted/RakeGenericPickup/PickupInteractionArea"]
[editable path="YSorted/ScytheGenericPickup"] [editable path="YSorted/ScytheGenericPickup"]
[editable path="YSorted/ScytheGenericPickup/InteractionArea2"] [editable path="YSorted/ScytheGenericPickup/PickupInteractionArea"]
[editable path="YSorted/ShovelGenericPickup"] [editable path="YSorted/ShovelGenericPickup"]
[editable path="YSorted/ShovelGenericPickup/InteractionArea2"] [editable path="YSorted/ShovelGenericPickup/PickupInteractionArea"]
[editable path="CanvasLayer"] [editable path="CanvasLayer"]
@@ -21,7 +21,7 @@
[ext_resource type="AudioStream" uid="uid://cohyenfo1rtxh" path="res://audio/sfx/Animals/SFX_Cat_Meow_01.wav" id="16_d7yky"] [ext_resource type="AudioStream" uid="uid://cohyenfo1rtxh" path="res://audio/sfx/Animals/SFX_Cat_Meow_01.wav" id="16_d7yky"]
[ext_resource type="PackedScene" uid="uid://dfvgp1my5rydh" path="res://prefabs/characters/Yeli.tscn" id="16_dhsxs"] [ext_resource type="PackedScene" uid="uid://dfvgp1my5rydh" path="res://prefabs/characters/Yeli.tscn" id="16_dhsxs"]
[ext_resource type="AudioStream" uid="uid://b2cmf5ie7cwka" path="res://audio/sfx/Animals/SFX_Cat_Meow_02.wav" id="17_7a68a"] [ext_resource type="AudioStream" uid="uid://b2cmf5ie7cwka" path="res://audio/sfx/Animals/SFX_Cat_Meow_02.wav" id="17_7a68a"]
[ext_resource type="Script" uid="uid://cvkw4qd2hxksi" path="res://scripts/GdScript/dialogic_toggle.gd" id="17_k0k8c"] [ext_resource type="Script" path="res://scripts/GdScript/dialogic_toggle.gd" id="17_k0k8c"]
[ext_resource type="AudioStream" uid="uid://cttisejnt2l8f" path="res://audio/sfx/Animals/SFX_Cat_Meow_03.wav" id="18_dhsxs"] [ext_resource type="AudioStream" uid="uid://cttisejnt2l8f" path="res://audio/sfx/Animals/SFX_Cat_Meow_03.wav" id="18_dhsxs"]
[ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="18_dw4nn"] [ext_resource type="Script" uid="uid://bqomwxclsbhd3" path="res://scripts/CSharp/Common/Camera/CameraController.cs" id="18_dw4nn"]
[ext_resource type="AudioStream" uid="uid://cbmagiou0n0t3" path="res://audio/sfx/Animals/SFX_Cat_Meow_04.wav" id="19_k0k8c"] [ext_resource type="AudioStream" uid="uid://cbmagiou0n0t3" path="res://audio/sfx/Animals/SFX_Cat_Meow_04.wav" id="19_k0k8c"]
@@ -29,7 +29,7 @@
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="21_blyw3"] [ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="21_blyw3"]
[ext_resource type="AudioStream" uid="uid://r2f6xmjvyyjv" path="res://audio/sfx/Animals/SFX_Cat_Purr_01.wav" id="21_ytap8"] [ext_resource type="AudioStream" uid="uid://r2f6xmjvyyjv" path="res://audio/sfx/Animals/SFX_Cat_Purr_01.wav" id="21_ytap8"]
[ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer.cs" id="22_tggq2"] [ext_resource type="Script" uid="uid://cfnrd5k1k0gxw" path="res://scripts/CSharp/Common/AudioPlayer.cs" id="22_tggq2"]
[ext_resource type="Resource" uid="uid://cbpurnewhyefa" path="res://resources/quests/beetRoot.tres" id="22_yd2gv"] [ext_resource type="Resource" path="res://resources/quests/beetRoot.tres" id="22_yd2gv"]
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="24_yd2gv"] [ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="24_yd2gv"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_a2ood"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_a2ood"]
@@ -539,7 +539,6 @@ position = Vector2(-565, 464)
[node name="dialogic_toggle" type="Node2D" parent="Yeli"] [node name="dialogic_toggle" type="Node2D" parent="Yeli"]
script = ExtResource("17_k0k8c") script = ExtResource("17_k0k8c")
metadata/_custom_type_script = "uid://cvkw4qd2hxksi"
[node name="Beetroot Quest trigger" type="Node2D" parent="Yeli"] [node name="Beetroot Quest trigger" type="Node2D" parent="Yeli"]
script = ExtResource("21_blyw3") script = ExtResource("21_blyw3")
+1 -1
View File
@@ -6,7 +6,7 @@
[node name="BabushkaSceneStartMenu" type="Node2D"] [node name="BabushkaSceneStartMenu" type="Node2D"]
script = ExtResource("1_fj2fh") script = ExtResource("1_fj2fh")
_sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_disclaimer.tscn") _sceneNamesToLoad = PackedStringArray("res://scenes/Babushka_scene_farm_outside_2d.tscn")
[node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="CanvasLayer" type="CanvasLayer" parent="."]
+3 -3
View File
@@ -2,9 +2,9 @@
[ext_resource type="PackedScene" uid="uid://cqcs80xsgygeb" path="res://prefabs/UI/Book/Book.tscn" id="1_bd7dq"] [ext_resource type="PackedScene" uid="uid://cqcs80xsgygeb" path="res://prefabs/UI/Book/Book.tscn" id="1_bd7dq"]
[ext_resource type="Script" uid="uid://cg0oqug38c81n" path="res://scripts/CSharp/Common/Quest/QuestTestingScript.cs" id="2_sv6jn"] [ext_resource type="Script" uid="uid://cg0oqug38c81n" path="res://scripts/CSharp/Common/Quest/QuestTestingScript.cs" id="2_sv6jn"]
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="3_nhtae"] [ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test/test_01.tres" id="3_nhtae"]
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test_02.tres" id="4_kr4yw"] [ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test/test_02.tres" id="4_kr4yw"]
[ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test_03.tres" id="5_4cktu"] [ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test/test_03.tres" id="5_4cktu"]
[node name="BabushkaTestsBook" type="Node"] [node name="BabushkaTestsBook" type="Node"]
@@ -0,0 +1,74 @@
[gd_scene load_steps=5 format=3 uid="uid://baunkb4wwtl32"]
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="1_wnfrg"]
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test/test_01.tres" id="2_nud5h"]
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test/test_02.tres" id="3_tb5fn"]
[ext_resource type="Script" uid="uid://d2486x6upmwqq" path="res://scripts/GdScript/dialogic_starter.gd" id="4_6p0xc"]
[node name="BabushkaTestsQuestDialogic" type="Node2D"]
[node name="Button" type="Button" parent="."]
offset_left = 105.0
offset_top = 47.0
offset_right = 423.0
offset_bottom = 185.0
text = "Start Quest 1"
[node name="Node" type="Node" parent="Button"]
script = ExtResource("1_wnfrg")
questResource = ExtResource("2_nud5h")
toStatus = 1
makeCurrent = true
[node name="Button2" type="Button" parent="."]
offset_left = 460.0
offset_top = 49.0
offset_right = 778.0
offset_bottom = 187.0
text = "End Quest 1"
[node name="Node" type="Node" parent="Button2"]
script = ExtResource("1_wnfrg")
questResource = ExtResource("2_nud5h")
toStatus = 2
[node name="Button3" type="Button" parent="."]
offset_left = 105.0
offset_top = 215.0
offset_right = 423.0
offset_bottom = 353.0
text = "Start Quest 2"
[node name="Node" type="Node" parent="Button3"]
script = ExtResource("1_wnfrg")
questResource = ExtResource("3_tb5fn")
toStatus = 1
makeCurrent = true
[node name="Button4" type="Button" parent="."]
offset_left = 460.0
offset_top = 217.0
offset_right = 778.0
offset_bottom = 355.0
text = "End Quest 2"
[node name="Node" type="Node" parent="Button4"]
script = ExtResource("1_wnfrg")
questResource = ExtResource("3_tb5fn")
toStatus = 2
[node name="Button5" type="Button" parent="."]
offset_left = 1314.0
offset_top = 67.0
offset_right = 1632.0
offset_bottom = 205.0
text = "Start Dialog"
[node name="Node" type="Node" parent="Button5"]
script = ExtResource("4_6p0xc")
[connection signal="pressed" from="Button" to="Button/Node" method="Trigger"]
[connection signal="pressed" from="Button2" to="Button2/Node" method="Trigger"]
[connection signal="pressed" from="Button3" to="Button3/Node" method="Trigger"]
[connection signal="pressed" from="Button4" to="Button4/Node" method="Trigger"]
[connection signal="pressed" from="Button5" to="Button5/Node" method="open" binds= ["test_1"]]
+3 -3
View File
@@ -2,9 +2,9 @@
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="1_opxcj"] [ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="1_opxcj"]
[ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="3_sx4ix"] [ext_resource type="Script" uid="uid://cldtt4atgymm5" path="res://scripts/CSharp/Common/Quest/QuestTrigger.cs" id="3_sx4ix"]
[ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test_01.tres" id="4_qyyck"] [ext_resource type="Resource" uid="uid://0aruj4lm74n6" path="res://resources/quests/test/test_01.tres" id="4_qyyck"]
[ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test_02.tres" id="5_sokiv"] [ext_resource type="Resource" uid="uid://be1dmc6d2mxl5" path="res://resources/quests/test/test_02.tres" id="5_sokiv"]
[ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test_03.tres" id="6_ajsa7"] [ext_resource type="Resource" uid="uid://tmmnsg1bge2" path="res://resources/quests/test/test_03.tres" id="6_ajsa7"]
[node name="BabushkaTestsQuests" type="Node2D"] [node name="BabushkaTestsQuests" type="Node2D"]
@@ -2,6 +2,7 @@
using System; using System;
using Godot; using Godot;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
namespace Babushka.scripts.CSharp.Common.Inventory; namespace Babushka.scripts.CSharp.Common.Inventory;
@@ -120,12 +121,29 @@ public partial class InventoryInstance : Node
{ {
if (destinationSlot < 0 || destinationSlot >= _slots.Count) if (destinationSlot < 0 || destinationSlot >= _slots.Count)
return InventoryActionResult.DestinationDoesNotExists; return InventoryActionResult.DestinationDoesNotExists;
if (!_slots[destinationSlot].IsEmpty()) if (!_slots[destinationSlot].IsEmpty())
return InventoryActionResult.DestinationFull; return InventoryActionResult.DestinationFull;
_slots[destinationSlot].itemInstance = itemInstance; _slots[destinationSlot].itemInstance = itemInstance;
EmitSignal(SignalName.InventoryContentsChanged); EmitSignal(SignalName.InventoryContentsChanged);
return InventoryActionResult.Success; return InventoryActionResult.Success;
} }
}
public int TotalItemsOfBlueprint(ItemResource blueprint)
{
return _slots
.Where(i => !i.IsEmpty() && i.itemInstance!.blueprint == blueprint)
.Sum(i => i.itemInstance!.amount);
}
public bool HasItems(ItemInstance item)
{
return TotalItemsOfBlueprint(item.blueprint) >= item.amount;
}
public bool HasItems(IEnumerable<ItemInstance> items)
{
return items.All(HasItems);
}
}
@@ -1,9 +1,13 @@
namespace Babushka.scripts.CSharp.Common.Inventory; using Godot;
namespace Babushka.scripts.CSharp.Common.Inventory;
public class ItemInstance // Do not instantiate this resource
// But it has to be a resource because Godot
[GlobalClass]
public partial class ItemInstance: Resource
{ {
public ItemResource blueprint; [Export] public ItemResource blueprint;
public int amount = 1; [Export] public int amount = 1;
public ItemInstance Clone() public ItemInstance Clone()
{ {
@@ -6,7 +6,7 @@ public partial class TalkingCharacter : Node2D
{ {
[Export] private AnimatedSprite2D? _sprite; [Export] private AnimatedSprite2D? _sprite;
[Export] private string[] _timelinesToPlay; [Export] private string[] _timelinesToPlay;
[Export] private bool _retriggerSameTimeline = false;
private bool _isTalking = true; private bool _isTalking = true;
private int _timelineIndex = 0; private int _timelineIndex = 0;
@@ -32,7 +32,8 @@ public partial class TalkingCharacter : Node2D
_sprite.Animation = "talk"; _sprite.Animation = "talk";
_isTalking = true; _isTalking = true;
EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]); EmitSignal(SignalName.Talking, _timelinesToPlay[_timelineIndex]);
_timelineIndex++; if (!_retriggerSameTimeline)
_timelineIndex++;
} }
if (_sprite != null) if (_sprite != null)
_sprite.Play(); _sprite.Play();
+7 -2
View File
@@ -16,13 +16,16 @@ public partial class QuestManager : Node
[Signal] [Signal]
public delegate void QuestsChangedEventHandler(); public delegate void QuestsChangedEventHandler();
[Signal]
public delegate void DialogicActiveQuestEventHandler(string value);
public override void _EnterTree() public override void _EnterTree()
{ {
Instance = this; Instance = this;
} }
private Godot.Collections.Dictionary<QuestResource, QuestStatus> _questStatus = new(); private Godot.Collections.Dictionary<QuestResource, QuestStatus> _questStatus = new();
private QuestResource? _followQuest; private QuestResource? _followQuest;
@@ -37,6 +40,7 @@ public partial class QuestManager : Node
value.status = newStatus; value.status = newStatus;
EmitSignalQuestsChanged(); EmitSignalQuestsChanged();
EmitSignalDialogicActiveQuest(_followQuest?.id ?? "none");
if (newStatus == QuestStatus.Status.Active) if (newStatus == QuestStatus.Status.Active)
{ {
@@ -57,7 +61,7 @@ public partial class QuestManager : Node
{ {
if (_questStatus.TryGetValue(questResource, out var status)) if (_questStatus.TryGetValue(questResource, out var status))
return status; return status;
status = new QuestStatus(); status = new QuestStatus();
_questStatus.Add(questResource, status); _questStatus.Add(questResource, status);
return status; return status;
@@ -72,5 +76,6 @@ public partial class QuestManager : Node
{ {
_followQuest = questResource; _followQuest = questResource;
EmitSignalQuestsChanged(); EmitSignalQuestsChanged();
EmitSignalDialogicActiveQuest(_followQuest?.id ?? "none");
} }
} }
+4 -4
View File
@@ -6,10 +6,10 @@ public partial class QuestStatus : GodotObject
{ {
public enum Status public enum Status
{ {
Hidden, Hidden = 0,
Active, Active = 1,
Done, Done = 2,
Canceled, Canceled = 3,
} }
public Status status = Status.Hidden; public Status status = Status.Hidden;
@@ -1,20 +1,22 @@
using Godot; using Godot;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using Babushka.scripts.CSharp.Common.Quest; using Babushka.scripts.CSharp.Common.Quest;
using Godot.Collections; using Godot.Collections;
public partial class QuestTestingScript : Node public partial class QuestTestingScript : Node
{ {
[Export(PropertyHint.ArrayType)] [Export(PropertyHint.ArrayType)]
private Array<QuestResource> _questsToActivate; private Array<QuestResource>? _questsToActivate;
public override void _EnterTree() public override void _EnterTree()
{ {
Debug.Assert(_questsToActivate != null);
foreach (var questResource in _questsToActivate) foreach (var questResource in _questsToActivate)
{ {
QuestManager.Instance.ChangeQuestStatus(questResource, QuestStatus.Status.Active); QuestManager.Instance!.ChangeQuestStatus(questResource, QuestStatus.Status.Active);
} }
} }
} }
@@ -0,0 +1,33 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Linq;
using Babushka.scripts.CSharp.Common.Inventory;
using Babushka.scripts.CSharp.Common.Quest;
public partial class DetectInventoryContains : QuestFulfillmentBase
{
[Export(PropertyHint.ArrayType)] private ItemInstance[] _itemsToContain = null!;
public override void _Ready()
{
QuestManager.Instance!.QuestsChanged += CheckInventory;
InventoryManager.Instance.playerInventory.InventoryContentsChanged += CheckInventory;
CheckInventory();
}
public override void _ExitTree()
{
QuestManager.Instance!.QuestsChanged -= CheckInventory;
InventoryManager.Instance.playerInventory.InventoryContentsChanged -= CheckInventory;
}
private void CheckInventory()
{
if (IsQuestActive() && InventoryManager.Instance.playerInventory.HasItems(_itemsToContain))
{
Fulfill();
}
}
}
@@ -0,0 +1 @@
uid://c741nyedy26mx
@@ -0,0 +1,6 @@
using Godot;
using System;
public partial class DetectToolCollection : Node
{
}
@@ -0,0 +1 @@
uid://caohn76m3n3nm
@@ -0,0 +1,35 @@
using Godot;
using System;
using System.Linq;
using Babushka.scripts.CSharp.Common.Quest;
public abstract partial class QuestFulfillmentBase : Node
{
[Export] private QuestResource _onActiveQuest;
[Export] private QuestResource _toNextQuest;
[Export] private bool _whenFulfilledSetActiveQuestToDone = true;
[Export] private bool _whenFulfilledSetNextQuestToActive = true;
[Export] private bool _whenFulfilledSetNextQuestToFollow = true;
protected void Fulfill()
{
if (_whenFulfilledSetActiveQuestToDone)
{
QuestManager.Instance!.ChangeQuestStatus(_onActiveQuest, QuestStatus.Status.Done);
}
if (_whenFulfilledSetNextQuestToActive)
{
QuestManager.Instance!.ChangeQuestStatus(_toNextQuest, QuestStatus.Status.Active);
}
if (_whenFulfilledSetNextQuestToFollow)
{
QuestManager.Instance!.SetFollowQuest(_toNextQuest);
}
}
protected bool IsQuestActive()
{
return QuestManager.Instance!.GetActiveQuests().Any(q => q.Key == _onActiveQuest);
}
}
@@ -0,0 +1 @@
uid://dw158xraniqkd
+4
View File
@@ -0,0 +1,4 @@
extends Node
func _SetActiveQuestVar(value:String):
Dialogic.VAR.ACTIVEQUEST = value
@@ -0,0 +1 @@
uid://bukwr1h3hn8sx