2017-01-25 14:13:28

Hi, everyone.
Recently I've discovered the awesome function sound_positioning. More than that, I've also learned how to use it.
My question is, how to  proceed to make the sound being centered on more squares, not just one, like  sound_positioning usually does?
For example, let's say that on the right I have a river or something else. As I get closer to it, the sound starts centering. When it's centered, I want it to remain centered about 10 or 15 squares, until I get out of the water and the sound  could start changing its position according to the player position.
So, in conclusion, I'd like to know how to have the sound I've put with sound_positioning function, centered more than 1 square.
Below I'll put the code
void level1()
{
int default_weapon_item=1;
int default_weapon=0;
string sword="inactive";
x=0;
y=0;
int s_position=10;

drum.resize(50);
sound ambience;
sound step;
sound wall;
sound swordsound;
sound sabie;
ambience.stream("Sounds/Suburban Neighborhood.ogg");
ambience.volume=-5;
ambience.play_looped();
swordsound.load("Sounds/sword.ogg");
swordsound.volume=0;
wall.load("sounds/wall.ogg");
step.load("Sounds/Concrete1.wav");
step.volume=-5;
sabie.load("sounds/sword.wav");
sabie.play_looped();
for(int x=0; x<50; x++)
{
drum[x];
}
drum[2]="Casa";
drum[4]="Casa";
drum[7]="Casa";
drum[15]="Scut";
while(true)
{
wait(5);
if(key_down(KEY_LEFT)&&T.elapsed>250)
{
if(x>0)
{
T.restart();
walk_left();
position_sound_1d(sabie, x, s_position, 1, 1);
step.stop();
step.play();
spune(""+drum[x]+"");
}
}
if(key_down(KEY_RIGHT)&&T.elapsed>250)
{
if(x<51)
{
T.restart();
walk_right();
position_sound_1d(sabie, x, s_position, 1, 1);
step.stop();
step.play();
spune(""+drum[x]+"");
}
}

2017-01-26 03:28:59

I don't know much about it though, wasn't there an include called sound_pool? It may allow you to do what you want.

I don't speak as good as I write, and I don't listen as good as I speak.

2017-01-26 12:33:29

Exactly, the sound pool class can do just this, and the standalone sound positioning functions can't. You should learn to use the sound pool anyway, there is usually no more need to use the positioning functions directly since the sound pool has been released.

I wonder whether people just don't read the reference parts of the help file or what, since the sound pool has been a part of BGT since the public betas, which means several years now, and this is not the only instance I've heard people asking about something that's been in the engine almost since the beginning.

Lukas

I won't be using this account any more or participating in the forum activity through other childish means like creating an alternate account. I've asked for the account to be removed but I'm not sure if that's actually technically possible here. Just writing this for people to know that I won't be replying, posting new topics or checking private messages until the account is potentially removed.

2017-01-26 19:18:24

It's not about not reading the tutorials and all stuff, which I did, it's about asking more experienced users who can provide examples, alternative metods in some situations and so on

2017-02-06 21:34:32 (edited by Saman 2017-02-06 21:35:28)

hello. As far as i know, you cannot make something like that  with the sound positioning, but you can do it in sound pool,  the play extended 1 or 2d version. Check it out, although i suggest you to use sound pool at all, which very better and more  useful than sound positioning.