Much better narration/dialogue/action handling (and for lua too)

This commit is contained in:
2026-01-23 02:42:29 +03:00
parent cd91174f5d
commit 1d358d206e
7 changed files with 220 additions and 28 deletions

View File

@@ -656,6 +656,29 @@ setup_handler(function(event, trigger_entity, what_entity)
end
end)
setup_action_handler("talk", {
count = 0,
activate = function(this)
this._narration("Booo!! Lua...", {"One", "Two", "Three"})
end,
event = function(this, event)
this.count = this.count + 1
if event == "narration_progress" then
this.count = this.count + 1
this._narration("Booo!!!", {})
end
if event == "narration_answered" then
this.count = this.count + 1
this._narration("Booo!!!_", {})
end
if this.count > 10 then
this._finish()
end
end,
finish = function(this)
this.count = 0
end,
})
--[[
active_dialogues = {}
setup_action_handler("talk", function(town, index, word)