Home   Help Search Login Register  

Author Topic: All ai on map attack 1 unit?  (Read 1225 times)

0 Members and 1 Guest are viewing this topic.

Offline punisher

  • Members
  • *
All ai on map attack 1 unit?
« on: 14 Feb 2007, 20:53:07 »
hi
im making a mission but theres too many people to add waypoints all on one man. Is there a way too make all units on east and res attack a single soldier?
thanks
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: All ai on map attack 1 unit?
« Reply #1 on: 14 Feb 2007, 21:40:57 »
Given them all a doMove to the location of the victim.
{_x doMove getPos victim} forEach array

where array is a list of all the attacking units.

You might need to repeat it at intervals of 30 seconds or so.

Offline punisher

  • Members
  • *
Re: All ai on map attack 1 unit?
« Reply #2 on: 21 Feb 2007, 16:52:24 »
hmm so where do i pit this in a trigger?
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: All ai on map attack 1 unit?
« Reply #3 on: 22 Feb 2007, 08:29:38 »
If you need to repeat it in certain intervals (like THobson suggests) a simple script should be used..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: All ai on map attack 1 unit?
« Reply #4 on: 22 Feb 2007, 09:41:06 »
mkay. what you need is a trigger covering the whole map, activated by whichever side you want to do the chasing. in the 'on activation' box of this trigger you should put

Code: [Select]
all_enemies = thislist
now, when you want them all to start attacking the unfortunate unit, you need to run a script to get them all moving. as thobson said, repeating the script every 30 seconds or so is vital. if you run it only once, they will move to where the unit first was. the unit could have moved on by then, so you need an update of his position.

the script would look something like this

Code: [Select]
;all enemies chase unit

#loop
? not (alive unit_name):exit
{_x domove getpos unit_name} foreach all_enemies
~30
?alive unit_name:goto "loop"

and just for good measure, i've put all this into a demomission so you can see it in action. good luck  :good:

Offline punisher

  • Members
  • *
Re: All ai on map attack 1 unit?
« Reply #5 on: 22 Feb 2007, 13:37:32 »
thanks for going out of your way and making a demonstration! That works great , i put the time to 10 seconds because its a road chase and i dont want them falling far behind
again thanks for yourtime :)
The Gimp clan- pushing the limits of OFP
http://www.youtube.com/user/Pigdogmeat