Home   Help Search Login Register  

Author Topic: Fire Once At Car  (Read 1762 times)

0 Members and 1 Guest are viewing this topic.

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Fire Once At Car
« on: 10 Mar 2007, 22:16:58 »
I have a problem with my mission. I have a civilian going past in his truck, he slows down next to two BLUFOR soldiers (one of which  is me), shouts something then drives off quite fast. I want the solider that isn't me to target the car, let off one shot and then stand around as normal (I'll add what happens next later). I've tried a whole combination of COMREF commands, fire, dofire, dotarget, dowatch... but I can't get it to work. If I use the fire command the soldier, even if he is aimed at the car, aims in the air, fires his bullet then aims at the car again. Very annoying. If I use dofire, he lets off his whole magazine at the car which is not what I want. Even if the car's an enemy he aims in the air to fire his shot.

Solvable?

Thanks in advance.
Can you HELP?

Offline Blanco

  • Former Staff
  • ****
Re: Fire Once At Car
« Reply #1 on: 10 Mar 2007, 23:06:30 »
Quote
If I use dofire, he lets off his whole magazine at the car which is not what I want

Use dofire and a "fired" eventhandler, count the shots & remove his magazines. Actually you don't have to count the shots, just put the code in your eventhandler right away.

Quote
this addEventHandler ["fired",{this removeallmagazines "name of magazine"}]

Not sure about the syntax tho  :confused:

...or try to cancel the fire order.

Quote
unitname dofire objnull

som' like that.
« Last Edit: 10 Mar 2007, 23:32:56 by Blanco »
Search or search or search before you ask.

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Re: Fire Once At Car
« Reply #2 on: 11 Mar 2007, 17:09:54 »
Thanks a lot, I'll try it out :)
Can you HELP?

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Re: Fire Once At Car
« Reply #3 on: 11 Mar 2007, 18:02:32 »
OK it doesn't work. I tried RemoveAllWeapons as well but neither work. I also tried _this instead of this and a few other things but nothing works. It came up with this error:



Any ideas? Is it just the syntax that's wrong?

I already tried the dofore objnull and that didn't work :/

EDIT: Silly me I put this instead of man1. Works now, thanks a lot :)
Can you HELP?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Fire Once At Car
« Reply #4 on: 11 Mar 2007, 18:10:43 »
Hmmm.........  this should work as well.........

I just tried:

removeallweapons this; this addmagazine "stinger"; this addweapon "stinger"

Everything worked ok.


Planck
I know a little about a lot, and a lot about a little.

Offline SaBrE

  • Members
  • *
  • I was once a Llama
    • www.Armed-Assault-Zone.com
Re: Fire Once At Car
« Reply #5 on: 11 Mar 2007, 18:40:33 »
Well it all works except one thing: the soldier won't target nothing after he fires the shot. I tried man1 dotarget objnull and man1 dofire objnull but he won't stop aiming at the car. I can get him to aim at me instead of the car after he fires the shot but he won't aim at nothing again.

Must be solvable; any ideas?

Thanks.

EDIT: Solved. Wrote man1 dotarget hgfhgfh instead (a name that wasn't used).

However, although I doubt it is solvable, there is a problem that I can live with but will detract from the mission a lot. It's that man1 when starting to target the car, aims away from it and slowly, slowly brings his weapon to bear, sometimes turning the wrong way about 30o or so. It just looks really odd. I guess it's one of those OFP/ArmA AI niggles  :(
« Last Edit: 11 Mar 2007, 20:59:14 by SaBrE »
Can you HELP?