Register    Login    Forum    FAQ    PinSimDB.org

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




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 1:33 am 
Offline

Joined: Sat Feb 20, 2016 1:06 am
Posts: 4
Anyone know how to script a sound effect when adding High Score Entry? I don't think I've seen it done before so I have no sample scripts to view. I figured out the flipper sound effect when selecting a letter but the sound effect I want is when you confirm a letter with the game start key (1).

This is what I have in the script which doesn't work.

If (KeyCode = GetKeyCode(StartGameKey)) and (bEnteringAHighScore = TRUE) Then
PlaySound "x"
End If

Thanks for any info.


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 6:26 am 
Offline
User avatar

Joined: Mon Sep 21, 2015 10:33 am
Posts: 111
Location: UK - Bridgnorth (Shropshire)
Hi Crow,

If you want to see how this can be achieved, I would suggest SLAMT1LTs 'Gorgar' table; which he has just updated and re-released (ULTIMATE 1.03) - including:

Quote:
added an additional music track to high score entry


The table can be downloaded from his "Slam's Pinball Emporium" website;

http://speak1970.wix.com/slamspinballemporium

which will hopefully allow you to see how it was scripted (using a random track ("Select Case")); see lines 667 - 675.

Code:
bEnteringAHighScore = TRUE
MyDMD.Text = "[edge3][box1,1,1,126,30][f6][xc][y2]HIGH SCORE[y17]ENTER YOUR NAME"
MyDMD2.Text = "[edge3][box1,1,1,126,30][f6][xc][y2]HIGH SCORE[y17]ENTER YOUR NAME"
EnterHighScore(CurrentPlayer)

   Select Case RandomNumber(3)
      Case 1: PlayMusic 7, "Music_HS", FALSE, 1
      Case 2,3: PlayMusic 7, "Music_HS2", FALSE, 1
   End Select


As opposed to using the "PlayMusic" script - change this for "PlaySound" script.

Hope this makes sense / helps,

Gin

End of Line...


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 7:26 am 
Offline
User avatar

Joined: Fri Jul 02, 2010 4:50 am
Posts: 1111
Location: Paris - France
Crow wrote:
...
the sound effect I want is when you confirm a letter with the game start key (1).
...

I you want to do that, you have to script the High Score Entry sequence.

_________________
Les cons ça ose tout. C'est même à  ça qu'on les reconnaît.
My tables avalaible at http://www.pinsimdb.org/fpreleases/ and http://www.irpinball.org/
Image
Image
Le prix s'oublie, la qualité reste


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 1:23 pm 
Offline
User avatar

Joined: Mon Sep 21, 2015 10:33 am
Posts: 111
Location: UK - Bridgnorth (Shropshire)
Hi Crow,

Apologies... should have read your request closer...

As Popotte has commented, you could achieve this through scripting the
Quote:
High Score Entry Sequence


I believe that what you are trying to do has been implemented on the "Cadash" pinball table; by Gimli and Wild (Found here : http://www.pinsimdb.org/pinball/table-22364-cadash_fantasy_pinball)

I think that Script lines 673-724 show this...?

*** Perhaps Gimli / Wild could confirm this is the case (?) ***

and then include your "PlaySound" SFX at the relevant point in the script.

Here' hoping this helps (this time :oops: ),

Gin

End of Line...


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 3:43 pm 
Offline
User avatar

Joined: Fri Jul 02, 2010 4:50 am
Posts: 1111
Location: Paris - France
Not really. Cadash use the "HIGH SCORE DMD DISPLAY ROUTINE Francisco666 from Apollo13 table" and not the regular High Score Entry sequence.
The regular High Score Entry sequence is a built-in function and you can't have an action on it.

_________________
Les cons ça ose tout. C'est même à  ça qu'on les reconnaît.
My tables avalaible at http://www.pinsimdb.org/fpreleases/ and http://www.irpinball.org/
Image
Image
Le prix s'oublie, la qualité reste


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 5:43 pm 
Offline

Joined: Sat Feb 20, 2016 1:06 am
Posts: 4
I figured that was the case Popette since I haven't seen any tables calling for that action. Unfortunately I have very little scripting knowledge so scripting a separate high score sub routine is beyond my ability.

I was drooling to have the transporter sound effect for confirming a letter in the high score entry for the Star Trek table. I was hoping for a simple solution, something I was missing.

If anyone can think of a table that scripts the high score routine please let me know so I can take a look. Thanks.


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 6:13 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2014
Location: Ontario, Canada
If you don't mind having the High Score in the DMD ( I prefer it) then what you are asking should be easy.

I usually create a new independent DMD before trying to imbed it in an existing DMD, as it is easier at first. Always try this stuff as a "new table" to make sure you can do it. Once you try it on a real table like star trek sometimes there are other things getting in the way that you have to figure out...

I can help you....

but first try my tutorial:
viewtopic.php?f=55&t=5186

and the only difference should be instead of entering one of the code segments under Plungerkey
you enter it under start game key (although I don't know why you want it there).
I believe you can just copy the whole code below as separate "If (KeyCode = GetKeyCode(StartGameKey)) " routine in the same general area as the other similar startgamekey routines in the script....

just enter the name of your sound below where I put Playsound "WhatCrowWants"

Oh ya , and you probably know, you can copy and paste from these green code boxes.
(I click on the first word, use the arrow to the right of the box to scroll down to the bottom of the code box. Place mouse over end of last word and press and hold the Shift key and then click mouse. That selects all the text. Then Control C to copy and control V to paste it into the script...)

Code:
If (KeyCode = GetKeyCode(StartGameKey)) Then
if benterhighscoremode=true then
         'ShutBackgroundsOff()
         PlaySound "whatCrowWants"
         if ChangeLetter=63 then'End the entername
               endselection
               exit sub
            end if
            if ChangeLetter=62 then'Backspace
               if SelectLetter=1 then
                  exit sub
               end if
        end if

                     if SelectLetter=2 then
                        letter2=64
                     end if
                     if SelectLetter=3 then
                        letter3=64
                     end if
                  SelectLetter=SelectLetter-1
                  highscoremoveright=true
                  moveletterhs
                  highscoremoveright=false
                  moveletterhs   
               exit sub   
            end if
               SelectLetter=SelectLetter+1
                  if SelectLetter=>4 then
                     SelectLetter=4
                     ChangeLetter=63
                  end if
               highscoremoveright=true
               moveletterhs
               highscoremoveright=false
               moveletterhs
            exit sub
         end if


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Fri Mar 04, 2016 7:41 pm 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2014
Location: Ontario, Canada
yea that works fine Crow.

Here is a demo table with a DMD high score routine and with Start GAme key used instead of
plunger. I used the "fanfareWhip" sound from Indiana Jone :D

https://www.dropbox.com/s/rhqfxlsxjg9dp4f/crow.fpt?dl=0

I set balls per game to 1 just to end game quickly.

If you go to script and select "find" under "Edit" at the top of page and type "Crow" you will see where I added stuff in script as per my tutorial.


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Sat Mar 05, 2016 12:01 am 
Offline

Joined: Sat Feb 20, 2016 1:06 am
Posts: 4
Awesome Gimli! Thanks for spending a little time to help me out. I'm going to add this to all my favorite tables and figure out a good sound effect that fits. Have a great day. :)


Top 
 Profile  
 
 Post subject: Re: Sound Effect For High Score Entry
 Post Posted: Sat Mar 05, 2016 10:19 am 
Offline

Joined: Mon Jan 27, 2014 12:36 pm
Posts: 2014
Location: Ontario, Canada
No worries.
It will take a little fiddling to embed it each table. The tables with a lot animation often use a "Kill code"
that stops the animation during game play, so the next one can be viewed. So you have to discover
this code (it can be something like ScoreUpdate = False or StopAnimation = True or AnimationTimer.Enabled = False etc...I just made those up, but you get the idea).
Often the embedded DMD Highscore Code works right away.....

Also you can put different sounds, in that code segment that you put under StartGameKey, for each letter chosen and after the final selection. I put the playsound "Crow" at the top of that code so each
time you press "StartGameKey" the sound is the same but you can do it anyway you like..

Let me know how it goes, it can be frustrating at first

Cheers


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 10 posts ] 

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


Who is online

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