feat: author emergent situations and dialogue

This commit is contained in:
Rijad Zuzo
2026-08-12 21:58:12 +02:00
parent 14120115d4
commit d12e9515fb
29 changed files with 856 additions and 143 deletions
@@ -3,12 +3,15 @@ extends Resource
@export var intent_id: StringName
@export var response_intent_ids: Array[StringName] = []
@export var template_catalog_id: StringName
func validate() -> Array[String]:
var errors: Array[String] = []
if not ConversationSemantic.is_valid_id(intent_id):
errors.append("intent_id is invalid")
if template_catalog_id.is_empty():
errors.append("template_catalog_id is empty for '%s'" % intent_id)
var seen: Dictionary = {}
for response_intent_id in response_intent_ids:
if not ConversationSemantic.is_valid_id(response_intent_id):
@@ -20,3 +23,11 @@ func validate() -> Array[String]:
else:
seen[response_intent_id] = true
return errors
func duplicate_definition() -> ConversationIntentDefinition:
var copy := ConversationIntentDefinition.new()
copy.intent_id = intent_id
copy.response_intent_ids = response_intent_ids.duplicate()
copy.template_catalog_id = template_catalog_id
return copy