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
182
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:
    Pinbalbilly has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    flipjuice has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    apollo2000 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gmelo1 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    jose49 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    darcel has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    cocopops has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Nightvoice has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    drew1 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Cicero Silva has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    manstein has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    1000 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Destruck62 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    WeadlyDeapon has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    SaixXemnas has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gege has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Fatmeatball has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    titomajo has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    daveseawater has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    rockin ray has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Citron68 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    hammerpower has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    max37170 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    OZZOLO has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    GG974 has left the room.
      Chat Bot Mibs Chat Bot Mibs: GG974 has left the room.
      Back
      Top