Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Footstep sounds with distance  (Read 5287 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Footstep sounds with distance
« on: January 26, 2007, 03:21:40 PM »

Hi all,
       I was wondering if a pair of sounds can be assigned to the actors footsteps for the right and left foot that are lower in volume or that the volume of the footstep sounds assigned to the actor - (See different footstep sounds) could be altered to give the feeling of depth in a scene.

Any ideas how this could be implemented for say 800x600 screens and 1024x768 screens using the base footsteps sound tutorial already posted.


Many thanks



Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mac

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 136
    • View Profile
    • Homepage
Re: Footstep sounds with distance
« Reply #1 on: January 26, 2007, 05:01:07 PM »

Maybe you could adjust the volume of the footstep sound according to the actual actor scaling. If the actor scaling is low then he's probably far away and the sample is played with low volume. If the scaling factor is high the sample is played with full volume.

Mac
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Footstep sounds with distance
« Reply #2 on: January 27, 2007, 03:02:44 AM »

No Shit Sherlock!!! I know this but how do I connect a script to the verticle scale in scene edit?
So that at a certain Y position the sound of the footsteps is lower than say right up front in the foreground?
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mac

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 136
    • View Profile
    • Homepage
Re: Footstep sounds with distance
« Reply #3 on: January 27, 2007, 07:30:15 AM »

Good point Watson! I thought one could read the current scaling factor of the actor from within a script, but it doesn't work as I just found out. So the easiest way will be this:

min_y -> the lowest possible y coordinate in the scene (far)
max_y -> the highest possible y (near)

Code: [Select]
current_vol = (actor.Y-min_y)/(max_y-min_y)*100
But this will only work if you have two scale level bars in your scene.

Mac
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Footstep sounds with distance
« Reply #4 on: January 27, 2007, 08:48:44 AM »

I thought one could read the current scaling factor of the actor from within a script, but it doesn't work as I just found out.
You can, actually, not by querying the actor, but the scene. Something like:

var ActorScale = Scene.GetScaleAt(actor.X, actor.Y);
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Footstep sounds with distance
« Reply #5 on: January 29, 2007, 05:14:47 PM »

Thanks Mnemonic, SO I place this line in my Scene.Init file for a certain big scene.

But how do I interrupt the actors scripts of footstepl.script and footstepr.script that determine what sound is played on what surface??


Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Footstep sounds with distance
« Reply #6 on: January 29, 2007, 08:06:50 PM »

No, you need to set the volume repeatedly, you can't just set it once in scene_init. So you should probably put it directly to your footstepr/footstepl scripts.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Footstep sounds with distance
« Reply #7 on: January 30, 2007, 05:24:16 PM »

Not sure how to code this, I tried putting the ActorScale variable into this code - Footstepl and got no sound at all.


Here is the footstepl code

Code: [Select]
#include "scripts\base.inc"

on "footstepl"
{
 // get a region the actor is standing in
 var Reg = Scene.GetRegionAt(this.X, this.Y);
 if (Reg!=null)
 {
   // play a sound depenging on a surface
   // "xSurface" is a custom property we defined in SceneEdit
   switch(Reg.xSurface)
   {
    case "stone":
       this.PlaySound("sounds\stoneL.wav");
     break;

     case "wood":
       this.PlaySound("sounds\wood04.wav");
     break;

      case "carpet":
       this.PlaySound("sounds\carpet4.wav");
     break;


  case "steps":
       this.PlaySound("sounds\step2.wav");
     break;

  case "gravel":
       this.PlaySound("sounds\gravel4.wav");
     break;

case "metal":
       this.PlaySound("sounds\metalstepl.wav");
     break;

case "snow":
       this.PlaySound("sounds\snow2.wav");
     break;


     // add more sounds here...
   }
}
}


Can you point me in the right direction please.


Thanks



Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Footstep sounds with distance
« Reply #8 on: January 30, 2007, 07:59:56 PM »

Where and what did you put there? I can't see it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Footstep sounds with distance
« Reply #9 on: January 30, 2007, 09:50:06 PM »

Oh sorry,
            I left it without the added code so you could pave the way, I basically delared the variable of Actor.Scale under var Reg

and then

if (Reg!=null && Actor.Scale < 80)
play the sounds as normal volume (100%)

else

actor.SetVolume(50); 

But I got no sound  on the left foot.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mac

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 136
    • View Profile
    • Homepage
Re: Footstep sounds with distance
« Reply #10 on: January 31, 2007, 10:11:31 AM »

As mentioned above actor.Scale always returns null. Try this:

Code: [Select]
var ActorScale = Scene.GetScaleAt(actor.X, actor.Y);
if (Reg!=null) {
    if(ActorScale < 80) {
       // Play at low volume
    } else {
       // Play at high volume
    }
}
...

Mac
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Footstep sounds with distance
« Reply #11 on: January 31, 2007, 03:32:43 PM »

Thanks, I have sorted this out now, and it sounds much better.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
 

Page created in 0.126 seconds with 24 queries.