@GeorgeH @AnonTet : Here the code with the idea. I make it on my break at workplace ^^...
I have and error with "if" before the "end sub".. I'm not a real coder.. And no more time today.. if anyone can look at it, but it's the idea.
I make 5 points ( 4 zone: 0-->0.25, 0.25-->0.5, 0.5-->0.75, 0.75-->1.2 ), on each zone omega correction is calculated. We can make more zone.
You can check
https://mycurvefit.com (Online curve-fitting at mycurvefit.com) to see your curve you want. Choose Linear -- point to point. Enter your value below
' FLIPPER OMEGA
' You may want to adjust the strength (also called omega) of the flippers when you add dynamic flippers to other tables.
' Only change the values for "MaxOmega" and "MinOmega" These settings override the flipper omega listed in the XML.
' You probably will want to adjust MaxOmega between 40 and 50 and MinOmega between 26 and 33. This is not a strict rule
' but it gives you an idea of approximate values that work for me. You need to leave the section below "MaxOmega2"
' unchanged and then go on to "BOUNCE CONTROL" below.below.
If BAM_VERSION => 254 then
const Omega1 = 50 ' Omega at base of flipper. Must be < MaxOmega. Default = 33
const Omega2 = 45 ' Omega at base/middle of flipper. Must be < MaxOmega. Default = 33
const Omega3 = 45 ' Omega at middle of flipper. Must be < MaxOmega. Default = 33
const Omega4 = 40 ' Omega at middle/tip of flipper. Must be < MaxOmega. Default = 33
const Omega5 = 33 ' Omega at tip of flipper. Must be > MinOmega. Default = 50
End If
Dim ball_to_flipper_angle
''''''''''''''''''''''''''''''''''''''''''''Right Flipper Prehit Code'''''''''''''''''''''''''''''''''''''''
Sub RightFlipper_prehit()
If BAM_VERSION < 254 then Exit Sub
Dim ball
Set ball = xBAM.BallCloseTo(0,0)
If xBAM.Ball.Speed <= 200 then BounceMix = 1 'Ball Speed Measures 150 rolling down left fliper from cradled ball so this should capture it
If xBAM.Ball.Speed > 200 then BounceMIx = 2
OnPreHitFlipperSettings(RightFlipperExt)
omegaCorrectionrOmega12 = MaxOmega - (RightFlipperExt.ContactPoint * ((Omega2 - Omega1)/1.2))
omegaCorrectionrOmega23 = MaxOmega - (RightFlipperExt.ContactPoint * ((Omega3 - Omega2)/1.2))
omegaCorrectionrOmega34 = MaxOmega - (RightFlipperExt.ContactPoint * ((Omega4 - Omega3)/1.2))
omegaCorrectionrOmega45 = MaxOmega - (RightFlipperExt.ContactPoint * ((Omega5 - Omega4)/1.2))
If RightFlipperExt.ContactPoint < 0.0 then RightFlipperExt.Omega = Omega1
If RightFlipperExt.ContactPoint > 1.2 then RightFlipperExt.Omega = Omega5
If (RightFlipperExt.ContactPoint => 0.0) And (RightFlipperExt.ContactPoint =< 0.25) then
RightFlipperExt.Omega = omegaCorrectionr12
If (RightFlipperExt.ContactPoint => 0.25) And (RightFlipperExt.ContactPoint =< 0.5) then
RightFlipperExt.Omega = omegaCorrectionr23
If (RightFlipperExt.ContactPoint => 0.5) And (RightFlipperExt.ContactPoint =< 0.75) then
RightFlipperExt.Omega = omegaCorrectionr34
If (RightFlipperExt.ContactPoint => 0.75) And (RightFlipperExt.ContactPoint =< 1.2) then
RightFlipperExt.Omega = omegaCorrectionr45
End if
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''Left Flipper PreHit Code'''''''''''''''''''''''''''''
Sub LeftFlipper_prehit()
If BAM_VERSION < 254 then Exit Sub
Dim ball
Set ball = xBAM.BallCloseTo(0,0)
If ball.Speed <= 200 then BounceMix = 1 'Ball Speed Measures 150 rolling down left fliper from cradled ball so this should capture it
If xBAM.Ball.Speed <= 200 then BounceMix = 1 'Ball Speed Measures 150 rolling down left fliper from cradled ball so this should capture it
If xBAM.Ball.Speed > 200 then BounceMIx = 2
If BAM_VERSION < 254 then Exit Sub
OnPreHitFlipperSettings(LeftFlipperExt)
omegaCorrectionrOmega12 = MaxOmega - (LeftFlipperExt.ContactPoint * ((Omega2 - Omega1)/1.2))
omegaCorrectionrOmega23 = MaxOmega - (LeftFlipperExt.ContactPoint * ((Omega3 - Omega2)/1.2))
omegaCorrectionrOmega34 = MaxOmega - (LeftFlipperExt.ContactPoint * ((Omega4 - Omega3)/1.2))
omegaCorrectionrOmega45 = MaxOmega - (LeftFlipperExt.ContactPoint * ((Omega5 - Omega4)/1.2))
If LeftFlipperExt.ContactPoint < 0.0 then LeftFlipperExt.Omega = Omega1
If LeftFlipperExt.ContactPoint > 1.2 then LeftFlipperExt.Omega = Omega5
If (LeftFlipperExt.ContactPoint => 0.0) And (LeftFlipperExt.ContactPoint =< 0.25) then
LeftFlipperExt.Omega = omegaCorrectionr12
If (LeftFlipperExt.ContactPoint => 0.25) And (LeftFlipperExt.ContactPoint =< 0.5) then
LeftFlipperExt.Omega = omegaCorrectionr23
If (LeftFlipperExt.ContactPoint => 0.5) And (LeftFlipperExt.ContactPoint =< 0.75) then
LeftFlipperExt.Omega = omegaCorrectionr34
If (LeftFlipperExt.ContactPoint => 0.75) And (LeftFlipperExt.ContactPoint =< 1.2) then
LeftFlipperExt.Omega = omegaCorrectionr45
End if
End Sub