Register    Login    Forum    FAQ    PinSimDB.org

Board index » Welcome to GoPinball » General Discussion




Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: DMD ON BACKGLASS
 Post Posted: Sun May 05, 2019 2:31 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2553
Location: Ontario, Canada
GeorgeH wrote:
You might send the code to Smoke. I don't think he likes entering duplicate code but he might go for this.

George


If I were to code a table from the beginning like the true table dev's , I would definitely use this code. It seems very simple.

There are 2 ways that we commonly add text to DMD's :

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
1. We can add text to DMD's as single text line statement (not in a queue)
This is the so called "Simple Method"
From Fp manual:
<String> .Text = { "String to Display" } ** SIMPLE METHOD **

Here is an example from FP manual
Code:
MyDmd.Text = "SCORE " & FormatNumber(nvScore1, 0, -1, 0, -1)


The code example above only applies to one DMD named "MyDMD"

The monster bash code uses this to capture all DMD's:

Code:
Sub DMDSetText(pText)
   DispDmd1.Text = pText
        DispDmd2.Text = pText
   DispDmd3.Text = pText
End Sub


Using example above, Then in script you can simply do this:
Code:
DMDSetText  "SCORE " & FormatNumber(nvScore1, 0, -1, 0, -1)


This code above applies to all three DMD's


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
2. In a queue of successive lines of text. This allows coding a series of DMD frames, with
scrolling effects and timing settings...

From FP manual
.QueueText ( <String> Text, <Enumeration> Effect, <Integer> TimeOn, <Boolean> FlushQueue, <String> SoundEffect )


Example from FP manual:
Code:
MyDmd.QueueText "[edge2]SCROLL LEFT", deScrollLeft, 750, True
MyDmd.QueueText "[edge4]SCROLL LEFT OVER", deScrollLeftOver, 750, True


The code above only applies to one DMD named "MyDMD"

The monster bash code uses this to capture all DMD's:
Code:
Sub DMDQueueText(pText, pEffect, pTimeOn, pFlush)
   DispDmd1.QueueText pText, pEffect, pTimeOn, pFlush
   DispDmd2.QueueText pText, pEffect, pTimeOn, pFlush
   DispDmd3.QueueText pText, pEffect, pTimeOn, pFlush
End Sub


Using example above, Then in script you can simply do this:
Code:
 DMDQueueText "[edge2]SCROLL LEFT", deScrollLeft, 750, True
 DMDQueueText "[edge4]SCROLL LEFT OVER", deScrollLeftOver, 750, True


This code above applies to all three DMD's

Monster bash also had this variant of the Queue method, adding a sound clip to the queue
Code:
Sub DMDQueueTextWSound(pText, pEffect, pTimeOn, pFlush, pSound)
   DispDmd1.QueueText pText, pEffect, pTimeOn, pFlush, pSound
   DispDmd2.QueueText pText, pEffect, pTimeOn, pFlush
   DispDmd3.QueueText pText, pEffect, pTimeOn, pFlush
End Sub


Example
Code:
DMDQueueTextWSound "[edge2]SCROLL LEFT", deScrollLeft, 750, True, "bellsound"
 DMDQueueTextWSound "[edge4]SCROLL LEFT OVER", deScrollLeftOver, 750, True, "JackHammerSound"


''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
3. Adding Fonts to DMDs

From FP Manual the synax is:
.AddFont ( <Integer> Slot, <Boolean> FontName )

Example from FP Manual:
Code:
MyDmd.AddFont 1, "dmd05x05p"
MyDmd.AddFont 2, "dmd06x07p"


Once again, this only applies to DMD Named "MyDMD"

The monster bash code uses this to capture all DMD's:
Code:
Sub DMDAddFont(pSlot, pName)
   DispDmd1.AddFont pSlot, pName
   DispDmd2.AddFont pSlot, pName
   DispDmd3.AddFont pSlot, pName
End Sub


Using example above, Then in script you can simply do this:

Code:
DMDAddFont 1, "dmd05x05p"
DMDAddFont 2, "dmd06x07p"


This code above applies to all three DMD's


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Now, if for some reason later we want to add a new DMD , and we name it
DispDmd4

We can simply add it to each of the above config routines and it will be implemented automatically during game play:
Code:
[code]Sub DMDSetText(pText)
   DispDmd1.Text = pText
        DispDmd2.Text = pText
   DispDmd3.Text = pText
       DispDmd4.Text = pText
End Sub[/code]


Top 
 Profile  
 
 Post subject: Re: DMD ON BACKGLASS
 Post Posted: Sun May 05, 2019 3:16 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2090
Location: Arkansas, USA
Interesting. It looks like you would still have to make lots of changes to the script of an existing table, but this looks like it might be easier if you were coding a table from scratch.

George


Top 
 Profile  
 
 Post subject: Re: DMD ON BACKGLASS
 Post Posted: Sun May 05, 2019 5:35 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2553
Location: Ontario, Canada
It's probably easier on all counts, as in existing tables you are simply pasting over top the existing DMD name not adding new lines of code


Top 
 Profile  
 
 Post subject: Re: DMD ON BACKGLASS
 Post Posted: Sun May 05, 2019 6:08 pm 
Offline

Joined: Thu Aug 16, 2012 11:12 pm
Posts: 2090
Location: Arkansas, USA
I think I am beginning to understand. To convert an existing table, you would add these 2 subroutines (for 3 DMDs):

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

Sub DMDSetText(pText)
DispDmd1.Text = pText
DispDmd2.Text = pText
DispDmd3.Text = pText
End Sub

Then you would have to replace all occurrences of the name of the DMD with DMDQueueText if the DMD is displaying text. If it displays fonts, then you would change the name the DMD to DMDSetText.

I am guessing that the DMD text has to have all 4 of the parameters defined (pText, pEffect, pTimeOn, pFlush) or there will be some sort of error.

Not too many tables use the pSound parameter. Funhouse used it though. I am sure it is only used for one DMD because you don't want the same sound to play more than once at the same time otherwise it would be too loud and distorted.

George


Top 
 Profile  
 
 Post subject: Re: DMD ON BACKGLASS
 Post Posted: Sun May 05, 2019 6:11 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2553
Location: Ontario, Canada
Yep and I would also use the addfont routine as this deals with not just text fonts but all the dmdfonts that give the animations


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 15 posts ]  Go to page Previous  1, 2

Board index » Welcome to GoPinball » General Discussion


Who is online

Users browsing this forum: No registered users and 11 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: