Originally Posted By: painkiller
using snd_play and changing the volume depending on the position would work, but would loose 3d sounds advantages, for example knowing if an enemy comes from the left or right side.

You can do that yourself too though, for example as follows (untested, just the idea):

vec_diff(temp,ent.x,camera.x);
temp.z = 0;
vec_normalize(temp,1);
vec_set(temp2,vector(0,-1,0));
vec_rotate(temp2,vector(camera.pan,0,0)); // pan alone should be enough, right?
var balance = vec_dot(temp,temp2)*100;
snd_tune(...,balance);

If the result is super wrong, I'd start with DEBUG_VARing the vec_dot result.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends