Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
gigahertz77

DirectB2S doesn't work with some tables

Recommended Posts

Hello, I don't know why some tables doesn't work with DirectB2S , for example I have the addams family table and visual pinball 9.9.5 and not work, the backglass It does not appear. But Medieval Madness, same visual pinball 9.9.5 work perfectly..

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Have to make sure you BG and your table names match and in the script you see this line or change it to ....Set Controller=CreateObject("B2S.Server")

in some of the older VPX tables or some 9.9.5 there are choices in the script to check or change ....

Select Case cController
            Case 1:
                Set Controller = CreateObject("VPinMAME.Controller")
                If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
                If VPMver>"" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
                If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
            Case 2:
                Set Controller = CreateObject("UltraVP.BackglassServ")
                'Leds.Enabled = 1
            Case 3:
                Set Controller = CreateObject("B2S.Server")

or something similar .......if the BG wont load its usually because of these options most of the newer VPX these are built in so you wont have to worry about it...

Share this post


Link to post
Share on other sites

ok I have added this into the table and now works

 

'******************* Options *********************
' DMD/Backglass Controller Setting
Const cController = 3        '0=Use value defined in cController.txt, 1=VPinMAME, 2=UVP server, 3=B2S server, 4=B2S with DOF (disable VP mech sounds)
'*************************************************

Dim cNewController
Sub LoadVPM(VPMver, VBSfile, VBSver)
    Dim FileObj, ControllerFile, TextStr

    On Error Resume Next
    If ScriptEngineMajorVersion < 5 Then MsgBox "VB Script Engine 5.0 or higher required"
    ExecuteGlobal GetTextFile(VBSfile)
    If Err Then MsgBox "Unable to open " & VBSfile & ". Ensure that it is in the same folder as this table. " & vbNewLine & Err.Description

    cNewController = 1
    If cController = 0 then
        Set FileObj=CreateObject("Scripting.FileSystemObject")
        If Not FileObj.FolderExists(UserDirectory) then 
            Msgbox "Visual Pinball\User directory does not exist. Defaulting to vPinMame"
        ElseIf Not FileObj.FileExists(UserDirectory & "cController.txt") then
            Set ControllerFile=FileObj.CreateTextFile(UserDirectory & "cController.txt",True)
            ControllerFile.WriteLine 1: ControllerFile.Close
        Else
            Set ControllerFile=FileObj.GetFile(UserDirectory & "cController.txt")
            Set TextStr=ControllerFile.OpenAsTextStream(1,0)
            If (TextStr.AtEndOfStream=True) then
                Set ControllerFile=FileObj.CreateTextFile(UserDirectory & "cController.txt",True)
                ControllerFile.WriteLine 1: ControllerFile.Close
            Else
                cNewController=Textstr.ReadLine: TextStr.Close
            End If
        End If
    Else
        cNewController = cController
    End If

    Select Case cNewController
        Case 1
            Set Controller = CreateObject("VPinMAME.Controller")
            If Err Then MsgBox "Can't Load VPinMAME." & vbNewLine & Err.Description
            If VPMver>"" Then If Controller.Version < VPMver Or Err Then MsgBox "VPinMAME ver " & VPMver & " required."
            If VPinMAMEDriverVer < VBSver Or Err Then MsgBox VBSFile & " ver " & VBSver & " or higher required."
        Case 2
            Set Controller = CreateObject("UltraVP.BackglassServ")
        Case 3,4
            Set Controller = CreateObject("B2S.Server")
    End Select
    On Error Goto 0
End Sub
 

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

×