Code/Example Simulate drop target bank

Coding and examples for future Pinball and BAM

AnonTet

Pinball Master
Site Supporters
Joined
Jun 21, 2020
Messages
1,976
Solutions
1
Reaction score
1,125
Points
125
Favorite Pinball Machine
Indiana Jones
I asked Rav if there was a way to simulate a drop target bank for when you don't want or can't to use drop target banks, like with FizX.

Here is the needed code to do it. I commented it here but as an attachment i'll leave the table Rav did with the full example


Code:
' support Sub to define a new _hit Sub name that is able to process Hit events
' In this case it'll be to simulate a DropTaget Bank of 5 targets

Sub SetHitSub(DTs, hitSubName)
  Dim i
  For i = 1 To UBound(DTs)
    ExecuteGlobal "Sub " & DTs(i).name & "_hit(): " & hitSubName & "(" & i & "): End Sub"
  Next
End Sub


' Define the wall "targets" for FizX -  "bring to front" of the actual drop targets in the GUI
Dim DTs(5)   ' array for DT walls
Set DTs(1) = DT1 : Set DTs(2) = DT2 : Set DTs(3) = DT3 : Set DTs(4) = DT4 : Set DTs(5) = DT5

' The normal Sub _hit that process the hit events
Sub DTs_Hit(idx)
     ' debug info
     AddDebugText "DTs_Hit! " &_
        "name = " & DTs(idx).name &_
        ", idx = " & idx &_
        ", fpEvendId = " & fpEventId

     ' insert what to do below  
End Sub

' set "DTs_hit" as the name of the Sub that processes wall hit events
SetHitSub DTs, "DTs_Hit"
 

Attachments

  • dt-array.fpt
    227 KB · Views: 17
Forum activity
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.
      Mibs Mibs: Pop Bumper Pete has posted a new reply in the thread "Post interesting videos you found on YouTube".
      Back
      Top