eble 3 Posted December 20, 2008 I've been trying to add a sound to the sonic boom FX script, without success at the moment. I was hoping someone could point me in the right direction. I'm using the following script, I've put in private "_plane" and the call would look like _plane say "RKT_F35_Boom" I just can't for the life of me get the script to call it without error. Any help would be appreciated. Cheers Southy <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> // --------------------- // Original FX scripts by Lethal // Modified by Gnat // --------------------- private ["_emitter","_nowspeed", "_lastspeed", "_plane"]; _emitter = "#particlesource" createVehicle position _this; _emitter setParticleRandom [0.05,[2,2,2],[5,5,5],0,0.5,[0.1,0.1,0.1,0.5],0,0]; _emitter setDropInterval 0; while {(alive _this) and (_this animationPhase "KillFx" == 0)} do { _nowspeed = speed _this; if ((_nowspeed > 850) and (_nowspeed < 860) and (_lastspeed < _nowspeed)) then { _plane say "RKT_Flog_Boom" _emitter setDropInterval 0.0005; for "_i" from 1 to 100 do { _emitter setParticleRandom [0.4,[10*(_i/100),10*(_i/100),10*(_i/100)],[10*(_i/100),10*(_i/100),10*(_i/100)],0,0.3,[0.1,0.15,0.3,0.5],0,0]; _emitter setParticleParams ["\Ca\data\cl_basic","","Billboard",1,0.1,[0,(-12*(_i/100)+8),-0.5],(velocity _this),1,1.2745,1,0.001,[20*(_i/100)],[[1,1,1,0],[1,1,1,0.1*(_i/100)],[1,1,1,0]],[0],0,0,"","",_this]; sleep 0.005; }; _emitter setDropInterval 0; sleep ((random 5)+ 5); } else {_emitter setDropInterval 0}; _emitter setParticleParams ["\Ca\data\ParticleEffects\ROCKETSMOKE\RocketSmoke","","Billboard",1,0.05,[0,-0.5,1.0],(velocity _this),1,1.2745,1,0.001,[10,20],[[1,1,1,0],[1,1,1,0.1],[1,1,1,0]],[0],0,0,"","",_this]; _emitter setpos (getpos _this); _lastspeed = speed _this; sleep 0.356759; }; deleteVehicle _emitter; Share this post Link to post Share on other sites
Q1184 0 Posted December 20, 2008 1. You forgot the semicolon: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_plane say "RKT_Flog_Boom"; 2. Is RKT_F35_Boom defined properly in CfgSounds? 3. From what I can tell, you can safely use _this with the 'say' command, as it points to the plane in question. Plus I don't see where the variable _plane is defined. So try this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_this say "RKT_Flog_Boom"; Share this post Link to post Share on other sites
eble 3 Posted December 20, 2008 1. You forgot the semicolon: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_plane say "RKT_Flog_Boom"; 2. Is RKT_F35_Boom defined properly in CfgSounds? 3. From what I can tell, you can safely use _this with the 'say' command, as it points to the plane in question. Plus I don't see where the variable _plane is defined. So try this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_this say "RKT_Flog_Boom"; thanks mate worked like a charm Southy Share this post Link to post Share on other sites