Code/Example Simulate drop target bank

Coding and examples for future Pinball and BAM

AnonTet

Pinball Master
Site Supporters
Joined
Jun 21, 2020
Messages
2,036
Solutions
1
Reaction score
1,194
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
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.
  • 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:
    nunolilo has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    DavidT2025 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Gary-7 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Thunderbird has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    alug has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    bluebird has left the room.
  • HZR @ HZR:
    It’s nice to go all see a place I can play actual machines!!!!
    Quote
  • Chat Bot Mibs Chat Bot Mibs:
    Sunrise74 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Rai has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    liebowa has left the room.
      Chat Bot Mibs Chat Bot Mibs: liebowa has left the room.
      Back
      Top