Frictional Games Forum (read-only)
Level ambience - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Level ambience (/thread-48975.html)



Level ambience - Xallikk - 06-05-2016

I can't find anything online about this and I was wondering if you guys could help me out with this. I just want one the their ambience sounds to play throughout the whole level right when I spawn into it. How do I make that work?


RE: Level ambience - Romulator - 06-05-2016

Use a looping PlaySoundAtEntity() on the Player in OnStart();

Or, place it somewhere in the map, call it OnStart(); and loop it, or make it play at selective times using a timer.


RE: Level ambience - Xallikk - 06-05-2016

Would it just look like this then?

void OnStart()
{
AddEntityCollideCallback("Player", "AmbienceWind", "Level2", true, 1);
}


void Level2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("windsound", "ambience_wind_eerie.snt", "AmbienceWind", 0.01f, true);
}


RE: Level ambience - Daemian - 06-05-2016

Or use a sound object in the level editor, place it anywhere and select the ambiance sound you want to play.
Try the ones in /sounds/ambience


RE: Level ambience - Xallikk - 06-05-2016

Great that works thx! I tried that before and it hadn't worked but now it does!