OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: Palamedes on 08 Sep 2003, 06:05:53
-
As some of you know, I am working on some serious SAM sites..
One thing that a lot of antiaircraft missiles have in them is a proximity fuse..
Given that we have a target locked, how can I force the missile to explode at a given range from that target?
Basically the missile needs to track its distance from the target, and once that distance stops decreasing, it needs to explode.
Thoughts?
-
Well, for the distance thing, its easy. :)
Use a loop to constantly compute distance using the following command until its below a certain value...
From the Editors Depot - Commands listing (http://www.ofpec.com/editors/comref.php):
obj1 distance obj2
Operand types:
obj1: Object
obj2: Object
Type of returned value:
Number
Description:
Compute distance between two objects.
With regards to the detonation, someone should answer that one soon (I'm a little too rusty)
-
With regards to the detonation, someone should answer that one soon (I'm a little too rusty)
One way is to createVehicle an invisible object with a large fire geometry infront of the missile, or at least thats how we made our proximity fused AMRAAMs detonate :thumbsup:
-
Go to the DKM MOD forums (betatesting/Havoc bug report I think); I posted some code there to make a nice proximity fuse. Its pretty simple; all you need is a scripted "Fired" eventhandler. I tested it; it works with arbitrary targets and it *does* increase the effectiveness of the missile.
BUT... maybe there's a far better way, as Hudson suggests. Maybe some tweaking of the firing/collision geometry in O2 could do the trick as well ; I dunno.