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

Bam Ball shadow
http://www.gopinball.com/forum/viewtopic.php?f=86&t=9117
Page 1 of 4

Author:  francisco666 [ Wed Mar 06, 2019 9:00 pm ]
Post subject:  Bam Ball shadow

Maybe allready exist
Use xbam globalpositon a toy with texture and a clock

Attachment:
sha.jpg


Table demo
https://mega.nz/#!adYHgShZ!8L4eUg88hbXf ... 7m38AMinLM

Author:  GeorgeH [ Wed Mar 06, 2019 11:13 pm ]
Post subject:  Re: Bam Ball shadow

I don't think it has been done before. A ball shadow is pretty cool.

George

Author:  francisco666 [ Thu Mar 07, 2019 12:13 am ]
Post subject:  Re: Bam Ball shadow

In the script there are some minus at the x and y position, it is the size of the playfield/2

If it only can adjust the toy size :twisted: it will be nice to adjust the size of the shadow if the ball are on a rail

Author:  Gimli [ Thu Mar 07, 2019 8:24 am ]
Post subject:  Re: Bam Ball shadow

Wonderful idea ! :shock:
Changing size and location of Toy Shadow definitely can be done.

I will show you how...

Francisco, you should learn how to use the "miniplayfield" feature of BAM.
It was designed for grabbing a small playfield and scaling it and moving it onto
the table.

But you can grab anything or group of things on and off the table .

In this case you grab the shadow toy inside a miniplayfield box and attach it to the tracked ball.

Because it is now a "miniplayfield" , you can use the miniplayfield code to change its
size and location in the code...

viewtopic.php?nomobile=1&f=55&t=6587&p=85768#p85768


Author:  Gimli [ Thu Mar 07, 2019 10:03 am ]
Post subject:  Re: Bam Ball shadow

here is a demo table
I couldn't see your invisible shadow , so I put a grey colored light on playfield overtop of your
toy...
https://www.dropbox.com/s/k3cdmy0ayxapt ... 2.fpt?dl=0

To Change Size, you can use:

Code:
MiniPlayField_0.Scale = Number


Addendum:
I just updated the above link
If you press "B" on keyboard it should change shadow size
I used this code:

Code:
Dim ShadSize
' The User Has Pressed A Key on the Keyboard..
'
Sub FuturePinball_KeyPressed(ByVal KeyCode)
   'AddDebugText "KeyCode = " & KeyCode
   'AddDebugText "Titled = " & fpTilted
   '
   ' Process any keys which are valid at all times
   '
   If keycode = 48 then
      ShadSize = ShadSize + 1
      If ShadSize = 7 then ShadSize = 1
      If ShadSize = 1 then miniplayfield_0.Scale = 0.3
      If ShadSize = 2 then miniplayfield_0.Scale = 0.6
      If ShadSize = 3 then miniplayfield_0.Scale = 1
      If ShadSize = 4 then miniplayfield_0.Scale = 1.3
      If ShadSize = 5 then miniplayfield_0.Scale = 1.6
      If ShadSize = 6 then miniplayfield_0.Scale = 2
   End if

Author:  francisco666 [ Thu Mar 07, 2019 10:49 pm ]
Post subject:  Re: Bam Ball shadow

Thanks for looking it and the reply

O i see, correct me if I wrong, the toy must be inside the miniplayfield all the time, and now the miniplayfield going to follow the ball as be his shadow?

Author:  Gimli [ Thu Mar 07, 2019 11:22 pm ]
Post subject:  Re: Bam Ball shadow

francisco666 wrote:
Thanks for looking it and the reply

O i see, correct me if I wrong, the toy must be inside the miniplayfield all the time, and now the miniplayfield going to follow the ball as be his shadow?


Correct !
Pretty cool !
You can attach anything you want
A shadow is very useful , great idea !

Author:  francisco666 [ Fri Mar 08, 2019 12:46 am ]
Post subject:  Re: Bam Ball shadow

Mmm Im having some problems with this, the toy cant be found when when I use MiniPlayField_0.Position., :?

Edit 1-2: for some reasom the toy is not visible if it is under the ball when using the miniplayfield or not :? Could it be the tga transparent?

Also why the miniplayfield are not traking the ball? Is moving but not allways under the ball

Author:  Gimli [ Fri Mar 08, 2019 11:27 am ]
Post subject:  Re: Bam Ball shadow

francisco666 wrote:
Mmm Im having some problems with this, the toy cant be found when when I use MiniPlayField_0.Position., :?

Edit 1-2: for some reasom the toy is not visible if it is under the ball when using the miniplayfield or not :? Could it be the tga transparent?


I had the same problem. Try making a visible shadow toy

francisco666 wrote:
Also why the miniplayfield are not traking the ball? Is moving but not allways under the ball

Yes, I agree that the shadow isn't always under the ball, but that would be the case with a shadow based on light source...
You can play around with the position of the shadow as shown in the video below.
I used my cheatcode to change the scale of the shadow, but you can also adjust the scale on the fly from the BAM menu
When happy , you need to press control C in upper half of Miniplayfield menu to create
a new Dim Miniplayfield_0 and a new Set Miniplayfield_0

https://youtu.be/r9c4JTc5EFY

Author:  francisco666 [ Fri Mar 08, 2019 7:36 pm ]
Post subject:  Re: Bam Ball shadow

Whell after hours of try and error I foynd that the Center miniplayfield coordenates was the ones doing the mess.

I dont know how to calculate in a proper way, I just adjust it in q dev option untill I get the values ones, or so I think :lol:

The main thing of doing it with minipfs is to reduce the size of the shadow so when the ball are in ramps it drop a smaller shadow on playfield, I try with a fail of the 99.99% with a error of 0.01%. Shadow dont stay in playfield, I have foresee that in my mind, but couldnt script in a proper way and the shadows dont get smaller :roll:

So far:
https://mega.nz/#!aE5ETayY!ZYEZXUi7jdOD3BkFIs0-7ChmlOlSBOT4OktAtc3bpZ4

For now I have a "momentary" roll back to square 1, use the old script and using the texture change so I change the shadowToy texture if its on the rail or on the ground

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