Much better narration/dialogue/action handling (and for lua too)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user