RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu
  • Welcome to The RPG Maker Resource Kit.

[Solved] RMX-OS Help

Started by PhoenixFire, August 06, 2014, 04:25:50 AM

0 Members and 1 Guest are viewing this topic.

PhoenixFire

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][/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

&&&&&&&&&&&&&

add another end to the end
&&&&&&&&&&&&&&&&

PhoenixFire

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!!!

Zeriab

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

Ohjoolly

I read for a better view seems to be good.