From dbc7f4a12cf6409f309ffb701131fbf2727279ad Mon Sep 17 00:00:00 2001 From: Sokomine Date: Sat, 8 Oct 2022 23:48:20 +0200 Subject: [PATCH] improved logging of actions --- exec_actions.lua | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/exec_actions.lua b/exec_actions.lua index dd25626..4422929 100644 --- a/exec_actions.lua +++ b/exec_actions.lua @@ -212,8 +212,8 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id) tostring(this_action.a_on_failure)..".") yl_speak_up.log_change(pname, n_id, "Player failed to complete action "..tostring(a_id).. - " of "..tostring(o_id).." of "..tostring(d_id)..": ".. - tostring(this_action.a_value)..".") + " "..tostring(o_id).." "..tostring(d_id)..": ".. + yl_speak_up.show_action(this_action)) yl_speak_up.speak_to[pname].d_id = this_action.a_on_failure yl_speak_up.speak_to[pname].o_id = nil yl_speak_up.speak_to[pname].a_id = nil @@ -222,9 +222,11 @@ yl_speak_up.execute_next_action = function(player, a_id, result_of_a_id) alternate_text = this_action.alternate_text}) return else + local this_action = actions[ sorted_key_list[ nr ]] yl_speak_up.log_change(pname, n_id, "Player completed action "..tostring(a_id).. - " of "..tostring(o_id).." of "..tostring(d_id)..".") + " "..tostring(o_id).." "..tostring(d_id)..": ".. + yl_speak_up.show_action(this_action)) end end -- get the next entry @@ -404,9 +406,9 @@ yl_speak_up.action_quest_item_check = function(player) " Expected: "..tostring(a.a_value)..".") yl_speak_up.log_change(pname, n_id, "Action "..tostring(a_id).. - " of "..tostring(yl_speak_up.speak_to[pname].o_id).. - " of "..tostring(yl_speak_up.speak_to[pname].d_id).. - "failed: Player gave item \""..tostring(cmp).."\", but we wanted: \"".. + " "..tostring(yl_speak_up.speak_to[pname].o_id).. + " "..tostring(yl_speak_up.speak_to[pname].d_id).. + " failed: Player gave item \""..tostring(cmp).."\", but we wanted: \"".. tostring(a.a_value).."\".") return false end @@ -420,9 +422,9 @@ yl_speak_up.action_quest_item_check = function(player) ": Wrong quest item (wrong ID).") yl_speak_up.log_change(pname, n_id, "Action "..tostring(a_id).. - " of "..tostring(yl_speak_up.speak_to[pname].o_id).. - " of "..tostring(yl_speak_up.speak_to[pname].d_id).. - "failed: Player gave wrong quest item (wrong ID).") + " "..tostring(yl_speak_up.speak_to[pname].o_id).. + " "..tostring(yl_speak_up.speak_to[pname].d_id).. + " failed: Player gave item with wrong quest ID.") return false end -- was this quest item given to another player? @@ -433,9 +435,9 @@ yl_speak_up.action_quest_item_check = function(player) ", but "..tostring(pname).." gave it.") yl_speak_up.log_change(pname, n_id, "Action "..tostring(a_id).. - " of "..tostring(yl_speak_up.speak_to[pname].o_id).. - " of "..tostring(yl_speak_up.speak_to[pname].d_id).. - "failed: Player gave quest item that belonged to player ".. + " "..tostring(yl_speak_up.speak_to[pname].o_id).. + " "..tostring(yl_speak_up.speak_to[pname].d_id).. + " failed: Player gave quest item that belonged to player ".. tostring(meta:get_string("yl_speak_up:quest_item_for"))..".") return false end @@ -672,15 +674,15 @@ yl_speak_up.input_fs_action_text_input = function(player, formname, fields) if(not(success)) then yl_speak_up.log_change(pname, n_id, "Action "..tostring(a_id).. - " of "..tostring(yl_speak_up.speak_to[pname].o_id).. - " of "..tostring(yl_speak_up.speak_to[pname].d_id).. + " "..tostring(yl_speak_up.speak_to[pname].o_id).. + " "..tostring(yl_speak_up.speak_to[pname].d_id).. ": Player answered with \""..tostring(fields.quest_answer:trim()).. "\", but we expected: \""..tostring(a.a_value:trim()).."\".") else yl_speak_up.log_change(pname, n_id, "Action "..tostring(a_id).. - " of "..tostring(yl_speak_up.speak_to[pname].o_id).. - " of "..tostring(yl_speak_up.speak_to[pname].d_id).. + " "..tostring(yl_speak_up.speak_to[pname].o_id).. + " "..tostring(yl_speak_up.speak_to[pname].d_id).. ": Answer is correct.") end -- the action was a either a success or failure