Posted By: HackerL
[Newton]sound! - 11/11/05 18:09
Have can i add engine sound to newton car?
with media_play is'nt working for me!!!
Posted By: HackerL
Re: [Newton]sound! - 11/13/05 21:01
Okey i used media_loop! But how can i stop it when i realese key!
Quote:
if(key_cuu)
{
my.carEngineTorque = my.car_maxToque;
fps_max = 50; // limit the frame rate to 50 fps
media_loop ("engine.wav", null, 100);
}
Script is here! When i press CUU key sound starts playing but when i realase i need to stop engine sound!!!
And when i press key ENGINE sound starts about 100 and 100 times!
Posted By: Carloos
Re: [Newton]sound! - 11/14/05 12:02
//First, declare your sound :
sound engine_wav = <engine.wav>;
// Then, use ent_playloop to play your sound : ( I use this code in my NewtonVehicle Function, dont know if is the right place, but it works.
var engine_handle;
engine_handle = ent_playloop (my, engine_wav, 50);
// Finally, modulate your engine sound with your engine rpm :
snd_tune (Engine_handle, 50,50,0 );
// To make the sound disappear, you can simple troggle its volume to 0 ( Zero ), the first value : snd_tune(Engine_Handle,vol, freq, bal)
Good luck.
Posted By: HackerL
Re: [Newton]sound! - 11/14/05 12:33
i dont understand it is working like media_loop i dont now how can i stop it! and when i press cud button its again starting hundred times! i just need to play sound when i hold the button!
Posted By: Carloos
Re: [Newton]sound! - 11/14/05 14:49
Maybe
if(key_cuu)
{
my.carEngineTorque = my.car_maxToque;
fps_max = 50; // limit the frame rate to 50 fps
media_loop ("engine.wav", null, 100);
}
Else
{
media_loop ("engine.wav", null, 0);
}
Posted By: HackerL
Re: [Newton]sound! - 11/14/05 16:30
Nop!!
but my game is starting! And then MY game shuts down!! WHAT can i do?
Posted By: Carloos
Re: [Newton]sound! - 11/14/05 18:41
remove the last code you entered in SED then save and try to run your game again
Posted By: Carloos
Re: [Newton]sound! - 11/14/05 18:41
Or better, put the error message here, so we can help you better.
Posted By: HackerL
Re: [Newton]sound! - 11/14/05 19:24
there arent any error messages ! Games starts and then SHUTDOWNS!
Posted By: Carloos
Re: [Newton]sound! - 11/16/05 10:40
Do you see any 3d window ? the game starts, you see your level and then shutdown ?
Posted By: HackerL
Re: [Newton]sound! - 11/16/05 14:03
Yes i see 3d about a second! And then my game shuts down!
Posted By: Carloos
Re: [Newton]sound! - 11/16/05 15:08
Did you get the last code out of your wdl project file ?
Posted By: HackerL
Re: [Newton]sound! - 11/18/05 21:53
what last code! engine sound? then yes
Posted By: Gafgar
Re: [Newton]sound! - 11/19/05 00:09
How does your main function look like?... show us...
maybe there is something in there shutting down the game.. It sounds like it...
Posted By: HackerL
Re: [Newton]sound! - 11/19/05 14:45
Here is my main function!
Quote:
function main()
{
mat_model.albedo=15;
wait(3);
level_load(s_level);
wait(1);
dll_handle=newtonHandle;
NewtonAddMap(s_level,0);
screen_pan.visible = on; // FRONT END
D_timer(); // Crono
}
Posted By: Gafgar
Re: [Newton]sound! - 11/19/05 16:16
ok.. i cant see anything strange with it... the only reason that i can see that is should behave like you say is that it happens something after that "wait(1)"
try to just comet them away one at a time and see witch is doing anything (if any one is doing anything that might shut down the whole thing)