Jump to content

Kayzee

Member
  • Content Count

    3,889
  • Joined

  • Last visited

  • Days Won

    437

Blog Comments posted by Kayzee


  1. Well actually it should be 'Same as Characters' not 'Below Characters' I said the wrong thing before. But actually I was assuming you were using Tile E graphics for the doors for some reason, othewise I have no clue why the heck giving walls priority would cause the events on them to be higher priority. I think It must be a script you added or something. Of course if the doors weren't higher priority they would be covered up by the wall, unless you had a hole in the wall for the door. In witch case why would it make the doors higher priority?


  2. What? No more rants? But I like rants! ūüė≠

     

    Anyway I wouldn't feel too bad about any stupid things you may have said. If there is one thing I have learned over the years it's that being stupid is an inescapable fact of life. Time passes and you hopefully grow, but that just means you are stupid in new ways. So personally I strive to came to terms with the fact that I am an idiot. Why bother trying to deny it? I don't mean it's not worth it to grow and better myself, but I think at some point it's worth asking if I even know what 'bettering myself' even means.

     

    I tend to think wisdom is just another type of foolishness and in foolishness there is a type of wisdom. So I offer you some of my wise foolishness and my foolish wisdom, my own special brand of madness to be excepted or rejected as thou wilt. There is a Zen Koan that goes a little something like: "If you meet Buddha on the road, kill him". I find that little saying rather interesting, don't you?

     


  3. OOOppps... I noticed I made a mistake with the debugger script. No wonder it wasn't working right! It should be:

     

    Spoiler
    
    #========================================================================
    # ** Save Debugger, by: Kayzee
    #------------------------------------------------------------------------
    # Will print messages to the console detailing any problems when saving.
    # Mostly good for finding scripts that use undumpable objects in places
    # where they shouldn't.
    #========================================================================
    
    module DataManager
      
      #--------------------------------------------------------------------------
      # * Execute Save (No Exception Processing)
      #--------------------------------------------------------------------------
      def self.save_game_without_rescue(index)
        begin
          $game_system.on_before_save
        rescue
          puts "Error with $game_system.on_before_save!"
          puts_error(e)
        end
    
        h = dump_block("header") { make_save_header }
        c = dump_block("contents") { make_save_contents }
    
        File.open(make_filename(index), "wb") do |file|
          file.write(h)
          file.write(c)
          @last_savefile_index = index
        end
        return true
      end
      
      def self.dump_block(name, &block)
        begin 
          result = block.call
        rescue Exception => e
          puts "Error creating save "+name+"!"
          puts_error(e)
          return false
        end
        
        begin
          return Marshal.dump(result)
        rescue Exception => e
          puts "Cannot dump save "+name+"!"
          result.each_pair do |key, value|
            begin 
              Marshal.dump(value)
            rescue Exception => e
              puts "Dump error detected in: " + key.to_s
              puts_error(e)
              check_object_dump(key, value)
            end
          end
          return nil
        end
      end
      
      def self.check_object_dump(key, obj, depth = 0)
        obj.instance_variables.each do |var|
          getvar = obj.instance_variable_get(var)
          begin
            Marshal.dump(getvar)
          rescue Exception => e
            puts "Dump error detected in: " + key.to_s + " " + var.to_s
            puts_error(e)
            if depth < 20
              check_object_dump(key.to_s + " " + var.to_s, getvar, depth + 1)
              if getvar.is_a?(Hash)
                getvar.each_pair do |k, v|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + k.to_s + ']', v, depth + 1)
                end
              elsif getvar.is_a?(Enumerable)
                getvar.each_with_index do |o, i|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + i.to_s + ']', o, depth + 1)
                end
              end
            end
          end
        end
      end
      
      def self.puts_error(e)
        puts "Error message: " + e.message
        return unless defined? Error_Handler
        trace = Error_Handler.do_backtrace(e)
        puts(trace)
      end
      
    end

     

     

     


  4. Leave it in... or if you rather, use my new one:

     

    Spoiler
    
    #==============================================================================
    # * Error handling functions.
    #==============================================================================
    
    module Error_Handler
      
      def self.script_names
        unless @script_names
          @script_names = load_data('Data/Scripts.rvdata2')
          @script_names.collect! {|script|  script[1]  }
        end
        @script_names
      end
      
      def self.do_backtrace(error)
        backtrace = self.parse_trace(error.backtrace)
        error_line = backtrace.first
        backtrace[0] = ''
        return error_line + ": " + error.message + " (#{error.class})" + backtrace.join("\n\tfrom ") + "\n"
      end
      
      def self.parse_trace(trace)
        out = []
        trace.each_with_index do |line,i|
          if line =~ /{(.*)}(.*)/
            out << (script_names[$1.to_i] + $2)
          elsif line.start_with?(':1:')
            break
          else
            out << line
          end
        end
        out
      end
      
      def trace_me
        begin
          raise
        rescue => exception
          puts trace = Error_Handler.do_backtrace(exception)
        end
      end
      
    end
    
    alias rgss_main_without_rescue rgss_main
    
    def rgss_main(&block)
      begin
        rgss_main_without_rescue do
          begin
            block.call
          rescue SystemExit
            exit
          rescue Exception => error
            trace = Error_Handler.do_backtrace(error)
            print(trace)
            raise(error.class, trace, [error.backtrace.first])
          end
        end
      end
    
    end

     

     

    If you use the new one remember it no longer replaces the 'Main' script and you can add it like any other script.


  5. Now that's interesting... Okay I know you use my little error backtrace replacement for 'main' (btw the other day I made a version of that that doesn't replace main and works like a normal script), so let me make a version that can call the backtrace code... Try this and see what happens!

     

    #========================================================================
    # ** Save Debugger, by: Kayzee
    #------------------------------------------------------------------------
    # Will print messages to the console detailing any problems when saving.
    # Mostly good for finding scripts that use undumpable objects in places
    # where they shouldn't.
    #========================================================================
    
    module DataManager
      
      #--------------------------------------------------------------------------
      # * Execute Save (No Exception Processing)
      #--------------------------------------------------------------------------
      def self.save_game_without_rescue(index)
        begin
          $game_system.on_before_save
        rescue
          puts "Error with $game_system.on_before_save!"
          puts_error(e)
        end
    
        h = dump_block("header") { make_save_header }
        c = dump_block("contents") { make_save_contents }
    
        File.open(make_filename(index), "wb") do |file|
          file.write(h)
          file.write(c)
          @last_savefile_index = index
        end
        return true
      end
      
      def self.dump_block(name, &block)
        begin 
          result = block.call
        rescue Exception => e
          puts "Error creating save "+name+"!"
          puts_error(e)
          return false
        end
        
        begin
          return Marshal.dump(result)
        rescue Exception => e
          puts "Cannot dump save "+name+"!"
          result.each_pair do |key, value|
            begin 
              Marshal.dump(value)
            rescue Exception => e
              puts "Dump error detected in: " + key.to_s
              puts_error(e)
              check_object_dump(key, value)
            end
          end
          return nil
        end
      end
      
      def self.check_object_dump(key, obj, depth = 0)
        obj.instance_variables.each do |var|
          getvar = obj.instance_variable_get(var)
          begin
            Marshal.dump(getvar)
          rescue Exception => e
            puts "Dump error detected in: " + key.to_s + " " + var.to_s
            puts_error(e)
            if depth < 20
              check_object_dump(key.to_s + " " + var.to_s, getvar, depth + 1)
              if getvar.is_a?(Hash)
                getvar.each_pair do |k, v|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + k.to_s + ']', v, depth + 1)
                end
              elsif getvar.is_a?(Enumerable)
                getvar.each_with_index do |o, i|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + i.to_s + ']', o, depth + 1)
                end
              end
            end
          end
        end
      end
      
      def puts_error(e)
        puts "Error message: " + e.message
        return unless defined? Error_Handler
        trace = Error_Handler.do_backtrace(e)
        puts(trace)
      end
      
    end

     


  6. Also: I just made a new version of the save debugger that should catch more problems. So try this out if the old one still reports nothing:

     

    Spoiler
    
    #========================================================================
    # ** Save Debugger, by: Kayzee
    #------------------------------------------------------------------------
    # Will print messages to the console detailing any problems when saving.
    # Mostly good for finding scripts that use undumpable objects in places
    # where they shouldn't.
    #========================================================================
    
    module DataManager
      
      #--------------------------------------------------------------------------
      # * Execute Save (No Exception Processing)
      #--------------------------------------------------------------------------
      def self.save_game_without_rescue(index)
        begin
          $game_system.on_before_save
        rescue
          puts "Error with $game_system.on_before_save!"
          puts "Error message: " + e.message
        end
    
        h = dump_block("header") { make_save_header }
        c = dump_block("contents") { make_save_contents }
    
        File.open(make_filename(index), "wb") do |file|
          file.write(h)
          file.write(c)
          @last_savefile_index = index
        end
        return true
      end
      
      def self.dump_block(name, &block)
        begin 
          result = block.call
        rescue Exception => e
          puts "Error creating save "+name+"!"
          puts "Error message: " + e.message
          return false
        end
        
        begin
          return Marshal.dump(result)
        rescue Exception => e
          puts "Cannot dump save "+name+"!"
          result.each_pair do |key, value|
            begin 
              Marshal.dump(value)
            rescue Exception => e
              puts "Dump error detected in: " + key.to_s
              puts "Error message: " + e.message
              check_object_dump(key, value)
            end
          end
          return nil
        end
      end
      
      def self.check_object_dump(key, obj, depth = 0)
        obj.instance_variables.each do |var|
          getvar = obj.instance_variable_get(var)
          begin
            Marshal.dump(getvar)
          rescue Exception => e
            puts "Dump error detected in: " + key.to_s + " " + var.to_s
            puts "Error message: " + e.message
            if depth < 20
              check_object_dump(key.to_s + " " + var.to_s, getvar, depth + 1)
              if getvar.is_a?(Hash)
                getvar.each_pair do |k, v|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + k.to_s + ']', v, depth + 1)
                end
              elsif getvar.is_a?(Enumerable)
                getvar.each_with_index do |o, i|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + i.to_s + ']', o, depth + 1)
                end
              end
            end
          end
        end
      end
      
    end
    
    

     

     

     


  7. When saving no longer woks it's usually because there is some script is using an unsavable object somewhere it shouldn't be. A classic example is khas awesome light effects will refuse to save while the light effects are being used (though I can't remember if it clears stuff properly when switching scenes, and if so it's usually not a problem because most games switch to the menu scene first. Autosave scripts and such still refuse to save though).

     

    I made a script just for debugging problems with saving the game:

     

    Spoiler
    
    #========================================================================
    # ** Save Debugger, by: Kayzee
    #------------------------------------------------------------------------
    # Will print messages to the console detailing any problems when saving.
    # Mostly good for finding scripts that use undumpable objects in places
    # where they shouldn't.
    #========================================================================
    
    module DataManager
      
      #--------------------------------------------------------------------------
      # * Execute Save (No Exception Processing)
      #--------------------------------------------------------------------------
      def self.save_game_without_rescue(index)
        $game_system.on_before_save
        c = make_save_contents
        c.each_pair do |key, value|
          begin 
            Marshal.dump(value)
          rescue Exception => e
            puts "Save game has encountered errors:"
            puts "Dump error detected in: " + key.to_s
            puts "Error message: " + e.message
            check_object_dump(key, value)
            return false
          end
        end
        File.open(make_filename(index), "wb") do |file|
          Marshal.dump(make_save_header, file)
          Marshal.dump(c, file)
          @last_savefile_index = index
        end
        return true
      end
      
      def self.check_object_dump(key, obj, depth = 0)
        obj.instance_variables.each do |var|
          getvar = obj.instance_variable_get(var)
          begin
            Marshal.dump(getvar)
          rescue Exception => e
            puts "Dump error detected in: " + key.to_s + " " + var.to_s
            puts "Error message: " + e.message
            if depth < 20
              check_object_dump(key.to_s + " " + var.to_s, getvar, depth + 1)
              if getvar.is_a?(Hash)
                getvar.each_pair do |k, v|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + k.to_s + ']', v, depth + 1)
                end
              elsif getvar.is_a?(Enumerable)
                getvar.each_with_index do |o, i|
                  check_object_dump(key.to_s + " " + var.to_s + '[' + i.to_s + ']', o, depth + 1)
                end
              end
            end
            #puts "Error object dump: " + getvar.inspect
          end
        end
      end
      
    end

     

     

    Make sure the console is tuned on and try to save in game and the script should find the problem and print details to the console.

     

     


  8. People just inexplicably going missing and seeming to vanish into nothing is, believe it or not, actually kinda normal. You would think in today's always connected world that would be nearly impossible. Not so. It's quite easy in fact. Sometimes you can go for a walk for example without telling anyone where you are and leave your phone off or at home. You might just walk for hours and hours on backroads or following trails and might wind up in another country if that part of the border isn't secured very well. You could even do this in the middle of the day and be seen by lots of people and chances are most of them will just not remember you.

     

    Sometimes people get up one day and just... leave. Sometimes they committed a crime they are running from, sometimes they just feel like they need a new life, some times they never meant to be away that long but one thing lead to another and they are gone for years. And sometimes they never left at all you just hadn't happened to have seen them. These things happen. For all that people like to keep track of other people, sometimes they slip through the cracks. Maybe they could have been found if someone put in a little more effort, but people tend to be lazy if they can help it. Sometimes they suddenly show up years later without an offered explanation. Sometimes people don't even bother to ask.
     

    And who knows, perhaps every once and a while someone might be walking through the woods or a park they think they know well and hear giggling in the trees. Maybe they ignore it and continue on, maybe they get scared and get out of there and later convince themselves they imagined it. But maybe, just maybe, they get a little too curious and hear the giggle again deeper in the woods. And well, people like that if they get seen again don't tend to be seen for a long time and often have been marked by the experience, for better or for worst.

     

    Not only that, but as PS implies, people's memories can be unreliable. A false memory is easy to implant with the right story... Perhaps it might be not too much harder to tell someone a story that they start to believe over their own memories. If someone is skilled enough, perhaps they could mold a susceptible person's while memory to their whim. Post people might not even say anything about it if they start remembering something different or if they do they don't push it for fear that one of them might be crazy. Well of course they are! They both have the delusion that the world has to be an ordered rational place where things always make sense.

     

    It's okay though all you poor foolish souls... I am here to try and free you all from the terrible shackles you call 'sanity'! <3

×