Hi Rwl !
Great work on Junkyard !
try the table it's a drop box link that you can download..https://www.dropbox.com/s/0smvbduexzc4a ... v.rar?dl=0Yes the ball handles collisions with targets. Use the manual ball roller to move the pendulum and I think it strikes most of the targets.
You can modify the strike areas of the ball and chain by tweaking the circular guide on the table editor.
As you may have gathered this is an optical illusion technique as follows:
1. Use BAM ball manager to create a huge invisible ball that will be constrained by the an elevated circular invisible guide
2. Normal sized balls will simply roll under the elevated guide and hit the larger invisible ball
3. Attach the Ball and Chain toy to the invisible ball using BAM miniplayfield and BAM Track Ball code ( This is an attached toy object and doesn't collide itself...just a facade)
4.Use Rav's pendulum code to simulate proper pendulum swing with a swing point above the table
5.Code the crane to move when a certain trigger is hit
6.Use BAM magnetic field to lift and lower ball
7.Rav used an elevated hidden collidable surface for the elevated ball to come in contact with...
Because it is a real ball ( invisible and large) that is being hit it therefore will generate hit events and
collide with the other balls naturally....
In terms of hitting targets on a elevated rack... you may have to do some tricky stuff as the invisible ball never elevates...but because it is a large ball...I believe its strike point will be higher than the normal game ball. So you could have some slightly elevated targets that only the pendulum hits ( but have the rack graphics where you want, again an illusion...)
You could create many Bam magnets to lift ball at various points but that likely is a little complicated (but doable) but I don't think necessary.
Fyi
I put all my stuff at the end of the script and Rav added a few lines for BAM at the start.
Note the following:
Code:
CreateCustomBall ( Source, BallName, Radius, Mass, Opacity )
This code will specify the above 5 custom ball options...so
Code:
call CreateCustomBall(kicker7,ChainBall, 27.0, 5, 0):Kicker7.SolenoidPulse()
The above line specifies:
1.kicker7 is location
2.ChainBall is the name I gave it
3.the Radius is 27
4.the Mass is 5 (increase this number if you want the pendulum harder to swing)
5.the Opacity is 0 (the ball is invisible , to see the giant ball change this value to any number less than 1 . For example 0.8)
Also if look under Sub FuturePinball_KeyPressed(ByVal KeyCode)
you will see the code to raise and lower ball.
You can use this anywhere in the script that is needed
Code:
If (KeyCode = 48) Then
If MagneticField_0.Z <> CRANE_MAGNET_Z Then
AddDebugText "[on]"
' Move up
MagneticField_0.Z = CRANE_MAGNET_Z
MagneticField_0.Strength = 10
' DstX DstY DstZ RotX RotY RotZ Scale Time
Call MiniPlayField_1.MoveTo( 671.2, 499.2, 51.4, 2.6, 0.2, 0, 1, 0.2)
Else
AddDebugText "[off]"
' Move down
MagneticField_0.Z = 0
MagneticField_0.Strength = 1
Call MiniPlayField_1.MoveTo( 670.6, 509, 75.801, 6.8, 0.2, 0, 1, 0.2)
End If
End If
Cheers