Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # RAFAEL_SOL_MAKER's VX GENERAL SCRIPT EVALUATOR v1.0a
- # Based on 'Detailled Call Script Error Message' by ERZVX.
- #-------------------------------------------------------------------------------
- # Description: Check all scripts generated "by the game", like the "Run Script"
- # event commmand, event move routes, or even event conditions.
- # It will act as a error handling and will provide a more detailed
- # error information, like error line, event that caused the error,
- # description, etc.
- #-------------------------------------------------------------------------------
- # How to Use: Configure in the general configuration module the use (or not!)
- # of this funcion.
- #-------------------------------------------------------------------------------
- # Special Thanks: ERZVX
- #-------------------------------------------------------------------------------
- #===============================================================================
- #===============================================================================
- # UPDATES
- #-------------------------------------------------------------------------------
- # VX GENERAL SCRIPT EVALUATOR -> v1.0a
- # * In this revision, only the 'eval' scripts with a unique argument, like the
- # ones generated "by the game" will pass in this basic error handling. Anyway,
- # it's only recommendable to use after freeing the bugs of the scripts from
- # 'Script Editor', since very few scripts yet can use the command internally.
- # * Now the line with error is shown correctly in the message, even if the ran
- # script have only one line.
- # * Some other minor things...
- #-------------------------------------------------------------------------------
- #===============================================================================
- module PowerPackVX_General_Configs
- # Check the scripts generated by the game?
- Use_Script_Evaluator = true
- end
- #===============================================================================
- class Game_Interpreter
- attr_reader :event_id
- end
- if PowerPackVX_General_Configs::Use_Script_Evaluator == true
- alias rsmaker_script_eval eval unless $@
- def eval(*args)
- n = *args.size; return rsmaker_script_eval(*args) if n > 1
- begin
- return rsmaker_script_eval(*args)
- rescue Exception
- exit if $!.class == SystemExit
- desc = $!.message.split(/['\n]/)[1].sub('`'){'\''}
- desc += "'" if $!.class == NameError
- line = $!.message.split(':')[1].to_i
- lines = *args[0].split(/\n/)
- if lines.is_a? (Array)
- errline = lines[(line - 1)]
- else
- errline = lines
- end
- print "Error during the execution of the game script!\n",
- "Please contact the creator of the game and inform the following:\n",
- "----------------------------------------------------------------------\n",
- "----------------------------------------------------------------------\n",
- "Map ID: #{$game_map.map_id}\n",
- "Event ID: #{$game_map.interpreter.event_id}\n",
- "----------------------------------------------------------------------\n",
- "----------------------------------------------------------------------\n",
- "Error type: #{$!.class}\n",
- "Description: \"#{desc}\"\n",
- "----------------------------------------------------------------------\n",
- "----------------------------------------------------------------------\n",
- "Error line number: #{line}\n",
- "Line with Error: \"#{errline}\"\n",
- "----------------------------------------------------------------------\n",
- "----------------------------------------------------------------------\n"
- end
- return nil
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement