Difference between revisions of "PhysicalSounds"

Line 8: Line 8:
 
==About==
 
==About==
  
Physical Sounds are used when you want to have a kickable make Impact and Sliding sounds when you hit or punch the object.
+
Physical Sounds are used when you want to have a kickable make Impact and Sliding sounds when you hit or slide the object.
  
  

Revision as of 21:15, 2 July 2008

Note: This tutorial has been made in preparation for an upcoming release of PyPrp, it will only work with the newest (unreleased version). This is currently unsupported (we won't help you with something if you get stuck).


Physical Sounds

About

Physical Sounds are used when you want to have a kickable make Impact and Sliding sounds when you hit or slide the object.


Use

Ok, you're going to want to start with an empty (your emitter), and then add a random-sound to the object. All we have to do is add the AlcScript#sound settings that we want for the multiple sounds to the "sounds" list. In most cases we'll want to use "static" sounds (you put the wav in the streaming cache for these). Here is an example of the random sound set up with two sounds--both static:

<Emitter-Object name>:
    type: randomsound
    randomsound:
        sounds:
          - SomeSound1:
                sound:
                    file: SomeSoundBlock1
                    volume: 1.0
                    buffer: static
          - SomeSound2:
                sound:
                    file: SomeSoundBlock2
                    volume: 1.0
                    buffer: static

As you can see, the stuff listed under "sounds" is exactly the same structure as with normal emitter settings.

Now that we have our random sound emitter we can start work on the actual physical sounds. :D

Here are the props for your physical object (say a beach-ball):

<Kickable-Object name>:
    physical:
        sndgroup: (metal|grass|wood|stone|<Number>(advanced users only))
        impact: <your random sound emitter name (leave blank if you don't want any)>
        slide: <your random sound emitter name (leave blank if you don't want any)>

Now, since you most likely don't want your object to make sounds elsewhere while you play with it you'll need to parent the emitter to the kickable object. To do this you first select the emitter, then you select the kickable and press CTL+P then press ok.

Now you need to add a sndgroup to the collider-ground:

<Ground-Object name>:
    physical:
        sndgroup: (metal|grass|wood|stone|<Number>(advanced users only))

That's everything. Not that much to this is there? ;)