GoPinball.com
http://www.gopinball.com/forum/

BAM Commands Comment and Discussion
http://www.gopinball.com/forum/viewtopic.php?f=86&t=6583
Page 5 of 11

Author:  Gimli [ Wed Feb 28, 2018 9:23 am ]
Post subject:  Re: BAM Commands Comment and Discussion

Are you using miniplayfield for your gameroom?
If so just set second last number in your miniplayfield code to 0

"Call miniplayfield_0.moveto (bla bla , 0, bla)"

If you look at the grid above the code, you can see this is number for "Scale"
Setting Scale to 0, makes your room disapear
Code:
'                              DstX    DstY    DstZ   RotX   RotY    RotZ   Scale    Time
Call MiniPlayField_0.MoveTo(  132.3,   636.7,   0.6,      0,     0,      0,      1,      0)


See this
viewtopic.php?nomobile=f=55&t=6587&p=85657#p85657

You really have 3 options:
1.Wild GameRoom on (FP GameRoom Off)
2.FP GameRoom On (Wild GameRoom Off)
3.Both off (Room is black)

1. Wild GameRoom On
Code:
xBAM.GameRoom = False
Call miniplayfield_0.moveto  (bla,bla,bla, Previous Scale Number, bla)


2. FP GameRoom ON
Code:
xBAM.GameRoom = True
Call miniplayfield_0.moveto (bla,bla,bla,0,bla)

3. Both Off
Code:
xBAM.GameRoom = False
Call miniplayfield_0.moveto  (bla,bla,bla, 0, bla)


So, If you want 3 options with keycode = 34 then I can take your code and change it like this:

Code:
If KeyCode = 34 Then  'key G
  GameRoomOnOff = GameRoomOnOff + 1
 If GameRoomOnOff > 3 then GameRoomOnOff = 1
   If GameRoomOnOff  = 1 Then
      xBAM.GameRoom= false
     Call Miniplayfield_0.moveto  (bla, bla, bla, bla, Scale Number,bla)
   End if
   If GameRoomOnOff  = 2 Then
      xBAM.GameRoom= true
     Call Miniplayfield_0.moveto  (bla, bla, bla, bla, 0,bla)
   End if
   If GameRoomOnOff  = 3 Then
      xBAM.GameRoom= false
     Call Miniplayfield_0.moveto  (bla, bla, bla, bla, 0,bla)
   End if
  End if
   

Author:  wild [ Wed Feb 28, 2018 9:55 am ]
Post subject:  Re: BAM Commands Comment and Discussion

ok,but you could make an effort, more....I like it, and I understand the subroutine

Code:
Sub GameRoomBamOn()
Dim MiniPlayField_1        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_1        = xBAM.CreateMiniPlayfield(   -400,    -80,      300,     700,      50,     300,    -300,    405,       0)
'                              DstX     DstY      DstZ     RotX     RotY     RotZ    Scale     Time
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   25.000,    0)
End Sub


Sub GameRoomBamOff()
Dim MiniPlayField_1        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_1        = xBAM.CreateMiniPlayfield(   -400,    -80,      300,     700,      50,     300,    -300,    405,       0)
'                              DstX     DstY      DstZ     RotX     RotY     RotZ    Scale     Time
CCall MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub



because in this way it does not work for me

Code:
If KeyCode = 34 Then  'key G
   If GameRoomOnOff  = TRUE Then'on
      GameRoomOnOff  = FALSE
      xBAM.GameRoom= false
      GameRoomBamOn
   Else
   If GameRoomOnOff  = FALSE Then'off
      GameRoomOnOff  = TRUE
      xBAM.GameRoom= true
      GameRoomBamOff
         End if
   End if
   End if

Author:  wild [ Wed Feb 28, 2018 10:02 am ]
Post subject:  Re: BAM Commands Comment and Discussion

all those if, and blah blah blah, confuse me, if you can give me a codec using this way,as a basis

Code:
If KeyCode = 34 Then  'key G
   If GameRoomOnOff  = TRUE Then'on
      GameRoomOnOff  = FALSE
      xBAM.GameRoom= false
      GameRoomBamOn
   Else
   If GameRoomOnOff  = FALSE Then'off
      GameRoomOnOff  = TRUE
      xBAM.GameRoom= true
      GameRoomBamOff
         End if
   End if
   End if

Author:  Gimli [ Wed Feb 28, 2018 10:03 am ]
Post subject:  Re: BAM Commands Comment and Discussion

Very close Paolo,
you only use "Dim" and "Set" once at the top of the script

I would change to :

Code:
Sub GameRoomBamOn()
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   25.000,    0)
End Sub


Sub GameRoomBamOff()
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub


And if you want the FP GameRoom as an opton then:

Code:
Sub GameRoomBamOn()
xBAM.GameRoom = False
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   25.000,    0)
End Sub


Sub GameRoomBamOff()
xBAM.GameRoom = True
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub

Sub BothRoomsOff()
xBAM.GameRoom = False
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub



Code:
If KeyCode = 34 Then  'key G
  GameRoomOnOff = GameRoomOnOff + 1
 If GameRoomOnOff > 3 then GameRoomOnOff = 1
   If GameRoomOnOff  = 1 Then GameRoomBamOn()
   If GameRoomOnOff  = 2 Then GameRoomBamOff()
   If GameRoomOnOff  = 3 Then BothRoomsOff()
  End if



Remember that if we choose to use "GameRoomOnOff" as a number instead of true/false (so we can have more than just 2 options) , then we have to always use it as a number.

Code:
Dim GameRoomOnOff

Sub FuturePinball_BeginPlay()
GameRoomOnOff =1
xBAM.GameRoom = False

Author:  wild [ Wed Feb 28, 2018 10:32 am ]
Post subject:  Re: BAM Commands Comment and Discussion

ok, but the sub.....this

Code:
Sub GameRoomBamOff()
Dim MiniPlayField_1        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_1        = xBAM.CreateMiniPlayfield(   -400,    -80,      300,     700,      50,     300,    -300,    405,       0)
'                              DstX     DstY      DstZ     RotX     RotY     RotZ    Scale     Time
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub


What I do I leave, I take it off, what I have to do

Author:  wild [ Wed Feb 28, 2018 10:47 am ]
Post subject:  Re: BAM Commands Comment and Discussion

what is this BothRoomsOff()

Author:  Gimli [ Wed Feb 28, 2018 10:48 am ]
Post subject:  Re: BAM Commands Comment and Discussion

Remove
Code:
Dim MiniPlayField_1        '                             Xmin     Xmax     Ymin     Ymax     Zmin     Zmax     CenX     CenY     CenZ
Set MiniPlayField_1        = xBAM.CreateMiniPlayfield(   -400,    -80,      300,     700,      50,     300,    -300,    405,       0)


and leave
Code:
Sub GameRoomBamOff()
'                              DstX     DstY      DstZ     RotX     RotY     RotZ    Scale     Time
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)
End Sub


instead of
Code:
Call MiniPlayField_1.MoveTo(   -1500,    -2000,   -3000,     0,       0,       0,   0,    0)


To make you games room disapper, you may find it easier to use:
Code:
MiniPlayField_1.Scale = 0


and to make it reappear:
Code:
MiniPlayField_1.Scale = 25

Author:  Gimli [ Wed Feb 28, 2018 10:54 am ]
Post subject:  Re: BAM Commands Comment and Discussion

so if you want to use miniplayfield_1.Scale code then:
Code:
Sub GameRoomBamOn()
xBAM.GameRoom = False
miniplayfield_1.Scale = 25
End Sub


Sub GameRoomBamOff()
xBAM.GameRoom = True
miniplayfield_1.Scale  =0
End Sub

Sub BothRoomsOff()
xBAM.GameRoom = False
miniplayfield_1.Scale = 0
End Sub

Author:  wild [ Wed Feb 28, 2018 11:14 am ]
Post subject:  Re: BAM Commands Comment and Discussion

I'm not understanding anything anymore send me a demo, or I'm no longer on-off

Author:  Gimli [ Wed Feb 28, 2018 11:19 am ]
Post subject:  Re: BAM Commands Comment and Discussion

I am going out for the day but if you look at xBAM.GameRoom tutorial link I posted above...
you can download the mod of your DragonsKeep table, where I do some of this...use "B" on keyboard to switch rooms
https://www.dropbox.com/s/myt16p8ufvfxu ... h.rar?dl=0

Page 5 of 11 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/