jsm174 / vpx-standalone-scripts

Table patches for VPX Standalone
https://github.com/vpinball/vpinball/tree/standalone/
28 stars 14 forks source link

SolCallback(sSaucer) - Table Antar (bigus) - crash #267

Open zognic opened 6 months ago

zognic commented 6 months ago

The table Antar (Playmatic 1979)_Bigus(MOD)1.0.vpx crash on recent standalone build. (https://www.vpforums.org/index.php?app=downloads&showfile=18081)

vpinball.log

2024-03-07 10:59:22.698 ERROR [20925] [CodeViewer::OnScriptError@1212] Script Error at line 2478 : VBSE_INVALID_TYPELIB_VARIABLE
2024-03-07 10:59:22.698 ERROR [20925] [CodeViewer::AppendLastErrorTextW@3979] Runtime error: Line: 2478, Character: 2, VBSE_INVALID_TYPELIB_VARIABLE

From core.vbs bloc line 2469 to 2488

Sub InitSolCallbacks
    If SolCallbackInitialized Then Exit Sub

    ' Calling Execute can be an heavy operation depending on user setup as it seems that security programs like Microsoft Defender are triggered by this call
    ' Therefore we add the callbacks to the script during vpmInit using ExecuteGlobal to prevent stutters during play
    Dim sol, cbs: cbs = ""
    For sol = 0 To UBound(SolCallback)
        Set SolCallbackRef(sol) = Nothing
        Set SolModCallbackRef(sol) = Nothing
        If SolCallback(sol) <> "" Then cbs = cbs & vblf & "Sub XXXSolCallback_" & sol & "(state): " & SolCallback(sol) & " state: End Sub"
        If SolModCallback(sol) <> "" Then cbs = cbs & vblf & "Sub XXXSolModCallback_" & sol & "(state): " & SolModCallback(sol) & " state: End Sub"
    Next
    If cbs <> "" Then ExecuteGlobal cbs
    For sol = 0 To UBound(SolCallback)
        If SolCallback(sol) <> "" Then Set SolCallbackRef(sol) = GetRef("XXXSolCallback_" & sol)
        If SolModCallback(sol) <> "" Then Set SolModCallbackRef(sol) = GetRef("XXXSolModCallback_" & sol)
    Next

    SolCallbackInitialized = True
End Sub

Script VBS

On the table this bloc coz the issue

 SolCallback(sSaucer) = array("bsSaucerR.SolOut","bsSaucerR1.SolOut")
 SolCallback(sSaucer) = array("bsSaucerL.SolOut","bsSaucerL1.SolOut")

If I comment this line, the table don't crash anymore but the ball can stuck into this hole (screenshot)

screenshot-2024 03 07-10h38 57

zognic commented 6 months ago

Related to this https://github.com/vpinball/vpinball/commit/c6a24e2b50aaa739754c25a1a5602cd7e23b28d6 the table works prior to this PR. I guess the table script need to be modify.

rh6423 commented 6 months ago

The table is stable for me if I change ".ShowFrame = 0" to ".ShowFrame = 1". I don't get the backglass/score in desktop mode on my Mac and the dmd fix doesn't help, so I'm not sure if I should do a pull req for this or not?