02-05-2014, 06:08 PM
So, why hello there dear Amnesia Community. Up ahead will probably be a somewhat long post for a probably not so huge problem. Though i want to be sure let you guys know what i'm doing and how i'm doing it.
So basically i'm using an ambient music technique where i have different script areas that play different types of music depending on the surrounding architecture. The code looks, in short, something likes this:
With this method the ambient sound can easily be changed with different script areas. Though i ran into problems when it comes to shaped rooms that are not quadrangular. The way I've done it was that i just set one script area up so that it covers the blank areas (because the music would stop otherwise) and let it play the same sound/music again. I've put together a little picture to demonstrate it a little better.
The point marked with an X is the problem zone. If the player switches or passes this point the ambient music changes and starts over from the start again. It's either a whole other setup of code or i'm just being too fussy about this because it is easily overheard. Though i'd like to discuss it here and see if someone is willing to help me out here . Thanks in advance.
So basically i'm using an ambient music technique where i have different script areas that play different types of music depending on the surrounding architecture. The code looks, in short, something likes this:
PHP Code:
//AMBIENCE COLLIDE CALLBACKS
AddEntityCollideCallback("Player", "AmbientScriptArea", "AmbienceHandler", false, 0)
//HANDLER
void AmbienceHandler (string &in asParent, string &in asChild, int alState) {
if (asChild == "AmbientScriptArea") {
if (alState == 1) {
PlaySoundAtEntity("Ambience01", "amb_xx_xx.snt", "Player", 1.0f, true) }
if (alState == 1) {
StopSound("Ambience01", 1.0f) }
}
}
With this method the ambient sound can easily be changed with different script areas. Though i ran into problems when it comes to shaped rooms that are not quadrangular. The way I've done it was that i just set one script area up so that it covers the blank areas (because the music would stop otherwise) and let it play the same sound/music again. I've put together a little picture to demonstrate it a little better.
The point marked with an X is the problem zone. If the player switches or passes this point the ambient music changes and starts over from the start again. It's either a whole other setup of code or i'm just being too fussy about this because it is easily overheard. Though i'd like to discuss it here and see if someone is willing to help me out here . Thanks in advance.