Tutorial How to Code Zipper Flippers and Migrating Flippers

Gimli

Pinball Master
Joined
Feb 6, 2020
Messages
1,341
Reaction score
882
Points
120
Favorite Pinball Machine
Monster Bash
@wild
@TerryRed
@ravarcade
@shiva
@Ike Savage
@NitroNimbus
@GeorgeH
@polygame
@madmrmax
@ULTIMATE Pro Pinball
@AnonTet

I was just going through the process of zipper flippers with Wild. We used this for the first time ever in Nip it.
As BAM progresses the process for Zipper Flippers can be refined.

Terms:
1. Zipper Flippers: The flippers articulate between two positions based on Game Events
2. Migrating Flippers: Have Flippers appear anywhere on table or even code flippers that seem to move or slide along the table...you use this for instance to emulate Foosball or Hockey

3. Invisible Flippers: In this tutorial we use Invisible flipper objects created by Franzleo. The Flipper Models function like a complete flipper but all you will see is the flipper shadow (if you have flipper shadows turned on in BAM which is the default)

4. Dummy Flippers: In this tutorial I will use Flipper Objects (either in form of a Toy or "peg") that have no collision properties and are just superimposed over the invisible flipper to make them seem visible.
- Peg Dummy Flipper Model: Using Future Pinball Model Editor program can designate any model you create or import to be treated like specific Pinball objects (Pegs, guides, Flippers, bumpers, toys etc...) So for instance I can change a flipper model created in MilkShape3d to be treated as a "flipper, peg, bumper, wall.....etc..."
This is confusing but true. Pegs for some reason have the benefit of being opaque wheres toys seems to allow shadow artifacts to show through.
-Toy Dummy Flipper Model: Same as above but you use Future Pinball Model Editor program to assign the flipper model created in MilkShape3d to be treated as a Toy.Toys allow shadows to through but have other assets that can be useful in certain cases.
For this tutorial Peg Dummy Flippers are preferable

5.. "Miniplayfield": Originally referred to an extra miniature fully functional playfield with all its objects that BAM grabbed and moved onto the table.

This code is now used to grab any object or group of objects on or off the table and move it/them anywhere on or off the table.
For our use in this tutorial various flipper objects (both visible and invisible) will each be grabbed and moved in what is called a "miniplayfield grab box"
This tutorial uses the BAM default names for Miniplayfields. Miniplayfield_0 is the first one created.
There are two ways to grab flipper objects in Miniplayfield Grab boxes :
1. Visual Grab from BAM menu during a game (see my tutorial on this). This I use primarily to grab groups of objects or objects without unique names (Like "pegs")
In this tutorial the only time I used this was for the Peg Dummy Flipper Models
2. Shortcut Code Grab. See Below. Where possible I use this as it simple and moves automatically is you change the objects location in table editor.
In this tutorial the only time I used this was for the Invisible flipper models

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Describing the Illusion of Zipper Flippers


BAM now allows taking FP objects like bumpers and grabbing them and animating them to slide or move across playfield and it will automatically apply the collidable physics of that object as it moves.

Unfortunately this CANNOT be done with Flippers
What we can do with BAM however make the Flippers Collidable or Non Colidable. And we can make the Flippers Disappear and Reappear.
So to create the illusion of movement we superimpose a dummy model that we can move around and then switch collidabilty on /off of the underlying real (but invisible) flippers as needed.


View attachment Future Pinball 2021-01-16 16-05-16-43.mp4

In the Video above. I demonstrate Migrating Flipper illusion. I have 4 sets of flipper that actually never move. I just make them invisible or visible by setting Scale = 0 or 1
and Collidable or Non Collidable using BAM Code. The Above does not use Franzleo invisible Flipper models. I will include the demo of this table below called test2.fpt ("B" on keyboard switches on /off the different flippers)

Now for the Zipper Flipper table we do the following:
1. Place two sets of invisible flippers using Frazleo's invisible zed models onto the table.

Invisible Flipper Models.jpg


2. Place one set of DUMMY Flipper Peg Models beside table:
DummyPegFlippers.jpg

3. Create the "miniplayfield Grab boxes" that will grab the Invisible Flippers using the BAM code Shortcut.

The invisible flippers have been given these names:
Left Invisible Flippers I called : LeftFlipper and Flipper1
Right Invisible Flipper I called : RightFlipper and Flipper2

Here is the code:
Code:
''''''''''''''''''''''''''''''Zippers Flippers Code

Function CreateMiniPlayfield(ByRef item, Z, H)
   Dim X, Y
   X = item.X
   Y = item.Y
   Const e = 0.2
   Dim MP
   Set MP = xBAM.CreateMiniPlayfield(X-e, X+e, Y-e, Y+e, Z-e, Z+H+e, X, Y, Z)
   MP.MoveTo X, Y, Z, 0,0,0, 1, 0
   Set CreateMiniPlayfield = MP
End Function

Dim miniplayfield_0
Set miniplayfield_0  = CreateMiniPlayfield(LeftFlipper, 0, 100)


Dim miniplayfield_1
Set miniplayfield_1  = CreateMiniPlayfield(RightFlipper, 0, 100)

''''''''''''''''''''''''''''''''''''''''


Dim miniplayfield_2
Set miniplayfield_2  = CreateMiniPlayfield(Flipper1, 0, 100)


Dim miniplayfield_3
Set miniplayfield_3  = CreateMiniPlayfield(Flipper2, 0, 100)

You will see therefore that Flippers have assigned to a "miniplayfield" as follows:
LeftFlipper to miniplayfield_0
RightFlipper to miniplayfield_1
Flipper1 to miniplayfield_2
Flipper2 to miniplayfield_3

So the Flippers on the left are assigned miniplayfield_0 and miniplayfield_2
and So the Flippers on the right are assigned miniplayfield_1 and miniplayfield_3

4. Because we are using Peg Flipper Objects that in FP don't have names for BAM to identify them, we a have to use the old BAM Menu visual way of grabbing them (that I describe in a separate tutorial) but they are coded as follows:
Code:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'DUMMY PEG FLIPPERS
'Left Peg Flipper Model
Dim MiniPlayField_4        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_4        = xBAM.CreateMiniPlayfield(-166.801,  -164.2,     587,   589.6,    11.2,    23.8,  -165.5,   588.3,    17.5)

''''''''''''''''''''''''''''''''''
'Right Peg Flipper Model
Dim MiniPlayField_5        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_5        = xBAM.CreateMiniPlayfield( -123.8, -122.201,   720.8, 722.395,    11.4,    23.8,    -123, 721.598,    17.6)

You will see therefore that DUMMY Peg Flipper objects have assigned to a "miniplayfield" as follows:
LeftFliper Peg to miniplayfield_4
RightFlipper Peg to miniplayfield_5

5. Now that we have grabbed all the Flipper Objects in "miniplayfield grab boxes" , we can simply use BAM code to decide what is active , visible or invisible and when.

Using BAM Miniplayfield Code
BAM will automatically keep track of their respective location, rotation, size and time.
a. LOCATION: Miniplayfiled x and y location.
We will want our DUMMY Flippers to move to the location of the Invisible Flippers

LeftFlippers
we will assign the Left DUMMY "Peg" Flipper to either the LeftFlipper or Flipper1
in other words we will move miniplayfield_4 to the location of either miniplayfield_0 or miniplayfield_2
The code is simple.
Lets move miniplayfield_4 to the location of miniplayfield_0
Code:
miniplayfield_4.position.x = miniplayfield_0.position.x
miniplayfield_4.position.y = miniplayfield_0.position.y

Lets move miniplayfield_4 to the location of miniplayfield_2
Code:
miniplayfield_4.position.x = miniplayfield_2.position.x
miniplayfield_4.position.y = miniplayfield_2.position.y


RightFlippers
we will assign the Rightt DUMMY "Peg" Flipper to either the RightFlipper or Flipper2
in other words we will move miniplayfield_5 to the location of either miniplayfield_1 or miniplayfield_3

Lets move miniplayfield_5 to the location of miniplayfield_1
Code:
miniplayfield_5.position.x = miniplayfield_1.position.x
miniplayfield_5.position.y = miniplayfield_1.position.y

Lets move miniplayfield_5 to the location of miniplayfield_3
Code:
miniplayfield_5.position.x = miniplayfield_3.position.x
miniplayfield_5.position.y = miniplayfield_3.position.y

b. ROTATION: Miniplayfiled Rotation
The underlying invisible flippers have been assigned specific swings and rotations in FP table editor.
We need to match the rotation of our DUMMY "peg" flippers to this.

We will using rotation in the "z" axis in BAM to accomplish this.
I used a trial and error process to determine these values. That I can describe maybe later but I assigned these rotation in the code when the Left and right flippers are called for:

When Flipper keys are pressed during game the Solenoids turn on :
Code:
If (KeyCode = GetKeyCode(LeftFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then LeftFlipper.SolenoidOn:Miniplayfield_4.rotation.z = -45 'Gimli
                if ZipperFlippersActive = true then Flipper1.SolenoidOn:Miniplayfield_4.rotation.z = -70
                  PlaySound "Flipper"
            End If

            ' If the Right Flipper Key Has Been Press, Activate The Right Flipper(s)
            If (KeyCode = GetKeyCode(RightFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then RightFlipper.SolenoidOn:Miniplayfield_5.rotation.z = 45 'Gimli
                if ZipperFlippersActive = true then Flipper2.SolenoidOn:Miniplayfield_5.rotation.z = 70
                PlaySound "Flipper"
            End If

And when the Flipper keys are released in Future pinball the Solenoids turn off:

Code:
If (KeyCode = GetKeyCode(LeftFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then LeftFlipper.SolenoidOff:Miniplayfield_4.rotation.z = 10 'Gimli
                if ZipperFlippersActive = true then Flipper1.SolenoidOff:Miniplayfield_4.rotation.z = - 25

            End if    

            ' The Right Flipper Key has been released, Turn Off the Right Flipper(s)
            If (KeyCode = GetKeyCode(RightFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then RightFlipper.SolenoidOff:Miniplayfield_5.rotation.z = -10 'Gimli
                if ZipperFlippersActive = true then Flipper2.SolenoidOff:Miniplayfield_5.rotation.z = 25

                
            End If


You will notice reference to a few other items:
ZipperFlippersActive is the Flag that I use to assign zipper flipper on or off

SetDummyFlipperLocation() is a the subroutine I use to move the dummy flippers as I describe above the appropriate location depending or whether the Zipper flippers are on or off

Here is the Code to switch Zipper Flippers on /off
Code:
Sub ToggleZipperFlippers()
    if ZipperFlippersActive = False then ZipperFlippersActive = True:Miniplayfield_5.rotation.z = 25::Miniplayfield_4.rotation.z = -25:SetDummyFlipperLocation():Exit Sub
    if ZipperFlippersActive = True then ZipperFlippersActive = False:Miniplayfield_5.rotation.z = -10:Miniplayfield_4.rotation.z = 10:SetDummyFlipperLocation():Exit Sub
End Sub

Here is the Code To Set Location of DUMMY "peg" flippers
Code:
'''''''''''''''''''''''''''''''''''''Dummy Location set to real flipper location

Sub SetDummyFlipperLocation 'Gimli

        If ZipperFlippersActive = True then
            Miniplayfield_4.position.x = Miniplayfield_2.position.x 'left Dummy Peg Flipper to Flpper1 Location
            Miniplayfield_4.position.y = Miniplayfield_2.position.y
            Miniplayfield_5.position.x = Miniplayfield_3.position.x 'Right Dummy Peg Flipper to Flipper2 Location
            Miniplayfield_5.position.y = Miniplayfield_3.position.y

    
        MiniPlayField_0.Collidable = False
        MiniPlayField_1.Collidable = False
        Miniplayfield_2.Collidable = True
        Miniplayfield_3.Collidable = True

        Miniplayfield_0.Scale = 0  'hide flipper shadows
        Miniplayfield_1.Scale = 0
        Miniplayfield_2.Scale = 1 'show flipper shadows
        Miniplayfield_3.Scale = 1
        Exit Sub
        End if

        If ZipperFlippersActive = False then
            Miniplayfield_4.position.x = Miniplayfield_0.position.x 'left Peg Flipper Dummy to LeftFlpper Location
            Miniplayfield_4.position.y = Miniplayfield_0.position.y
            Miniplayfield_5.position.x = Miniplayfield_1.position.x 'Right Peg Flipper  Dummy to RightFlipper Location
            Miniplayfield_5.position.y = Miniplayfield_1.position.y

        MiniPlayField_0.Collidable = True
        MiniPlayField_1.Collidable = True
        Miniplayfield_2.Collidable = False
        Miniplayfield_3.Collidable = False

        Miniplayfield_0.Scale = 1  'show flipper shadows
        Miniplayfield_1.Scale = 1
        Miniplayfield_2.Scale = 0 'hide flipper shadows
        Miniplayfield_3.Scale = 0
        Exit Sub
        End if
End Sub

Note how we make the flippers collidable and non collidable as desired:
Lets make RightFlipper contained in miniplayfield_1 collidable
Code:
MiniPlayField_1.Collidable = true

c. Scale using Miniplayfield Scale to make shadows appear and disappear.
As mentioned previously Franzleo's Invisible Flipper although invisible do have visible Shadows.
So Miniplayfield Scale = 0 will hide flipper shadows by making the contents disappear.
So to make the shadows of Leftflipper contained in Miniplayfied_0 dissapear the code is
Code:
miniplayfield_0.Scale = 0

And to make the Shadow reappear we simply set the scale back to 1
Code:
miniplayfield_0.Scale = 1

d. Time using Miniplayfield timing to match actual flipper swing speed
You can set the time that BAM takes to move the dummy flippers from one location to another using Miniplayfield time
I found that a time of 0.05 is perfect.

So the code for the time of the left dummy "peg" flipper contained in Miniplayfield_4 is :
Code:
Miniplayfield_4.time = 0.05

And the code for the time of the right dummy "peg" flipper contained in Miniplayfield_5 is :
Code:
Miniplayfield_5.time = 0.05

Ok Clear as mud ?
That's about it but I am sure you may have questions.

See the demo table below Called ZipperFlipperDemo2
you can use "B" key on the keyboard to toggle zipper flippers.

I also coded them to Toggle on/off when right and left slingshots are hit as follows:

Code:
Sub LeftSlingshotRubber_Hit()
    ToggleZipperFlippers()
    ' add some points
    AddScore(5)
    ' flash the lights around the slingshot
    LeftSlingshotBulb1.FlashForMs 100, 50, BulbOff
    LeftSlingshotBulb2.FlashForMs 100, 50, BulbOff
End Sub


' The Right Slingshot has been Hit, Add Some Points and Flash the Slingshot Lights
'
Sub RightSlingshotRubber_Hit()
    ToggleZipperFlippers()
    ' add some points
    AddScore(5)
    ' flash the lights around the slingshot
    RightSlingshotBulb1.FlashForMs 100, 50, BulbOff
    RightSlingshotBulb2.FlashForMs 100, 50, BulbOff
End Sub
I simply added " ToggleZipperFlippers()" to the existing code.

View attachment Future Pinball 2021-01-16 16-07-04-04.mp4

Enjoy !
Cheers and Happy New Year
 

Attachments

  • test2.fpt
    227.5 KB · Views: 81
  • ZipperFlipperDemo2.fpt
    726.5 KB · Views: 100
Last edited:
see above
 
Last edited:
ok,our discussion in private brought some good, so for anyone who wants to use this system, he now has a tutorial to follow ... good.
but I will continue with you in private Gimli, I hope you agree,to discuss further improvements.

for those wondering which table has been inserted, here it is......Nip-it
 
ok,our discussion in private brought some good, so for anyone who wants to use this system, he now has a tutorial to follow ... good.
but I will continue with you in private Gimli, I hope you agree,to discuss further improvements.

for those wondering which table has been inserted, here it is......Nip-it
Thanks Paolo !

Paolo just reminded me of another way to toggle flipper shadows on/off

To Enable the above Flipper Shadows:
Code:
xBAM.EnableFlipperShadows "LeftFlipper":xBAM.EnableFlipperShadows "RightFlipper":xBAM.EnableFlipperShadows "Flipper1":xBAM.EnableFlipperShadows "Flipper2"

To Disable the above Flippers Shadows:
Code:
xBAM.DisableFlipperShadows "LeftFlipper":xBAM.DisableFlipperShadows "RightFlipper":xBAM.DisableFlipperShadows "Flipper1":xBAM.DisableFlipperShadows "Flipper2"

I had already grabbed each flipper in a miniplayfield grab box....so setting MP Scale accomplished
the same thing.
 
I'm stickying this thread for now as it sits in this particular forum section, but I think there's an argument for moving it to the general FP tutorial section. Any opinion on that, Gimli?

I also want to thank you (and @TerryRed & @GeorgeH) sincerely for all these finely-crafted tutorials. Really makes me wish I was testing & developing in FP personally, so as to try all these techniques out myself.

Still, I'm sure some of our readers & your fellow devs will find this stuff immediately useful, with more hopefully discovering this stuff over time.
 
I'm stickying this thread for now as it sits in this particular forum section, but I think there's an argument for moving it to the general FP tutorial section. Any opinion on that, Gimli?

I also want to thank you (and @TerryRed & @GeorgeH) sincerely for all these finely-crafted tutorials. Really makes me wish I was testing & developing in FP personally, so as to try all these techniques out myself.

Still, I'm sure some of our readers & your fellow devs will find this stuff immediately useful, with more hopefully discovering this stuff over time.
Thanks Nic !
Ya I wasnt sure where to put it as it does require BAM
 
ok .... i had the idea to insert the "zippers" in batman 66, since i still don't know what to do with the script, i tried to change the fins, it seems to work watch the video,please
View attachment ZP2.mp4
it's not perfect yet, but it can only be improved upon....

@Gimli

I created the fake or "dummy" fins in trigger, so you can insert the name of the object in the creation code of the MP, with calc center
for the "moveto", I still used the system with the old (so to speak) coordinates to be inserted, I still have to understand your new "ZipperFlippersActive" system

about the shade I thought if it is possible to change the color? of course the shadow has no color and always black .... but I wonder if it is possible to change color, because on a playfield with a dark background. you can hardly see the shadow ....

then there is another topic to be clarified( at least for me) about fin strength adjustment .... this has always been a point that i didn't understand well .... if you use the DF .... the adjustment that is in the fp editor, is overwritten by the script? in the script we have the omega to be adjusted and the bounceControl, but I never understood if they are in conflict or are associated the 2 ways of fin adjustment , see photos, to understand,please......

const MinOmega = 32
const MaxOmegaL = 34
const MaxOmegaR = 34

regolaggio.JPG

I have always done adjusted both in the editor and in the script ... but I don't know if it is right to do so in this way ... or if is there another solution ..... this is also a question that could be discussed with @shiva , since it is creating a new system, which is still unknown to me .... he has not yet answered my question in his thread...but .... so I ask you too I think you know something about it ... right?
 
Last edited:
ok .... i had the idea to insert the "zippers" in batman 66, since i still don't know what to do with the script, i tried to change the fins, it seems to work watch the video,please
View attachment 16442
it's not perfect yet, but it can only be improved upon....

@Gimli

I created the fake or "dummy" fins in trigger, so you can insert the name of the object in the creation code of the MP, with calc center
for the "moveto", I still used the system with the old (so to speak) coordinates to be inserted, I still have to understand your new "ZipperFlippersActive" system

about the shade I thought if it is possible to change the color? of course the shadow has no color and always black .... but I wonder if it is possible to change color, because on a playfield with a dark background. you can hardly see the shadow ....

Looks great Paolo !
No I don't believe you can change the color of the shadows.

ZipperFlippersActive = true of false

You can call it whatever you want.

I think in Nip it we used
ZipperOn = True or False

It is the same thing we do in coding all the time. You have used lights for this same purpose in many tables.....

If LightPaolo.State = BubOn or LightPalo.State = BulbOff
then there is another topic to be clarified( at least for me) about fin strength adjustment .... this has always been a point that i didn't understand well .... if you use the DF .... the adjustment that is in the fp editor, is overwritten by the script? in the script we have the omega to be adjusted and the bounceControl, but I never understood if they are in conflict or are associated the 2 ways of fin adjustment , see photos, to understand,please......

const MinOmega = 32
const MaxOmegaL = 34
const MaxOmegaR = 34
Omega is how fast the Real flippers are rotating. This is same as "Strength"
View attachment 16443

I have always done adjusted both in the editor and in the script ... but I don't know if it is right to do so in this way ... or if is there another solution ..... this is also a question that could be discussed with @shiva , since it is creating a new system, which is still unknown to me .... he has not yet answered my question in his thread...but .... so I ask you too I think you know something about it ... right?

The DUMMY flippers have NO STRENGTH so we don't use "Omega" for dummy flippers.

Instead we use Rotation in the Z-Axis

To match the Z-rotation of the DUMMY FLippers , you can use math to calculate or use the BAM Mniplayfield Menu to get the numbers visually.

To Calculate this we look at the Starting angle and Swing values above.

Starting Angle = 95
and Swing is = - 51

So the Ending angle is 95 - 51 = 44
(So the left flipper Swings from 95 degrees of clockwise rotation to 44 degrees of clockwise rotation


I will show you how to do this soon...
ut I want to check something else first....
 
Last edited:
@wild
Ok here is a much easier table. See Below.

I am SO STUPID :bigdance:
It just dawned on me that we can use ACTUAL FLIPPER MODELS as the Dummy Flippers (Not Pegs or Toys or Triggers)

That way we can turn the shadows off all the time of the other flippers and only use the Shadows of The Dummy Flippers !!


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
I have come up with a simple COPY and Paste way of doing Zipper Flippers

Step1 Prep the table : The table author MUST use these names:


The names are as follows:
Left Flipper , LeftFipper2, LeftDummy
RightFlipper, RightFlipper2, Right Dummy

The author can set the Starting Rotation and the Swing of Left Flipper, LeftFlipper2, RightFlipper and RightFlipper2


****Note BAM will automatically track location of all 6 flippers so it doesn't matter where you place them in table editor.

The Dummy Flippers (LeftDummy and RightDummy are set to a starting rotation of 0 and the Swing doesn't matter as we are coding
Z-rotation instead of "Swing" for the Dummy Flippers

Step 2: Calculate the Z- rotations using this math:


'''''''''''''''''''''How to Calculate
'Look at table editor at each invisible flippers properties
' Starting Rotation Swing Ending Rotation (Starting Rotation plus Swing)
'LeftFlipper1 130, - 52 , 78,
'LeftFlipper2 95 , - 52 , 43,
'LeftDummy 0 Doesn't matter as we will adjust this using BAM Z-rotation

'RightFlipper1 230 , 52, 282
'RightFlipper2 264 , 52 , 316
'RightDummy 0 Doesn't matter as we will adjust this using BAM Z-rotation

'Note you can put your own values in up above



'''''''''''''''''How to Calculate Dummy Flipper z rotations (Miniplayfield_4.Rotation.z and Miniplayfield_5.Rotation.z) based on whethers Zipper Flippers are active or not

'''''''''''''''''''''''''''''''''''Zipper Flippers are NOT Active''''''''''''''''''''''''''''''''''''''''''''''''''
'Zipper Flippers are NOT active (ZipperFlippersActive = False) and they can be either up (LeftFlipper.SolenoidOn andRightFlipper.SolenoidOn) or down (LeftFlipper.SolenoidOff andRightFlipper.SolenoidOff)

'Flippers down
'Look at above chart.
'When Zipper Flippers on up LeftFlipper1 is in starting position 130 degrees and RightFlipper1 is at 230 degrees so to match this with the Dummy Flippers Miniplayfield_4.Rotation.z and Miniplayfield_5.Rotation.z
'Miniplayfield_4.Rotation.z = 130 and Miniplayfield_5.Rotation.z = 230

'Flippers up
'Look at above chart.
'When Zipper Flippers up LeftFlipper1 is in ending position 78 degrees and RightFlipper1 is at 282 degrees so to match this with the Dummy Flippers Miniplayfield_4.Rotation.z and Miniplayfield_5.Rotation.z
'Miniplayfield_4.Rotation.z = 78 and Miniplayfield_5.Rotation.z = 282
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''Zipper Flippers are Active''''''''''''''''''''''''''''''''''''''''''''''
'Zipper Flippers are active (ZipperFlippersActive = True) and they can be either up (LeftFlipper2.SolenoidOn and RightFlipper2.SolenoidOn) or down (LeftFlipper2.SolenoidOff and RightFlipper2.SolenoidOff)

'Zipper Flippers down
'Look at above chart.
'When Zipper Flippers on up LeftFlipper2 is in starting position 95 degrees and RightFlipper2 is at 264 degrees so to match this with the Dummy Flippers Miniplayfield_4.Rotation.z and Miniplayfield_5.Rotation.z
'Miniplayfield_4.Rotation.z = 95 and Miniplayfield_5.Rotation.z = 264

'Zipper Flippers up
'Look at above chart.
'When Zipper Flippers up LeftFlipper2 is in ending position 43 degrees and RightFlipper2 is at 316 degrees so to match this with the Dummy Flippers Miniplayfield_4.Rotation.z and Miniplayfield_5.Rotation.z
'Miniplayfield_4.Rotation.z = 43 and Miniplayfield_5.Rotation.z = 316
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Once the table author has done the above then simply copy and paste the code as follows:

1. Main Code segment copy and paste at the very bottom of the Script (See Code 1 below))


2.Flipper Code 1 simply copy and paste under "Sub FuturePinball_KeyPressed(ByVal KeyCode)"
use the values from you calculations above
Code:
If (fpGameInPlay = TRUE) Then
        ' and not Tilted ?
        If (fpTilted = FALSE) Then

            ' If the Left Flipper Key Has Been Press, Activate The Left Flipper(s)
            If (KeyCode = GetKeyCode(LeftFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then LeftFlipper.SolenoidOn:Miniplayfield_4.rotation.z = 78 'Gimli
                if ZipperFlippersActive = true then LeftFlipper2.SolenoidOn:Miniplayfield_4.rotation.z = 43

                PlaySound "Flipper"
            End If

            ' If the Right Flipper Key Has Been Press, Activate The Right Flipper(s)
            If (KeyCode = GetKeyCode(RightFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then RightFlipper.SolenoidOn:Miniplayfield_5.rotation.z = 282 'Gimli
                if ZipperFlippersActive = true then RightFlipper2.SolenoidOn:Miniplayfield_5.rotation.z = 316

            
                PlaySound "Flipper"
            End If
        End if
End If


3.FlipperCode 2 simply copy and paste under Sub FuturePinball_KeyReleased(ByVal KeyCode)
use the values from your calculatons above
Code:
If (fpGameInPlay = TRUE) Then
        ' and not tilted
        If (fpTilted = FALSE) Then

            ' The Left Flipper Key has been released, Turn Off the Left Flipper(s)
            If (KeyCode = GetKeyCode(LeftFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then LeftFlipper.SolenoidOff:Miniplayfield_4.rotation.z = 130 'Gimli
                if ZipperFlippersActive = true then LeftFlipper2.SolenoidOff:Miniplayfield_4.rotation.z = 95

            End if

            ' The Right Flipper Key has been released, Turn Off the Right Flipper(s)
            If (KeyCode = GetKeyCode(RightFlipperKey)) Then
                SetDummyFlipperLocation()
                if ZipperFlippersActive = false then RightFlipper.SolenoidOff:Miniplayfield_5.rotation.z =230 'Gimli
                if ZipperFlippersActive = true then RightFlipper2.SolenoidOff:Miniplayfield_5.rotation.z = 264

            
            End If
        End If
    End If

4. To Turn Zipper Flippers on/off in Code simple use this :
Code:
ToggleZipperFlippers()

for example when slingshots hit you could use this:

Code:
Sub LeftSlingshotRubber_Hit()
    ToggleZipperFlippers()
    ' add some points
    AddScore(5)
    ' flash the lights around the slingshot
    LeftSlingshotBulb1.FlashForMs 100, 50, BulbOff
    LeftSlingshotBulb2.FlashForMs 100, 50, BulbOff
End Sub


' The Right Slingshot has been Hit, Add Some Points and Flash the Slingshot Lights
'
Sub RightSlingshotRubber_Hit()
    ToggleZipperFlippers()
    ' add some points
    AddScore(5)
    ' flash the lights around the slingshot
    RightSlingshotBulb1.FlashForMs 100, 50, BulbOff
    RightSlingshotBulb2.FlashForMs 100, 50, BulbOff
End Sub


Done.....
 

Attachments

  • maincode.txt
    6.5 KB · Views: 98
  • ZipperFlipperDemo3.fpt
    728 KB · Views: 79
Last edited:
Here is an "uncoded table that is prepped for above. For people to try
The code in this is just the standard "new table " code.
 

Attachments

  • ZipperFlipperUncoded.fpt
    725.5 KB · Views: 72
@Gimli
He...he...he....yes, wanting to think, you had a great intuition, with the function, "Collidable = True / false" it is possible, to use only the real fin, and the zeds only as a shadow.....in my country it is said that, by eating by eating you make crumbs.the meaning is working on one thing often, you can have other solutions or intuition......very good.

ok, staying on the subject of stupidity, and I am more than you:bonk:, I'm thinking about eliminating the "flipper dummy" and using only the zeds, and make them visible when they close and obviously do the opposite......with the texture change function, which can be replaced with an invisible one when needed, I use this function for the wall that I call "gameroom"

and again why not !!!!I'm maybe crazy???:hysterical use only one fin ... instead of three? the normal fin also has shadow, if we only move one with MP ... instead of 2 or three .... that would be great,I think we could try it....maybe
 
BAM physics move doesnt work with flippers thats why we need 3 sets
 
BAM physics move doesnt work with flippers
@Gimli
@TerryRed
@GeorgeH
@Ike Savage
ok....you are right .. this is something we should address with Rav .... sooner or later ... honestly I don't remember the details of this feature ..... but I know what works with the bumpers ... in fact it was designed by Rav at that time for Time-Machine ... but because it works with the bumpers and not with the fins, I still don't understand this

meanwhile, here is the first step I eliminated the "dummy flippers" now we only have 2 fins, the zeds to make you understand ..... which are not zed but standard fins modified by me...

look the video


EDIT:
I did a further test .. it works great?
 
Last edited:
@Gimli
@TerryRed
@GeorgeH
@Ike Savage
ok....you are right .. this is something we should address with Rav .... sooner or later ... honestly I don't remember the details of this feature ..... but I know what works with the bumpers ... in fact it was designed by Rav at that time for Time-Machine ... but because it works with the bumpers and not with the fins, I still don't understand this

meanwhile, here is the first step I eliminated the "dummy flippers" now we only have 2 fins, the zeds to make you understand ..... which are not zed but standard fins modified by me...

look the video


EDIT:
I did a further test .. it works great?
Yes it does, I guess you only need dummies if the distance between flippers increases to make it look like the flippers are transitioning from one place to the next

If they are close I guess your brain is tricked to think they are moving

That makes the process very simple !
 
Yes it does, I guess you only need dummies if the distance between flippers increases to make it look like the flippers are transitioning from one place to the next
but I don't think it is necessary, because the zipper system is only in that specific space, I don't think you need to do more distance ...... because it seems to you that it has some defects? I left the original distance, don't move it ...... but why doesn't physics work on the fins and on the bumpers yes?
 
Last edited:
If they are close I guess your brain is tricked to think they are moving
you edited your comment?, because this was not there before......

I don't think you get this effect or deception, because it's the same way and time to make shadow active or not, and again, same time and way to move "dummy flipper" with mp......

the movement is immediate, or rather I make the texture invisible and visible with the function xBAM.SetTexture

sub SetTextureLeftFlipperOn(textureName1)
xBAM.SetTexture "LeftFlipper", textureName1
End Sub

sub SetTextureLeftFlipperOff(textureName2)
xBAM.SetTexture "LeftFlipper", textureName2
End Sub

sub SetTextureFlipper1On(textureName3)
xBAM.SetTexture "Flipper1", textureName3
End Sub

sub SetTextureFlipper1Off(textureName4)
xBAM.SetTexture "Flipper1", textureName4
End Sub


Sub ZipperOn()
zipper=true
SetTextureLeftFlipperOff "invisible"
SetTextureFlipper1On "tex-flip-s"
LeftFlipper.SolenoidOff
RightFlipper.SolenoidOff
xBAM.DisableFlipperShadows "LeftFlipper"
xBAM.DisableFlipperShadows "RightFlipper"
xBAM.EnableFlipperShadows "Flipper1"
xBAM.EnableFlipperShadows "Flipper2"
'FLIPEER SINISTRO
MiniPlayField_0.Collidable = False' LeftFlipper
MiniPlayField_1.Collidable = True' Flipper1
'FLIPEER DESTRO
MiniPlayField_2.Collidable = False' RightFlipper
MiniPlayField_3.Collidable = True' Flipper2
playsound"zipperClose"
Miniplayfield_0.Time = MPTime
Miniplayfield_1.Time = MPTime
Miniplayfield_2.Time = MPTime
Miniplayfield_3.Time = MPTime
End Sub


Sub ZipperOff()
Zipper = False
SetTextureLeftFlipperOn "tex-flip-s"
SetTextureFlipper1Off "invisible"
Flipper1.SolenoidOff
Flipper2.SolenoidOff
xBAM.DisableFlipperShadows "Flipper1"
xBAM.DisableFlipperShadows "Flipper2"
xBAM.EnableFlipperShadows "LeftFlipper"
xBAM.EnableFlipperShadows "RightFlipper"
'FLIPEER SINISTRO
MiniPlayField_0.Collidable = True
MiniPlayField_1.Collidable = False
'FLIPEER DESTRO
MiniPlayField_2.Collidable = True
MiniPlayField_3.Collidable = False
playsound"zipperOpen"
Miniplayfield_0.Time = MPTime
Miniplayfield_1.Time = MPTime
Miniplayfield_2.Time = MPTime
Miniplayfield_3.Time = MPTime
End Sub
 
Last edited:
ok...look this video....more distant zipper
 
Last edited:
ok, i completed the work, it seems to work well, they are two fins (those standard of fp) that you see in action.


Edit:
now you can also move the fins, as you wish, and adjust the angles as usual.....
Gimli and I have made progress on this system and always improving it for optimal gameplay....but it can always be improving in the future, because BAM is always in constant evolution.
 
Last edited:
but I don't think it is necessary, because the zipper system is only in that specific space, I don't think you need to do more distance ...... because it seems to you that it has some defects?
No it looks great !
It is much easier this way.
I left the original distance, don't move it ...... but why doesn't physics work on the fins and on the bumpers yes?
It was't doable according to Rav
 
@wild
@TerryRed
@GeorgeH
@polygame
@shiva
@NitroNimbus
@Ike Savage
@popotte
@ravarcade

For those wondering what Paolo and I are talking about, we are trying to refine the process of Zipper Flippers / Migrating Flippers.

Conventional zipper flippers are very close together and what I mean by migrating flippers are when the flippers appear to move from greater distances.

BAM does allow moving most objects across the playfield while at the same maintaining full collision physics properties.

But this CANNOT be done at this point with Flippers unfortunately.

BAM does allow toggling flipper collidability and visibility (invisible vs visible)


When Flippers are close together Paolo has discovered that if you simply toggle between sets of flippers it works very well.

However when sets of flippers are further apart then superimposing "Dummy Flippers" that have no collision properties make flippers appear to
transition smoothly between locations. See the video below to see the difference.

1. "Migrating Flippers" from larger distances.

Using "Dummy Flippers"
View attachment DummyAnimation.mp4


No Dummy Flippers
View attachment NoDummy.mp4


2. Zipper Flippers (moving flippers from Close Distances)
With Dummy flippers
View attachment DummyClose.mp4

No Dummy flippers (Wild's approach)
View attachment NoDummyClose.mp4

Conclusion:
In my opinion:

Migrating Flippers look better using super imposed Dummies for smooth animation

Zipper Flippers may look slightly better with Dummies but it is much easier implement this function without them. Much less coding.
And also performance may be better using Paolo's approach as there is less code and less moving parts
 
Last edited:
Nice!!!!! I couldn't have explained it better ... great job.

the fact of fluidity, almost not perceived, because they are very close .... at the greater distance yes .... but this distance is difficult to use as a zipper system .....on the other hand it there much less work to do (in script) easier and simpler to understand, as you have rightly specified too, for those who would like to use it immediately.

Good zipper to all you.
 
Forum activity
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: MMITG is our newest member. Welcome!
      Back
      Top