Gerade einfach mal getestet diverse Exceptions zu raisen und anscheinend werden die tatsächlich nicht über die Konsole ausgegeben sondern in einem neuen Fenster angezeigt.
Falls irgendetwas in deinem RGSS Code den Prozess zum Absturz bringt, könte es also sein, dass dir gar keine Exception angezeigt wird (...vielleicht? Ich habe absolut keinen Plan wovon ich rede )
Probier mal folgendes in deinen Materials Bereich zu droppen:
Code (Ruby):
#==============================================================================#​ ** Console Support for XP/VX
#------------------------------------------------------------------------------
# By Grim from <a href="http://www.biloucorp.com" target="_blank">http://www.biloucorp.com</a>
#==============================================================================
# Function :
#==============================================================================
# Console.log(text) => display text in console
# console.log(text) => display text in console
#==============================================================================
# ** Configuration
#------------------------------------------------------------------------------
# Configuration data
#==============================================================================
module Configuration
#--------------------------------------------------------------------------
# * Active Console (true=>activate console, false=>unactivate console)
# * Only for XP and VX
#--------------------------------------------------------------------------
ENABLE_CONSOLE = true
end
#==============================================================================
# ** Console
#------------------------------------------------------------------------------
# VXAce Console Handling
#==============================================================================
module Console
#--------------------------------------------------------------------------
# * Librairy
#--------------------------------------------------------------------------
AllocConsole = Win32API.new ( 'kernel32' , 'AllocConsole' , 'v' , 'l' )
FindWindowA = Win32API.new ( 'user32' , 'FindWindowA' , 'pp' , 'i' )
SetForegroundWindow = Win32API.new ( 'user32' , 'SetForegroundWindow' ,'l' ,'l' )
SetConsoleTitleA = Win32API.new ( 'kernel32' ,'SetConsoleTitleA' ,'p' ,'s' )
WriteConsoleOutput = Win32API.new ( 'kernel32' , 'WriteConsoleOutput' , 'lpllp' , 'l' )
#--------------------------------------------------------------------------
# * Singleton
#--------------------------------------------------------------------------
extend self
#--------------------------------------------------------------------------
# * Initialize
#--------------------------------------------------------------------------
def init
if ( RUBY_VERSION != '1.9.2' )
return unless ( $TEST || $DEBUG )
hwnd = FindWindowA.call ( 'RGSS Player' , 0 )
AllocConsole.call
SetForegroundWindow.call ( hwnd)
SetConsoleTitleA.call ( "RGSS Console" )
$stdout .reopen ( 'CONOUT$' )
end
end
#--------------------------------------------------------------------------
# * Log
#--------------------------------------------------------------------------
def log( * data)
return unless ( $TEST || $DEBUG )
if ( RUBY_VERSION == '1.9.2' )
p ( * data)
return
end
return unless Configuration::ENABLE_CONSOLE
puts ( * data.collect { | d| d.inspect } )
end
end
#==============================================================================
# ** Kernel
#------------------------------------------------------------------------------
# Object class methods are defined in this module.
# This ensures compatibility with top-level method redefinition.
#==============================================================================
module Kernel
#--------------------------------------------------------------------------
# * Alias for console
#--------------------------------------------------------------------------
def console; Console; end
#--------------------------------------------------------------------------
# * pretty print
#--------------------------------------------------------------------------
if ( RUBY_VERSION != '1.9.2' ) && ( $TEST || $DEBUG )
def p ( * args)
console.log ( * args)
end
end
end
#--------------------------------------------------------------------------
# * Initialize Console
#--------------------------------------------------------------------------
Console.init if Configuration::ENABLE_CONSOLE
Das fügt einen brauchbaren Logger für die Konsole hinzu.
Code (Ruby):
class Exception
alias real_init initialize
def initialize( * args)
real_init * args
console.log ( self )
end
end
Das modifiziert Ruby's Exception-Klasse so, dass jede Exception zuerst auf der Konsole ausgegeben wird, wenn sie auftritt.
Bin mir allerdings noch unsicher, inwiefern dass in diesem Fall helfen würde, da sich RGSS ja anscheinend selber wegkegelt (?).
Ansonsten eventuell alle Exceptions rescuen, loggen und dann erst raisen?