Home   Help Search Login Register  

Author Topic: SAM - Is there an advanced script around?  (Read 1419 times)

0 Members and 1 Guest are viewing this topic.

Offline wired

  • Members
  • *
  • Explosion Scripter for the [unsung] mod!!!
SAM - Is there an advanced script around?
« on: 19 Feb 2004, 12:51:54 »
Ok, heres what i want:
* I would like an SAM script so, when activated by a trigger, a rocket flies at me, im my plane but if i dodge it i want it to come right back at me again and again until it explodes.
* I have seen SEFE's guided missile script, and its very good, but the missiles dont turn round and attack again like they do in real life. Also, how about making it so when i drop some flares, they MIGHT go for them, but might still go for me. If u dont understand, watch 'Behind Enemy Lines.'

If there is already a script, then please tell me or even better, give me a link to it. Ta  :D



wired
We have a problem at 'Oscar-Charlie 2-7' do you read me? Well its that guy with the RPG!

sa8gecko

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #1 on: 19 Feb 2004, 13:21:15 »
The missile launched and guided with SEFE's script won't come back at
you because it looses lock if its target is no more in its seeking cone.
Remove this check in the above script and the missile will fly back to you.
For engaging the flares the missile "needs" to know they are there:
if all the flares were the same (or very few types, anyway) with a
nearestobject command you could check if one is in front of
"your" missile and deviate it on the flare accordingly.
I know you would have preferred the easy way, I mean the script
ready to use. If you can't do the above keep posting and maybe me
or someone better (that is, the majority of people around here) will
give you what you are looking for.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:SAM - Is there an advanced script around?
« Reply #2 on: 19 Feb 2004, 21:49:46 »
Sound's like a neat idea!  And I could use the same idea in a mission I'm working on, so I will take a look at SEFE's script and see what I can do to modify it to have the missiles turn back on the target and also be potentially distracted by flares (this will problably be a combination between distance, nearness to missle "search cone" and a random function).  Maybe the same thing should also apply to the missle turning around, because I think in some cases a missle can be "juked" enough so that it cannot relock.  Either way I will make these adjustble parameters so that the mission maker can adjust as he sees fit.  It should take me a couple of nights, then I will submit it to the editor depot.  I'll keep you posted as to my progress.
« Last Edit: 19 Feb 2004, 21:50:25 by Raptorsaurus »

Leech

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #3 on: 20 Feb 2004, 02:18:49 »
missles dont turn around and come back at u man
movies arent always real life--sorry to let u kno

OrangeLeader

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #4 on: 20 Feb 2004, 05:57:34 »
Adavnced SAM do track a target pretty well. And they do turn.

sa8gecko

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #5 on: 20 Feb 2004, 06:52:06 »
Keep in mind that missiles and shells have a limited life in OFP ( I think
about 10 seconds), so the missile would probably have the time to turn
to you only one or two times. Using SEFE's script you could anyway
substitute the missile which is approaching its end with
another one (getpos and velocity, then setpos and setvelocity, the
target you already know...): you just need to modify it a little.

Leech

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #6 on: 22 Feb 2004, 04:26:30 »
they have too high of a turn radius to turn completely around and come back at u after a miss
i think a script like this would be neat and id love to see it....u just sed "like in real life" (doesnt happen in real life)

Harkonin

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #7 on: 27 Feb 2004, 21:25:38 »
Anyone have a link to SEFE's script so I can try and modify it?

Harkonin

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #8 on: 27 Feb 2004, 21:47:40 »
nm found it

sa8gecko

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #9 on: 28 Feb 2004, 07:49:10 »
Harkonin:
I could mail it to you, with something more interesting, if you wish.
Message me if you are interested.

FragMASTER

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #10 on: 07 Mar 2004, 07:48:40 »
Back in the vietnam era, the missles used by the vietcong (dont know about americans) relied mostly on a direct hit. When it didnt hit its target, it would attempt to turn back around but it ran out of fuel before it could. These days, even if a missle doesnt get a direct hit, it will still explode trying to kill its target with the shockwave.

I kinda laughed when I saw the missle chase in Behind Enemy Lines.

DBR_ONIX

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #11 on: 07 Apr 2004, 19:58:47 »
Anyone got anywhere with this yet?

Sounds cool.. Esp if flares put it off the target :)
- Ben

Grendel

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #12 on: 08 Apr 2004, 00:03:36 »
Probably already done by sa8gecko, but JIC,

Here's an idea on flares:

You could put some lines in the SAM script that loop a call for a nearestObject search on the target aircraft itself, not the SAM.  The flares could be camcreated/setvelocity objects (something small like a smoke shell) with the requisite drop effects to create the right appearance.  

Since normally there would be no reason for a smokeshell flying around at the aircraft's height, you could make this the target of the nearestObject search.  If the plane launhed a flare, it would be detected with the  search and trigger the script to make the flare the new target.

There are a bunch of ways to make the spoofing less than 100%..."pulse" the nearestObject search with pauses, so it might catch the flare, or might not.  Or you could just add a simple probability script:

Code: [Select]
;_chance is the precentage that the event will happen
;so if there was a 75% chance bob's your uncle...
_chance=75
_rollthedice=random(100)
?(_rollthedice>_chance):goto "skipEvent"
player sidechat "bob's my uncle!"
exit
#skipEvent
player sidechat "bob's not my uncle."
exit
-Grendel
« Last Edit: 08 Apr 2004, 00:11:58 by Grendel »

sa8gecko

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #13 on: 08 Apr 2004, 11:20:39 »
Grendel:
No, I haven't done this yet. The problem are that you'll never be able to
keep up with the number of flare types being created.
A solution, that I didn't test yet, but I considered for an advanced
arena script, is to find the flare thanks to its low velocity
(to evitate to target choppers hovering is easy too).
So if you find an object near the target, which velocity is far less
than target's, you could be pretty sure it's a flare : or a parachute !
that anyway is a chopper's subclass.

BTW: my lead collision guidance script does (can do) just what wired
asked for

DBR_ONIX

  • Guest
Re:SAM - Is there an advanced script around?
« Reply #14 on: 12 Apr 2004, 12:48:11 »
How hard would it be to modify the script so that :
1. The missile is visable
2. It has a smoke trail
3. It is slower, for using on a heli, but still be able to dodge it

I want to do a helo mission where you are fling a squad into a town, by fast rope (BAS MAH60/Delta/Rangers).
And RPG's to be flying every where.
- Ben