Jump to content
PhoenixSoul

VX Ace F12 Fix: Not Fully Functional

Recommended Posts

So, I've found that if one uses the F12 Fix, and one uses the console window, the console window does not return after the scriptlet is executed. Yes, I do consider this an oversight, and was wondering how I might go about patching out the issue.

Spoiler

#==============================================================================
#   ** F12 Reset Fix
#   Version 1.1
#------------------------------------------------------------------------------
#   No credit needed. Just use it.
#==============================================================================

alias f12_reset_fix rgss_main
def rgss_main(*args, &block)
  f12_reset_fix(*args) do
    if $run_once_f12
      pid = spawn ($TEST ? 'Game.exe test' : 'Game')
      # Tell OS to ignore exit status
      Process.detach(pid)
      sleep(0.01)
      exit
    end
    $run_once_f12 = true
    # Run default rgss_main
    block.call
  end
end

 

I figure the issue lies in that the debug console window is a separate process from the game window, even if it doesn't explicitly say so. Problem is that I do not know how to remedy this, only that I can guess where to place the call to have the console window appear.

 

Share this post


Link to post
Share on other sites
Posted (edited)

For the console Window it's the option under the prgram menu. Game -> show console.

For the F12 reset issue, the best F12 fix is by Chainsawkitten. Here

#==============================================================================
# Chainsawkitten's Disable F1, Alt+Enter, F12 v1.1
#------------------------------------------------------------------------------
# Disable the use of F1, Alt+Enter and F12 by registering a hook which consumes
# keypress events as well as setting the keyboard state.
#==============================================================================
 
module CskDisable
  # Whether to disable F1. 0 = enable, 1 = disable.
  DISABLE_F1 = 0
  
  # Whether to disable F12. 0 = enable, 1 = disable.
  DISABLE_F12 = 1
  
  # Whether to disable Alt+Enter. 0 = enable, 1 = disable.
  DISABLE_ALT_ENTER = 1
end
 
Win32API.new("System/F1AltEnterF12", "hook", "III", "").call(
  CskDisable::DISABLE_F1,
  CskDisable::DISABLE_F12,
  CskDisable::DISABLE_ALT_ENTER)

F1AltEnterF12.zip

place the dll in the project folder\system

Edited by roninator2
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

That first F12 fix is filled with problems really, and personally I don't like using DLLs if I can help it. I managed to create an almost perfect f12 fix myself:

module SceneManager
  class << self
    alias run_reset_base run
  end
  
  def self.run
    begin
      run_reset_base
    rescue RGSSReset
      [Sprite, Plane, Window, Tilemap, Viewport].each { |cl|
        ObjectSpace.each_object(cl) {|obj| obj.dispose }
      }
      clear
      retry
    end
  end
  
end

Almost perfect because you can still screw up script loading by pressing F12 as the game loads. I coded a way to detect that but it's another thing.

My advice: If you do use the dll, put the script before the default scripts so to stop F12 as scripts are loaded.

Edit: Replaced script with a better one.  Oh, and put it in the usual place above main.

Edited by Kayzee
  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, roninator2 said:

For the console Window it's the option under the program menu. Game -> show console.

Yes, I know; the F12 fix I shared respawns only the game window regardless of the setting. I guess I'm not that great at English phrasing, huh?

8 hours ago, roninator2 said:

For the F12 reset issue, the best F12 fix is by Chainsawkitten.

I can see this being useful for those that use mkxp.

4 hours ago, Kayzee said:

I managed to create an almost perfect F12 fix myself...

Now, the only question is where does this one go...
(below main? above main but below other scripts?)

Share this post


Link to post
Share on other sites
23 hours ago, PhoenixSoul said:

useful for those that use mkxp.

I use this in my Ace project. Works great.

23 hours ago, PhoenixSoul said:

where does this one go...

Looks like it can go anywhere above main. Scripts never go below main because they don't run if you put them below, at least not until the game closes.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted