- Joined
- May 3, 2016
- Messages
- 2,685
- Solutions
- 6
- Reaction score
- 2,138
- Points
- 145
- Favorite Pinball Machine
- Attack From Mars
I had some trouble a long time ago with figuring out ball speed because the numbers fly by so fast you can't read them when set up to run in real time. Ravarcade sent me this code for max ball speed debug code. It works pretty well. It has two parts:
This part you add under the Sub FuturePinball_KeyPressed(ByVal KeyCode):
Gimli created something different where the debug code displays the ball speed at a 200 millisecond interval (you need to add a timer):
This part is added under Sub FuturePinball_BeginPlay():
Hopefully one of these may help you.
Code:
'Rav's Fastest ball speed debug start
' ----------------------- This will record fastert ball (and display new record) -------------------
Dim FastestBallSpeed
FastestBallSpeed = 0
Sub NewtonPhysicsTick()
Dim Ball
Set Ball = xBAM.BallCloseTo(0,0,0)
If Ball.Exist Then
If FastestBallSpeed < Ball.Speed Then
FastestBallSpeed = Ball.Speed
AddDebugText "New Ball Speed Record: " & FastestBallSpeed
End If
End If
End Sub
'Rav's Fastest ball speed debug end
This part you add under the Sub FuturePinball_KeyPressed(ByVal KeyCode):
Code:
'Rav's Fastest ball speed debug start
' --------------------------- Add this to FuturePinball_KeyPressed, to reset and read Ball Speed Record
If KeyCode = 82 Then FastestBallSpeed = 0 ' KeyCode = 82 = '0' on numpad
If KeyCode = 79 Then AddDebugText "Ball Speed Record: " & FastestBallSpeed ' KeyCode = 79 = '1' on numpad
'Rav's Fastest ball speed debug end
Gimli created something different where the debug code displays the ball speed at a 200 millisecond interval (you need to add a timer):
Code:
' Ball Speed Debug Start
Sub BallSpeedTimer_Expired()
AddDebugText "Ball Speed: " & xBam.Ball.Speed
End Sub
' Ball Speed Debug End
This part is added under Sub FuturePinball_BeginPlay():
Code:
' Ball Speed Debug Start - Be sure to add timer named "BallSpeedTimer".
BallSpeedTimer.Set True, 200
' Ball Speed Debug End
Hopefully one of these may help you.