Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: ONLY BAM FUNCTIONS-COMMANDS
 Post Posted: Tue Jan 16, 2018 12:15 pm 
Offline
User avatar

Joined: Sun May 08, 2011 4:57 pm
Posts: 1063
Location: Turin-ITALY
New function:
Code:
'                               X  Y   Z   Range    Strength
Set MF=xBAM.CreateMagneticField(X, Y,  0,   100,       0)


if you use:
Code:
Set MF=xBAM.CreateMagneticField(light1.X, light1.Y,  0,   100,       0)


just move the light (light1) with the mouse and automatically move the magnet.
----------------------------
instead of "MF" you can use any variable
instead of "light1" can use any object
X,Y,Z magnet coordinates
RANGE where the magnet works
STRENGTH of the magnet
Z it is usually zero. To make less oscillations use negative values
-------------------------------
Here the demo table:
https://www.sendspace.com/file/z2z66b

Used :
"M" per Magnet On
"S" per Magnet Off with slow ball
"F" per Magnet Off with fast ball
--------------------------------
That object has same properties as arguments names. You can read or set that properties anytime in script.
So you can for example move magnet:
MF.X = MF.X + 10
or change strength:
MF.Strength = MF.Strength - 10
-------------------------------
Here the original discussion:
viewtopic.php?f=86&t=6356
I hope I was simple and concise. Have fun changing the values and you will discover a strange magnet .... but realistic.

-------------------------------
Addendum to Franzleo post above (by Gimli)

How-To guide Here:
viewtopic.php?f=55&t=6587&p=85596#p85596

1. You can use Control-C from BAM magnetic field menu to create code:
Code:
Dim MagneticField_0   '                      X           Y    Z  Range Strength
Set MagneticField_0   = xBAM.CreateMagneticField(1442, 871,   0,   500,   1    )


2. Use Control-V to Paste code into script

3.*** On the fly tweaking can only be done if you keep the original names
MagneticField_0, MagneticField_1, MagneticField_2 etc...)


Top 
 Profile  
 
 Post subject: Re: BAM FUNCTIONS-COMMANDS
 Post Posted: Wed Jan 17, 2018 12:12 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
xBAM.GameRoom Games Room on/off
Here is a simple command
For toggling FP default games room on /off in script

1. First enable render arcade room inFP video settings

Then you can remove arcade room in script with
Code:
 xBAM.GameRoom= false


And then switch it back on with
Code:
 xBAM.GameRoom= true


See How-To Guide Here:
viewtopic.php?nomobile=0f=55&t=6587&p=85657#p85657


Last edited by Gimli on Thu Feb 22, 2018 11:19 am, edited 5 times in total.

Top 
 Profile  
 
 Post subject: Re: BAM FUNCTIONS-COMMANDS
 Post Posted: Wed Jan 17, 2018 4:41 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 1603
Location: Arkansas, USA
' xBAM.FixScore

This code increases high score overflow from 2,147,483,647 points (about 2 billion) to 922,337,203,685,477 points (about 922 trillion). High score overflow produces a meditation error while playing a game and the game must be ended.

The code requires BAM version v1.4-183 for it to work. A good feature is that the code still works if you place a single quote before the xBAM.FixScore. This is a "fail safe" because if someone uses a version of BAM before v1.4-183, the line of code just looks like a remark and the code will be ignored.

How to add the code:

It is best to put ' xBAM.FixScore on a separate line by itself and not inside an existing subroutine. I like to add it just below "Option Explicit".

Some scripts require changes to be made before the code will work. There are 3 operators that will make the code fail:

1) The new code is not compatible with the operators like "SetValue" and "AddValue" when used with the score. (It is OK to use "SetValue" and "AddValue" for credits or other functions).
2) The " mod " operator is not compatible with the new code.
3) The back slash (\) operator is not compatible with the new code. A forward slash (/) is OK.

A requirement is you cannot use nvS14, nvS15 or nvS16 in the script. Also the end user must use the new high score screen for the score to be displayed properly.

It is best to test to make sure the code works by adding a cheat code that adds a score higher than 2 billion. I have found that about 80% of all the existing tables I tested required no changes to the script.

Rav explained everything on a separate topic (link below). I posted examples of some tables he changed that use the thre operators listed above so that ' xBAM.FixScore would work:

http://gopinball.com/forum/viewtopic.php?f=86&t=6473

BAM version v1.4-183 was posted here:

http://gopinball.com/forum/viewtopic.ph ... big#p84316

This code was added to a table that is available on PinSimDB. The DMD on the table will only display 13 digits although it is unlikely a player will have a score go that high. A good player might be able to exceed 2 billion points which is why the code was added to the table:

http://www.pinsimdb.org/pinball/table-2 ... ed_edition

George


Last edited by GeorgeH on Sun Feb 25, 2018 7:04 pm, edited 6 times in total.

Top 
 Profile  
 
 Post subject: Re: BAM FUNCTIONS-COMMANDS
 Post Posted: Thu Feb 08, 2018 2:01 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
xBAM.SetTexture For TEXTURE SWAPPING
viewtopic.php?nomobile=1&f=86&t=3249&p=84086&hilit=Texture#p84086
July 9 and July 17 ,2017

Downloadable Demo Here:
http:\\www.ravarcade.pl/beta/SetTextureDemo.fpt

How-to Tutorial Here:
viewtopic.php?nomobile=0f=55&t=6587&p=85592#p85592

The code is simple and is as follows:

Code:
xBAM.SetTexture "fpObjectName", "TextureName", "ObjectFace"


1.fpObjectName refers to the name of the table object you want to swap textures on.

Textures can be swapped on the following object types:
Surface
Toy
Bulb,Light
Gate
Spinner
Trigger
TriggerOpto
SpinningDisk
AutoPlunger
Bumper
Diverter
EmKicker
Popup
Flipper
Target
DropTarget
SwingTarget
TargetVari

2.TextureName refers to the name of the texture you want to use.

**TIP in order to be accessible textures must BOTH be imported into texture manager AND assigned to a surface on the table editor (each surface has 3 slots)

3.ObjectFace (0,1,2) refers to objects with more that one side (front, top, side )


Last edited by Gimli on Thu Feb 22, 2018 11:19 am, edited 2 times in total.

Top 
 Profile  
 
 Post subject: Re: BAM FUNCTIONS-COMMANDS
 Post Posted: Sat Feb 10, 2018 11:28 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
BAM "FAIL SAFE" code

In order to prevent BAM from Crashing when either running FP alone or older versions of BAM
that do not support newer features, Ravarcade developed a simple code.

At the top of the script under Option Explicit put
Code:
Const BAM_VERSION = 0


And then add qualifiers based on the BAM features you are using
We should come up with a full list, but here are some examples:
The first two (GameRoom and Fix Score put under BAM_VERSION= 0)
Code:
If BAM_VERSION > 157 Then
      xBAM.GameRoom = false
   End If


Code:
If BAM_VERSION > 179 Then xBAM.FixScore



The next 2 examples (Miniplayfield and Magnet) you have to use every time these are called for in script....

Code:
If BAM_VERSION > 133 Then
   Dim MiniPlayField_0        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
   Set MiniPlayField_0        = xBAM.CreateMiniPlayfield(  -1200,    -300,       0,     534,       0,     500,       0,       0,       0)
   Dim MiniPlayField_1        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
   Set MiniPlayField_1        = xBAM.CreateMiniPlayfield(   1000,    2000,       0,     534,       0,     500,       0,       0,       0)
   End if


Code:
If BAM_VERSION > 154 Then
Dim MagneticField_0   '                      X           Y    Z  Range Strength
Set MagneticField_0   = xBAM.CreateMagneticField(1442, 871,   0,   500,   1    )
End if


**Note - FAIL SAFE prevents crashing but it should be noted that older versions will load the table but be absent of the new features involved and this may create major issues with game play


Top 
 Profile  
 
 Post subject: Re: BAM FUNCTIONS-COMMANDS
 Post Posted: Sat Feb 17, 2018 11:56 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
BAM Animation Sequencer
Original Discussion Here:
viewtopic.php?nomobilef=86&t=3249&p=70680p70680

How-to Tutorial Here:
viewtopic.php?nomobile=0f=55&t=6587&p=85723#p85723

Examples:
https://www.dropbox.com/s/b03qv1whgl0dz ... s.rar?dl=0
The above zip has example sequence files.
copy the default.seq file into your BAM directory.

Usages:
1. Create "Room Camera Sequences" as an attract mode type feature to view the Arcade Room and Table
2. Create new camera angles from which to play the table. This is accomplished by setting the transition time to next angle to 100000000 ms (27 hours !)

This is a little known BAM Function accessed only through BAM menu.
"Animation Sequencer" is a confusing term.

This function essentially changes the Room Camera angle and creates a sequence of 1 - 10 camera settings per "Animation Sequence".

These are the Parameters that can be set:
1. Camera Image Location Tx, Ty, Tz
2. Camera Image Stretch Sx, Sy, Sz
3. Camera Image Rotation Rx, Ry, Rz
4. Time to move the image to parameters set in 1-3 above

You can create 3 independent Sequences per table and they are saved in BAM/CFG directory

The sequences will be played smoothly by BAM using F1, F2, F3.


Currently there is a bug and the save feature is creating spacing problems in the tablename.seq file that is generated and saved in your BAM/CFG directory.

Bug fixed with:
http://www.ravarcade.pl/beta/BAM.dll

To use this feature you MUST be do the following:
1. Select Desktop in Future Pinball Video Settings (NOT ARCADE)
2.Be in the Advanced BAM Menu
3.Select "Static Cam" in BAM Menu
4.Select "Forced Arcade Mode" under "AddOns" in BAM menu


Last edited by Gimli on Thu Feb 22, 2018 11:21 am, edited 3 times in total.

Top 
 Profile  
 
 Post subject: Re: ONLY BAM FUNCTIONS-COMMANDS
 Post Posted: Tue Feb 20, 2018 7:10 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
xBAM.BallManager for many Custom Balls Features
Using Script to:
1. define Custom Ball Features including:
Size, Mass, Opacity, Ball Texture
2. To enable transforming from one Ball texture to another with game events
3. To enable game events to change when linked to a specific ball


Extensive and Original Discussion Here:
viewtopic.php?nomobile=0f=86&t=5583&p=80071p80071

How-to Guide here:
viewtopic.php?nomobile=0f=55&t=6587&p=85765#p85765

Demo Table Using example below:
https://www.dropbox.com/s/f362uirwvbz0a ... 9.fpt?dl=0
This is WIP, I will update as I go and explain later :shock:

1. Copy and Paste under "Option Explicit" at top of Script

Code:
Function CreateCustomBall ( Source, BallName, Radius, Mass, Opacity )
   xBAM.BallRadius = Radius
   xBAM.BallMass = Mass
   xBAM.BallOpacity = Opacity

   Dim bi
   Set bi = xBAM.BallManager.CreatCustomBall(BallName)
   Source.CreateBall bi.Red, bi.Green, bi.Blue, bi.BallNumber
   AddDebugText "["&xBAM.BallID&"]"
   CreateCustomBall = bi.BallNumber

End Function


2.Ball Textures must be BOTH imported in Texture Manager and added to "surfaces" that you create in the FP table editor.
Each ball you create will have 3 textures
This is Explained "How-to" thread

3. Define Balls ( in example below I chose names "BeachBall" , "VolleyBall" and "TennisBall"

Code:
Dim Beachball, TennisBall, VolleyBall
BeachBall = xBAM.BallManager.DefineCustomBall(192, 192, 192, "Beach_452", "Beach_334", "Beach_269")
TennisBall = xBAM.BallManager.DefineCustomBall( 222, 253,  130, "Tennis_452", "Tennis_334", "Tennis_269")
VolleyBall = xBAM.BallManager.DefineCustomBall( 255, 255, 255, "Volley_452", "Volley_334", "Volley_269")



4. Create a ball in a kicker. Typical location is under Sub Createnewball()
Code:
Sub CreateNewBall()
   call CreateCustomBall(PlungerKicker, BeachBall, 13.0, 20, 1)
       BallsOnPlayfield = BallsOnPlayfield + 1
      PlungerKicker.SolenoidPulse
End Sub

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
5."Transformation Code" is for Changing custom balls with either hit events or simply in code add the following in same location as above:

Code:
Dim BallTransformations
Set BallTransformations = xBAM.BallManager.CreateTransformation
call BallTransformations.AddRule(BeachBall, TennisBall)
call BallTransformations.AddRule(TennisBall, VolleyBall)
call BallTransformations.AddRule(VolleyBall, BeachBall)

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Example of hit event (This will rotate between custom ball each time LeftSlingshot is hit)

Code:
Sub LeftSlingshotRubber_Hit()
   BallTransformations.UpdateBall(fpBallID)
   End Sub


Example of changing custom ball with code (this will toggle between custom balls with pressing C, V or B on keyboard)

Code:
Sub FuturePinball_KeyPressed(ByVal KeyCode)
   If keycode = 48 then call xBAM.BallManager.UpdateBall(fpBallID,BeachBall)
   If keycode = 47 then call xBAM.BallManager.UpdateBall(fpBallID,VolleyBall)
   If keycode = 46 then call xBAM.BallManager.UpdateBall(fpBallID,TennisBall)
End sub


Last edited by Gimli on Fri Mar 02, 2018 11:31 pm, edited 5 times in total.

Top 
 Profile  
 
 Post subject: Re: ONLY BAM FUNCTIONS-COMMANDS
 Post Posted: Wed Feb 21, 2018 2:03 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2061
Location: Ontario, Canada
xBAM.Miniplayfield
Original Thread Here:
viewtopic.php?nomobile=0f=86&t=6214

How-To Guide Here:
viewtopic.php?nomobile=1&f=55&t=6587&p=85768#p85768

Usages:
1. Originally created for scaling, rotating, moving a "Miniplayfield" from beside the table
and onto the desired location on the main table playfield

2. Can actually be used on Any object or group of objects (including DMD's , overlays, all table objects) can be scaled, rotated, and moved anywhere in the FP environment (both on the table and in the surrounding Games Room)

3. A Sequence of Moveto commands can be used to animate the miniplayfield or object(s) in 1. and 2. above

4. Can be used to attach any object to an invisible ball



''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
A Code Creating and Defining A "Miniplayfield"
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Generated from BAM/miniplayfield Menu

It should look like this:
Code:
Dim MiniPlayField_0       
Set MiniPlayField_0 = xBAM.CreateMiniPlayfield(  208,   308,  484,   584,   0,   100,   258,   534,  50)


Moveto Command is also generated from the BAM/miniplayfield menu
The Script should now look like this:
Code:
'                              DstX     DstY     DstZ     RotX   RotY   RotZ    Scale   Time
Call MiniPlayField_0.MoveTo( 258,     534,     150,       0,       0,       0,     1,    0)


C.Object Animation can be achieved by creating a timer in Table Editor
and adding a code in the script to go from one "moveto" command created above to another.
The BAM/MiniPlayfield Menu has a real-time animation player to assist you.


"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
D. Assigning an object to a ball
1This achiieved by using xBAM.BallManager to create a custom ball
2.Using xBAM.miniplayfield to capture your object
3.Using xBAM.TrackBall closeto

Demo Table Here:
https://www.dropbox.com/s/1uc1whmxrmaen ... g.fpt?dl=0

***************************************
Other Miniplayfield Codes

Object created with xBAM.CreateMiniPlayfield have many properties. They may be used to move, rotate, scale mini-playfield.
- MiniPlayField_0.Position.X (or .Y, or .Z) - set it to move playfield to any position.
- MiniPlayField_0.Rotation.X (or .Y, or .Z) - set rotation of mini-playfield.
- MiniPlayField_0.Scale - set scale of mini-playfield.
- MiniPlayField_0.Time - same as last param in "MoveTo" coomand. When this param is set to value greater than 0, mini-playfield will be animated from current position to target position.

All values from .Position, .Rotation, .Scale you can read in script. When you reed that value during animation, you will get value between starting and ending position.
In many scenarios you will want to increase/decrease target value and you don't know if playfiled reach target position. So you may read previously set target position with:
.TargetPosition.X (or .Y, or .Z) ,
.TargetRotation.X (or .Y, or .Z) ,
.TargetScale

... OR current position / rotation / scale, even if animation is played.
.CurrentPosition.X (or .Y, or .Z) ,
.CurrentRotation.X (or .Y, or .Z) ,
.CurrentScale
***************************************************


Top 
 Profile  
 
 Post subject: Re: ONLY BAM FUNCTIONS-COMMANDS
 Post Posted: Sat Apr 14, 2018 1:36 pm 
Offline
User avatar

Joined: Sun May 08, 2011 4:57 pm
Posts: 1063
Location: Turin-ITALY
xBAM.SetTexture "fpObjectName", "TextureName", "ObjectFace"

fpObjectName refers to the name of the table object you want to swap textures on.
Object types are:
Surface,Toy,Bulb,Light,Gate,Spinner,Trigger,TriggerOpto,SpinningDisk,AutoPlunger,Bumper Diverter,EmKicker,Popup,Flipper,Target;DropTarget,SwingTarget,TargetVari
TextureName refers to the name of the texture you want to use.
ObjectFace (0,1,2) refers to objects with more that one side (front, top, side )

Extensive and Original Discussion Here:
http://www.gopinball.com/forum/viewtopic.php?nomobile=1&f=86&t=3249&p=84086&hilit=Texture#p84086

Downloadable Demo Here:
https://www.sendspace.com/file/f8rss3

Explanation of Demo:
Create one "Surface" Top Height= 0,1 e Bottom Height= 1 as new playfield (NewPf)
Create an other "Surface"(Surface1) to load on Top Texture:PFnormal in Side Texture : PFon and in Enamel Map : PFoff
Place all the lights in Position/Surface = New PF

By pressing the keys A, S, D you will see the 3 textures of the playfield change.
Good fun


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

Board index » Future Pinball » BAM corner


Who is online

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