Jump to content

DirectB2S doesn't work with some tables


Recommended Posts

Link to comment
Share on other sites

  • Administrators

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...

Link to comment
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
 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...