Thoughts: Using BAM generic Hit to track "last switch hit"?

madmrmax

Weeeeeee
Site Supporters
Joined
Sep 21, 2017
Messages
519
Solutions
2
Reaction score
250
Points
75
Favorite Pinball Machine
Indiana Jones (Williams)
I know it is common to set the "LastSwitchHit" in each _Hit event, but since BAM is already getting known and generic Hit events for physics, what are people's thoughts on adding logic in there to say "if hit is on a switch then update the LastSwitchHit" tracker.

Most switch material is metal so I don't know if it is possible to do this. My thinking it would be something like:
C#:
const IsRbPost = 1001
const IsRbBand = 1002
const IsDTWall = 1003
const IsMtl = 1004
const IsWd = 1005
const IsPlastic = 1006
const IsApron = 1007
const IsFlipper = 1008
const IsSling = 1009
const IsSwitch = 1010 'new

and

Switches = GetObjectsInfoRange("Switch"...)

and then

C#:
Sub Generic_Hit(FizX, ballspeed, material) 'Scatter Bounce and Hit Event
 If FizX.ExtInt1 = IsSwitch Then
     ' get the FP switch object and update the LastSwitchHit value
 End If
 
Is the code 1010 actually a switch? I think the codes must be defined by BAM because I don't see them defined anywhere else. I have always been curious where they came from. I admit I am not much of a coder but I have never understood the purpose of adding the numbers because they are not used anywhere. It seems like the objects are defined in the section below the numbered section.

This might be a way to automate roll over sounds instead of having to add code to so many triggers although it would probably be necessary to rename all the affected triggers so it would work correctly.

A nice aspect of the generic hit code is that none of the objects have to be renamed for it to work.
 
Last edited:
For Generic_Hit the 1010 (or any number) is self-provided and then as part of GetObjectsInfoRange those objects ObjectInfo.ExtInt1 value is assigned that custom value, which is then tested in Generic_Hit. It's just a way of passing info from the object into the Generic_Hit.

Following the FizX system, with Generic_Hit it would requires all switches (or posts, rubberbands, wood walls...etc) to at least start with a keyword to "assign" said tag.

The challenge also would be to go from the ObjectInfo to the actual FP object, but I think this could be done with a string to object call.
 
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:
    DrazeScythe has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Torntabittz has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    brotherboard has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    GARRY040 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    BL2K has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Chilldog has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    rodneyfitz has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    ace19120 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tomasaco has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Greek_Jedi has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Beermano has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    02browns has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    nitram1864 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    aeponce has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    JEAN LUC has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    lorenzom has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    maxangelo19 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Dragonslapper has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    royaljet has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tyfox has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Goldtopboy has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    slick267 has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    dabreeze has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Spike has left the room.
  • Chat Bot Mibs Chat Bot Mibs:
    Tofa has left the room.
      Chat Bot Mibs Chat Bot Mibs: Tofa has left the room.
      Back
      Top