Jump to content
Sign in to follow this  
kocrachon

Spawn missile that locks on?

Recommended Posts

So I am trying to make script that when I toss a smock grenade, the nearest target gets a laser target attached. Which is working right now

The part that gets hard is after that I want a Hellfire to spawn mid air, lock onto the target, and hit the target.

Is this possible to do? If so how do I make the missile target and fly at the target after I spawn it?

Share this post


Link to post
Share on other sites

That may be a little difficult, target locking is AI side, if you can perhaps use a UAV or some such, that'd be fine. Otherwise you may have to get script the locking mechanism yourself.

Some complex math could be done to set the vector of the missile straight onto the target, ie only one calculation. I'm not entirely sure of how to do that however.

Share this post


Link to post
Share on other sites

Surely it'd be easier to place an apache a helluva ways off and get that to fire at it? Especially since I'm assuming that's the 'simulated effect' you're looking for

Share this post


Link to post
Share on other sites

Yes, in fact I use a trimmed down version of the script that Kylania posted to hit a helicopter, hits every time. ;)

Share this post


Link to post
Share on other sites
Yes, in fact I use a trimmed down version of the script that Kylania posted to hit a helicopter, hits every time. ;)

Same here. Works like a charm!

Share this post


Link to post
Share on other sites

I tried the script that kylania mentioned and it works for me, but it also has a bug in it that I can't seem to get figured out. Basically, I call the missile and use my laser to guide it in, but if I turn the laser off for a moment, the missile never arrives, which means that the missile went towards a secondary target "invisible H pad" that is used when the rocket is not guided. The bug I then run into is... the option to call another airstrike never reappears on my actions menu ever again during the mission. I tried to change the script and remove the secondary target so the missile would hopefully keep heading to the position that the laser was last targeting before the laser was turned off, but that didn't work either. Again... if I turn the laser off before the missile arrives, I permanently lose the option to call another airstrike. Is there a way to fix this? Is there a way to remove the secondary target and make it so the missile keeps heading to the last position the laser was targeting before it was turned off?

Share this post


Link to post
Share on other sites

You can try this (not tested).

Look for this....

//secondary target used for random trajectory when laser designator is turned off prematurily
[b]_secondaryTarget = "HeliHEmpty" createVehicle _defaultTargetPos;[/b]

...and change that second line to this.

_secondaryTarget = "HeliHEmpty" createVehicle getpos _primaryTarget;

This should create the secondary target at the primary target position. Hope it works!

Edited by twirly
Calrity

Share this post


Link to post
Share on other sites

That fixed it. I was hopping that the missile would go to the last position the laser was pointing at before the laser was turned off, but it didn't, but at least the option to use the radio to call in another airstrike became available again, where as before your fix - it did not. The fix you suggested should be updated in the script where ever it is being hosted for download. Thank you very much twirly.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×