Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 222 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23
Author Message
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Wed Aug 21, 2019 5:52 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2753
Location: Ontario, Canada
Gimli wrote:
GeorgeH wrote:
I would be interested in trying the code that pushes the ball up a ramp if you could post it with some directions. I might have used it on Independence Day which is the most difficult table I have ever done.

George


It's on the Franky ramp of your most recent Monster Bash version


Oops, I lied , I went with "y" velocity instead
When Y velocity < 0 the ball is rolling up the table....If you look at the code below you will see I actually dynamically change the strength of the magnet assist based on actual y velocity. I measure the y velocity number using BAM monitoring mentioned above...a negative MagneticField Strengh number pushes the ball (repels it...)

If xBAM.Ball.Velocity.y < 0 then the following will apply.......

1. If xBAM.Ball.Velocity.y > -300 then MagneticField_0.Strength = -60

2.If xBAM.Ball.Velocity.y > -500 then MagneticField_0.Strength = -50

3. otherwise MagneticField_0.Strength = -40 . If the ball is going up the table very fast with a Y velocity that is < - 500 ie - 600 , -700 or whatever




So essentially what should happen during game play is if the ball hits the designated trigger while rolling up the table then the magnet will pulse and push the ball with a force that is adjusted based on the y velocity number....

I had a hell of a time before getting the ball go up the Franky Ramp to activate "It's Alive"
now it's dead easy...

Procedure:
1. In table editor add a trigger named " FrankyTrigger" x = 170 , y = 297 on table
2. In table editor add a timer named "FrankyMagnet"
3. Copy this code anywhere in script that is outside of a "Sub bla bla.....End Sub" routine

Code:
'To push ballup franky ramp
Dim MagneticField_0        '                                X        Y        Z    Range Strength
Set MagneticField_0        = xBAM.CreateMagneticField(    170,     297,       30,     500,      0)

Dim MagOn ' true/false to keep track of whether magnet pulse is on or off currently

Sub FrankyMagnet_Expired()
   FrankyMagnet.Set False
   If MagOn = False then
      If xBAM.Ball.Velocity.y < 0 then
      MagOn = True
      If xBAM.Ball.Velocity.y > -300 then MagneticField_0.Strength = -60:AddDebugText "xBAM.Ball.Velocity.y: " & xBAM.Ball.Velocity.y:AddDebugText "MagneticField_0.Strength = " & MagneticField_0.Strength:FrankyMagnet.Set True, 200:Exit Sub
      If xBAM.Ball.Velocity.y > -500 then MagneticField_0.Strength = -50:AddDebugText "xBAM.Ball.Velocity.y: " & xBAM.Ball.Velocity.y:AddDebugText "MagneticField_0.Strength = " & MagneticField_0.Strength:FrankyMagnet.Set True, 200:Exit Sub
      MagneticField_0.Strength = -40:AddDebugText "xBAM.Ball.Velocity.y: " & xBAM.Ball.Velocity.y:AddDebugText "MagneticField_0.Strength = " & MagneticField_0.Strength:FrankyMagnet.Set True, 200:Exit Sub
      FrankyMagnet.Set True, 1000
      Else
      MagneticField_0.Strength = 0
      End if
   Exit Sub
   End if
   If MagOn = True then
      MagOn = False
   MagneticField_0.Strength = 0
   AddDebugText "Magnet Off"
   Exit Sub
   End if
End Sub

Sub FrankyTrigger_hit()
   If (fpTilted = True) Then Exit Sub
   If MagOn = False and xBAM.Ball.Velocity.y < 0 then
   FrankyMagnet.Set True, 50
   AddDebugText "Franky Trigger"
   AddDebugText "xBAM.Ball.Velocity.y: " & xBAM.Ball.Velocity.y
   DiverterRight.SolenoidOn()
   End if
End Sub



Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Wed Aug 21, 2019 6:46 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2321
Location: Arkansas, USA
I will have to try it.

Thanks,

George


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 222 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23

Board index » Future Pinball » BAM corner


Who is online

Users browsing this forum: No registered users and 4 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to: