FizX Custom Balls

Zobou

Pinball Hall of Famer
Joined
Mar 29, 2022
Messages
240
Reaction score
287
Points
76
Favorite Pinball Machine
Jupiter
J'essaie depuis un moment de changer la texture de ma balle. J'ai fait tous les tutoriels que j'ai pu trouver, mais cela me donne plusieurs erreurs différentes à chaque fois que j'essaie les méthodes données.
quelque chose m’échappe ?

I've been trying for a while to change the texture of my ball. I did all the tutorials I could find, but it gives me several different errors each time I try the given methods.
am I missing something?
 
It's always better to post what you've already tried to do. Post the code you have because sometimes is just a matter of syntax.
 
J'essaie depuis un moment de changer la texture de ma balle. J'ai fait tous les tutoriels que j'ai pu trouver, mais cela me donne plusieurs erreurs différentes à chaque fois que j'essaie les méthodes données.
quelque chose m’échappe ?

I've been trying for a while to change the texture of my ball. I did all the tutorials I could find, but it gives me several different errors each time I try the given methods.
am I missing something?
What type of custom ball do you want. If you PM me, I can help
 
I posted everything I know in my guide and attached all the custom balls I have here:

 
En fin de compte, le problème était l’utilisateur derrière l’ordinateur. Je n’ai pas sauvegardé avant de tester pour ne pas avoir à tout supprimer en cas d’échec. L’erreur venait souvent de la ligne Sub DrawFrameTick()... J’ai utilisé le tutoriel de GeorgeH donc je l’ai ajouté comme référence au code

résolut.

Ultimately, the problem was the user behind the computer. I didn't save before testing so I wouldn't have to delete everything in case of failure. The error often came from the line Sub DrawFrameTick()... I used GeorgeH's tutorial so I added it as a reference to the code

resolved.
 
' =============================================================================

DOF_enabled = False 'Enable/Disable DOF for cabinet users with feedback and lighting
' if DOF is not installed, then this will automatically be disabled
'
PUP_SSF_enabled = True 'Enable/Disable PUP SSF (Surround and Automatic ball and table sounds)
' needs Pinup Player and FP_PUP_SSF PuP-Pack installed in up video folder

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

' Thanks To Terry Red , Rav and The Rest At Pinball Nirvana (www.pinballnirvana.com) for the below code

' Define Custom Balls


Dim BallColor
Dim GreenBall
Dim YellowBall
Dim RedBall
Dim BlueBall


' # Custom Balls Script TERRY RED - P.S - Thank You ###############

Function CreateCustomBall ( Source, BallName, Radius, Mass, Opacity )
xBAM. BallRadius = Radius
xBAM.BallMass=7900'DEFAULT 8000
xBAM. BallOpacity = Opacity
Dim bi
Set bi = xBAM.BallManager.CreatCustomBall(BallName)
Source.CreateBall bi. Red, bi. Green, bi. Blue, bi. BallNumber
AddDebugText "["&xBAM.BallID&"]"

Dim ball
Set ball = xBAM.BallCloseTo(Source.X, Source.Y)
'Set CreateCustomBall = ball
End Function

' ------ DEFINE BALL TEXTURES -------

Dim GreenBall_452_ColorMap
Set GreenBall_452_ColorMap = xBAM.GetTexture("GreenBall_452_ColorMap")
GreenBall_452_ColorMap.normalMap = "GreenBall_452_NormalMap"
GreenBall_452_ColorMap.normalMapScale = -2
GreenBall_452_ColorMap.SetSpecularColor 0, 0, 0

Dim YellowBall_452_ColorMap
Set YellowBall_452_ColorMap = xBAM.GetTexture("YellowBall_452_ColorMap")
YellowBall_452_ColorMap.normalMap = "YellowBall_452_NormalMap"
YellowBall_452_ColorMap.normalMapScale = -1
YellowBall_452_ColorMap.SetSpecularColor 0, 60, -1.65

Dim RedBall_452_ColorMap
Set RedBall_452_ColorMap = xBAM.GetTexture("RedBall_452_ColorMap")
RedBall_452_ColorMap.normalMap = "RedBall_452_NormalMap"
RedBall_452_ColorMap.normalMapScale = -1
RedBall_452_ColorMap.SetSpecularColor 0, 0, 0

Dim BlueBall_452_ColorMap
Set BlueBall_452_ColorMap = xBAM.GetTexture("BlueBall_452_ColorMap")
BlueBall_452_ColorMap.normalMap = "BlueBall_452_NormalMap"
BlueBall_452_ColorMap.normalMapScale = -1
BlueBall_452_ColorMap.SetSpecularColor 0, 0, 0

GreenBall = xBAM.BallManager.DefineCustomBall (255, 255, 255, "GreenBall_452_ColorMap", "GreenBall_334", "GreenBall_269")
YellowBall = xBAM.BallManager.DefineCustomBall (255, 255, 255, "YellowBall_452_ColorMap", "YellowBall_334", "YellowBall_269")
RedBall = xBAM.BallManager.DefineCustomBall (255, 255, 255, "RedBall_452_ColorMap", "RedBall_334", "RedBall_269")
BlueBall = xBAM.BallManager.DefineCustomBall (255, 255, 255, "BlueBall_452_ColorMap", "BlueBall_334", "BlueBall_269")


' # PUP Plug-in: Texture Swaps and Animations ##################

' - used on all objects where the normal BAM texture swapping commands won't work (like ornaments, ramps, etc)
' - can be used to swap textures with pretty much anything
' - replacement textures that are not used on any surface or object must be added to an Image Sequence (so BAM can "see" it)
' - note, that EVERY texture you are swapping (to and from) needs to use GetTextureId to fetch the texture
' - then you simply just need to use the ReplaceTexture command to replace each texture
' - keep in mind... this will replace the texture on ALL objects / surfaces that use it, so you may need uniquely named textures
' - you must SAVE the table after adding new textures before running the table or this may not work!
' - any changes made to the source texture (brightness, colour, etc) will effect the swapped out texture!


' **** Initialize the pup plug-in ****

Dim PuP_Plug_Tex

Set PuP_Plug_Tex = xBAM.Get("PuPPlugin")
If PuP_Plug_Tex Is Nothing Then
AddDebugText "PuP Plugin is missing"
Else
AddDebugText "PuP Plugin has started"
End if


You can make a key press trigger the ball change
' if keycode = xxxxKey then defaultball = blueball
 
Last edited:
sorry when I post code it changes words on me in the box? Keeps changing dim to Sun?
 
Code:
dim Sun

Testing insert code tags...

For posting script using the code tags will present the script as intended.
 
Code:
dim Sun

Testing insert code tags...

For posting script using the code tags will present the script as intended.
yeah when I paste code this stuff happens? it kept changing Dim to Sun ? I had to reboot and clear all by browser cache to be able to post code correctly in the reply box? It kept doing it, It now seems fine.
here is the correct code I used, It uses pup to swap textures which is why you put them in a image list and not on a hidden surface..
I did notice, it causes me shutter if there is a lot of raycasting shadowmaps and holograms, i only get shutter when I use the custom balls, it doesnt ever shutter with the default 1k ball.
Im still testing this to make sure thats the issue, I need to go to the old way of mapping with the surfaces.
]
 

Attachments

  • PN_CustomBallTexturesUsingPUP-hzr.txt
    6.8 KB · Views: 1
Last edited:
Im running into a huge shutter and lag, its only when im usuing a custom ball, the default 1k ball works fine.
any ideas?
 
Im running into a huge shutter and lag, its only when im usuing a custom ball, the default 1k ball works fine.
any ideas?

Custom balls only use 3 small textures although it does have to render them quickly. Still, it doesn't seem it should use that many resources on your PC.

Try reducing the number of balls in the "C:\Games\Future Pinball\BAM\balls" folder. Your PC has to load all of them even if it only uses one ball. If you have saved every ball in the download to your balls folder, that is way too much. I only keep about 40 balls in my folder. You can save the zip file of balls with designated tables as I describe in the guide or periodically change out the ones in your balls folder.
 
First time ive had this issue, it does it with the default ball too.
I do have all the packs in my balls folder though. Ill try that. I think its a table issue with raytracing shadowmaps and 5 flashers going with 2 of them rotating and also a playfield change.
Not sure yet.
 
General chit-chat
Help Users
You can interact with the ChatGPT Bot in any Chat Room and there is a dedicated room. The command is /ai followed by a space and then your ? or inquiry.
ie: /ai What is a EM Pinball Machine?
  • No one is chatting at the moment.
      Chat Bot Mibs Chat Bot Mibs: Flipper Hermann has left the room.
      Back
      Top