Fixing Broken Tables - dekay/vpinball-wiki GitHub Wiki
Note
By "Broken", we mean those tables that don't run properly in VPX Standalone. Chances are high that they run just fine in the Windows version.
Visual Pinball tables uses VBScript as the scripting engine for its tables. VPX Standalone leverages the VBScript engine from Wine as VBScript is not natively available for operating systems other than windows. The Wine developers have done a tremendous job on their VBScript interpreter but bugs remain. Bugs are opened against Wine as they are discovered and good progress is being made in knocking them down. For those bugs that do remain open, there is usually a workaround available that gets a problem table working under Standalone.
Note
There are reasons besides VBScript bugs for why a table might not run properly in VPX Standalone. Another reason is PuP Pack support, which is only partially implemented at time of writing. Those issues usually require further software development to get working. Patience is a virtue.
Visual Pinball Standalone supports "sidecar" scripts. If a .vbs
file with the same name as the table is put in the same directory as the table, then that script will be used instead of the embedded script. @jsm174's VPX Standalone Scripts repository contains fixed "sidecar" scripts for a large number of tables broken by bugs in the VBScript interpreter.
Installing a script from the script repository is a matter of finding the correct .vbs
for your table and saving it next to the table. Taking Batman 66 Stern Tribute as an example, the corresponding directory in the VPX Standalone Scripts repository contains three files:
-
Batman66_1.1.0.vbs
: This is the only file of the three you need to worry about to get a table working in Standalone. Place this file in the same directory as the.vpx
file i.e. in the same directory asBatman66_1.1.0.vpx
. The name is case-sensitive, so the only difference between the.vpx
flename and the.vbs
filename will be the extension. -
Batman66_1.1.0.vbs.original
: this is the original VBScript code extracted from the table download that requires some kind of fix to work on Standalone. It is only there to generate the patch file that follows. Ignore the.original
file if you just want to play the table. -
Batman66_1.1.0.vbs.patch
: the.patch
file is the difference between the original table and the fixed table. This file is only used to tell table developers how to get the next version of the table working on Standalone without modifications. Again, Ignore this.patch
file if you just want to play the table.
Let's say you'd like to try your hand at fixing a table that doesn't work properly on Standalone. What you'll find in practice is that script debugging can be a game of whack-a-mole: you'll fix one problem, run the table, and then the next problem pops up. There are also two phases where problems are detected:
- during compilation when the table is first run
- during execution when the table is being played
You might have to play a table for some time to ensure you've worked all the bugs out.
Wine vbscript error messages are generally not very helpful in telling you what the real problem is but they are helpful in telling you where the problem is. Something like this is typical:
wine vbscript fails with: "Compile error: Line: 1817, Character: 2, Description unavailable"
On and around Line 1817 is where you'll want to start looking.
If you want to try and get a table working under Standalone, the first thing you'll need to do is extract the .vbs
Visual Basic script from the .vpx
table file to give you something to work with. There are two ways to do this. Assuming you have the BGFX version of VPinball installed, the first way is to use VPinball itself:
./VPinballX_BGFX -extractvbs <VPXPATH>
The second way is to install and use vpxtool
. Vpxtool
is faster and has other features that will help you get a table working.
./vpxtool extractvbs <VPXPATH>
Next you can see if vpxtool
can fix the issue automatically. Vpxtool
can patch some typical issues, but don't expect wonders. From the command line:
./vpxtool script patch <VPXPATH>
Most vpxtool
commands are also available in its frontend. Vpxtool
will report any fixes it applies.
If vpxtool
reported some fixes, try to run the table with the updated script using the rules discussed here. If the table still doesn't work properly, review the line in the script where the error was reported. VBScript bugs that affect VPinball and the workarounds for them are tracked here. If any of the workarounds on that page look like they might apply to your table, give them a shot and try again.
Important
Don't sleep on that link in the previous paragraph. It is a critical resource for anyone interesting in getting a table working under Standalone.
Note that VPinball Standalone syncs with Wine's upstream code as fixes are made. Standalone also carries its own workarounds for some bugs that are not yet fixed upstream.
If you get a table working properly, consider submitting your fix to the VPX Standalone Scripts repository so your work is made available for everyone. Instructions for submitting a fix are given in detail at that link.
You can also use vpxtool
to generate a patch. Currently this is only available in the tool's frontend.