Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sound Entities in Level Editor
TheGreatCthulhu Offline
Member

Posts: 213
Threads: 10
Joined: Oct 2010
Reputation: 32
#3
RE: Sound Entities in Level Editor

Yeah. Also, from my experience, when using Sound entities, the playback is started as soon as the level loads - but it can be heard only if you are in range. If it's not a looping sound, it will simply stop when it reaches the end of the audio clip, after which you can play it again using this script function:

void FadeInSound(string& soundEntityName, float fadeInTime, bool playStart);
The documentation doesn't say what the third parameter does, and I wasn't able to figure it out, so just pass either true or false.

If it's a looping sound, it will loop during your time in the level.

You can stop both types of sounds using the StopSound(/* ...params omited... */ ) script function (see the wiki for details).


All that said, you'll have more flexibility with this:
void PlaySoundAtEntity(
    string& internalSoundResourceID,
    string& soundFileName,
    string& targetEntity,
    float fadeInTime,
    bool rememberPlaybackState   // restores playback for looping sounds when the lvl is revisited
);

Using that function, you don't have to use Sound entity objects, you can simply refer to a sound file, and easily create audio feedback for collisions and other events - but then you can't set the range where the sound will be audible (the settings from the sound file will be used).
(This post was last modified: 12-07-2012, 03:11 AM by TheGreatCthulhu.)
12-07-2012, 03:10 AM
Find


Messages In This Thread
Sound Entities in Level Editor - by AGP - 12-07-2012, 02:19 AM
RE: Sound Entities in Level Editor - by TheGreatCthulhu - 12-07-2012, 03:10 AM
RE: Sound Entities in Level Editor - by AGP - 12-07-2012, 03:51 AM
RE: Sound Entities in Level Editor - by AGP - 12-07-2012, 06:52 AM



Users browsing this thread: 1 Guest(s)