beta BAM.dll:
http://www.ravarcade.pl/beta/BAM.dllSmall warning.
Next weekend i have to move "ravarcade.pl" to another hosting service.
It may creates troubles with access to my site.
This feature require BAM_VERSION >= 198.
Part 1.
BEFORE YOU START DO ANYTHING WITH CAMERA IN SCRIPT.
xBAM.Camera.ModeSimple read only property.
= 0 if game is running in "Desktop Mode"
= 1 if game is running in "Cab Mode" (Arcade Mode)
= 2 if game is running in "VR Mode"
Because you should not use in script "magic numbers" i added constants:
xBAM_Camera_Desktop = 0
xBAM_Camera_Cabinet = 1
xBAM_Camera_VR = 2
Script:
Code:
If xBAM.Camera.Mode = xBAM_Camera_Desktop Then
' Do something if user plays in "Desktop Mode"
End If
xBAM.AspectRatioSimple read only property.
Equal to screen width dived by screen height.
So, if you play on screen in res 1920 x 1080 then xBAM.AspectRatio is equal to 1.7777.. (16/9)
If you have rotated screen (in FP Video/Rendering Options) it will be equal to 0.5625 (9/16)
xBAM.ScriptControlSimple read only property.
= True if script can change camera
= False if script can't change camera
I think, that user will be confused if something start to happend with game camera without warning. So, i belive script have to ASK user for permision to do anything with camera.
When game starts xBAM.ScriptControl= False.
xBAM.RequestForControlProcedure. No params.
Script should call it, if xBAM.ScriptControl = False and want to take control on camera.
Code:
If xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End If
User will see:

User can with fippers Allow or Deny.
Congratulation. Now you have 4 new thing in script and still cant do anything with camera.
Part 2.
DESKTOP MODE.
xBAM.Camera.DesktopSet eyeX, eyeY, eyeZ, atX, atY, atZ, FOV, delayProcedure.
You can define camera with 3 things:
- point from where you look (eye)
- point you are looking at (at)
- field-of-view (fov)
last param, delay, is time in ms whan camera should be set.
Code:
xBAM.Camera.DesktopSet 232, 961.2, 373.8, 232, 694.2, 0, 80, 2000
Note. It will not do anything with camera if xBAM.ScriptControl = FALSE.
xBAM.Camera.DesktopRelease delayProcedure.
One pram: delay in ms.
Most likely you will want to change camera only for some time. So, you will want to change camre back to settings used by user. This procedure allow you to "release camera" or give back control over it to FP/BAM.
Bigger example:
Code:
Sub FuturePinball_KeyPressed(ByVal KeyCode)
If KeyCode >= 30 And KeyCode <= 33 And xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End If
If KeyCode = 30 Then
xBAM.Camera.DesktopSet 232, 961.2, 373.8, 232, 694.2, 0, 80, 2000
End If
If KeyCode = 31 Then
xBAM.Camera.DesktopSet 361.2, 1068, 480.6, 258, 640.8, 0, 60, 2000
End If
If KeyCode = 32 Then
xBAM.Camera.DesktopSet 0, 854.4, 213.6, 258, 694.2, 0, 90, 2000
End If
If KeyCode = 33 Then
xBAM.Camera.DesktopSet 0, 854.4, 213.6, Bumper1.X, Bumper1.Y , 0, 20, 1000
End If
If KeyCode = 34 Then
xBAM.Camera.DesktopRelease 100
End If
We use 4 keys: A,S,D,F and G.
A,S,D,F are used to set 1 of 4 predefined camera settings.
Note: In last "camera settings" you can see "Bumper1.X, Bumper1.Y". So, if you have Bumper1 on table, when camera will look at it.
G is used to release constol camera.
Also, when you press keys A,S,D,F and script don't have control over camer, user will see "request".
Finall tip.
In BAM menu you will find "Camera" menu. (only if menu type is "advanced" and you are in "Desktop Mode").
Here you can edit settings. You have 3 "global camera presets" (values stored in "BAM/reality.dat"). They are accessible on all tables and 3 "local camera presets" for current table (values are stored in "TableName.cfg").
You can prest CTRL-C. It will put in clipboard text ready to paste in script editor.
xBAM.Camera.DesktopSetLookAt eyeX, eyeY, eyeZ, atX, atY, atZ, FOV, delayProcedure.
Same params as for xBAM.Camera.DesktopSet.
You can set different camera params for case, when user press TAB or LookAtBackbox is executed.
IMPORTANT! Call xBAM.Camera.DesktopSetLookAt right after xBAM.Camera.DesktopSet, because xBAM.Camera.DesktopSet will reset camare params.
Code sample:
Code:
Sub FuturePinball_KeyPressed(ByVal KeyCode)
If KeyCode = 30 Then
LookAtBackbox
End If
If KeyCode = 31 Then
LookAtPlayfield
End If
If (KeyCode = 32 OR KeyCode = 33) AND xBAM.Camera.ScriptControl = FALSE Then
xBAM.Camera.RequestForControl
End If
If KeyCode = 32 Then
xBAM.Camera.DesktopSet -582, 734, 500, -582, -5.8, 0, 50, 400
xBAM.Camera.DesktopSetLookAt -582, 934, 500, -582, -66, 330, 44, 400
End If
If KeyCode = 33 Then
xBAM.Camera.DesktopSet 1338, 934, 500, 1308, 634, 0, 50, 400
xBAM.Camera.DesktopSetLookAt 1338, 934, 500, 1308, 634, 0, 40, 400
End If
Key A - will call "LookAtBackbox",
Key S - will call "LookAtPlayfield",
Key D - will set cam params to look at "moon patrol" cab in default FP game room
Key F - will set cam params to look at "donkey kong" in default FP game room
TAB key will change little bit look at that both toys in game room, but cam will not look at backbox
Part 3.
DESKTOP CAMERA ANIMATION - HOW TO USE BAM MENU.
See, video:
https://youtu.be/hnIiXPnxQwEGo to: [DEV Options] -> [Desktop Camera Animation]
First 10 lines is list of camera params. Same as for
xBAM.Camera.DesktopSet eyeX, eyeY, eyeZ, atX, atY, atZ, FOV, delay.
You can add new, delete, edit all params. If there is more than 10, it will scroll.
At end of list there is button "insert". Press enter and it will add new entry.
Keyboard shortcuts:
- SHIFT+ENTER - it will copy settings of current camera (that what you see now on screen). You can use Manual Camera (F11). I did it on video above
- SHIFT+INSERT - it will add new camera settings to list just before line of current select line. So, you can add now position in list not only at end, but also in middle or at begin of list
- SHIFT+DELETE - will remove current postion from list
- CTRL-C - will copy whole camera animation to clippbord in form ready to paste in script
Lines in menu:
- Play - will play current sequence. It must have 3 or more lines.
- Optimize Cam Speed - you can set how long it takes to move camera to next point in list. Because distance between 2 positions on list can varry, it is not easu to guess how long it takes to move camera. This command will calc total camera move distance and will set all delays on list based on distance between points. It will also keep total animation time constants. So, it will make camera move speed "more constant". This move can't be constant, but will be less vary.
- Slot - you can select one of 5 slots. You can use Save and Load command to save and load sequences. That sequences are stored in "default.seq" in BAM dir. They are also stored in form "ready to paste in script".
Now, it is time to create own animation, edit it, play with it, save it and take a look at content of "default.seq".
Part 3.
DESKTOP CAMERA ANIMATION - SCRIPT COMMANDS
You can create up to 100 animations. Every animation have own integer number assigned. That number is between 0 and 99. Only first 5 are stored in "default.seq". You can have more in script.
If you look at "default.seq" with stored animation, you will see something like this:
Code:
' ===================== DESKTOP CAMERA ANIMATION ======================
If BAM_VERSION > 205 Then
xBAM.Camera.DesktopSequenceBegin 0
xBAM.Camera.DesktopSequenceAddEntry 483.5, 958.5, 156.5, 373.3, 745, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 513.6, 736.1, 121.2, 288.6, 876.2, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 314.9, 674.3, 60, 479.4, 860.9, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 298, 843.7, 125.6, 418.3, 783.1, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 439.3, 923.1, 125.6, 222.8, 825.8, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 364.1, 1006.7, 100.2, 207.7, 888.4, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 206.8, 950.2, 40, 112.4, 837.3, 0, 65, 1000
xBAM.Camera.DesktopSequenceAddEntry 58.8, 853.4, 86.1, 87.3, 711.7, 0, 75, 1000
xBAM.Camera.DesktopSequenceAddEntry 87.5, 723.4, 95.8, 272.3, 395.3, 0, 40, 1000
xBAM.Camera.DesktopSequenceAddEntry 341.4, 625.4, 105.8, 423.5, -106.8, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 515.3, 570.7, 132, 64.5, 298.7, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 261.3, 411.5, 119.2, 397, -313.8, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry -80.2, 387.4, 223.6, 243.7, 30.2, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry -46.7, 253.9, 176.8, 386.4, 50.1, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 155.1, 100, 194.2, 313, 204.9, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 422.8, 108.4, 223.5, 350.4, 268.8, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 464.6, 236, 141.5, 319.3, 628.7, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 361.1, 452.7, 116.1, 226.4, 685, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 180.3, 711.5, 96.7, 114.7, 792.5, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 150.4, 846.9, 174, 103.9, 829.3, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry 126, 936.1, 374.6, 82.7, 835.3, 0, 50, 1000
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequenceBegin 1
xBAM.Camera.DesktopSequenceAddEntry 106.5, 252.3, 246.1, 104.4, 223.8, 0, 50, 1000
xBAM.Camera.DesktopSequenceAddEntry -148.9, 249.7, 227.4, -149.8, 193.3, 0, 50, 1000
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequenceBegin 2
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequenceBegin 3
xBAM.Camera.DesktopSequenceEnd
xBAM.Camera.DesktopSequenceBegin 4
xBAM.Camera.DesktopSequenceEnd
End If
' =====================================================================
This looks like script

. You can copy it to your own script. Now about commands.
xBAM.Camera.DesktopSequenceBegin animationIdProcedure.
One param. Animation Id number. Integer value in range: 0 ... 99
This command must be caller before you add new camera position entry to list.
It will also delete previous sequence stored at given animationId. So, remember to edit it, when you add something to script.
If you press CTRL-C in menu, BAM will set put in clipboard all needed commands to create whole sequence, but at begin you will have:
Code:
xBAM.Camera.DesktopSequenceBegin 10
Remember to change that
10 if you want to have more animations
xBAM.Camera.DesktopSequenceAddEntry eyeX, eyeY, eyeZ, atX, atY, atZ, FOV, delayProcedure.
Same params as for xBAM.Camera.DesktopSet.
This procedure will add one entry to camera animation.
xBAM.Camera.DesktopSequenceEndProcedure.
Call it after last entry.
xBAM.Camera.DesktopSequencePlay animationIdProcedure.
One param. Animation Id number. Integer value in range: 0 ... 99
Finally you can play animation from script.
If you call
xBAM.Camera.DesktopSet,
xBAM.Camera.DesktopSetLookAt or
xBAM.Camera.DesktopRelease during played animation, when animation will be stoped.
Same thing will happend, when user will press keys like F1 .. F8.
---- update: mar 31 2018 ---
- TAB key and script commands LookAtBacbkox, LookAtPlayfield works with new camera.
- new
xBAM.Camera.DesktopSetLookAt command, see info above.
to set camera params when TAB key is pressed or LookAtBackbox is executer. Same params as xBAM.Camera.DesktopSet command. Must be executer right after
xBAM.Camera.DesktopSet, because
xBAM.Camera.DesktopSet it will set "default" params for camera, when TAB is pressed.
Only in script you can set different params for camera when TAB key is pressed.
----- update: apr 17 2018 ---
- added Desktop Camera Animations