BAM ObjectInfo x, y, and z values are 0 for objects which have no physics

madmrmax

Weeeeeee
Site Supporters
Joined
Sep 21, 2017
Messages
519
Solutions
2
Reaction score
250
Points
75
Favorite Pinball Machine
Indiana Jones (Williams)
Probably just a BAM documentation issue, but the more I attempt to use ObjectInfo the more I'm realizing that it really doesn't do what I need.

I found that if I have Kicker objects with "Render Model" unchecked that the ObjectInfo for that Kicker is all Zeros.

The issue still remains then -- Using xBam.BallCloseTo() when I can't reliability get the X, Y, and Z values of an object.

Even more a reason why I'd love to see BAM support this:

Thanks!
-mark
 
You don't need to use FindObject to get Kicker position.
This will print kicker X&Y position: AddDebugText "K: "&PlungerKicker.X&", "&PlungerKicker.Y
But not Z.
In general, most FP objects has X,Y property accessible from script.
 
Thanks @ravarcade. Since I had some invisible kickers to simulate some ball movement on the upper areas, I was trying to figure out a better way to track the "Z" or "height" without having to jump through the object references to get the Surface or Playfield object the kicker is connected to. But right now I'm just keeping "Z" at 0 if it can't get the ObjectInfo.
 
Yeah, Kickers don't have a height property. That being said, Kicker's height can't change through time (even on Miniplayfields; it's the Miniplayfield's data itself the one being replaced) so a function that returns it is never needed. I'd define a const and use that instead.

Code:
Const Kicker1Height = 32
Const Kicker2Height = 0
' ...

If it's a lot of kickers and you want to get their height from a single function, you could use an Array of heights instead, or a special Class with the Height parameter attached.

Code:
Class KickerClass
    Public kObj
    Public Height

    Public Sub SetKicker(Kicker)
        Set kObj = Kicker
    End Sub

    ' Get X from object property
    Public Function X
        X = kObj.X
    End Function

    ' Get Y from object property
    Public Function Y
        Y = kObj.Y
    End Function

    ' Get stored Z (same as Height)
    Public Function Z
        Z = Height
    End Function
End Class

Dim Kicker1c : Set Kicker1c = New KickerClass
Kicker1c.SetKicker Kicker1 : Kicker1c.Height = 32

' Get Kicker's X, Y and Z

AddDebugText Kicker1c.X    ' => 190
AddDebugText Kicker1c.Y    ' => 162
AddDebugText Kicker1c.Z    ' => 32
 
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