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

madmrmax

Weeeeeee
Site Supporters
Joined
Sep 21, 2017
Messages
462
Solutions
1
Reaction score
237
Points
55
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:
    MedievilMadness has left the room.
  • 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: OZZOLO has left the room.
      Back
      Top