PyPRP:Adding Footstep Sounds

Revision as of 22:21, 20 May 2008 by Nadnerb (Talk | contribs) (Available footstep sounds)

Remember that little (not yet DRC approved) age I wrote to demonstrate stenciling? Well it was awefully quiet there so I decided to add some footsteps to my blended terrain. Since I blended grass and stone/dirt those were the sounds I wanted. Not surprising really.


Using the old plugin I always had trouble getting footsteps to work. Using AlcScript however I had it working in one go. It's really very simple. You only need two basic steps:


1. add a region

2. add AlcScript for that specific region


Have a look at my age. You will notice that I added two regions (marked pink). They cover both my grassy patch and my dirt patch. In this tutorial I will explain how to add these regions and how to add the correct AlcScript to make them work. Don't worry! This will be a walk in the park.


FootSteps rgns.jpg


Step 1: Adding regions

So how did I add these regions. Actually this is pretty straight forward too. Change one of the Blender windows to Scripts and use the Script button to add a PyPRP script. One of the options is "Add a Footstep Sound Region". Sounds like that's the one we need :)


FootSteps addRgn.jpg


Regions are by default added to the second layer in Blender. To be able to scale them correctly I activated both the first and second layer (hold shift while clicking on the layer buttons), so both my terrain and the regions would be visible.


FootSteps layers.jpg


Don't forget to set their object names. The Region on the left is called RgnFootStepGrass, the other one RgnFootStepDirt. We will need these when adding AlcScript.


Btw don't think a footstep region has to be rectangular. You can give it any shape you want. For instance in my Swimming pool age (Adding swimregions tutorial) I added a big region for the pool side tiles and actually cut out the pool part. This way very interesting regions can be created.


Remember the old plugin had some sort of fade out at the regions edges? Well now the sounds are played all the way to the edge of the region. Pretty cool!

Step 2: Adding AlcScript

This was the first time I actually added AlcScript. And it couldn't have been easier.


For starters change one of the windows to Text and choose AlcScript from the dropdown. The text window will now display the "# insert AlcScript code here" comment at the top of the window. Chances are that's the only code there is right now.


Have a look at the code I entered.


FootSteps alc.jpg


I added code for both regions, using their object names. (Remember I said we would need those here?). For simple footsteps only two properties have to be set:


1. type: in this case we are adding code to a footstep region

2. surface: type of sound. Here resp. dirt and grass


Alternative to step 2: using text properties (the old way)

You can also use text properties, similar to the old footstep region style. Any text properties set on an object will override AlcScript settings. The new props for footstep regions are:

<objectname>:
   type: region
   region:
      type: footstep
      surface: <surface name>

Note: in version 1.2.0, using the Scripts > Add > PyPRP > Add a Footstep Sound Region will set the text properties to the default:

FootProps.jpg

Because text settings override AlcScript settings, if you intend to use AlcScript to set your surfaces, you will need to delete the surface property.

Available footstep sounds

There are off course many more types of terrain you will want to add footstep sounds too. Below is a list of available footstep sounds to use with the "surface" property.


  • dirt
  • puddle (Not implemented in PotS plasma. Do not use)
  • water
  • tile
  • metal
  • woodbridge
  • ropeladder
  • grass
  • brush (Not implemented in PotS plasma. Do not use)
  • hardwood
  • rug
  • stone
  • mud (Not implemented in PotS plasma. Do not use)
  • metalladder
  • woodladder
  • deepwater
  • maintainerglass (Not implemented in PotS plasma. Do not use)
  • maintainerstone (Not implemented in PotS plasma. Do not use)
  • swimming

Wrapping up

Well... that's it. There isn't much more to it. You have to take my word that I actually do have footsteps in my little age ;) I'm not sure whether more tweaking is possible with AlcScript. I will have to figure that out for myself first or have some of the real PyPRP gurus have it explain to me. If there is more I will add it here.


Shorah!


Marcello