[Ace] Disposed Sprite error

Discussion in 'RGSSx Script Support' started by faultnorroie, Jul 30, 2019.

  1. faultnorroie

    faultnorroie Warper Member

    Messages:
    3
    Likes Received:
    1
    Location:
    hell lol
    First Language:
    English
    Primarily Uses:
    RMVXA
    okayy sooo, this my first thread so correct me if i did anything wrong lol but uhh

    it's just as the title says, whenever i exit the character menu to continue playing,

    clicking [CANCEL] - - -
    [​IMG]

    this error message will show
    |
    |
    V

    problem.PNG

    I will appreciate any help i can get about this error C: also i am a complete noob at scripting soo yeaH

    the other scripts i have are

    • Yanfly Message Ace - Menu Cursor
    • TSDA Advanced Message System
    • Super Simple Animated Title Screen
    • Cursor Blink Remover
    • ATS: Face Options
    • ATS: Special Message Codes
    aaand that's about it :3
     
    #1
  2. Another Fen

    Another Fen Veteran Veteran

    Messages:
    519
    Likes Received:
    234
    First Language:
    German
    Hey there,

    Could you maybe add links to where you found these scripts?
    The error only indicates that a sprite has been accessed that was no longer meant to be accessed. This could have happened if some of your scripts accessed the map screen to early when you returned to it.

    You could try to temporarily add this script to your project. It won't fix the error, but it should hopefully expand the error message to help locate the position where things went wrong:
    Code:
    
    if $TEST || $BTEST
    
    class << SceneManager
     
      alias_method(:run_ILC_ExceptionBacktrace, :run)
      def run
        begin
          run_ILC_ExceptionBacktrace
        rescue Object
          stack = $!.backtrace.map { |pos|
            match = pos.match(/^([^:]*):([^:]*)(?::(.*))?$/)
            next pos  unless match
            name = match[1][/^\{(\d+)\}$/] ? $RGSS_SCRIPTS[$1.to_i][1] : match[1]
            line = match[3] ? " (line #{match[2]})" : ""
            location = match[3] ? match[3] : match[2]
            next "  #{name}#{line} : #{location}"
          }.join("\n")
          raise $!.exception($!.message + "\n\nError occurred in:\n#{stack}")
        end
      end
    end
    
    
    class Game_Interpreter
     
      alias_method(:setup_ILC_ExceptionBacktrace, :setup)
      def setup(list, event_id = 0)
        setup_ILC_ExceptionBacktrace(list, event_id)
        @list_source = find_list_source(list, event_id)
      end
     
      def find_list_source(list, event_id)
        map = $game_map.instance_variable_get(:@map)
        map.events.each_value { |event|
          event.pages.each_with_index { |page, index|
            next  unless page.list.equal?(list)
            return "Map %03d (%s) Event %03d (%s), Page %d" % [$game_map.map_id,
                ($data_mapinfos[$game_map.map_id].name rescue "???"), event.id,
                event.name, index + 1]
          }
        }
        $data_common_events.each { |commonevent|
          next  unless commonevent && commonevent.list.equal?(list)
          return "Common Event %03d (%s)" % [commonevent.id, commonevent.name]
        }
        return "Unknown Event (ID:%d)" % [event_id]
      end
     
      alias_method(:run_ILC_ExceptionBacktrace, :run)
      def run
        begin
          run_ILC_ExceptionBacktrace
        rescue Object
          line = @list ? @list.take(@index + 1).rindex { |cmd| cmd.code < 400 } : 0
          $!.set_backtrace($!.backtrace + ["> #{@list_source}:#{line + 1}"])
          raise $!
        end
      end
    end
    
    end
     
    Last edited: Jul 31, 2019
    #2
  3. faultnorroie

    faultnorroie Warper Member

    Messages:
    3
    Likes Received:
    1
    Location:
    hell lol
    First Language:
    English
    Primarily Uses:
    RMVXA
    oh ok sure!

    i shall update further upon using the script :3

    EDIT>> so here's what i got after hitting the [CANCEL] button from the menu

    [​IMG]
     
    Last edited: Jul 31, 2019
    #3
    Another Fen likes this.
  4. KK20

    KK20 Just some XP Scripter Veteran

    Messages:
    76
    Likes Received:
    35
    Location:
    Orange County, California
    First Language:
    English
    Primarily Uses:
    RMXP
    Perhaps make this change to Yanfly Menu Cursor
    Code:
      #--------------------------------------------------------------------------
      # new method: dispose_menu_cursors
      #--------------------------------------------------------------------------
      def dispose_menu_cursors
        @menu_cursors.each { |cursor| cursor.dispose }
        @menu_cursors.clear
      end
    
     
    #4
    Another Fen likes this.

Share This Page