Hello.
I need help with ambiences in bgt.
How do I make a sertan ambience to play at x, y, z, that I want, and how do I make it so it pans when you walk.
I tried sound_pozitioning, but I can't get it to work.
Any help would be apprishiated.
Pages 1
You are not logged in. Please login or register.
AudioGames.net Forum → Developers room → help in BGT needed
Hello.
I need help with ambiences in bgt.
How do I make a sertan ambience to play at x, y, z, that I want, and how do I make it so it pans when you walk.
I tried sound_pozitioning, but I can't get it to work.
Any help would be apprishiated.
If you don't want to use the sound_pool:
// Global, or in a class instance:
sound@ amb;
void init_amb (){
sound temp;
ámb=temp;
amb.load("ambience.ogg"); // use the filename you want.
}
// assuming you have player position variables:
void update_amb (int player_x, int player_y, int player_z) {
position_sound_3d (amb, player_x, player_y, player_z, amb_x, amb_y, amb_z, 1, 1, 1);
}
If you'd rather use the sound_pool, it's much simpler, especially if you have multiple sounds:
sound_pool pool;
void init_amb (){
pool.play_3d ("amb.ogg", player_x, player_y, player_z, amb_x, amb_y, amb_z, true);
}
//after you've moved the player:
pool.update_listener_3d (player_x, player_y, player_z, player_angle);
I might have forgotten when to use the listener angle in there, but that's easy enough to check (I'm typing this on my phone ).
Basically, you need to update the sound every time the player moves. The sound_pool does this for all playing sounds with a single method, that only takes the player's new position. So, unless I'm trying to do something fancy like sound rings, I'd just stick with the sound_pool.
AudioGames.net Forum → Developers room → help in BGT needed
Generated in 0.030 seconds (28% PHP - 72% DB) with 12 queries