I know some of you wanted something to do, so here's an issue I have for you. I'm trying to get RMX-OS to work with XPAce, and I ran into an issue while rewriting the Main function. It ~looks~ correct, but there's supposedly an issue ;9
Need some help with this one. I'm in the middle of putting this into XPA, and got an interesting error. I had to modify the Main script, and I think I may have somehow messed it up. The code I'm using is:
[spoiler]
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
# After defining each class, actual processing begins here.
#==============================================================================
begin
ERROR_LOG_FILE = 'Error.log' # leave empty for no log
def mod_error(error)
# load scripts
scripts = load_data('Data/Scripts.rxdata')
bt = error.backtrace.clone
# change backtrace display to show script names
bt.each_index {|i| bt[i] = bt[i].sub(/\ASection(\d+)/) {scripts[$1.to_i][1]} + "\n"}
# new error message
message = error.message + "\n" + bt.join('')
# write to file if file defined
if ERROR_LOG_FILE != ''
File.open(ERROR_LOG_FILE, 'a') {|f| f.write("#{Time.now.to_s}:\n#{message}\n")}
end
return message
begin
rgss_main {
# loading game data
$data_actors = load_data('Data/Actors.rxdata')
$data_classes = load_data('Data/Classes.rxdata')
$data_skills = load_data('Data/Skills.rxdata')
$data_items = load_data('Data/Items.rxdata')
$data_weapons = load_data('Data/Weapons.rxdata')
$data_armors = load_data('Data/Armors.rxdata')
$data_enemies = load_data('Data/Enemies.rxdata')
$data_troops = load_data('Data/Troops.rxdata')
$data_states = load_data('Data/States.rxdata')
$data_animations = load_data('Data/Animations.rxdata')
$data_tilesets = load_data('Data/Tilesets.rxdata')
$data_common_events = load_data('Data/CommonEvents.rxdata')
$data_system = load_data('Data/System.rxdata')
# active connection scene
$scene = Scene_Servers.new
Graphics.resize_screen(640, 480)
# Prepare for transition
Graphics.freeze
$scene = Scene_Title.new
# Call main method as long as $scene is effective
$scene.main while $scene != nil
Graphics.transition(20)
# disconnection
$network.disconnect
}
rescue SyntaxError
$!.message.sub!($!.message, mod_error($!))
raise
rescue
$!.message.sub!($!.message, mod_error($!))
raise
ensure
# disconnection
$network.disconnect
end
[/spoiler]
And the error I get is:
[spoiler](https://dl.dropboxusercontent.com/u/25886192/rmxoserror.PNG)[/spoiler]
I know that there's probably a little bit more to it, so, I've zipped the current project for you to try out.
NOTE: I did in fact get RMX-OS working perfectly with a vanilla install of it. Works great, so I know it's nothing to do with server/client config issues.
Download Zip: Work In Progress (http://rmxpace.com/rmxpace/WIP-XPAce.zip)
add another end to the end
It ended up needing 2 ends added, but now those errors are gone! It now boots up and immediately exits. I assume it's something to do with not having set up anything at all yet in the game, so I doubt it's an actual issue.
But yeah, so, RMX-OS works with XPA!!! wooooo!!!
This type of issue is easily spotted by having proper indentation. Look :3
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
# After defining each class, actual processing begins here.
#==============================================================================
begin
ERROR_LOG_FILE = 'Error.log' # leave empty for no log
def mod_error(error)
# load scripts
scripts = load_data('Data/Scripts.rxdata')
bt = error.backtrace.clone
# change backtrace display to show script names
bt.each_index {|i| bt[i] = bt[i].sub(/\ASection(\d+)/) {scripts[$1.to_i][1]} + "\n"}
# new error message
message = error.message + "\n" + bt.join('')
# write to file if file defined
if ERROR_LOG_FILE != ''
File.open(ERROR_LOG_FILE, 'a') {|f| f.write("#{Time.now.to_s}:\n#{message}\n")}
end
return message
begin
rgss_main {
# loading game data
$data_actors = load_data('Data/Actors.rxdata')
$data_classes = load_data('Data/Classes.rxdata')
$data_skills = load_data('Data/Skills.rxdata')
$data_items = load_data('Data/Items.rxdata')
$data_weapons = load_data('Data/Weapons.rxdata')
$data_armors = load_data('Data/Armors.rxdata')
$data_enemies = load_data('Data/Enemies.rxdata')
$data_troops = load_data('Data/Troops.rxdata')
$data_states = load_data('Data/States.rxdata')
$data_animations = load_data('Data/Animations.rxdata')
$data_tilesets = load_data('Data/Tilesets.rxdata')
$data_common_events = load_data('Data/CommonEvents.rxdata')
$data_system = load_data('Data/System.rxdata')
# active connection scene
$scene = Scene_Servers.new
Graphics.resize_screen(640, 480)
# Prepare for transition
Graphics.freeze
$scene = Scene_Title.new
# Call main method as long as $scene is effective
$scene.main while $scene != nil
Graphics.transition(20)
# disconnection
$network.disconnect
}
rescue SyntaxError
$!.message.sub!($!.message, mod_error($!))
raise
rescue
$!.message.sub!($!.message, mod_error($!))
raise
ensure
# disconnection
$network.disconnect
end
I read for a better view seems to be good.