Rogue Pinball

Visual Pinball => VP Tools => Topic started by: Itchigo on November 29, 2012, 04:44:43 AM

Title: Sounds and Images
Post by: Itchigo on November 29, 2012, 04:44:43 AM
Adding sounds and images are pretty easy, making them "fit" is harder. To add sounds go to "Table"/"Sound Manager" (top of the editor) and you will see all sounds that are in the table. Assuming it's a VP table and not VPM, you can also "Export" them out (a copy) to wherever and use them in another table. Use the "Import" and browse for sounds to add to your table. You can make them play by using the command: Playsound "addyoursoundhere". That name must match the name in the sound manager or it will not play.

Overlapping sounds: Here is how you keep sounds from overlapping one another.

Sub Toplane_Hit()
    Playsound "toplane"
End Sub

Checktoplanes()
If  Toplane1.state=1 and Toplane2.state=1 then
    Stopsound
    Playsound "toplanes completed"
End If
End Sub

Sub Stopsound()
    Stopsound "toplane"
End Sub

Say you want to play the toplane sound, but if you complete all toplanes you don't want the completed sound to be drown out. So you put the playsound "Toplane" command in when you hit the toplanes, then you call the stopsound sub where you check if all toplanes are hit. This plays the toplane sound, then stops it when all lanes are hit so it can play the completed sound.


Images are added/exported the same way. You will see a colored rectangle below your image, this is the transparent color. In other words, the editor will ignore this color. A great example is a ball image. A ball image is the ball with a background color. Set the transparent color to match the background color and all you see is the ball itself, not the whole square image. Caution: Make sure to set the transparent color to a color NOT in your image ANYWHERE. Otherwise your image will be blotchy due to a missing color. Images are used for lights and walls.

It's best to export a blueprint and paste your image to the blueprint. Go to "File"/"Export Blueprint" (Top left). Paste your image to that blueprint. Keep in mind the size of the image vs the size on the blueprint. The size will have to match up or the image won't look right.
Title: Re: Sounds and Images
Post by: faralos on November 29, 2012, 12:36:54 PM
for music or longer sound bytes that you don't want to overlap
write this out at the top of your code somewhere:
Sub Silence
    Stopsound"song name1"    
    StopSound"song name2"
    StopSound"song name3"
    StopSound"song name4"
    Stopsound"song name5"
 End Sub
now in the coding you just write:
Silence
 and that will stop ALL the sounds you have in the sub
so in essence you have a sub written  like such:

Sub Playsound"song name1"
End Sub
then to start the second song you write it like this:
 Sub Playsound"song name1"
End Sub
Silence
 Sub Playsound"song name2"
End Sub
 this can go on for as many tunes or sounds as you want
as long as you have them in that Silence sub at the top of your coding
this is the way I get songs to stop without overlapping even before the song finishes
Title: Re: Sounds and Images
Post by: faralos on November 29, 2012, 12:48:51 PM
All sounds/music must be in wav format to work in vp
(if using MP3's they must sit outside of the pin in a separate folder)
best saved at its lowest sound setting too for minimum size
I use that 6000 hz quality file for lesser sounds like effects
or songs that are way too large to drop into a pin
for best quality (most tunes that play while the pin is active I save this way)
I save at the best WavePad quality rate I can usually  41000 hz