Grinman 0 Posted August 1, 2007 Hi guys I need a way to keep something like an M119 firing in a certain area, so that it doesn't swing out into its gun emplacement / follow helicopters going overhead/turn right round so that basically its rotation would be limited a certain amount in each direction, like this \ / \ / < Field of fire \ / m119 Share this post Link to post Share on other sites
ColonelSandersLite 0 Posted August 1, 2007 Tried setting it behind a broken wall or something, thus reducing it's field of fire and providing cover? Share this post Link to post Share on other sites
Grinman 0 Posted August 1, 2007 Ah but herin lies the problem: The gun will swing through the hole in the wall, so that the barrel will just ghost through the wall Basically I want to limit the range of movement so it cannot just go 'through' solid objects Share this post Link to post Share on other sites
Big Dawg KS 6 Posted August 2, 2007 The only way to do that is to make an addon with a modified config. Share this post Link to post Share on other sites
Grinman 0 Posted August 3, 2007 Bugger. Ahwell, thanks anyway Share this post Link to post Share on other sites
nullsystems 0 Posted August 4, 2007 Hmm, thats not strictly true. I have something which will help you on your quest: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;watch script for searchlights 0.2 ;written by Blanco _unit = _this select 0 _dis = 200 #loop ?!alive _unit : exit _dir = random 360 _steps = random 350 + 10 _steps = _steps - _steps %1 ~2 _x = 0 _i = -1 _maxheight = 360 _minheight = 2 _inc = -0.2 _height = (5 + random 55) ~1 ?random 2 < 1 : _i = 1 ?random 2 < 1 : _inc = 0.2 #steps ?!alive gunner _unit : goto "unitdied" _dir = _dir + _i ?_dir < 0: _dir = _dir +360 ?_dir > 360: _dir = _dir -360 _upos = getpos _unit _cposx = _upos select 0 _cposy = _upos select 1 _cposz = _upos select 2 _height = (_height - _inc) ?(_height > _maxheight) : _inc = 0.2 ?(_height < _minheight) : _inc = -0.2 ?alive _unit : _unit doWatch [_cposx + ((sin _dir) * _dis), _cposy + ((cos _dir) * _dis),(_height - _inc)] ~0.2 _steps = _steps - 1 ?_steps > 0 : goto "steps" goto "loop" #unitdied _gl = "logic" createvehicle [0,0,0] _gl moveingunner _unit @!alive _unit deletevehicle _gl exit That is designed for searchlights, they spin slowly and randomly around a 360 axis. You could modify it, so that your static positions revolve around a few degrees only....thats what I did. Share this post Link to post Share on other sites
Grinman 0 Posted August 7, 2007 Ah, slight issues I can't get the script to run without errors Plus one small question, would it be possible to make a gun rotate, then, when a trigger is activated by opfor, it follows a set fire plan of rotating, firing, reloading, setting new angle, and rotating again so that it walks a barrage forward? Ofcourse the angle would need to be tweaked to suit wherever the gun is placed but would it be possible? Share this post Link to post Share on other sites