Home   Help Search Login Register  

Author Topic: Special Mi-24 attack  (Read 571 times)

0 Members and 1 Guest are viewing this topic.

AlejandroDaJ

  • Guest
Special Mi-24 attack
« on: 02 Apr 2004, 08:02:22 »
Hi, I've just started framing a script for having Mi-24s specifically make attack runs against players on foot, not in vehicles. My goal is to have the 24s use its machinegun when players are in view and (if possible) fire rockets when the player isn't in view.

I haven't even tried working with the rockets yet, but I've been trying to make Mi-24s attack the player, with little success. I've been experimenting with in-game scripts to see what works, and I'll add successful code to external scripts once I get it working. But I haven't gotten it working yet.

So far, I have triggers have the Hinds every 5 seconds DoMove, DoTarget, and DoFire any western soldier that sits in a trigger area. I also manually set the chopper's behavior to "combat", its speed to "full", and its combat mode to "Engage, fire at will".

However, despite the fact that the chopper will keep making passes toward my player, it behaves sluggishly, only opens fire at the last second, and always misses the player, firing behind him. This occurs even when the Mi-24 skill is set very high.

Does anyone have any clue what is going wrong here? I'd like to solve this problem before building a more advanced script.

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:Special Mi-24 attack
« Reply #1 on: 02 Apr 2004, 13:44:58 »
Hmm, you could DoWatch the position but that would probably cause the Hind to hold station and not 'make passes'.

I think the problem with your script is too many orders too often - order, counter-order, disorder as they say. Its that old minimum engagement time again - 20s for infantry, might be longer for choppers.  More specifically, DoMoving the Hind to the targets position will end up with the target being in a blind spot - the cannon probably won't depress far enough and you can't drop rockets.

How about using a West Present repeating trigger to define the target area, perhaps with a timeout to give targets a chance to get into the middle.  In the meantime, the Hind can cycle round its waypoints or whatever.

OnActivation the trigger could:

{myhind Reveal _x} ForEach thisList

myhind can be either a unit or a group.  Given your current problem, I'm hesitant to recommend DoTargetting or DoFiring on multiple targets as I think the AI will only act on the first one.  In theory, if you just give it a list of targets the AI will rank then rake the targets in threat order.  It should also mean that if it sees a Vulcan trundles up outside the trigger, the Hind will still have a chance to defend itself.

As for rockets against infantry, you're probably going to be at the mercy of the AI again.  There is a script command for selecting weapons, but whether it works with vehicles, I don't know off-hand.

I find that scripting isn't so much telling units what to do, it's more a battle to stop the AI doing what it wants to do.

Dubieman

  • Guest
Re:Special Mi-24 attack
« Reply #2 on: 03 Apr 2004, 16:03:34 »
Not sure if this does anything but maybe try different speeds for the Hind cause you try being the gunner while your pilot goes quickly around and through the target area while targeting small infantry. Maybe at norm speed the gunner will have that extra second to lock on and start firing accurately. Or if you can set speed like in a number value that is a little higher than normal, that would work.  :-\

But I like the idea of a helicopter raining rockets and cannon fire down while you run from bush to bush, far too often they fly absent minded around while they could help their infantry boys. :P