Tutorial How to Add More Than One DMD to a Table Easily

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
Some of the old tables only have one DMD coded in the script. This guide provides step by step instructions on how to add multiple DMDs to a table which might look complex but usually can be completed in less than 30 minutes for most tables.

The old table developers would sometimes add a blank DMD and provide directions on how to swap between the two DMDs. You could either have a HUD DMD or a translite DMD but not both. The reason this was done is that DMDs used to be coded so that the same lines of code were duplicated for each DMD. Adding duplicate code for each DMD can be a long tedious process. This tutorial describes a different method. If updating a table, I describe how to use replace commands below to add more than one DMD to a table. If you are creating a new table, this method makes it so you only need to code the DMDs once and not have to repeat code for each DMD. ...Or you can code it like this from the start. Multiple DMDs can be added by just adding the name of the DMD to a few subroutines. I am a novice at coding so these directions should be able to be performed by anyone. I am assuming you are starting this process on a table that has one DMD named "DispDmd1". If your table has the DMD named something else, use that name instead of "DispDmd1".

The following steps are the replace operations you need to perform. The subroutine that you add has two DMDs listed but you can add as many as you want. Just copy one of the existing lines and paste it to a new line and change the name of the DMD. If the search you conduct yields no results, then go on to the next step:

1a) The table below identifies the replacements you need to make. The character represents a space. You can use the "replace all" function to do this although you need to perform the searches in the order that they are listed below. The reason for performing the searches in the listed order is to accommodate code with no spaces, like "DispDmd1.Text=dmdstring". If you replace "DispDmd1.Text=" with "DMDSetText", you will end up with "DMDSetTextdmdstring" which will produce an error when you play the table. As you can see in the table, the script is replaced with code that has a space at the end that prevents having 2 commands run together. Performing the 4 replacements can be performed very quickly just by editing the same "Find" criteria previously used although you will probably need to scroll back up to the top of the script and start from the beginning before pressing the "Replace All" button again. I have made the mistake of not replacing the equal sign in the past and it doesn't work.

Search the script for:Replace with:
DispDmd1.Text=DMDSetText
DispDmd1.Text=DMDSetText
DispDmd1.Text=DMDSetText
DispDmd1.Text=
DMDSetText

1b) Add this subroutine:

Sub DMDSetText(pText)
DispDmd1.Text = pText
HudDmd1.Text = pText
End Sub

2a) You can use the "replace all" function.

Search the script for:Replace with:
DispDmd1.AddFontDMDAddFont

2b) Add this subroutine:

Sub DMDAddFont(pSlot, pName)
DispDmd1.AddFont pSlot, pName
HudDmd1.AddFont pSlot, pName
End Sub

3a) The queue text code may have a sound that plays at the end of the line of code although it is rarely used. The code that plays sound must be handled differently than code that does not. A sound can be identified as a name with double quotes before and after the name and appears red in color. The line of code that does not use sound ends with true or false.

Example of code with a sound at the end of the line of code where "bonus" is the name of the sound:

DispDmd1.QueueText "[f11][y3][xc]TOTAL SCORE[F11][y18][XC]" & FormatNumber(nvScore(CurrentPlayer), 0, -1, 0, -1), deScrollIn, 2000, FALSE, "bonus"

Example of code with no sound:

DispDmd1.QueueText "[f4][xc][y12]WELCOME PLAYER " & PlayersPlayingGame, deNone, 1000, true

NOTE: If the line ends with true or false, then use "DMDQueueText". If the lines ends with a sound, then use "DMDQueueTextWSound". You won't be able to use the "replace all" function in the script because you will need to manually identify if the code ends with a sound. Just use the "Find" function and manually replace.

Search the script for:Replace with:
DispDmd1.QueueTextDMDQueueText or
DMDQueueTextWSound

3b) Add this subroutine for code with no sound:

Sub DMDQueueText(pText, pEffect, pTimeOn, pFlush)
DispDmd1.QueueText pText, pEffect, pTimeOn, pFlush
HudDmd1.QueueText pText, pEffect, pTimeOn, pFlush
End Sub

If "DMDQueueTextWSound" is used, then add this:

Sub DMDQueueTextWSound(pText, pEffect, pTimeOn, pFlush, pSound)
DispDmd1.QueueText pText, pEffect, pTimeOn, pFlush, pSound
HudDmd1.QueueText pText, pEffect, pTimeOn, pFlush, pSound
End Sub

4a) Be sure to perform the searches in the order identified. You can use the "Replace All" function.

Search the script for:Replace with:
DispDmd1.FlushQueue()DMDFlushQueue
DispDmd1.FlushQueueDMDFlushQueue

4b) Add this subroutine:

Sub DMDFlushQueue()
Dispdmd1.FlushQueue
HudDmd1.FlushQueue
End Sub

5a) Be sure to perform the searches in the order identified. You can use the "Replace All" function.

Search the script for:Replace with:
DispDmd1.FlushAnimation()DMDFlushAnimation
DispDmd1.FlushAnimationDMDFlushAnimation

5b) Add this subroutine:

Sub DMDFlushAnimation()
Dispdmd1.FlushAnimation
HudDmd1.FlushAnimation
End Sub

6a) Use the same rules as step 1a.

Search the script for:Replace with:
DispDmd1.UpdateInterval=
DispDmd1.UpdateInterval=
DispDmd1.UpdateInterval=
DMDUpdateInterval
DMDUpdateInterval
DMDUpdateInterval
DispDmd1.UpdateInterval=DMDUpdateInterval

6b) Add this subroutine:

Sub DMDUpdateInterval(pInterval)
Dispdmd1.UpdateInterval = pInterval
HudDmd1.UpdateInterval = pInterval
End Sub

After performing the above replacements, perform another search for the name of the DMD. You should only find hits in the subroutines that you added. The exception is coding for the HUD. Don't change DMDs set to FadeIn and FadeOut commands that are used for the HUD because each DMD needs to be coded differently.

You may rarely but occasionally encounter a few additional subroutines that you need to add. The ones identified above are the main ones. Jurassic Park uses a function called DMD FastBlinkSpeed but I didn't add it to the guide because it is almost never used. You can use the method similar to steps 1 to 6 above for FastBlinkSpeed. You just need to look up the name of the function in the FP manual (which is in the FP help) and add the names of the parameters like you see above. Or, you can just duplicate the lines of code for the new DMDs like you would do if not using this process.

On "Tales of the Arabian Nights", I encountered the following subroutine that runs another subroutine. I just duplicated the subroutine for each DMD and didn't use the above process.

Sub DispDmd1_Empty()
DMDrun()
End Sub

The "Jurassic Park" table uses over 900 lines of code to drive one DMD. It would be a monumental task to add duplicate code for a second DMD using the old method. It only took about 45 minutes to do it using the method in this guide. If you have questions, feel free to ask.

George
 
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