Helper class to invoke xBam.Call Asynchronously to avoid nested call errors

Support File BAM Helper class to invoke xBam.Call Asynchronously to avoid nested call errors 1.0

No permission to download
I've updated this to 1.0 version.
For those that are interested, I've created a script helper which will invoke xBam.Call asynchronously. Calling xBam.Call async like this enables one function to "use" xBam.Call for a time delay invoke and not have to worry about if the call to xBam.Call is "contained" within another xBam.Call.

Save the vbs file in same dir as table, then in the script for the table at the very top, put:
C#:
ExecuteGlobal LoadExternalScript ("BamAsyncInvoke.vbs")
Note you can also just copy the class definition into your table script.

Then I put one timer object on my table. Note the name of the timer. In the example below I named my timer AsyncBamCallTimer but you can use whatever as long as you update the below. Add this code in BeginPlay:
C#:
Dim xBamAsync

Sub FuturePinball_BeginPlay()

    set xBamAsync = (new BamInvoke)(AsyncBamCallTimer) 'AsyncBamCallTimer is a FP timer object

    ...

Now in my calls where I used xBam.Call, I now use either of Inoke or InvokeWithArgs:
C#:
    xBamAsync.InvokeWithArgs "RotateTrunkTo", 300, cTrunkLight
    ' or
    xBamAsync.Invoke "TrunkFrontHole_DestroyBall", 300

Updated code to support having multiple calls in same sub/function
C#:
    xBamAsync.Invoke "TrunkFrontHole_DestroyBall", 300
    xBamAsync.InvokeWithArgs "MakeSound", 600, "ding"

At the Initialize of the object I use Execute to auto generate the Timer's Expired method, but apart from that it doesn't use Execute/Eval
Author
madmrmax
Downloads
9
Views
310
First release
Last update
Rating
0.00 star(s) 0 ratings
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
  • Chat Bot Mibs Chat Bot Mibs:
    scutters has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    vincez28 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    rocker has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    unomismo has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gamegod2x has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    DocRazor has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    ejrcooney has joined the room.
  • E @ ejrcooney:
    B2S server.exe Version 2.5.0.320 How can you make the B2SDMD stay on Visible. Make it the default instead of hidden. Did new install of 10.8 final have many tables I would have to open to change to visible instead of hidden. Any help would be much appreciated.
    Quote
  • xenonph @ xenonph:
    @ejrcooney Try right clicking on backglass with mouse pointer, and you should see B2S DMD Visibility setting at top of window.
    Quote
  • E @ ejrcooney:
    Want to make visible the default. Right now it is set on hidden.
    Quote
  • Quote
  • xenonph @ xenonph:
    I sent you message with pic showing where to make visible adjustment.
    Quote
  • Chat Bot Mibs Chat Bot Mibs:
    Pinped has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    daleks12 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Stephen has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    docdoc has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Exnihilo_Mundus has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    angmarg52 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    tully619 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    smorndb has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tech49 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Topsi Klaus has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Forsaken43 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    duduky72 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gerge has left the room.
      Chat Bot Mibs Chat Bot Mibs: Gerge has left the room.
      Back
      Top