Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
91327ee
Added player character input disabling facilities
jonjondev Mar 9, 2025
80d469a
Updated save game debug section to load file contents on prompt
jonjondev Mar 9, 2025
30cb495
Implemented world character action node type
jonjondev Mar 9, 2025
d363cca
Updated all zones to use world character actions on traversal and sup…
jonjondev Mar 9, 2025
ce5f1ca
Added some lighting to the terrain shader
Swiggies Mar 14, 2025
9b57d7b
Renamed time increment debug section controls
jonjondev Mar 13, 2025
cad1add
Removed Draw3D functionality, replaced with DebugDraw static functions
jonjondev Mar 13, 2025
3b1a323
Implemented appointment spawners with related DT configuration
jonjondev Mar 13, 2025
ebfd522
Cleaned up node ID naming conventions, renamed all zones
jonjondev Mar 15, 2025
54ab40b
Added time readout to game debug panel section
jonjondev Mar 15, 2025
5c74396
Implemented wrapping appointments for characters
jonjondev Mar 15, 2025
ca7bc2d
Reenabled post-processing, moved main menu controls to UI layer
jonjondev Mar 15, 2025
3f3412b
Added terrain capabilities for non-builtin resource editing
jonjondev Mar 24, 2025
6066603
Extracted terrain mesh and collision resources from zone scenes
jonjondev Mar 24, 2025
dc1df9c
Updated zone traversal triggers to use zone id values for referencing
jonjondev Mar 24, 2025
f7beab5
Extracted navmesh bake data to external resources for each zone
jonjondev Mar 24, 2025
e275158
Cleaned up zones directory, moved all data into relevant categories
jonjondev Mar 24, 2025
4342bcd
Reworked character actions as configurable resources
jonjondev Mar 25, 2025
ac047da
Added zone exits to traversal triggers, removed specific world charac…
jonjondev Mar 25, 2025
d76c6a3
Updated appointment spawners to support dialogue script assignment
jonjondev May 5, 2025
2d62eed
Implemented farmer dialogue
jonjondev May 5, 2025
a91351a
Implemented traversal exits to zones for appointments
jonjondev May 5, 2025
908ff73
Updated landscape to preview without radiation
jonjondev May 5, 2025
36e8a96
Renamed agenda configs
jonjondev May 5, 2025
64573e3
Add farmer questions
BenKellySoftware May 7, 2025
90a7049
Update dialogue to handle multiple lines in a single segment
BenKellySoftware May 10, 2025
31b9d71
Max width and wrap dialogue text
BenKellySoftware May 11, 2025
48f46f1
Add main options to farmer
BenKellySoftware May 20, 2025
6849034
Implemented reverse appointment spawn traversal zone exit selection
jonjondev May 29, 2025
ff08584
Intro text, questions and intro dialogue for farmer and scientist, sp…
BenKellySoftware Jul 6, 2025
2873bb6
Fixed scientist spawn for campfire zone, initial spawn location checking
jonjondev Jul 8, 2025
a8026d8
Disabled NPC wandering
jonjondev Jul 20, 2025
abc024d
Added state blackboard to player data, fixed dialogue error
jonjondev Jul 20, 2025
d884cb3
Fix default state, and calls in scientist and farmer dialogue
BenKellySoftware Aug 23, 2025
13eefe4
Fixed dialogue reentry issues on character click
jonjondev Aug 23, 2025
7900854
Fixed line option dialogue display
jonjondev Aug 23, 2025
88cab59
Fixed farmer questions returning dialogue
jonjondev Aug 23, 2025
34b6be9
Added dictionary support for DT editor, added characters DT
jonjondev Aug 24, 2025
be65bc5
Moved dialogue configuration to character DT
jonjondev Aug 24, 2025
06220e2
Flatten world state dictionary
BenKellySoftware Aug 24, 2025
db907c1
Moved state blackboard to worldstate persistent data section
jonjondev Aug 24, 2025
b4f3334
Fixed collision issues across zones
jonjondev Aug 24, 2025
58dd11b
Added flatness parameter to terrain shader
jonjondev Aug 24, 2025
dd297cc
Removed unused state from player data
jonjondev Aug 24, 2025
896ac9b
Remove well, add water collection from river
BenKellySoftware Aug 24, 2025
72b2905
Add configure options to other actions
BenKellySoftware Aug 24, 2025
a1703d4
version bump
BenKellySoftware Aug 24, 2025
305022c
Fixed dialogue validations for options execution
jonjondev Aug 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ build/

# Affinity-specific ignores
*~lock~

# Local design files
designs/
18 changes: 16 additions & 2 deletions addons/datatable/scripts/datatable_editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,26 @@ func populate_row(index: int, key):
if DatatableUtils.validate_datatable_keys(current_dt):
ResourceSaver.save(current_dt)
refresh_table()
var key_props = {"type": current_dt.key_type, "hint": PROPERTY_HINT_NONE, "hint_string": ""}
var key_props = {"type": current_dt.key_type, "hint": PROPERTY_HINT_NONE, "hint_string": "", "row": key}
var field_control = build_field_control(key, key_props, key_setter_callback, true)
grid_container.add_child(field_control)

for property in row_properties:
var setter_callback = func(new_value):
row.set(property.name, new_value)
ResourceSaver.save(current_dt)
property["row"] = key
field_control = build_field_control(row.get(property.name), property, setter_callback, false)
grid_container.add_child(field_control)

var menu_btn = MenuButton.new()
menu_btn.get_popup().add_item("Delete", 0)
menu_btn.get_popup().add_item("Edit", 1)
menu_btn.icon = get_theme_icon("GuiTabMenuHl", "EditorIcons")
var on_pressed = func(id): if id == 0: on_delete_btn_pressed(key)
var on_pressed = func(id):
match (id):
0: on_delete_btn_pressed(key)
1: on_edit_btn_pressed(key)
menu_btn.get_popup().id_pressed.connect(on_pressed)
grid_container.add_child(menu_btn)

Expand Down Expand Up @@ -335,6 +340,7 @@ func build_field_control(value: Variant, property: Dictionary, setter_callback:
TYPE_ARRAY:
field_control = VBoxContainer.new()
var properties = DatatableUtils.get_properties_by_hint_string(property.hint_string)
properties.row = property.row

for index in len(value):
var item = value[index]
Expand Down Expand Up @@ -366,6 +372,10 @@ func build_field_control(value: Variant, property: Dictionary, setter_callback:
add_item_btn.button_down.connect(add_item)
add_item_btn.icon = get_theme_icon("New", "EditorIcons")
field_control.add_child(add_item_btn)
TYPE_DICTIONARY:
field_control = Button.new()
field_control.text = "%d %s" % [value.size(), "entry" if value.size() == 1 else "entries"]
field_control.pressed.connect(func(): on_edit_btn_pressed(property.row))
_:
field_control = Label.new()
field_control.size_flags_horizontal = Control.SIZE_EXPAND_FILL
Expand Down Expand Up @@ -402,6 +412,10 @@ func on_delete_btn_pressed(row):
ResourceSaver.save(current_dt)
refresh_table()

func on_edit_btn_pressed(row):
var row_data = current_dt.data[row]
EditorInterface.get_inspector().resource_selected.emit(row_data, row_data.resource_path)

func on_new_dt_btn_pressed():
var editor = EditorInterface.get_editor_main_screen()

Expand Down
38 changes: 22 additions & 16 deletions addons/dialogue/example/example_dialogue.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,37 +75,39 @@
},
"example_line_04": {
"lines": [
{
"condition": "false",
"speaker_id": "estragon",
"text": "THIS SHOULD NOT RUN",
},
{
"speaker_id": "estragon",
"text": "Me too.",
"next": "example_line_06"
},
],
},
"example_line_05": {
"lines": [
{
"condition": "not ctx.state.looped",
"speaker_id": "vladimir",
"text": "LINE!",
"next": "example_line_08"
"text": "Together again at last! We'll have to celebrate this. But how?",
},
],
},
"example_line_06": {
"lines": [
{
"condition": "ctx.state.looped",
"speaker_id": "vladimir",
"text": "Together again at last! We'll have to celebrate this. But how?",
"next": "example_line_06b"
"text": "Give me a hug!",
"next": "example_line_07"
},
{
"speaker_id": "vladimir",
"text": "Get up till I embrace you.",
"next": "example_line_07"
},
],
},
"example_line_06b": {
"example_line_05": {
"lines": [
{
"speaker_id": "vladimir",
"text": "Get up till I embrace you.",
"next": "example_line_07"
"text": "LINE!",
"next": "example_line_08"
},
],
},
Expand Down Expand Up @@ -194,6 +196,10 @@
"speaker_id": "vladimir",
"text": "I think let's end it here for today...",
},
{
"speaker_id": "estragon",
"text": "Very well",
},
],
},
}
28 changes: 24 additions & 4 deletions addons/dialogue/scripts/dialogue_script.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ signal advanced_with_option(option_id: int)
var file_path: String
var segments: Dictionary = {}
var current_segment_id: StringName
var current_line_idx: int
var context_object: Variant

func _init(file: String):
Expand Down Expand Up @@ -43,9 +44,9 @@ func progress_segment():
return
match(get_segment_type(current_segment)):
DialogueScriptSegmentType.LINE:
var line = find_first_valid_line(current_segment.lines)
var line = find_next_valid_line(current_segment.lines)
if not line:
push_warning("Failed to find valid line at \"", current_segment_id, "\"")
end()
return
var execution = line.get("execution", null)
if execution:
Expand All @@ -56,7 +57,12 @@ func progress_segment():
if formatting:
substitute_format_values(formatting)
line.processed_text = line.processed_text.format(formatting)
current_segment_id = line.get("next", StringName())
if line.has("next"):
current_segment_id = line.next
current_line_idx = 0
else:
current_line_idx += 1

execute_line(line)
DialogueScriptSegmentType.OPTION:
var valid_options = find_all_valid_options(current_segment.options)
Expand All @@ -74,6 +80,9 @@ func progress_segment():
if formatting:
substitute_format_values(formatting)
line.processed_text = line.processed_text.format(formatting)
var execution = line.get("execution", null)
if execution:
run_execution(execution)
execute_options(valid_options, line)
DialogueScriptSegmentType.UNKNOWN:
push_warning("Encountered unknown segment type at \"", current_segment_id, "\"")
Expand All @@ -99,6 +108,15 @@ func find_first_valid_line(lines):
if not condition or is_condition_valid(condition):
return line
return null

func find_next_valid_line(lines):
for idx in range(current_line_idx, len(lines)):
var line = lines[idx]
var condition = line.get("condition", null)
if not condition or is_condition_valid(condition):
current_line_idx = idx
return line
return null

func find_all_valid_options(options):
var valid_options: Dictionary
Expand Down Expand Up @@ -143,6 +161,7 @@ func process_text(segment):
func start() -> bool:
if is_active(): return false
current_segment_id = get_intial_segment_id()
current_line_idx = 0
if not current_segment_id:
push_error("Dialogue Error: failed to find intial segment ID for script \"", file_path, "\"")
return false
Expand All @@ -152,6 +171,7 @@ func start() -> bool:

func end() -> bool:
current_segment_id = StringName()
current_line_idx = 0
ended.emit()
return true

Expand All @@ -167,8 +187,8 @@ func advance():

func advance_with_option(option_id: int):
if select_option(option_id):
progress_segment()
advanced_with_option.emit(option_id)
progress_segment()

func is_active() -> bool:
return not current_segment_id.is_empty()
Expand Down
1 change: 1 addition & 0 deletions addons/dialogue/scripts/dialogue_validator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const valid_option_line_fields: Array[String] = [
"text",
"formatting",
"data",
"execution",
"dev_comment",
]

Expand Down
Loading
Loading