Code/Example Adding auto camera panning of tables.

Coding and examples for future Pinball and BAM

HZR

Pinball Hall of Famer
Joined
Aug 17, 2021
Messages
469
Solutions
1
Reaction score
137
Points
56
Favorite Pinball Machine
elm street
Can someone help me add camera Panning to my tables.
Meaning when a table loads the camera will go around the machine and table, I would like to add this for my cabinet. Any help appreciated. I tried adding this script but it didnt work. Figured I may ask before I spend hours on something that may be simple
example

''''''''''''''''''''''''''''''''''''''''''Camera Settings'''''''''''''''''''''''''''''''''''''''''''''''''

If xBAM.Camera.Mode = xBAM_Camera_Desktop then DesktopMode = True
If xBAM.Camera.Mode = xBAM_Camera_Cabinet Then DesktopMode = False


'Desktop Camera sequence for Panning
xBAM.Camera.DesktopSequenceBegin 10
xBAM.Camera.DesktopSequenceAddEntry -725, 1869, 928.6, 690.1, -22.6, 110.6, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 1275, 1869, 916.7, 220.3, -114.6, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 344.8, 1869, 1068.6, 297.9, -371.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 372.8, 1800.8, 948.8, 352.8, -102.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 192.6, 558.3, 0, 50, 8000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 10000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 3000
xBAM.Camera.DesktopSequenceAddEntry 275, 1421.5, 450, 275, 434, 0, 50, 3000
xBAM.Camera.DesktopSequenceEnd

'Cabinet Camera sequence for Panning
xBAM.Camera.CabinetSequenceBegin 11
xBAM.Camera.CabinetSequenceAddEntry 0, 0, 0, 1, 1, 1, 0, 0, 0, 5000
xBAM.Camera.CabinetSequenceAddEntry 0, 1200, -500, 2, 2, 1.1, 20, -0, 0, 10000
xBAM.Camera.CabinetSequenceAddEntry -1700, 800, -600, 2, 2, 1.1, 20, 0, -70, 10000
xBAM.Camera.CabinetSequenceAddEntry 1700, 800, -600, 2, 2, 1.1, 20, -0, 70, 10000
xBAM.Camera.CabinetSequenceEnd


Sub CheckCamera()
If xBAM.Camera.Mode = xBAM_Camera_Desktop and RoomCamera = 1 Then
DesktopMode = True
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if
End If
If xBAM.Camera.Mode = xBAM_Camera_Desktop and RoomCamera = 2 Then
DesktopMode = True
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if
End If
If xBAM.Camera.Mode = xBAM_Camera_Desktop and RoomCamera = 3 Then
DesktopMode = True
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if
End If

If xBAM.Camera.Mode = xBAM_Camera_Desktop then
DesktopMode = True

If RoomCamera = 0 then nvR2 = 0:xBAM.Camera.DesktopRelease
If RoomCamera = 1 then nvR2 = 1:xBAM.Camera.DesktopSequencePlay 10
If RoomCamera = 2 then nvR2 = 2:xBAM.Camera.DesktopSequencePlay 10
If RoomCamera = 3 then nvR2 = 3:xBAM.Camera.DesktopRelease
End if

If xBAM.Camera.Mode = xBAM_Camera_Cabinet and RoomCamera = 1 Then
DesktopMode = False
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if
End If
If xBAM.Camera.Mode = xBAM_Camera_Cabinet and RoomCamera = 2 Then
DesktopMode = False
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if
End If

If xBAM.Camera.Mode = xBAM_Camera_Cabinet then
DesktopMode = False
If RoomCamera = 0 then nvR2 = 0:xBAM.Camera.CabinetRelease
If RoomCamera = 1 then nvR2 = 1:xBAM.Camera.CabinetSequencePlay 11
End if
End Sub

''''''''''''''''''''''''''''''''''''''''''''''End if Camera Settings''''''''''''''''''''''''''''''''''
 
Can someone help me add camera Panning to my tables.
Meaning when a table loads the camera will go around the machine and table, I would like to add this for my cabinet. Any help appreciated. I tried adding this script but it didnt work. Figured I may ask before I spend hours on something that may be simple
example
in fp,con il tasto f7 hai la panoramica, chiamata fixed view...
in fp, with the f7 key you have the overview, called fixed view ...
Cattura1.JPG


invece se vuoi un codice di Bam,che ti permette ad ogni avvio di fp,la panoramica per il tuo cabinet,ecco cosa devi fare
devi creare la tua "custom camera" in questo modo:

instead if you want a Bam code, which allows you at each fp start the overview for your cabinet, here's what you need to do you have to create your "custom camera" in this way;


io spiego come creare la tua "custom camera" ci sono dei miei video e una demo
I explain how to create your "custom camera" there are my videos and a demo

se hai difficoltà dimmelo,sono felice di aiutare
if you have difficulty tell me, i am happy to help

ciao
 
Last edited:
Indiana Jones enhanced.
That's where I snagged the script.
I like the panning of this script. Just havent gotten it working.
It pans once the table loads so I dont know what triggers it.
I dont know script.

If I have the cam settings can I just paste the script at tue beginning of each table script.
So they are all the same.
Fast and easy?
 
Indiana Jones enhanced.
That's where I snagged the script.
I like the panning of this script. Just havent gotten it working.
It pans once the table loads so I dont know what triggers it.
I dont know script.

If I have the cam settings can I just paste the script at tue beginning of each table script.
So they are all the same.
Fast and easy?
I thought that with "custom camera" you could solve what you ask.
 
have not tried. my father is in hospital, very bad heart.
I'm very sorry friend, the right words to comfort are hard to find, I hope your father gets better.
 
i know how to change the camera view.

i want it to show a table like TPA and PB fx
try indy enhanced edition, it does it at the beginning
 
I think what you are wanting is the Camera Animation. After you start playing a table, open the BAM menu and arrow down to "DEV Options" then arrow down to "Desktop Camera Animation". It has been a while since I used it. You can create steps to move the camera. Unfortunately, I don't remember how to set it up. @Gimli probably remembers how to do it or if Indy has it, you can probably imitate the steps on other tables. ...Or if I remember correctly, you might be able to save the animation to other tables.
 
i know how to change the camera view.

i want it to show a table like TPA and PB fx
try indy enhanced edition, it does it at the beginning
I did the code I will have a look a give you a generic to use on any table....
 
I did the code I will have a look a give you a generic to use on any table....
just to understand, what kind of code is it?
 
Here is the a generic table see code at top of script which is this:

Code:
''''''''''''''''''''''''''''''''''''''''''Camera Settings'''''''''''''''''''''''''''''''''''''''''''''''''
xBAM.Camera.RequestForControl True

If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if

'Desktop Camera sequence for Panning
xBAM.Camera.DesktopSequenceBegin 10
xBAM.Camera.DesktopSequenceAddEntry -725, 1869, 928.6, 690.1, -22.6, 110.6, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 1275, 1869, 916.7, 220.3, -114.6, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 344.8, 1869, 1068.6, 297.9, -371.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 372.8, 1800.8, 948.8, 352.8, -102.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 192.6, 558.3, 0, 50, 8000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 10000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 3000
xBAM.Camera.DesktopSequenceAddEntry 275, 1421.5, 450, 275, 434, 0, 50, 3000
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequencePlay 10


'Cabinet Camera sequence for Panning
xBAM.Camera.CabinetSequenceBegin 11
xBAM.Camera.CabinetSequenceAddEntry 0, 0, 0, 1, 1, 1, 0, 0, 0, 5000
xBAM.Camera.CabinetSequenceAddEntry 0, 1200, -500, 2, 2, 1.1, 20, -0, 0, 10000
xBAM.Camera.CabinetSequenceAddEntry -1700, 800, -600, 2, 2, 1.1, 20, 0, -70, 10000
xBAM.Camera.CabinetSequenceAddEntry 1700, 800, -600, 2, 2, 1.1, 20, -0, 70, 10000
xBAM.Camera.CabinetSequenceEnd



xBAM.Camera.CabinetSequencePlay 11



xBAM.Camera.DesktopSequencePlay 10

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

If you copy and paste into any table it should work for both desktop and cabinet mode.
Although cabinet mode is a little trickier as each person has a different sized cabinet...

xBAM.Camera.RequestForControl True removes the permission request


if you press "M" it will stop the pan and "b" will start it again.

Code:
Sub FuturePinball_KeyPressed(ByVal KeyCode)

    if keycode = 48 then xBAM.Camera.DesktopSequencePlay 10:xBAM.Camera.CabinetSequencePlay 11
    if keycode = 50 then xBAM.Camera.DesktopRelease:xBAM.Camera.CabinetRelease
 
End Sub

Cheers

Bob
 

Attachments

  • camera.fpt
    224 KB · Views: 44
Last edited:
@hellrzr2k1
I have a tutorial that explains how I got these values. See Section on Desktop camera animation

 
Here is the a generic table see code at top of script which is this:

Code:
''''''''''''''''''''''''''''''''''''''''''Camera Settings'''''''''''''''''''''''''''''''''''''''''''''''''
xBAM.Camera.RequestForControl True

If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End if

'Desktop Camera sequence for Panning
xBAM.Camera.DesktopSequenceBegin 10
xBAM.Camera.DesktopSequenceAddEntry -725, 1869, 928.6, 690.1, -22.6, 110.6, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 1275, 1869, 916.7, 220.3, -114.6, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 344.8, 1869, 1068.6, 297.9, -371.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 372.8, 1800.8, 948.8, 352.8, -102.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 192.6, 558.3, 0, 50, 8000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 10000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 3000
xBAM.Camera.DesktopSequenceAddEntry 275, 1421.5, 450, 275, 434, 0, 50, 3000
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequencePlay 10


'Cabinet Camera sequence for Panning
xBAM.Camera.CabinetSequenceBegin 11
xBAM.Camera.CabinetSequenceAddEntry 0, 0, 0, 1, 1, 1, 0, 0, 0, 5000
xBAM.Camera.CabinetSequenceAddEntry 0, 1200, -500, 2, 2, 1.1, 20, -0, 0, 10000
xBAM.Camera.CabinetSequenceAddEntry -1700, 800, -600, 2, 2, 1.1, 20, 0, -70, 10000
xBAM.Camera.CabinetSequenceAddEntry 1700, 800, -600, 2, 2, 1.1, 20, -0, 70, 10000
xBAM.Camera.CabinetSequenceEnd



xBAM.Camera.CabinetSequencePlay 11



xBAM.Camera.DesktopSequencePlay 10

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

If you copy and paste into any table it should work for both desktop and cabinet mode.
Although cabinet mode is a little trickier as each person has a different sized cabinet...

xBAM.Camera.RequestForControl True removes the permission request


if you press "M" it will stop the pan and "b" will start it again.

Code:
Sub FuturePinball_KeyPressed(ByVal KeyCode)

    if keycode = 48 then xBAM.Camera.DesktopSequencePlay 10:xBAM.Camera.CabinetSequencePlay 11
    if keycode = 50 then xBAM.Camera.DesktopRelease:xBAM.Camera.CabinetRelease
 
End Sub

Cheers

Bob
AWESOME , thank you very much. I tried using the indi code, but couldnt figure out what was triggering the anim
 
AWESOME , thank you very much. I tried using the indi code, but couldnt figure out what was triggering the anim
Works like a charm. a bit farther away than expected, but Ill tinker with the values when I get time.
Bam dev camera mode doesnt function properly for me, not sure why. It did at one time.
because Ive been away from FP for a while.
 
where does the script for the keyboard routing go.
i tried before and after and it doesnt work
 
i feel stupid now..
thanks, you saved me an hour messing around.
 
@hellrzr2k1
I have a tutorial that explains how I got these values. See Section on Desktop camera animation

Thanks for the guide btw, Im getting better at this (i think)
managed to get my auto view working.. can to use xbam.camera x,y,z, etc.... but its better than hitting a button everytime you get multiball on single screen scroll mode 1
 
TUTORIAL Script for table camera panning (animated 3d view of full table and playfield)


' *********************************************************************
' ** **
' ** Future Pinball Full Table and Playfield Camera Panning
' ** Thanks to Gimli and Slamt1lt
' ** **
' *********************************************************************

Option Explicit
xBAM.CreateAllExt

' *********************************************************************
' *** DELETE THE 3 LINES BELOW IF YOU HAVE A PINCAB OR HATE THE
' ***DENY / ALLOW POP UP THAT APPEARS WHEN THE TABLE IS LOADED
' *********************************************************************

If (xBAM.Camera.ScriptControl = FALSE) Then
xBAM.Camera.RequestForControl
End If
'************************************************************************
' ** Camera Panning Animation Sequence **
'************************************************************************
xBAM.Camera.DesktopSequenceBegin 10
xBAM.Camera.DesktopSequenceAddEntry -725, 1869, 928.6, 490.1, -22.6, 110.6, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 1275, 1869, 916.7, 220.3, -114.6, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 344.8, 1869, 1068.6, 297.9, -371.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 372.8, 1800.8, 948.8, 352.8, -102.1, 0, 50, 7000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 192.6, 558.3, 0, 50, 8000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 10000
xBAM.Camera.DesktopSequenceAddEntry 199.4, 1116.7, 434.8, 183.7, 617.2, 449.6, 50, 3000
xBAM.Camera.DesktopSequenceAddEntry 275, 1421.5, 450, 275, 434, 0, 50, 3000
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequencePlay 10


'Cabinet Camera sequence for Panning
xBAM.Camera.CabinetSequenceBegin 11
xBAM.Camera.CabinetSequenceAddEntry 0, 0, 0, 1, 1, 1, 0, 0, 0, 5000
xBAM.Camera.CabinetSequenceAddEntry 0, 1200, -500, 2, 2, 1.1, 20, -0, 0, 10000
xBAM.Camera.CabinetSequenceAddEntry -1700, 800, -600, 2, 2, 1.1, 20, 0, -70, 10000
xBAM.Camera.CabinetSequenceAddEntry 1700, 800, -600, 2, 2, 1.1, 20, -0, 70, 10000
xBAM.Camera.CabinetSequenceEnd

' *************************************************************************************
' ** Future Pinball Defined Script Events
' ** put the below code where all the keyboard definitions are in the table script ' **************************************************************************************

Sub FuturePinball_KeyPressed(ByVal KeyCode)

' ** Keycode 48 = B key if pressed show camera panning

if keycode = 48 then xBAM.Camera.DesktopSequencePlay 10:xBAM.Camera.CabinetSequencePlay 11

' ** Keycode 32 = D key, if D key (or Plunger is pressed will also stop camera panning)

if keycode = 32 then xBAM.Camera.DesktopRelease:xBAM.Camera.CabinetRelease
If (KeyCode = GetKeyCode(plungerkey)) Then xBAM.Camera.DesktopRelease:xBAM.Camera.CabinetRelease
End if
END SUB
 
Last edited:
Just to make sure it is clear:
' ***DENY / ALLOW POP UP THAT APPEARS WHEN THE TABLE IS LOADED

You won't be asked to DENY/ALLOW the camera control if you use:
xBAM.Camera.RequestForControl True
 
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.
      Mibs Mibs: StevOz has posted a new reply in the thread "A Random solution.".
      Back
      Top