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.
2. Place one set of DUMMY Flipper Peg Models beside table:
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:
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:
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
Lets move miniplayfield_4 to the location of miniplayfield_2
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
Lets move miniplayfield_5 to the location of miniplayfield_3
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 :
And when the Flipper keys are released in Future pinball the Solenoids turn off:
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
Here is the Code To Set Location of DUMMY "peg" flippers
Note how we make the flippers collidable and non collidable as desired:
Lets make RightFlipper contained in miniplayfield_1 collidable
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
And to make the Shadow reappear we simply set the scale back to 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 :
And the code for the time of the right dummy "peg" flipper contained in Miniplayfield_5 is :
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:
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
@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.
2. Place one set of DUMMY Flipper Peg Models beside table:
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
View attachment Future Pinball 2021-01-16 16-07-04-04.mp4
Enjoy !
Cheers and Happy New Year
Attachments
Last edited: