How to make all enemies on the map attack the closest player

sirjasalot

New Member
Reaction score
3
Hi all. The map i'm making is a survival map where you must survive zombies for 2 hours. Will i need a trigger so that all the zombies attack the player that is clsoest to them? If yes what must it be?
 

Drakethos

Preordered Sc2 ftw!
Reaction score
56
Just tell them to attack walk to the center of the map. Or do you want more particular movements
 

sirjasalot

New Member
Reaction score
3
as long as they attack the closest player to them i'm happy. would i need to tell anything particular in that case?
 

Sim

Forum Administrator
Staff member
Reaction score
534
http://www.thehelper.net/forums/showthread.php?t=95538

Call this function.

For the condition part, create a condition in a separate trigger and convert it to JASS. Put it in your map header (Click on the map's name in the Trigger Editor). Then, under "boolexpr" in the function call replace it with

Condition(function Name_of_your_converted_condition_in_JASS_underlines_are_spaces)

EDIT: Well, I'll call it just to show you:

First of all you need to pick every unit of type "Zombie" with GUI, and, inside the loop, call the function like this:

JASS:
call GetUnitSomewhere(GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), 99999., false, true, false, Condition(function Name_of_your_converted_condition_in_JASS_underlines_are_spaces))


P.S. Your condition should be checking if the matching unit belongs to a player.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top