The most confusing part of my script above is likely this:
Code:
omegaCorrection = 50 - LeftFlipperExt.ContactPoint * 20
if omegaCorrection > 40 then omegaCorrection = 45
if omegaCorrection < 25 then omegaCorrection = 20
If LeftFlipperExt.ContactPoint > .3 then
LeftFlipperExt.Omega = omegaCorrection
I will attempt to explain this....
and you will understand if play in debug mode and use ball roller and move ball over flipper.Debug mode will show you the contact point number.
Rav calls the base of the flipper "P0" and it equals 0
and he calls the tip "P1" and it equals 1
so the middle of the flipper therefore is 0.5
You will notice however that sometimes debug mode shows you contact points that are less than zero , in the inlane
and sometime debug mode shows contact points that are greater than 1 as the ball rolls over tip of flipper.
We will have to account for these. See Below number 3 and 4
1.
My goal is to have the flipper omegas higher at the base of flipper and lower at the tip. this is accomplished by this
Code:
omegaCorrection = 50 - LeftFlipperExt.ContactPoint * 20
This is an arbitrary formula I came up with
2.Applying the Flipper Omega CorrectionCode:
If LeftFlipperExt.ContactPoint > .3 then
LeftFlipperExt.Omega = omegaCorrection
In the case above I decided that I wanted anything from 0 to 0.3 to use the xml default
Flipper Omega (so I didn't apply the "omega correction" here)
So number 3. below likely is redundant here
However, I want the "omega correction" applied to contact points > .3 (that is more than 0.3 to the tip of flipper 1.0)
3.
accounting for Contact point readings that are less than 0Code:
if omegaCorrection > 40 then omegaCorrection = 45
I want my max omega to be 45.
4.
accounting for Contact point readings that are greater than 1Code:
if omegaCorrection < 25 then omegaCorrection = 20
I want my minimum omega to be 20
Therefore the above code applies:
1. omega speed between 20-45 with the highest speeds at the base and lowest ones at tip.
Again you will see these values during debug mode...