Threads and tasks

This commit is contained in:
2026-01-29 15:28:50 +03:00
parent 4cf0ea5321
commit da4c1fee0e
21 changed files with 1464 additions and 558 deletions

View File

@@ -661,16 +661,29 @@ setup_action_handler("talk", {
activate = function(this)
local book = narrator.parse_file('stories.talk')
this.story = narrator.init_story(book)
local crash_bind = function()
crash()
local get_crash_bind = function(this)
local crash_bind = function()
print("variables")
print(dump(this.story.variables))
crash()
end
return crash_bind
end
this.story:bind('crash', crash_bind)
this.story:begin()
this:narration_update()
this.story:bind('crash', get_crash_bind(this))
local props = this._get_properties()
print(props)
local goals = this._get_goals()
print("node activated")
-- print(dump(goals))
local json_data = json.decode(props)
print(dump(json_data))
for i, v in ipairs(goals) do
print("Goal: ", i)
local goal_data = json.decode(v)
print(dump(goal_data))
end
this.story:begin()
this:narration_update()
get_crash_bind(this)()
crash()
end,
event = function(this, event)