Viktors Fog&Overlay with 640x480 resolution not working?

Fullscreen++ with Viktors fog&overlay prevents the overlays from becoming visible. They are still created however. As soon as I call:

Graphics.resize_screen(640,480)Viktors overlay no longer works. If I out-comment the above line then viktors fog&overlay works again. The resize_screen() is only called when the game is launched (before any map is created) and it is placed ABOVE all of viktors scripts.

Fullscreen++ script

http://forums.rpgmakerweb.com/index.php?/topic/14081-fullscreen/

Spoiler
# Fullscreen++ v2.0 for VX and VXace by Zeus81# Free for non commercial and commercial use# Licence : http://creativecommons.org/licenses/by-sa/3.0/# Contact : [email hidden]# (fr) Manuel d'utilisation : http://pastebin.com/1TQfMnVJ# (en) User Guide : http://pastebin.com/EgnWt9ur class << Graphics Disable_VX_Fullscreen = false CreateWindowEx = Win32API.new('user32' , 'CreateWindowEx' , 'ippiiiiiiiii', 'i') GetClientRect = Win32API.new('user32' , 'GetClientRect' , 'ip' , 'i') GetDC = Win32API.new('user32' , 'GetDC' , 'i' , 'i') GetSystemMetrics = Win32API.new('user32' , 'GetSystemMetrics' , 'i' , 'i') GetWindowRect = Win32API.new('user32' , 'GetWindowRect' , 'ip' , 'i') FillRect = Win32API.new('user32' , 'FillRect' , 'ipi' , 'i') FindWindow = Win32API.new('user32' , 'FindWindow' , 'pp' , 'i') ReleaseDC = Win32API.new('user32' , 'ReleaseDC' , 'ii' , 'i') SendInput = Win32API.new('user32' , 'SendInput' , 'ipi' , 'i') SetWindowLong = Win32API.new('user32' , 'SetWindowLong' , 'iii' , 'i') SetWindowPos = Win32API.new('user32' , 'SetWindowPos' , 'iiiiiii' , 'i') ShowWindow = Win32API.new('user32' , 'ShowWindow' , 'ii' , 'i') SystemParametersInfo = Win32API.new('user32' , 'SystemParametersInfo' , 'iipi' , 'i') UpdateWindow = Win32API.new('user32' , 'UpdateWindow' , 'i' , 'i') GetPrivateProfileString = Win32API.new('kernel32', 'GetPrivateProfileString' , 'ppppip' , 'i') WritePrivateProfileString = Win32API.new('kernel32', 'WritePrivateProfileString', 'pppp' , 'i') CreateSolidBrush = Win32API.new('gdi32' , 'CreateSolidBrush' , 'i' , 'i') DeleteObject = Win32API.new('gdi32' , 'DeleteObject' , 'i' , 'i') unless method_defined?🙂zeus81_fullscreen_update) HWND = FindWindow.call('RGSS Player', 0) BackHWND = CreateWindowEx.call(0x08000008, 'Static', '', 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0) alias zeus_fullscreen_resize_screen resize_screen alias zeus_fullscreen_update update end def initialize_fullscreen load_fullscreen_settings if Disable_VX_Fullscreen then toggle_vx_fullscreen else @fullscreen = false end if vx_fullscreen? fullscreen? ? fullscreen_mode : windowed_mode endprivate def initialize_rects @borders_size ||= borders_size @fullscreen_rect ||= fullscreen_rect @workarea_rect ||= workarea_rect end def load_fullscreen_settings buffer = [].pack('x256') section = 'Fullscreen++' filename = './Game.ini' get_option = Proc.new do |key, default_value| l = GetPrivateProfileString.call(section, key, default_value, buffer, buffer.size, filename) buffer[0, l] end @fullscreen = get_option.call('Fullscreen', '0') == '1' @fullscreen_ratio = get_option.call('FullscreenRatio', '0').to_i @windowed_ratio = get_option.call('WindowedRatio', '1').to_i end def save_fullscreen_settings section = 'Fullscreen++' filename = './Game.ini' set_option = Proc.new do |key, value| WritePrivateProfileString.call(section, key, value.to_s, filename) end set_option.call('Fullscreen' , @fullscreen ? 1 : 0) set_option.call('FullscreenRatio', @fullscreen_ratio) set_option.call('WindowedRatio' , @windowed_ratio) end def borders_size GetWindowRect.call(HWND, wrect = [0, 0, 0, 0].pack('l4')) GetClientRect.call(HWND, crect = [0, 0, 0, 0].pack('l4')) wrect, crect = wrect.unpack('l4'), crect.unpack('l4') Rect.new(0, 0, wrect[2]-wrect[0]-crect[2], wrect[3]-wrect[1]-crect[3]) end def fullscreen_rect Rect.new(0, 0, GetSystemMetrics.call(0), GetSystemMetrics.call(1)) end def workarea_rect SystemParametersInfo.call(0x30, 0, rect = [0, 0, 0, 0].pack('l4'), 0) rect = rect.unpack('l4') Rect.new(rect[0], rect[1], rect[2]-rect[0], rect[3]-rect[1]) end def hide_borders() SetWindowLong.call(HWND, -16, 0x14000000) end def show_borders() SetWindowLong.call(HWND, -16, 0x14CA0000) end def hide_back() ShowWindow.call(BackHWND, 0) end def show_back ShowWindow.call(BackHWND, 3) UpdateWindow.call(BackHWND) dc = GetDC.call(BackHWND) rect = [0, 0, @fullscreen_rect.width, @fullscreen_rect.height].pack('l4') brush = CreateSolidBrush.call(0) FillRect.call(dc, rect, brush) ReleaseDC.call(BackHWND, dc) DeleteObject.call(brush) end def resize_window(w, h) screen = @fullscreen ? @fullscreen_rect : @workarea_rect x, y = screen.x+(screen.width-w)/2, screen.y+(screen.height-h)/2 SetWindowPos.call(HWND, @fullscreen ? -1 : -2, x, y, w, h, 0) end def vx_fullscreen? screen = fullscreen_rect screen.width == 640 and screen.height == 480 end def toggle_vx_fullscreen inputs = [1,18,0, 1,13,0, 1,13,2, 1,18,2].pack('LSx2Lx16'*4) SendInput.call(4, inputs, 28) zeus_fullscreen_update end def release_alt inputs = [1,18,2].pack('LSx2Lx16') SendInput.call(1, inputs, 28) endpublic def fullscreen?() @fullscreen or vx_fullscreen? end def toggle_fullscreen() fullscreen? ? windowed_mode : fullscreen_mode end def fullscreen_mode return if vx_fullscreen? initialize_rects @fullscreen = true if @fullscreen_ratio == 0 w_max, h_max = @fullscreen_rect.width, @fullscreen_rect.height w, h = w_max, w_max * height / width h, w = h_max, h_max * width / height if h > h_max else w, h = width * @fullscreen_ratio, height * @fullscreen_ratio end show_back hide_borders resize_window(w, h) save_fullscreen_settings end def windowed_mode toggle_vx_fullscreen if vx_fullscreen? initialize_rects @fullscreen = false if @windowed_ratio == 0 w_max = @workarea_rect.width - @borders_size.width h_max = @workarea_rect.height - @borders_size.height w, h = w_max, w_max * height / width h, w = h_max, h_max * width / height if h > h_max else w, h = width * @windowed_ratio, height * @windowed_ratio end hide_back show_borders resize_window(w + @borders_size.width, h + @borders_size.height) save_fullscreen_settings end def toggle_ratio return if vx_fullscreen? initialize_rects if @fullscreen @fullscreen_ratio += 1 @fullscreen_ratio = 0 if width * @fullscreen_ratio > @fullscreen_rect.width or height * @fullscreen_ratio > @fullscreen_rect.height fullscreen_mode else @windowed_ratio += 1 @windowed_ratio = 0 if width * @windowed_ratio > @workarea_rect.width or height * @windowed_ratio > @workarea_rect.height windowed_mode end end def update release_alt if Disable_VX_Fullscreen and Input.trigger?(Input::ALT) zeus_fullscreen_update toggle_fullscreen if Input.trigger?(Input::F5) toggle_ratio if Input.trigger?(Input::F6) end def resize_screen(width, height) zeus_fullscreen_resize_screen(width, height) fullscreen? ? fullscreen_mode : windowed_mode endendGraphics.initialize_fullscreen
Fog & Overlay:

http://victorscripts.wordpress.com/rpg-maker-vx-ace/field-scripts/fog-and-overlay/

map notetag:

<fog effect>id: 2name: "Fog01"opacity: 255</fog effect>Viktors fog*overlay does not use, overwrite or alias any methods that the resolution script uses. It also uses no hard-coded "544" values. So I'm kinda puzzled here why they are not compatible...
Tested both scripts and they working fine in both resolutions.

 Maybe another script is interfering with them?
Ugh... Impossible... I accidentally copied the "unlimited resolution" script into the test project as well... You're right thanks. Sorry for wasting your time. (I spend like a whole day on this trying to figure out where the problem was..)

Spoiler
if !$imported || ($imported[:nap_script_boss] && Script_Boss.script_enabled?🙂unlimited_resolution))$imported ||= {}$imported[:unlimited_resolution] = 1.00=begin#=============================================================================== Title: Unlimited Resolution Date: Oct 24, 2013-------------------------------------------------------------------------------- ** Change log Oct 24, 2013 - Initial release-------------------------------------------------------------------------------- ** Terms of Use * Free-------------------------------------------------------------------------------- ** Description This script modifies Graphics.resize_screen to overcome the 640x480 limitation. It also includes some code to properly display maps that are smaller than the screen size. Now you can have arbitrarily large game resolutions. -------------------------------------------------------------------------------- ** Installation You should place this script above all custom scripts -------------------------------------------------------------------------------- ** Usage As usual, simply resize your screen using the script call Graphics.resize_screen(width, height)-------------------------------------------------------------------------------- ** Credits Unknown author for overcoming the 640x480 limitation Lantier, from RMW forums for posting the snippet above Esrever for handling the viewport#================================================================================end$imported = {} if $imported.nil?$imported["TH_UnlimitedResolution"] = true#===============================================================================# ** Configuration#===============================================================================module Graphics class << self alias :th_large_screen_resize_screen :resize_screen end #----------------------------------------------------------------------------- # Unknown Scripter. Copied from http://pastebin.com/sM2MNJZj #----------------------------------------------------------------------------- def self.resize_screen(width, height) wt, ht = width.divmod(32), height.divmod(32) #wt.last + ht.last == 0 || fail('Incorrect width or height') wh = -> w, h, off = 0 { [w + off, h + off].pack('l2').scan /.{4}/ } w, h = wh.(width, height) ww, hh = wh.(width, height, 32) www, hhh = wh.(wt.first.succ, ht.first.succ) base = 0x10000000 # fixed? mod = -> adr, val { DL::CPtr.new(base + adr)[0, val.size] = val } mod.(0x195F, "\x90" * 5) # ??? mod.(0x19A4, h) mod.(0x19A9, w) mod.(0x1A56, h) mod.(0x1A5B, w) mod.(0x20F6, w) mod.(0x20FF, w) mod.(0x2106, h) mod.(0x210F, h) # speed up y? #mod.(0x1C5E3, h) #mod.(0x1C5E8, w) zero = [0].pack ?l mod.(0x1C5E3, zero) mod.(0x1C5E8, zero) mod.(0x1F477, h) mod.(0x1F47C, w) mod.(0x211FF, hh) mod.(0x21204, ww) mod.(0x21D7D, hhh[0]) mod.(0x21E01, www[0]) mod.(0x10DEA8, h) mod.(0x10DEAD, w) mod.(0x10DEDF, h) mod.(0x10DEF0, w) mod.(0x10DF14, h) mod.(0x10DF18, w) mod.(0x10DF48, h) mod.(0x10DF4C, w) mod.(0x10E6A7, w) mod.(0x10E6C3, h) mod.(0x10EEA9, w) mod.(0x10EEB9, h) th_large_screen_resize_screen(width, height) endend#===============================================================================# Esrever's code from# http://www.rpgmakervxace.net/topic/100-any-chance-of-higher-resolution-or-larger-sprite-support/page-2#entry7997#===============================================================================class Game_Map #-------------------------------------------------------------------------- # overwrite method: scroll_down #-------------------------------------------------------------------------- def scroll_down(distance) if loop_vertical? @display_y += distance @display_y %= @map.height * 256 @parallax_y += distance else last_y = @display_y dh = Graphics.height > height * 32 ? height : screen_tile_y @display_y = [@display_y + distance, height - dh].min @parallax_y += @display_y - last_y end end #-------------------------------------------------------------------------- # overwrite method: scroll_right #-------------------------------------------------------------------------- def scroll_right(distance) if loop_horizontal? @display_x += distance @display_x %= @map.width * 256 @parallax_x += distance else last_x = @display_x dw = Graphics.width > width * 32 ? width : screen_tile_x @display_x = [@display_x + distance, width - dw].min @parallax_x += @display_x - last_x end endend # Game_Map#==============================================================================# ■ Spriteset_Map#==============================================================================class Spriteset_Map #-------------------------------------------------------------------------- # overwrite method: create_viewports #-------------------------------------------------------------------------- def create_viewports if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal? dx = (Graphics.width - $game_map.width * 32) / 2 else dx = 0 end dw = [Graphics.width, $game_map.width * 32].min dw = Graphics.width if $game_map.loop_horizontal? if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical? dy = (Graphics.height - $game_map.height * 32) / 2 else dy = 0 end dh = [Graphics.height, $game_map.height * 32].min dh = Graphics.height if $game_map.loop_vertical? @viewport1 = Viewport.new(dx, dy, dw, dh) @viewport2 = Viewport.new(dx, dy, dw, dh) @viewport3 = Viewport.new(dx, dy, dw, dh) @viewport2.z = 50 @viewport3.z = 100 end #-------------------------------------------------------------------------- # new method: update_viewport_sizes #-------------------------------------------------------------------------- def update_viewport_sizes if Graphics.width > $game_map.width * 32 && !$game_map.loop_horizontal? dx = (Graphics.width - $game_map.width * 32) / 2 else dx = 0 end dw = [Graphics.width, $game_map.width * 32].min dw = Graphics.width if $game_map.loop_horizontal? if Graphics.height > $game_map.height * 32 && !$game_map.loop_vertical? dy = (Graphics.height - $game_map.height * 32) / 2 else dy = 0 end dh = [Graphics.height, $game_map.height * 32].min dh = Graphics.height if $game_map.loop_vertical? rect = Rect.new(dx, dy, dw, dh) for viewport in [@viewport1, @viewport2, @viewport3] viewport.rect = rect end endend # Spriteset_Map#==============================================================================# ■ Scene_Map#==============================================================================class Scene_Map < Scene_Base #-------------------------------------------------------------------------- # alias method: post_transfer #-------------------------------------------------------------------------- alias scene_map_post_transfer_ace post_transfer def post_transfer @spriteset.update_viewport_sizes scene_map_post_transfer_ace endend # Scene_Mapend # Script Boss
Ah damn... I only used that script for the picture gallery (viewing pictures in 640 is kinda low..). But that script is unstable anyway. I'm gonna delete that "unlimited resolution script" because it's just way too buggy and now compatibility issues as well...
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/viktors-fog-overlay-with-640x480-resolution-not-working.21202/