kinismo 0 Posted July 1, 2007 How can i get d-30 cannons to fire in air ? They are not supposed to hit anything but it would look nice if they fired like real artillery. Share this post Link to post Share on other sites
UNN 0 Posted July 1, 2007 This script will give you a basic idea: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_Gun=_This Select 0; _Gun DoWatch (_Gun ModelToWorld [0,50,50]); WaitUntil     {     Sleep 10;     _Gun Fire ((Weapons _Gun) Select 0);     !((Alive _Gun) Or (SomeAmmo _Gun))     }; Adjust the sleep command according to the reload rate and the rate of fire you want. Share this post Link to post Share on other sites
kinismo 0 Posted July 1, 2007 Thanks a lot but i wonder why it says "generic error in expression" when executing waituntil command? Share this post Link to post Share on other sites
UNN 0 Posted July 1, 2007 Quote[/b] ]but i wonder why it says "generic error in expression" when executing waituntil command? How are you calling the script? Share this post Link to post Share on other sites
kinismo 0 Posted July 1, 2007 I wrote it in sqs and activating it in cannons init field. Share this post Link to post Share on other sites
firecontrol 0 Posted July 1, 2007 waitUntil is used in SQF files. @ is used in SQS files. The snippet he gave you is written in an SQF format. Here's how I did it, this will actually create explosions at the marker "tgt" in a 50 square meter zone as well... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_arty = _this select 0 _posX = getMarkerPos "tgt" select 0 _posY = getMarkerPos "tgt" select 1 _arty doWatch [_posx, _posy, 6000] Â Â Â Â Â Â Â Â Â ~((random 2.5) + 3) _arty fire "D30" Â Â Â Â Â Â ~8 _posX = _posX + ((random 100) - 50) _posY = _posy + ((random 100) - 50) "SH_125_HE" createVehicle [_posx, _posy, 0] IMPACT = true; if (local server) then {publicVariable "IMPACT"} exit I call it from 3 different D30's.. that's why the random wait is in there. So they don't all fire at exactly the same time. i.e. [arty1] exec "fire.sqs"; [arty2] exec "fire.sqs"; etc. Share this post Link to post Share on other sites
warpuppy 0 Posted September 8, 2007 Quote[/b] ]waitUntil is used in SQF files.@ is used in SQS files. The snippet he gave you is written in an SQF format. Here's how I did it, this will actually create explosions at the marker "tgt" in a 50 square meter zone as well... Code Sample _arty = _this select 0 _posX = getMarkerPos "tgt" select 0 _posY = getMarkerPos "tgt" select 1 _arty doWatch [_posx, _posy, 6000] ~((random 2.5) + 3) _arty fire "D30" ~8 _posX = _posX + ((random 100) - 50) _posY = _posy + ((random 100) - 50) "SH_125_HE" createVehicle [_posx, _posy, 0] IMPACT = true; if (local server) then {publicVariable "IMPACT"} exit I call it from 3 different D30's.. that's why the random wait is in there. So they don't all fire at exactly the same time. i.e. [arty1] exec "fire.sqs"; [arty2] exec "fire.sqs"; etc. @ Fire control How would i add a loop to this so that i can get conitous fire Just that i want to use this to film a cutscene and i have 6 d30's Any help would be much appreciated thanks Share this post Link to post Share on other sites