SoundObjectSetPosition(object, vector)

Sets the position of a sound object relative to the player(s).

void SoundObjectSetPosition(
    object oSound,
    vector vPosition
);

Parameters

oSound

The sound to be played.

vPosition

The vector where the sound should originate from.


Description

This function can be used to change the position of the sound object that is placed in the module. For instance, a sound of moaning could be placed on a player when they open a chest.



Remarks

For people using surround sound in their game environment, this can be very effective.


Version

1.22

Example

// assumes CryptMoans Sound is placed nearby
// this script placed in the OnDisturbed section of the chest
//
//  puts the sound of moaning crypt noises right on the person 
//  that disturbs the contents of the chest -  sccccaaaarrrrryyyy

void main()
{
     vector vPlayer = GetPosition(GetLastDisturbed());
     // location in vector format
     object mySound = GetObjectByTag("CryptMoans");
     SoundObjectSetPosition(mySound, vPlayer);
}

See Also

functions: SoundObjectSetVolume
categories: Action on Object Functions | Sound Effects Functions | Spell Casting Effects Functions


 author: Bill Castello, editor: Jeremy Spilinek