|
Re: snd_tune query
[Re: tex]
#459187
04/26/16 11:21
04/26/16 11:21
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
Hi, I dont know if this is the cause but this part looks suspicious:
while (1)
{
.............other code here
if(mouse_left){
on_mouse_left = mouse_leftsound;
var freq = ++300;
snd_tune(mouse_leftsound,100,freq,0);
}
.............other code here
wait(1);
}
Placing in a while loop on_mouse_left = mouse_leftsound; looks a bit weird I think. Second shouldn't var freq = ++300; be var freq += 300; ? (dont know if that really matters though) Finally, snd_loop(engine_sound,100,0); has no handle, which you need for snd_tune I think. This last one is why I think you get the crash and your bug.
Last edited by Reconnoiter; 04/26/16 11:23.
|
|
|
Re: snd_tune query
[Re: tex]
#459194
04/26/16 13:31
04/26/16 13:31
|
Joined: Dec 2011
Posts: 1,823 Netherlands
Reconnoiter
Serious User
|
Serious User
Joined: Dec 2011
Posts: 1,823
Netherlands
|
No problem, glad to help.
As for your current problem, try to store the original frequency in e.g. a global variable, than put an else after if(mouse_left) to restore the original frequency. So something like this:
var original_freq = whateverNumberYouWantHere; .... .... if(mouse_left) //left mouse button pressed? { speed+=1; //forward speed freq = 200*speed; } else freq = original_freq; //left mouse button NOT pressed .... ....
Could be I misinterpreted your question.
Last edited by Reconnoiter; 04/26/16 13:33.
|
|
|
Re: snd_tune query
[Re: Reconnoiter]
#459199
04/26/16 14:03
04/26/16 14:03
|
Joined: Apr 2008
Posts: 15 Oz
tex
OP
Newbie
|
OP
Newbie
Joined: Apr 2008
Posts: 15
Oz
|
that totally worked! not sure what you are like with PhysX but I have a post over there that hasn't got a response - re concave objects... You might have some ideas? thanks
Last edited by tex; 04/26/16 14:04.
|
|
|
|