-
Hachem_Muche authored
Cleaned up game log message rollback to only remove use messages and messages generated by the talent action/activate/deactivate functions when a talent fails to complete (i.e. returns nil/false). This is controlled by a new flag, ActorTalents._silent_talent_failure that controls game log rollback. (Previous behavior is the default). In ToME, setting NPC._silent_talent_failure=true and Player._silent_talent_failure=false removes messages for failed NPC actions but leaves them up for failed player actions. Fixed formatting of lua error output for errors originating inside coroutines external to the useTalent function. Updated the onTalentLuaError function to provide more information (to stdout) on talent failures, and added extra calls to ensure it is invoked by talent use errors. Error info is saved to actor.talent_error (first error) and game._talent_error (first error for last actor to error out). engine.Game.tick will now save up to the last 10 lua errors (current tick only) in a table: game.errors (cycling index, retaining first-out and last-out errors) to make tracking down compound errors easier. Added the LUA_CONSOLE key-bind to the ShowErrorStack dialog (requires config.settings.cheat). Added a new logTalentMessage function to ActorTalents.lua (automatically called by useTalent unless silent) to handle basic talent use messages and overloaded this function for ToME's custom messages. (This permits useTalent to distinguish normal use messages from those generated by preUseTalent.) Added basic game log function stubs (logSeen, logPlayer) to engine.Game. (Mostly for clarity, displaying expected arguments)
Hachem_Muche authoredCleaned up game log message rollback to only remove use messages and messages generated by the talent action/activate/deactivate functions when a talent fails to complete (i.e. returns nil/false). This is controlled by a new flag, ActorTalents._silent_talent_failure that controls game log rollback. (Previous behavior is the default). In ToME, setting NPC._silent_talent_failure=true and Player._silent_talent_failure=false removes messages for failed NPC actions but leaves them up for failed player actions. Fixed formatting of lua error output for errors originating inside coroutines external to the useTalent function. Updated the onTalentLuaError function to provide more information (to stdout) on talent failures, and added extra calls to ensure it is invoked by talent use errors. Error info is saved to actor.talent_error (first error) and game._talent_error (first error for last actor to error out). engine.Game.tick will now save up to the last 10 lua errors (current tick only) in a table: game.errors (cycling index, retaining first-out and last-out errors) to make tracking down compound errors easier. Added the LUA_CONSOLE key-bind to the ShowErrorStack dialog (requires config.settings.cheat). Added a new logTalentMessage function to ActorTalents.lua (automatically called by useTalent unless silent) to handle basic talent use messages and overloaded this function for ToME's custom messages. (This permits useTalent to distinguish normal use messages from those generated by preUseTalent.) Added basic game log function stubs (logSeen, logPlayer) to engine.Game. (Mostly for clarity, displaying expected arguments)
Loading