Can characters generate ambient sounds as they move?

Started by deltamatrix, Thu 06/11/2003 15:17:53

Previous topic - Next topic

deltamatrix

BAD WOLF - TORCHWOOD - MR SAXON - THE BEES ARE DISAPPEARING - PANDORICA - RIVER SONG

SSH

You can assign a "footstep" sound to a frame of a view. This doesn't have to be a footstep, though.
12

a-v-o

if you mean that the sound volume depends on how close they are to the player character, then there is no comman, but I used this script to produce the effect:

#define MIN_VOLUME     0
#define MAX_VOLUME   255
#define MAX_DISTANCE 160

int volume = 0;

function room_b() {
 // script for room: Repeatedly execute
 int PC = GetPlayerCharacter ();
 int dx = character [GUARD_CHAR].x - character [PC].x;
 if (dx <  0) { dx = -dx; }
 int distance = MAX_DISTANCE - dx;
 int vol = MIN_VOLUME;
 if (distance > 0)
 {
   vol += distance * (MAX_VOLUME - MIN_VOLUME) / MAX_DISTANCE;
 }
 if (volume != vol)
 {
   volume = vol;
   SetSoundVolume (volume);
 }
 if (IsSoundPlaying () <= 0) { PlaySound (97); }
}


SMF spam blocked by CleanTalk