Register    Login    Forum    FAQ    PinSimDB.org

Board index » Future Pinball » BAM corner




Post new topic Reply to topic  [ 131 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 14  Next
Author Message
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 10:25 am 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 995
Multiple ball textures teaser:


You do not have the required permissions to view the files attached to this post.

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-258, released: Sep 3, 2019


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 12:00 pm 
Offline

Joined: Fri Nov 22, 2013 8:25 am
Posts: 166
:o :P
Very Cool :!:

Even Zen like

You’re Not Just a Ball, You’re a Character
Image

This added with BallID tables could be made where curtain game modes have to be completed with a curtain ball (or texture). Just like Zen's “Marvel's The Avengers” table. :mrgreen:

Thanks again Ravarcade beautiful work :D


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 1:41 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2796
Location: Ontario, Canada
wow!!!!

that's AWESOME Rav!

thank you


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 5:12 pm 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 995
Here is new beta-bam:
http://www.ravarcade.pl/debug/beta.zip

updated files: BAM.dll, renderingengine.dll
new files: balls dirs and files inside. Here are files from miownkhan.
@miownkhan: i have to ask for permission to add that to normal BAM release.

Warrning: This is "beta' version, so new bugs may apear. In that case, let me know.

Recomendation: Please enable "dirt" on ball in FP Video/Rendering Options. That "dirt" is hevy used in all custom balls.

Now info whats new:
1. BAM will load ball textures from "balls" dir. That are ZIPs with 3 textures:
269.BMP - reflection displayed on ball reflected/mirrored in playfield.
334.BMP - reflection on ball (normal)
452.BMP - dirt (or inverted ball texture).
When you press N on keyboard you will switch to next ball loaded. Right now i don't save selected ball. I will add it in normal release.

2. script can create ball with different textures. Many balls with different texturex may be in same time on table. See:
http://www.ravarcade.pl/debug/ballDemo.fpt
What that demo do:
- there are 5 ball types, every created ball is different (see CreateNewBall function). 4 balls are with custom texture (well 3 are custom, one is same as default). One ball is "standard".
- when you press right flipper it creates ball.

Now description for table devs:
At begin of script there is my part of script. Copy it to own.
You will call function: BAM_CreateBall with 8 params...
1. Object what is used to create ball. (kicker?)
2-5. Same as for CreateBall. Colors RED, GREEN, BLUE and BALLID.
6. Texture name for "Dirt" (452.BMP)
7. Texture name for "Reflection" (334.BMP)
8. Texture name for "ReflectionInPlayfield" (269.BMP).
If you left name empty ( == "") default texture will be uesd, but ball will be still "custom".
Normal ball will change textures when you press N. Custom ball will not.

How BAM_CreateBall works?
It creates ball same way as standart but:
- it change ball color: RED = 1, GREEN,BLUE are used to as ball ID for BAM. So you can't create "standard ball" with RED color set to 1. I don't belive it will be problem.
- BAM get info about that custom ball: right color and textues names
- if there is no BAM or BAM is in old version, ball will be created as standard ball. (No need to have different version of table for BAM and for "no BAM" users).

What more.... more fixes ;)
1. When playfield is rotated, ball will be drawed ~correct, now withoutnew renderer too.
2. When playfield is rotated ball reflection in playfield will have also dirt texture. Pure FP only draw reflection texture. This is important for custom balls.
3. When playfield is rotated and new renderer is used all reflections (not only on ball) are drawed in correct direction. So they will look same way as on not rotated playfield. See this image: http://www.ravarcade.pl/debug/reflectio ... yfield.png

Here is list of what is still incorrect for balls drawnings:
- if playfield is rotated, reflection of ball in playfield will not rotate with ball. It is very hard to see. I will not fix it.
- If playfield is rotated and new renderer is not used reflection texture is not rotated. I will not fix it.
In every other condition ball is drawed same way as with playfield not rotated.

I almost forget:
- you can change ball change key: N in [Redefine keys] menu
- In [addons] you can disable ball color change in script (as miownkhan suggest) thet will be saved
- In [addons] menu you can change ball brighness (it will be save too). If you use new renderer value can be greater than 1.0. (Ball can be brighter).
- With 'N' key you cann change only standard ball. It will not affect "custom balls".

What may be added:
- abilitiy to change ball color or texture for ball already on table. Is it needed or not?

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-258, released: Sep 3, 2019


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 5:43 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2796
Location: Ontario, Canada
Rav, you are a genius !!

I'll start playing with this today :D


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Sun Feb 21, 2016 6:33 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2796
Location: Ontario, Canada
Cool I got it work with one type of ball from the plunger and another type of ball from a kicker. Works Amazing Rav !

Here is your demo table altered instead of right flipper press "V" and "b" to release balls
from either the kicker (which is set as a baseball) or plunger (which alternates balls, one of which is the default ball which you can switch ball images with the "n" key)
https://www.dropbox.com/s/pzz7qhop7a9ak ... l.fpt?dl=0

I notice that in this Bam beta, I can only see "Future pinball mode" on my table (static mode is missing the the actual table, only the table frame is visible and plunger is on the wrong side of the table, it's like the table image is flipped over upside down)

I don't think I have it quite right yet but here are my observations. Tell me if I am wrong:

We will have a balls directory under BAM. (C:/Games/Future Pinball/BAM/Balls) which will contain all the available balls as zip files:
baseball.zip
basketball1.zip
basketball2.zip
cue black.zip
cue white.zip
eyetoy.zip
fireball.zip
knight.zip
soccer ball1.zip
etc....


In the code you have given us a segment to copy and paste at the top of the script:
Code:
Option Explicit            ' Force explicit variable declaration

' ========== CUT HERE & COPY TO OWN SCRIPT ==================

Const BAM_VERSION = 0 ' BAM will replace that value with current build number (above 100)

Sub BAM_SendMessageToBAM(msg)
   If BAM_VERSION Then
      AddDebugText msg
      ExecuteGlobal LoadExternalScript("!BAM"&msg)
   End If
End Sub

Dim BAM_BallCounter
BAM_BallCounter = 0
Const BAM_MAX_BALLS = 4096
Const BAM_BALL_RED_COLOR = 1

Sub BAM_CreateBall(Source, Red, Green, Blue, BallID, Dirt, Reflection, ReflectionInPlayfield)
   If BAM_VERSION Then
      Dim cr
      cr = BAM_BALL_RED_COLOR
      BAM_SendMessageToBAM("CREATEBALL "&cr&" "&BAM_BallCounter&" "&Red&" "&Green&" "&Blue&" "&Dirt&" "&Reflection&" "&ReflectionInPlayfield)
      
      Red = BAM_BALL_RED_COLOR
      Green = BAM_BallCounter Mod 256
      Blue = BAM_BallCounter / 256
      BAM_BallCounter = BAM_BallCounter + 1
      If BAM_BallCounter >= BAM_MAX_BALLS Then
         BAM_BallCounter = 0
      End If      
   End If
   Source.CreateBall Red, Green, Blue, BallID
End Sub

Sub BAM_CreateCaptiveBall(Source, Red, Green, Blue, BallID, Dirt, Reflection, ReflectionInPlayfield)
   If BAM_VERSION Then
      Dim cr
      cr = BAM_BALL_RED_COLOR
      BAM_SendMessageToBAM("CREATEBALL "&cr&" "&BAM_BallCounter&" "&Red&" "&Green&" "&Blue&" "&Dirt&" "&Reflection&" "&ReflectionInPlayfield)
      
      Red = BAM_BALL_RED_COLOR   
      Green = BAM_BallCounter Mod 256
      Blue = BAM_BallCounter / 256
      BAM_BallCounter = BAM_BallCounter + 1
      If BAM_BallCounter >= BAM_MAX_BALLS Then
         BAM_BallCounter = 0
      End If      
   End If
   Source.CreateCaptiveBall Red, Green, Blue, BallID
End Sub

' =============================================================


and another segment that you placed above Sub CreateNewBall()
Code:
Dim dirt, reflection
Dim dirtTextures
Dim reflectionTextures
Dim texIdx
dirtTextures = Array("basket_452", "baseball_452", "knight_452", "", "")
reflectionTextures = Array("basket_334", "baseball_334", "knight_334", "", "")
texIdx = 4


I moved "Dim dirt,reflection" up with these other Dims...so it would be recognized
by other kickers etc...


and then we just use the syntax you described to activate the balls

you defined an array as below that assigns an order to the ball images. In this case:

Code:
Dim texIdx
dirtTextures = Array("basket_452", "baseball_452", "knight_452", "", "")
reflectionTextures = Array("basket_334", "baseball_334", "knight_334", "", "")


so your demo code has the following order
basketball (texIdx = 1),
baseball (texIdx = 2) ,
knight ball (textIdx = 3)
Default ball (textIdx = 4)
Is this correct?

so to create a basketball in script

Code:
texIdx =1
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


a baseball:

Code:
texIdx =2
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


a knight ball:
Code:
texIdx =3
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


default ball is just :
Code:
texIdx = 4
PlungerKicker.CreateBall


I'd love to try it in the Indiana Jones table, if I can get static mode etc... working

This is AWESOME !

Thanks Rav


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Mon Feb 22, 2016 6:43 am 
Offline

Joined: Fri Nov 22, 2013 8:25 am
Posts: 166
ravarcade wrote:
Here is new beta-bam:
http://www.ravarcade.pl/debug/beta.zip

updated files: BAM.dll, renderingengine.dll
new files: balls dirs and files inside. Here are files from miownkhan.
@miownkhan: i have to ask for permission to add that to normal BAM release.

Warrning: This is "beta' version, so new bugs may apear. In that case, let me know.

Use as you would like :)


Gimli wrote:
I notice that in this Bam beta, I can only see "Future pinball mode" on my table (static mode is missing the the actual table, only the table frame is visible and plunger is on the wrong side of the table, it's like the table image is flipped over upside down)


I also notice this. I took pictures using BAM of all Rotation modes with Arcade mode on\off.
Rotation 90 has the most problems with inverted Table Scale "Z" and camera.
Table Scale "X" needs to be .5 only when Rotation is set for 90 or 270.

https://www.dropbox.com/s/m4m3hbakikt6l ... s.zip?dl=0
14.97 MB, 10 pics

ravarcade wrote:
I almost forget:
- you can change ball change key: N in [Redefine keys] menu
- In [addons] you can disable ball color change in script (as miownkhan suggest) thet will be saved
- In [addons] menu you can change ball brighness (it will be save too). If you use new renderer value can be greater than 1.0. (Ball can be brighter).
- With 'N' key you cann change only standard ball. It will not affect "custom balls".


Can there be 2 keys for ball change.
a key for Next (n) and a key for Previous (p?)
This may help if a large number of ball are in the folder.

Disable ball color change in script
This is partly broken
I tested with Superman ULTIMATE 1.04 as it has changing colors
I left the Superman ball next to the table.
When I loaded the table my Silver ball with logo displayed as default ball. The colors did not change.
When I enabled change in script, My Superman still did not change colors. When I pressed "N" to change to other custom balls, they had the scripted color applied.
Can this be fixed?

Ball brighness
I liked this as you can make the balls like Neon Fluorescent Balls (GLo-Balls http://modmypin.com/)
This is good for 'Night' or 'Dark Night" lighting. Tables with Neon themes (big bang bar, Tii's or Mark1's tables)
This seems to be tied to "ball color change in script". Can the lighting of this be separate from the script coloring?

ravarcade wrote:
What may be added:
- abilitiy to change ball color or texture for ball already on table. Is it needed or not?

Do you mean.. change the color or texture of a ball(s) if it were to hit something?
example: If a silver ball were to hit Left Flipper the ball would turn Blue, and if it hit Right Flipper it would turn Pink.
If that is the case it would sound neat, if it would not be hard to add.


Thanks for all the hard work.
8-)


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Mon Feb 22, 2016 4:11 pm 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 995
Gimli wrote:
... I notice that in this Bam beta, I can only see "Future pinball mode" on my table (static mode is missing the the actual table, only the table frame is visible and plunger is on the wrong side of the table, it's like the table image is flipped over upside down). ...

I have way to replicate error. Soon i will fix it.
I see, that you still use one of old Lighting modes ("BAM initial release" or "New Light System). Both do lighting little wrong, so i recomend to switch mode to "New Renderer".
Anyway this is error and i have to fix it.

Gimli wrote:
... We will have a balls directory under BAM. (C:/Games/Future Pinball/BAM/Balls) which will contain all the available balls as zip files: baseball.zip
etc. ...

This dir is optional. You need it only to change standard ball with N key. It is not used to change ball in script.

Gimli wrote:
...
In the code you have given us a segment to copy and paste at the top of the script:
... FIRST CODE BLOCK ...

You need to copy only this segment. Second segment of code is only example.


Gimli wrote:
...
Code:
Dim texIdx
dirtTextures = Array("basket_452", "baseball_452", "knight_452", "", "")
reflectionTextures = Array("basket_334", "baseball_334", "knight_334", "", "")


so your demo code has the following order
basketball (texIdx = 1),
baseball (texIdx = 2) ,
knight ball (textIdx = 3)
Default ball (textIdx = 4)
Is this correct?

so to create a basketball in script

Code:
texIdx =1
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


a baseball:

Code:
texIdx =2
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


a knight ball:
Code:
texIdx =3
dirt = dirtTextures(texIdx)
reflection = reflectionTextures(texIdx)
Call BAM_CreateBall(PlungerKicker, 192, 192, 192, 1, dirt, reflection, reflection)


default ball is just :
Code:
texIdx = 4
PlungerKicker.CreateBall



Yes and no. I'm not sure if you get it right. Your interpretation will work for sure, but that names in arrays are names of textures in FP TextureManager. They are not related to files "BAM/balls" dir.

So, here is more info.
To create custom ball with different textures than standard one, you need:
1. Add textures to FP: Texture Manager. One, two or tree textures. Same as in ZIP: 452.BMP, 334.BMP, 269.BMP
2. Add surface to table. Assing that textures to surface. (To one surface you can assign up to 3 textures). Make that surface not visible by unchecking checkbox: Render object (initial value). Move that surface to outside table to place where it will not interupt table editing.

--- until now, that's 2 steps are same as adding any other textures for BAM, like with normal-maps ---
--- in my example i did not hide that additional surfaces only to make it more visible ---

3. Copy code from first code block at begin of script.
4. Replace:
Code:
Kicker1.CreateBall 128 128 128 1

with
Code:
call BAM_CreateBall(Kicker1, 128, 128, 128, 1, "DirtTextureNameFromTextureManager", "ReflectionTextureName", "OtherOrSameReflectionTextureName")

Thats all.

Please note, that:
Code:
 Kicker1.CreateBall
without params is same as
Code:
 Kicker1.CreateBall 192 192 192 1
.

In my example i put textures names in array only to make it simple and not repeat 4 times call BAM_CreateBall().

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-258, released: Sep 3, 2019


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Mon Feb 22, 2016 5:09 pm 
Offline

Joined: Mon Mar 25, 2013 4:02 pm
Posts: 995
miownkhan wrote:
... I also notice this. I took pictures using BAM of all Rotation modes with Arcade mode on\off.
Rotation 90 has the most problems with inverted Table Scale "Z" and camera.
Table Scale "X" needs to be .5 only when Rotation is set for 90 or 270.

https://www.dropbox.com/s/m4m3hbakikt6l ... s.zip?dl=0
14.97 MB, 10 pics

Like i say to Gimli. Solution: go to [Light] menu. First option "Lighting system" change it "FP Orginal" or "New renderer". Two other options are now broken. I will fix it, but i recomend to use "FP ..." or "New Renderer'.

miownkhan wrote:
... Can there be 2 keys for ball change. ...

Yes. I use one key to make it easy, but 2 keys will not be a problem for user.

miownkhan wrote:
...
Disable ball color change in script
This is partly broken
I tested with Superman ULTIMATE 1.04 as it has changing colors
I left the Superman ball next to the table.
When I loaded the table my Silver ball with logo displayed as default ball. The colors did not change.
When I enabled change in script, My Superman still did not change colors. When I pressed "N" to change to other custom balls, they had the scripted color applied.
Can this be fixed?

I'm lost in your example.
You can create balls in 2 ways: BAM_CreateBall and Kicker.CreateBall.
All balls created with BAM_CreateBall will have color assigned in BAM_CreateBall. That what is set in [addons] menu will not have effect on that ball.

All balls created with Kicker.CreateBall: (1) will react to 'N' key, (2) color of that ball can be locked to "brighness" in [Addons] menu.

So i know about only one way to give ball color: when it is created.

If there is command in script, used to change existing ball color, it will be able to change colors for any ball. More. It you use that command on custom ball, then ball will become standard ball (because i will not be able to recognize that ball).

I looked at Superman script. In few places i see:
Kicker.DestroyBall Kicker.CreateBall
If Kiker have catched custom ball, it will replace it with standard ball.
There is no way to prevent it.
Extrea work in script is needed:
1. You need to assign different ballId to different balls.
2. You need to read "fpBallID" when ball hit kicker.
3. Create same ball type, when kicker should release ball.
As i understand Kickers are objects used to destroy & create ball to reproduce "catch" "release" behaviour.

miownkhan wrote:
...
Do you mean.. change the color or texture of a ball(s) if it were to hit something?
example: If a silver ball were to hit Left Flipper the ball would turn Blue, and if it hit Right Flipper it would turn Pink.
If that is the case it would sound neat, if it would not be hard to add.
...

Yes. But it will make your life harder. You will be able to detect whitch ball hit only based on fpBallID. So if you have for example 3 balls on table with same custom look, you will have to do things like this:
Store ball type and BAM_BALL_ID in array for every created ball.
OnHit()
- read fpBallID,
- based on fpBallID find current custom type of ball (look in to array)
- change ball type, ball is selected based on BAM_BALL_ID
- update ball type in array

... and for me it won't be hard. I can also gives you example/template of script for it.

_________________
http://www.ravarcade.pl
Better Arcade Mode
current BAM version: v1.4-258, released: Sep 3, 2019


Top 
 Profile  
 
 Post subject: Re: Custom balls
 Post Posted: Mon Feb 22, 2016 8:08 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2796
Location: Ontario, Canada
Awesome guys.
I'll be away from my computer until March 3, so I won't be able to try this further until then.
I will still check the forum for news though

Thanks Rav !


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 131 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 14  Next

Board index » Future Pinball » BAM corner


Who is online

Users browsing this forum: Uncle ToyBox 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