My fplaunch script currently has 3 workaround sections:
1) VP9.08 tables - these tables run best in vp9.08. I created this originally when 9.10 came out with the labels bug. Still use it for scarred stiff which shows no flippers on vp 9.1.1
2) Sound mod tables - in these, I adjust the system sound volume before launching the vp executable so that all tables are the same volume and I'm not reaching for a vol knob
3) HD Render off tables - I use this for bally gameshow which stutters a bit with HD render option checked.
You could use these patterns and create other exceptions though.
First, a quick disclaimer. I really don't know anything about autohotkey scripting. I struggle with simple things still and everytime I make a change, I have to read the autohotkey docs. Therefore, there may be more efficient ways of doing these things. If you know them already, you probably don't need this topic anyways
For anyone that doesn't understand FPLaunch or doesn't care how this works and just wants to add this functionality, you can skip the rest of this and just rename your existing fplaunch.exe and fplaunch.ahk, download the included zip file, extract it to your Hyperpin directory, and read the readme.txt for how it works. I have already set up all the tables I believed were too loud on my set up and disabled HDRender only on The Bally Game Show, which stutters for me with the new ramps.
The file is too big to upload so here it is at my server: http://thebigboss.or...ss_fplaunch.zip
----------------------------------------------------------
Details for anyone that wants them:
The general approach I took was that I added the ability to insert a text file for each ability you want modified on a table-by-table basis in the HyperPin/Databases/Visual Pinball directory. The files I created are:
1) hdrenderofftables.txt. In this file, you just list each table name (minus the .vpt) that you wish to render without HD.
2) soundmodtables.txt - In this file, you just list the table name one one line. On the next line, the number of "clicks" to reduce volume. On my system, 1 unit equals 2% volume reduction. So 30% volume reduction is a value of 15. So in this file you list the table name followed by the vol reduction x 2%.
3) vp908tables.txt - This file just lists each table that you want run in vp9.08 instead of the latest visual pinball. The VPinball908.exe file must be present next to VPinball.exe for this to work. You could also modify this to be vp8 tables with a VPinball8.exe file.
Then when you launch this table from hyperpin, the visual pinball registry key will be updated disabling this feature, the table run, when you exit out the hdrender registry key will be restored so that the next table does render in HD. Here is the added fplaunch.ahk code:
At the top of the PFLaunch.ahk file add:
systemName = %1%
tableName = %2%
extraVPConfigDir = %A_ScriptDir%\Databases\Visual Pinball
picDir = %A_ScriptDir%\Media\HyperPin\Images\
loadingSpashVP = %picDir%\loadingsplashVP.png
loadingSpashFP = %picDir%\loadingsplashFP.png
Inside the virtual pinball run loop change it to:
else if (systemName = "Visual Pinball" && (executable = "VPinball.exe"))
{
Hotkey, $%exitEmulatorKey%, CloseVP
; Array examples: http://www.autohotke...misc/Arrays.htm
; Read config file for vp9.08 tables
vp908count = 0
; This loop retrieves each line from the file, one at a time.
Loop, Read, %extraVPConfigDir%\vp908tables.txt
{
vp908count += 1 ; Keep track of how many items are in the array.
vp908array%vp908count% := A_LoopReadLine ; Store this line in the next array element.
}
; Check if table is in the vp908tables array.
Loop %vp908count%
{
; The following line uses the := operator to retrieve an array element:
element := vp908array%A_Index% ; A_Index is a built-in variable.
if(tableName = element)
{
executable = VPinball908.exe
break
}
}
; Read config file for disable HD rendering tables since this is a global setting now.
HDRenderOffCount = 0
HDRenderOffChanged = 0
; This loop retrieves each line from the file, 1 at a time.
Loop, Read, %extraVPConfigDir%\hdrenderofftables.txt
{
HDRenderOffCount += 1 ; Keep track of how many items are in the array.
HDRenderOffArray%HDRenderOffCount% := A_LoopReadLine ; Store this line in the next array element.
}
; Check if table is in the no hdrender array and write the VP hardwarerender key to off.
Loop %HDRenderOffCount%
{
; The following line uses the := operator to retrieve an array element:
element := HDRenderOffArray%A_Index% ; A_Index is a built-in variable.
if(tableName = element)
{
HDRenderOffChanged = 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Visual Pinball\Player, HardwareRender, 0
break
}
}
; Read config for sound volume hard codes
SoundModCount = 0
SoundChangeAmount = 0
Loop, Read, %extraVPConfigDir%\soundmodtables.txt
{
SoundModCount += 1
SoundModCountArray%SoundModCount% := A_LoopReadLine
}
; Check if table is in the vp908tables array.
Loop %SoundModCount%
{
; The following line uses the := operator to retrieve an array element:
TableIndex = %A_Index%
SoundIndex = %TableIndex%
SoundIndex += 1
TheTable := SoundModCountArray%TableIndex%
TheSoundAmount := SoundModCountArray%SoundIndex%
if(tableName = TheTable)
{
; Set the new sound change amount. Should be a + or - number otherwise it needs a , SoundSet, absoluteamt
; SoundSet: http://www.autohotke...ds/SoundSet.htm
; SoundGet: http://www.autohotke...ds/SoundGet.htm
; For XP you could set absolute sound vol with something like: SoundSet, %TheSoundAmount%
Send {Volume_Down %TheSoundAmount%}
break
}
}
Run, "%emuPath%\%executable%" /play -"%tablePath%%tableName%.vpt",,UseErrorLevel
WinWait, ahk_class VPinball
WinHide, ahk_class VPinball
WinWait, ahk_Class VPPlayer
Gui, destroy
if(executable = "VPinball908.exe")
{
Process, WaitClose, VPinball908.exe
}
else
{
Process, WaitClose, VPinball.exe
}
if(%HDRenderOffChanged% != 0)
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Visual Pinball\Player, HardwareRender, 1
}
}
; This part was here like before
Run, "%emuPath%\VPinball.exe" /play -"%tablePath%%tableName%.vpt",,UseErrorLevel
WinWait, ahk_class VPinball
WinHide, ahk_class VPinball
WinWait, ahk_Class VPPlayer
Gui, destroy
Process, WaitClose, VPinball.exe
; Add this to the end of the code block to reenable hardware render option for next table load
if(%HDRenderOffChanged% != 0)
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Visual Pinball\Player, HardwareRender, 1
}
}
To restore the system volume level to what it was on exit, find the CloseVP: and change it to this:
CloseVP:
Hotkey, %exitScriptKey%, Off
; Restore master volume original value.
if(TheSoundAmount > 0)
{
Send {Volume_Up %TheSoundAmount%}
}
Ok for those of you that want this but really dont want to have to crack open your fplaunch.ahk or that dont understand what I'm doing above, I am attaching my fplaunch.ahk, my text files from my database directory, and my images. The other thing about my fplaunch.ahk is that it shows some images while loading vp or fp rather than a black screen. You can replace these images, change them, or replace them with images of all black if you would rather have the black screen. Sorry, but I have no other way to give you my predone file other than to also include these changes since at least this has been tested.
To use this you will also need to download vp9.08 raw executable and name it VPinball908.exe and put it into the same directory with your existing visual pinball executable. That, or just make sure vp908tables.txt is empty. (My guess is it should exist but be empty. If it doesn't exist you may also get an error in fplaunch).
Now, let's say you wanted to add a section for VP8 tables. You could copy this block of code that runs vp9.08 tables and modify it slightly. Something like this:
; Array examples: http://www.autohotke...misc/Arrays.htm
; Read config file for vp8 tables
vp8count = 0
; This loop retrieves each line from the file, one at a time.
Loop, Read, %extraVPConfigDir%\vp8tables.txt
{
vp8count += 1 ; Keep track of how many items are in the array.
vp8array%vp8count% := A_LoopReadLine ; Store this line in the next array element.
}
; Check if table is in the vp908tables array.
Loop %vp8count%
{
; The following line uses the := operator to retrieve an array element:
element := vp8array%A_Index% ; A_Index is a built-in variable.
if(tableName = element)
{
executable = VPinball8.exe
break
}
}
Then modify the exit section:
if(executable = "VPinball908.exe")
{
Process, WaitClose, VPinball908.exe
}
else if(executable = "VPinball8.exe")
{
Process, WaitClose, VPinball8.exe
}
else
{
Process, WaitClose, VPinball.exe
}
Note: Im sure the exit section could be fixed to use a variable so you dont have a big if-else, but I had some issues doing that and never finished debugging them. It looks a bit sloppy this way but works.
If there are other global settings you need to modify on a table-by-table basis and aren't sure how to do it, let me know by responding to this thread and I may have some suggestions. Also, I don't see why you couldnt run spanned vs rotated tables using this type of method and a command line tool to rotate the monitor.




Top
















are all trademarks of VPFORUMS.