Register    Login    Forum    FAQ    PinSimDB.org

Board index » Resources » Tutorials, how-to's, bug report and docs




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Simple DMD Highscore Illustrated for all comers
 Post Posted: Sat Nov 29, 2014 12:03 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
6.Scipting to make it all work (Copy 'N Paste)

Above "Drain / Plunger Functions "
Copy 'N Paste:

Code:
'HIGH SCORE DMD DISPLAY ROUTINE
'-----------------------------------------------------------------------------
sub TIMEDmoveletters_expired
   TIMEDmoveletters.set false
   moveletterhs
end sub


dim ChangeLetter'Selected initial
dim letter1'Name Initial 1
dim letter2'Name Initial 2
dim letter3'Name Initial 3
dim letter4'END letter

DIM ADER1
DIM ADER2
DIM ADER3
DIM ADER4
DIM ADER5
DIM ADER6
DIM ADER7
DIM AIZQ1
DIM AIZQ2
DIM AIZQ3
DIM AIZQ4
DIM AIZQ5
DIM AIZQ6
DIM AIZQ7

dim benterhighscoremode'Mode flag
dim SelectLetter'We are chosing the 1,2,3 letter, move up with enter
dim highscoremoveright'Move right true right flipper. false left flipper
dim tempnvname
dim giveacredit
dim temphsscore
dim tempposition


ChangeLetter=64


' 62 IS THE backspace
' 63 IS THE END
' 64 IS THE Space

Function FormatScore(num)
    Dim n, f, s
    n = CStr(num)
    f = ""
       
    do while len(n)>3
        if len(f)>0 then
            f = Right(n, 3) & "," & f
        else
            f = Right(n, 3)
        end if
        n = Left(n, Len(n)-3)
    loop
    if len(n)>0 then
        if len(f) > 0 then
            f = n & "," & f
        else
            f = n
        end if
    end if
    FormatScore = f
End Function

Sub moveletterhs
   if highscoremoveright=true then
      ChangeLetter=ChangeLetter+1     
         IF ChangeLetter>90 THEN
            ChangeLetter=62
         END IF
   end if
   if highscoremoveright=false then
      ChangeLetter=ChangeLetter-1
      IF ChangeLetter<62 THEN
         ChangeLetter=90
      END IF
   end if


      ADER1=ChangeLetter+1
      IF ADER1>90 THEN
         ADER1=62
      END IF
   ADER2=ADER1+1
      IF ADER2>90 THEN
         ADER2=62
      END IF
   ADER3=ADER2+1
      IF ADER3>90 THEN
         ADER3=62
      END IF
   ADER4=ADER3+1
      IF ADER4>90 THEN
         ADER4=62
      END IF
   ADER5=ADER4+1
      IF ADER5>90 THEN
         ADER5=62
      END IF
   ADER6=ADER5+1
      IF ADER6>90 THEN
         ADER6=62
      END IF
   ADER7=ADER6+1
      IF ADER7>90 THEN
         ADER7=62
      END IF

   AIZQ1=ChangeLetter-1
      IF AIZQ1<62 THEN
         AIZQ1=90
      END IF
   AIZQ2=AIZQ1-1
      IF AIZQ2<62 THEN
         AIZQ2=90
      END IF
   AIZQ3=AIZQ2-1
      IF AIZQ3<62 THEN
         AIZQ3=90
      END IF
   AIZQ4=AIZQ3-1
      IF AIZQ4<62 THEN
         AIZQ4=90
      END IF
   AIZQ5=AIZQ4-1
      IF AIZQ5<62 THEN
         AIZQ5=90
      END IF
   AIZQ6=AIZQ5-1
      IF AIZQ6<62 THEN
         AIZQ6=90
      END IF
   AIZQ7=AIZQ6-1
      IF AIZQ7<62 THEN
         AIZQ7=90
      END IF

   MyNewDMD.AddFont 30, "jm_9"
   MyNewDMD.AddFont 11, "dmd06x07p"
   MyNewDMD.AddFont 8, "dmd05x05p"
   AddDebugText "seleccionandoletra "&SelectLetter
   AddDebugText "ChangeLetter"&ChangeLetter

select case SelectLetter
   
   case 1
      letter1=ChangeLetter
      MyNewDMD.Text=   "[f11][XC][Y1]PLAYER"&(CurrentPlayer)&" ENTER INITIALS[B][f30][x50][y10]"&CHR(letter1)&"[f30][x60][y10]"&CHR(letter2)&"[f30][x70][y10]"&CHR(letter3)&"[/b][BF][box2,61,20,69,30][/BF][f30][XC][Y21]"&CHR(AIZQ7)&CHR(AIZQ6)&CHR(AIZQ5)&CHR(AIZQ4)&CHR(AIZQ3)&CHR(AIZQ2)&CHR(AIZQ1)&"          [f30][X62][Y21]"&CHR(ChangeLetter)&"[f30][X72][Y21]"&CHR(ADER1)&CHR(ADER2)&CHR(ADER3)&CHR(ADER4)&CHR(ADER5)&CHR(ADER6)&CHR(ADER7)
   case 2
      letter2=ChangeLetter
      MyNewDMD.Text=   "[f11][XC][Y1]PLAYER"&(CurrentPlayer)&" ENTER INITIALS[f30][x50][y10]"&CHR(letter1)&"[B][f30][x60][y10]"&CHR(letter2)&"[f30][x70][y10]"&CHR(letter3)&"[/b][BF][box2,61,20,69,30][/BF][f30][XC][Y21]"&CHR(AIZQ7)&CHR(AIZQ6)&CHR(AIZQ5)&CHR(AIZQ4)&CHR(AIZQ3)&CHR(AIZQ2)&CHR(AIZQ1)&"          [f30][X62][Y21]"&CHR(ChangeLetter)&"[f30][X72][Y21]"&CHR(ADER1)&CHR(ADER2)&CHR(ADER3)&CHR(ADER4)&CHR(ADER5)&CHR(ADER6)&CHR(ADER7)
   case 3
      letter3=ChangeLetter
      MyNewDMD.Text=   "[f11][XC][Y1]PLAYER"&(CurrentPlayer)&" ENTER INITIALS[f30][x50][y10]"&CHR(letter1)&"[f30][x60][y10]"&CHR(letter2)&"[B][f30][x70][y10]"&CHR(letter3)&"[/b][BF][box2,61,20,69,30][/BF][f30][XC][Y21]"&CHR(AIZQ7)&CHR(AIZQ6)&CHR(AIZQ5)&CHR(AIZQ4)&CHR(AIZQ3)&CHR(AIZQ2)&CHR(AIZQ1)&"          [f30][X62][Y21]"&CHR(ChangeLetter)&"[f30][X72][Y21]"&CHR(ADER1)&CHR(ADER2)&CHR(ADER3)&CHR(ADER4)&CHR(ADER5)&CHR(ADER6)&CHR(ADER7)
      case 4'END
      letter4=ChangeLetter
      MyNewDMD.Text=   "[f11][XC][Y1]PLAYER"&(CurrentPlayer)&" ENTER INITIALS[f30][x50][y10]"&CHR(letter1)&"[f30][x60][y10]"&CHR(letter2)&"[f30][x70][y10]"&CHR(letter3)&"[f30][x80][y10]"&CHR(letter4)&"[/b][BF][box2,61,20,69,30][/BF][f30][XC][Y21]"&CHR(AIZQ7)&CHR(AIZQ6)&CHR(AIZQ5)&CHR(AIZQ4)&CHR(AIZQ3)&CHR(AIZQ2)&CHR(AIZQ1)&"          [f30][X62][Y21]"&CHR(ChangeLetter)&"[f30][X72][Y21]"&CHR(ADER1)&CHR(ADER2)&CHR(ADER3)&CHR(ADER4)&CHR(ADER5)&CHR(ADER6)&CHR(ADER7)
     
end select
end sub

sub thehseseste
      afterhseob.set true,1800
   if giveacredit=true then
      giveacredit=false
      PlaySound"knocker"               
      PlaySound"knocker_"   
      nvCredits = nvCredits + 1
end if
      'ShutBackgroundsOff()
      MyNewDMD.Text=   "[f8][XC][Y0]PLAYER "&(CurrentPlayer)&" TOTAL [f8][XC][Y12]"&formatnumber(FormatScore(temphsscore), 0, -1, 0, -1)&"[f8][xc][y22]"&tempnvname&"  RANK " &tempposition
      'MyDmd.Text=  "[f1][XC][Y0]PLAYER "&(CurrentPlayer)&" TOTAL [f5][XC][Y9]"&formatnumber(FormatScore(temphsscore)* (100), 0, -1, 0, -1)&"[f1][xc][y22]"&tempnvname&"  RANK " &tempposition
   
     
end sub

sub endselection
      benterhighscoremode=false
      if letter1=64 then
         letter1=32
      end if
      if letter2=64 then
         letter2=32
      end if
      if letter3=64 then
         letter3=32
      end if

      tempnvname=""&CHR(letter1)&CHR(letter2)&CHR(letter3)&""
      dim act
   if  nvScore(CurrentPlayer) => nvHighScore(1) then
      for act=2 to 10
         execute "nvHighScore("&-act+12&")=nvHighScore("&-act + 11&")"
         execute "nvHighScoreName("&-act+12&")=nvHighScoreName("&-act + 11&")"
      next
            nvHighScore(1)=nvScore(CurrentPlayer)
            nvHighScoreName(1)=tempnvname
            giveacredit=true
            temphsscore=nvscore(CurrentPlayer)
            tempposition=1
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(2) then
      for act=3 to 10
         execute "nvHighScore("&-act+13&")=nvHighScore("&-act + 12&")"
         execute "nvHighScoreName("&-act+13&")=nvHighScoreName("&-act + 12&")"
      next
      nvHighScore(2)=nvScore(CurrentPlayer)
      nvHighScoreName(2)=tempnvname
           
            giveacredit=true
            temphsscore=nvscore(CurrentPlayer)
            tempposition=2
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(3) then
      for act=4 to 10
         execute "nvHighScore("&-act + 14&")=nvHighScore("&-act + 13&")"
         execute "nvHighScoreName("&-act + 14&")=nvHighScoreName("&-act + 13&")"
      next
      nvHighScore(3)=nvScore(CurrentPlayer)
      nvHighScoreName(3)=tempnvname
           
            giveacredit=true
            temphsscore=nvscore(CurrentPlayer)
            tempposition=3
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(4) then
      for act=5 to 10
         execute "nvHighScore("&-act + 15&")=nvHighScore("&-act + 14&")"
         execute "nvHighScoreName("&-act + 15&")=nvHighScoreName("&-act + 14&")"
      next
      nvHighScore(4)=nvScore(CurrentPlayer)
      nvHighScoreName(4)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=4
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(5) then
      for act=6 to 10
         execute "nvHighScore("&-act + 16&")=nvHighScore("&-act + 15&")"
         execute "nvHighScoreName("&-act + 16&")=nvHighScoreName("&-act + 15&")"
      next
      nvHighScore(5)=nvScore(CurrentPlayer)
      nvHighScoreName(5)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=5
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(6) then
      for act=7 to 10
         execute "nvHighScore("&-act + 17&")=nvHighScore("&-act + 16&")"
         execute "nvHighScoreName("&-act + 17&")=nvHighScoreName("&-act + 16&")"
      next
      nvHighScore(6)=nvScore(CurrentPlayer)
      nvHighScoreName(6)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=6
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(7) then
      for act=8 to 10
         execute "nvHighScore("&-act + 18&")=nvHighScore("&-act + 17&")"
         execute "nvHighScoreName("&-act + 18&")=nvHighScoreName("&-act + 17&")"
      next
      nvHighScore(7)=nvScore(CurrentPlayer)
      nvHighScoreName(7)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=7
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(8) then
      for act=9 to 10
         execute "nvHighScore("&-act + 19&")=nvHighScore("&-act + 18&")"
         execute "nvHighScoreName("&-act + 19&")=nvHighScoreName("&-act + 18&")"
      next
      nvHighScore(8)=nvScore(CurrentPlayer)
      nvHighScoreName(8)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=8
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(9) then
         nvHighScore(10)=nvHighScore(9)
         nvHighScoreName(10)=nvHighScoreName(9)
      nvHighScore(9)=nvScore(CurrentPlayer)
      nvHighScoreName(9)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=9
            thehseseste
      exit sub
   end if
   if  nvScore(CurrentPlayer) => nvHighScore(10) then
      nvHighScore(10)=nvScore(CurrentPlayer)
      nvHighScoreName(10)=tempnvname
           
            giveacredit=false
            temphsscore=nvscore(CurrentPlayer)
            tempposition=10
            thehseseste
      exit sub
   end if
thehseseste
end sub


sub afterhseob_expired
   afterhseob.set false,1500
   EndOfBallComplete
end sub


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


Last edited by Gimli on Thu Apr 27, 2017 10:06 am, edited 5 times in total.

Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated for all comers
 Post Posted: Sat Nov 29, 2014 12:04 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
There is one final step.

Different tables will have different names for the Hud and Backglass DMD's. (ie MyDMD, MyDMD2, DispDMD, DispDMD2, HudDMD, HudDMD2, MyNewDMD etc…)
There are 8 places where you must insert your desired DMD name into script that you just copied.
Use the find function…. and find "MyNewDMD" and change the name. (If you are using this tutorial in conjunction with Simple FutureDMD tutorial, no changes here are
required)


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


Last edited by Gimli on Sat Nov 29, 2014 2:00 pm, edited 2 times in total.

Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated for all comers
 Post Posted: Sat Nov 29, 2014 12:05 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Also if you are using this in conjunction with the Simple Background Animated DMD Tutorial there 5 places where you have to remove an Apostrophe to ShutbackgroundsOff() temporarily so you can see DMD highscore routine. (again use the find function …and find "ShutbackgroundsOff() and remove Apostrophe)


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


Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated for all comers
 Post Posted: Sat Nov 29, 2014 12:06 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
Well that's the procedure. Sometimes it takes some tweaking to get it right, especially if the flippers and plunger are doing numerous other tasks in certain games.
Step 3 Enabling DMD Highscore under "Sub EndOfBallTimer_Expired()" also can take some fiddling. But with a little persistence this method should work.

Existing Pinball tables with animations sometimes are tricky as the animations may need
to be turned off temporarily while DMD high score routine is active. Consider trying this on
a simple table the first few times until you get the hang of it.

All Credit goes to Franciso666 for this wonderful routine which makes gameplay seem even more authentic.

Feedback is appreciated

Good Luck !

Cheers,
Gimli


Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated
 Post Posted: Tue Jul 28, 2015 8:31 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
This approach has worked numerous times for me
However in the recently released Shootanza it caused a meditation error
On some European systems

If you get this error just remove the responsible
Line as it is not necessary . The affected code simply informs the player of his ranking
But the DMD high score function still works

This possibly can also be resolved
In European systems as per momochs post here :

viewtopic.php?nomobile=1&f=2&t=5547&p=77525#p77525


Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated
 Post Posted: Wed Apr 26, 2017 1:10 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2113
Location: Ontario, Canada
At the request of BlindPeser,
Heres a youtube video demonstrating this tutorial:
https://youtu.be/yMDt7ktYYlk


This tutorial contains all the required resources

Enjoy!


Last edited by Gimli on Sun Apr 30, 2017 9:17 am, edited 2 times in total.

Top 
 Profile  
 
 Post subject: Re: Simple DMD Highscore Illustrated
 Post Posted: Thu Apr 27, 2017 3:49 pm 
Offline

Joined: Thu Nov 24, 2016 7:46 pm
Posts: 137
Don't know how to find the right words for this. I never understood what the HUD highscore board was all about, but I learnt to accept that it is how it is. This method brings the experience significant closer to reality and should be a standard content in all creations that use a dmd. Gimli is even going to improve the dmds possibilities. Thank you very much Gimli and Francisco666!!!


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

Board index » Resources » Tutorials, how-to's, bug report and docs


Who is online

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