Tutorial Adding a Message Warning End User If Not Using Correct BAM Version

GeorgeH

Flippered Out
Site Supporters
Joined
May 3, 2016
Messages
2,664
Solutions
6
Reaction score
2,122
Points
145
Favorite Pinball Machine
Attack From Mars
I was asked to create a tutorial on how I add the message that makes end users aware they are not using the recommended version of BAM that looks like this:
Tales of the Arabian Nights 1.9.png
You need to be aware that displaying this message requires that the end user be able to load the table without crashing. The only way you can use the new BAM features on an old version of BAM and not have FP crash is to use fail safe coding. Fail safe coding turns off the features that use versions of BAM that are later than the version the end user has installed. Fail safe coding is not difficult but you do need to know the version of BAM that implemented the feature you are using. To do it, you need this line of code somewhere in the script:

Const BAM_VERSION = 0

There are two ways to add it. One way is to add this line below the first line of a subroutine if the whole subroutine adds a BAM feature:

If BAM_VERSION < 254 then Exit Sub

The other method can be added into a potions of a subroutine:

If BAM_VERSION => 254 then
[content]
End If


If you get this coding right, the end user will be able to play the table with an old version of BAM or not have BAM installed at all. This will keep FP from crashing but the end user may not know that their version of BAM is out of date. ...So that is where this message comes into play.

The first step is to start with creating the message. It has to be in an image format because it displays on an overlay. You can use an image editor to create it but I prefer using this web site because it is more convenient. I set the background to black because the objects on the table bleed through the overlay.


You can use Microsoft Word to set the fonts before you paste it into the web site. I use Segoe UI 20 pt font in Word. After converting the text to an image, you will need resize it so it is square and set to 1024x1024. This is the text I use. The guys on the forum have verified the Google translation on the non-English versions. You are welcome to use it if desired:

English - You are seeing this message because you are not using Better Arcade Mode (BAM) v1.4-267 or later that is recommended for this table. This message will also appear if you do not have BAM installed. You can identify the version of BAM you are using by opening the BAM menu and looking at the bottom right part of the screen. Please install a current version of BAM. Press the Special 1 key to turn off this message.​
Thank you!​
Français - Vous voyez ce message parce que vous n'utilisez pas Better Arcade Mode (BAM) v1.4-267 ou une version ultérieure recommandée pour cette table. Ce message apparaîtra également si BAM n'est pas installé. Vous pouvez identifier la version de BAM que vous utilisez en ouvrant le menu BAM et en regardant dans la partie inférieure droite de l'écran. Veuillez installer une version actuelle de BAM. Appuyez sur la touche spéciale 1 (Special 1 key) pour désactiver ce message.​
Je vous remercie!​
Italiana - Questo messaggio viene visualizzato perché non si utilizza Better Arcade Mode (BAM) v1.4-267 o versione successiva consigliata per questa tabella. Questo messaggio apparirà anche se non hai installato BAM. È possibile identificare la versione di BAM in uso aprendo il menu BAM e guardando nella parte in basso a destra dello schermo. Installa una versione corrente di BAM. Premere il tasto Speciale 1 (Special 1 key) per disattivare questo messaggio.​
Grazie!​
Español - Está viendo este mensaje porque no está utilizando Better Arcade Mode (BAM) v1.4-267 o posterior que se recomienda para esta mesa. Este mensaje también aparecerá si no tiene BAM instalado. Puede verificar la versión de BAM que está utilizando abriendo el menú BAM y mirando la parte inferior derecha de la pantalla. Por favor instale una versión actual de BAM. Presione la tecla Especial 1 (Special 1 key) para desactivar este mensaje.​
¡Gracias!​

Now you need to create an overlay that has an image list with the first frame being transparent and the second one being the image you created. A copy of the transparent frame is attached.

Insert the following script below the line "Sub FuturePinball_BeginPlay()":

' BAM Message Start (Be sure this line is present somewhere in the script: "Const BAM_VERSION = 0". Also be sure to add Overlay and its image list.
' Insert all this below line "Sub FuturePinball_BeginPlay()")
If BAM_VERSION >= 267 or nvTotalGamesPlayed > 0 then
Overlay1.Frame 1 ' transparent frame
else
Overlay1.Frame 2 ' frame explaining to use BAM 267
End If
' BAM Message End


Insert the following script below the line "Sub FuturePinball_KeyPressed(ByVal KeyCode)". This example uses the "Special 2" key but you can set it to any key. I sometimes use "X" when the Special 1 and 2 keys are being used for something else.

' BAM Message Start (Insert this below the line "Sub FuturePinball_KeyPressed(ByVal KeyCode)")
If (KeyCode = GetKeyCode(Special2Key)) Then
Overlay1.Frame 1 ' transparent frame
End If
' BAM Message End


If the end user has the correct version of BAM installed, they will never know this message exists. Just be sure the transparent frame is set to the first frame in the image list. FP always loads the first frame on an overlay.

This might seem like it takes a long time but after you have everything set up, it doesn't take long to add it to a table.
 

Attachments

  • AAtransparentPerfect.7z
    192 bytes · Views: 81
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