Home   Help Search Login Register  

Author Topic: Getting AI to fire using a trigger  (Read 474 times)

0 Members and 1 Guest are viewing this topic.

Tobruk

  • Guest
Getting AI to fire using a trigger
« on: 17 Mar 2003, 02:14:11 »
I know this is supposed to be easy but I can't for life of me get my Ai to fire when my squad passes a trigger.

I am using a Mortar addon and a Pak40 addon and would like these AI units to fire when my squad passes a certain point.

I have tried DoFire, unit fire, synced guard waypoints etc. Nothing seems to work.

Could it be because of addons? The will open fire but you have to be really close.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Getting AI to fire using a trigger
« Reply #1 on: 17 Mar 2003, 11:46:45 »
Usually it helps if you use doTarget first, then doFire.      You can't use a gamelogic as a target, but you can use an invisible H (I think) or bury something underground with setPos.
Plenty of reviewed ArmA missions for you to play

Tobruk

  • Guest
Re:Getting AI to fire using a trigger
« Reply #2 on: 18 Mar 2003, 05:20:06 »
Whoa, it sounds harder than I anticipated. What is this about invisible H?

So if I place an object and bury it and then set a way point as destroy, that would work?

Wouldn't the Ai just keep firing away a random, trying to destroy the buried target?

I really want to set up ambush points, I guess.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Getting AI to fire using a trigger
« Reply #3 on: 18 Mar 2003, 12:32:41 »
Ambushes are tricky, they have come up before so search the forum and be persistent, there is some stuff there.    

It may be a little laborious but the way to do it may be to use a bunch of doTarget and doFire commands, targeting each member of the target group in turn.

So when the target group reaches the kill zone a script activates which looks a bit like this

#one
mortar doTarget badloon1
mortar doFire badloon1
? getdammage badloon1<0.2 goto "one"

#two
mortar doTarget badloon2
mortar doFire badloon2
? getdammage badloon2<0.2 goto "two"

and so on.   That's just a sketch, its not a proper script.    You might be able to use forEach to make it neater.

To return to my original answer, it might be easier to place an invisible H in the centre of the kill zone.     An invisible H is just an object like a tent.   It's just like a helicopter landing H except its invisible ... you're supposed to use it to get choppers to land in the place you want, but it might help you out here.     Just get the mortar first to target, and then to fire at, the invisible H.   Since its in the middle of the kill zone the enemy will get killed.

Don't place a destroy waypoint on a fake target like the H or something buried.   It will as you say only end in farce.

Don't panic - none of this is complicated or difficult, its just a matter of finding the best solution for what you are trying to do.  :)  
Plenty of reviewed ArmA missions for you to play

Tobruk

  • Guest
Re:Getting AI to fire using a trigger
« Reply #4 on: 19 Mar 2003, 03:44:51 »
Thanks macguba for not making me feel like a complete noob. I thought for sure ambush points would be easy. I will fool around with your suggestions and see what happens.