Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 225 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: 2823
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: 2487
Location: Arkansas, USA
I will have to try it.

Thanks,

George


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Mon Sep 16, 2019 1:20 pm 
Offline

Joined: Sun Mar 10, 2019 5:13 pm
Posts: 159
OK so i'll need the experts.

I copied the physics and Dynamic Flipper code from Slam's latest Ultimate Pro Jaws table and pasted it to Aliens Badass Legacy table w/Doflinx but I'm getting an error.

When the ball drains on the right side, I get a mediation error and the line number associated with it is 457 based on how I pasted the code in. IIRC it referes to "LeftFlipperEXT" I believe.

If anyone of you dynamic flipper gurus can help out?

This is the table in question:

http://www.pinsimdb.org/pinball/table-2 ... ss_edition)(doflinx)


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Mon Sep 16, 2019 2:12 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2487
Location: Arkansas, USA
I'm not sure what you are using but when you add this line of code:

xBAM.CreateAllExt

you have to delete these lines of code:

Set RightFlipperExt = xBAM.Flipper("RightFlipper")
Set LeftFlipperExt = xBAM.Flipper("LeftFlipper")


If you have more than 2 flippers, delete it for all flippers.

If you use the CreateAllExt code, you can delete these dims also but it will still work without deleting them:

Dim RightFlipperExt,LeftFlipperExt

The CreateAllExt code will produce an error if you use it with the [table object]Ext code. You must use one or the other.

George


Top 
 Profile  
 
 Post subject: Re: BAM Dynamic Flipper Breakthrough !!
 Post Posted: Mon Sep 16, 2019 3:03 pm 
Offline

Joined: Sun Mar 10, 2019 5:13 pm
Posts: 159
Ahhh ok.

Well all i did was copy paste so maybe I missed that.

I'll check it when I get home, although I may not. My mini pinball kit came in today so its build time!

Thanks George!


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 225 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: