Register    Login    Forum    FAQ    PinSimDB.org

Board index » Resources » Tutorials, how-to's, bug report and docs




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to Fix Balls Getting Stuck Under a Flipper
 Post Posted: Sun Apr 23, 2017 4:56 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 995
Location: Arkansas, USA
Have you ever had a table that has 3 or 4 flippers and gotten the ball stuck under one of the flippers on the upper part of the table? It can happen on any flipper that has a wall behind it. It is possible to make a few adjustments that make this occur less often but you usually can't completely eliminate the problem, until now! I have found a neat solution. I have never seen anyone use approach so I decided to write a tutorial on how to do it. There are some additions to the script but they are not difficult so I think anyone can make this change, even if you don't know much about script.

Image

As you can see in the "Before" version of the screenshot, the upper flipper is recessed into the sidewall on the table I edited, "Jupiter Beta". This makes the ball get stuck at the arrow. On other tables, my experience is the ball still frequently gets stuck here even if the flipper is not recessed.

The fix I found is to add an invisible wall like in the "After" screenshot where the wall is collidable when the flipper is raised and not collidable when the flipper is lowered. On my first revision, I encountered a problem where the ball would sometimes hit the wall before the flipper raised completely. This is because the wall would become collidable instantly before the flipper had time to raise completely. Also, the ball could also enter the area under the flipper in the short time for the flipper to completely lower. These problems were resolved on my second revision by adding two timers. One timer delays making the wall collidable for 30 milliseconds when the flipper was raised. The other timer delays making the wall not collidable for 30 milliseconds when the flipper was lowered. After testing it, I found that the wall was collidable before I operated the flipper. This made the ball get caught by the wall above the flipper. On the third revision, I added a line of script to make the wall not collidable when the game starts. This made everything work perfectly!

The first step is to add a wall like shown in the "After" screenshot. You can make the wall curved by right clicking on one of the red "shape points" and selecting the option to add additional shape points. I suggest naming this wall "RightFlipperWall" because it will make additions to the script easier later. Click on the wall and in the right pane, click to uncheck "Render Object (Initial Value)". The default when you add the wall is for "Collidable (Affects the Ball)" to be checked and you should leave it checked. Then add two timers named "RightFlipperWallTimerUp" and "RightFlipperWallTimerDown". In the right pane for the timer, change the "Timer Interval" to 30 milliseconds and leave "Timer Enabled" unchecked.

Open the script editor and find the following line:

Sub FuturePinball_BeginPlay()

Make a hard return at the end of this line to add a blank line. Add the following to the blank line:

RightFlipperWall.Collidable=false

If you are revising the "Jupiter Beta" table, find the following line script:

RightFlipperUp.SolenoidOn

Create a blank line below this and add the following to the blank line:

RightFlipperWallTimerUp.Enabled = True

On other tables, click on the flipper and get the name of the flipper that is listed at the top of the right pane. On the "Jupiter Beta" table, the name of the flipper is "RightFlipperUp" but the flipper can have any name. Search for the name of the flipper and find the occurrence that is below a line that says "GetKeyCode(RightFlipperKey)" or "GetKeyCode(LeftFlipperKey)" and add a line below the line that says "[flipper name].SolenoidOn". Then add the above line of code. Note that "SolenoidOn" is the code that activates the flipper to raise it and the code you added starts the timer to activate the wall so it is collidable.

Find the following 2 lines of script:

If (KeyCode = GetKeyCode(RightFlipperKey)) Then
RightFlipperUp.SolenoidOff


Create a blank line below this and add the following to the blank line:

RightFlipperWallTimerDown.Enabled = True

On tables other than "Jupiter Beta", the line of code will be the same except the name of the flipper probably won't be "RightFlipperUp". Note that "SolenoidOff" is the code that deactivates the flipper to lower it and the code you added starts the timer that deactivates the wall so it is not collidable.

Then just below where you added the above line, look for "End Sub". Below "End Sub", make some space with hard returns and add all of the following:

Sub RightFlipperWallTimerUp_Expired():
RightFlipperWallTimerUp.Enabled = False
RightFlipperWall.Collidable=true
End Sub

Sub RightFlipperWallTimerDown_Expired():
RightFlipperWallTimerDown.Enabled = False
RightFlipperWall.Collidable=false
End Sub


Everything should work at this point. The flipper shown here has a swing of 60 degrees. Although I haven't tried this solution on other tables, it stands to reason that on other tables where the flipper has less swing you should require less time to the for the flipper to raise completely. I suggest dividing the degrees of swing by two to get the value for milliseonds for the timer. So if a flipper has a swing of 52 degrees, then I would suggest trying 26 milliseconds on the timers.


Top 
 Profile  
 
 Post subject: Re: How to Fix Balls Getting Stuck Under a Flipper
 Post Posted: Sun Apr 23, 2017 6:09 pm 
Online

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 1561
Location: Ontario, Canada
Nice tutorial George!
If I can't bump it out, I usually cheat with the manual ball roller :)


Top 
 Profile  
 
 Post subject: Re: How to Fix Balls Getting Stuck Under a Flipper
 Post Posted: Sun Apr 23, 2017 11:32 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 995
Location: Arkansas, USA
Gimli,

I usually am able to nudge the ball out from under the flipper but having it get stuck under there is aggravating. This solution works and is completely transparent on the finished table.

George


Top 
 Profile  
 
 Post subject: Re: How to Fix Balls Getting Stuck Under a Flipper
 Post Posted: Mon May 08, 2017 12:58 pm 
Offline

Joined: Mon May 08, 2017 12:41 pm
Posts: 1
Hi George, I answered your question about the jupiter table. Yes you can make it you want it. It is an honor to see this table in an improved version. Everyone is invited to modify this open beta. This table has a good look, but a horrible DMD and a basic code. Nothing to pay tribute to the films.


Hi George, je répond a votre question a propos de la table jupiter.Oui vous pouvez en faire se que vous en voulez. C'est un honneur de voir cette table en version améliorée. Tous le monde est invite a modifier cette open beta. Cette table a un bon look, mais un horrible DMD et un code basique. Rien pour rendre hommage au films.


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 4 posts ] 

Board index » Resources » Tutorials, how-to's, bug report and docs


Who is online

Users browsing this forum: No registered users and 2 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: