Neo-Bahamut
Member
AOT(always on top)
by Neo-Bahamut aka Wurstinator
Version: 1.1
Hi,
one of the problems with RMXP is the fact, that when the RGSS Player (the window in which your game is running) is not selected the music continues while the game stops. To prevent this, I wrote this code which disables this.
Requirements
Screenshots / Video
Screenshots would be not very useful. I uploaded a video some time ago:
http://www.youtube.com/watch?v=bqQ9klIwmLM
Script
Download
aot.exe: http://www.multiupload.com/FC9IVWLU2H
Demo project: http://www.multiupload.com/5C2ZADLAG0
Source
Since aot.exe is compiled here you can see its source code:
Bugs / Problems
Depending on the sleep time it may come to a conflict with the RMXP window which is shown when using the print/puts/p methods. You may not be able to close it with its "Ok" button so try the close button (red X).
by Neo-Bahamut aka Wurstinator
Version: 1.1
Hi,
one of the problems with RMXP is the fact, that when the RGSS Player (the window in which your game is running) is not selected the music continues while the game stops. To prevent this, I wrote this code which disables this.
Requirements
- the script above main of course
- the aot.exe in your project folder
- Windows, I think but as I only could test on XP and 7 I am not sure about this
Screenshots / Video
Screenshots would be not very useful. I uploaded a video some time ago:
http://www.youtube.com/watch?v=bqQ9klIwmLM
Script
Ruby:
# RGSS Player running always (not only when selected):
# Copy the aot.exe into your project directory and place this script into your
# script editor:
IO.popen('aot.exe 0.001')
# The number behind aot.exe represents the sleep time between a check.
# For example 0.05 means the programm will check if the RGSS Player is not on top
# every 50 milliseconds. I recommend something like 0.001
# Thanks to Skade for the idea to use IO.popen
# There may occure problems with print windows. Usually you won't be able to close
# them with pressing "ok" but the close button (red X) should work.
# Should only work on Windows, sorry :(
Download
aot.exe: http://www.multiupload.com/FC9IVWLU2H
Demo project: http://www.multiupload.com/5C2ZADLAG0
Source
Since aot.exe is compiled here you can see its source code:
Ruby:
require 'win32api'
Smallest_Float = 0.00000000000000001
Readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', 'pppplp', 'l')
Findwindow = Win32API.new('user32', 'FindWindowA', 'pp', 'l')
def get_rgss_handel(ini = ".\\Game.ini")
if !FileTest.exist?(ini)
exit
end
game_name = "\0" * 256
Readini.call('Game', 'Title', '', game_name, 255, ini)
game_name.delete!("\0")
return Findwindow.call('RGSS Player', game_name)
end
GetAct = Win32API.new('user32.dll', 'GetActiveWindow', '', 'i')
SetAct = Win32API.new('user32.dll', 'SetActiveWindow', 'i', 'i')
SetFor = Win32API.new('user32.dll', 'SetForegroundWindow', 'i', 'i')
IsWnd = Win32API.new('user32.dll', 'IsWindow', 'i', 'i')
$handel = get_rgss_handel
cores = ENV['NUMBER_OF_PROCESSORS'].to_i
sleeptime = ARGV[0].to_f
loop do
is_window = IsWnd.call($handel)
if is_window == 0
exit
end
act = GetAct.call
if act != $handel
# SetAct.call($handel)
SetFor.call($handel)
end
sleep(sleeptime)
end
Bugs / Problems
Depending on the sleep time it may come to a conflict with the RMXP window which is shown when using the print/puts/p methods. You may not be able to close it with its "Ok" button so try the close button (red X).