Jump to content
Sign in to follow this  
six6six

Ac130 circling

Recommended Posts

Is there any way I could get the AC130 addon to do a left hand circle around a target firing? I would do it myself, but I have no idea where to start.

Share this post


Link to post
Share on other sites

Guiding airplanes in OFP has always been a pain in the butt. To get a plane circling AND to a specific direction AND around a specific unit (AND firing at the same time too maybe?).. that sounds a bit too much.

In any case, I don't think it can be done within the editor, you may very well have to resort to external scripting, as in a sqs file.

It's been a long time since I've last written a line of code for OFP, but here goes nothing.

You need to place your plane and name it in the editor. Then place the target unit and name that one too. Next create this script file:

planesupress.sqs

----------------

_plane = _this select 0

_target = _this select 1

#loop

_plane domove [(getpos _target select 0)-400, (getpos _target select 1)]

@ unitready _plane || !alive _plane

?!alive _plane: exit

_plane domove [(getpos _target select 0), (getpos _target select 1)-400]

@ unitready _plane || !alive _plane

?!alive _plane: exit

_plane domove [(getpos _target select 0)+400, (getpos _target select 1)]

@ unitready _plane || !alive _plane

?!alive _plane: exit

_plane domove [(getpos _target select 0), (getpos _target select 1)+400]

@ unitready _plane || !alive _plane

?!alive _plane: exit

goto "loop"

You can try it out by executing it from a triggers init line or some place like that. The exec line should state something like this:

[planename, targetname] exec "planesupress.sqs"

The above will probably need some tweaking (or a lot) and there are more scientific was of calculating the circle, but if the above does it then it'll do.

Good luck smile_o.gif

Share this post


Link to post
Share on other sites

General Barron wrote a script that did this but it is M.I.A. If anyone has it could they please let me know?

Share this post


Link to post
Share on other sites

Please do not dig up old threads, unless you have something significant to add.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×