Debugging VX scripts? RGSS2 console?

● ARCHIVED · READ-ONLY
Started by Tsukihime 5 posts View original ↗
  1. How do people usually debug VX scripts?

    Was writing an add-on for VX, got tired of lack of console after the first test-run.

    Is there a script that attaches a console to VX game.exe and directs all print statements there instead of to a msgbox?
  2. In XP when I was doing stuff that required a lot of debugging and I got tired of the message box, I'd just open a file into a global variable, and print stuff to it as I played. Not as nice as the console in Ace, but better than message boxes, especially when you managed to get into some kind of loop!

    oh - lately I've implemented a hud, and I have some temporary text that always shows. I now put into that whatever I want to monitor, and I can see it change as things happen. That's also good if I just have a couple of things I want to monitor - the game screen itself becomes the console.
  3. Very, very simple...



    Code:
    if $TEST
      Win32API.new('kernel32.dll', 'AllocConsole', '', '').call
      Win32API.new('kernel32.dll', 'SetConsoleTitle', 'P', '').call('RGSS2 Console')
      $stdout.reopen('CONOUT$')
      def debug(*args)
        puts args.collect {|a| a.to_s }.join
      end
      def debug_p(*args)
        puts *args.collect {|a| a.inspect }
      end
    else
      def debug(*args);end
      def debug_p(*args);end
    end
    
    debug(1, "\n", 2)
    debug_p(1, "\n", 2)
    Just realloc the console and reopen the STDOUT.
  4. I already saw some systems to help the user to debug the code. Msgbox is horrible, and don't help so much.

    But there are some scripts that created the option to write some code and receive results. I think it was made by originalwij or yanfly, well, I don't remember. If I find this I'll post here.

    Consoles are such great options, they're great, but my personal favourite is the old "log.txt"