• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Unit System

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
I don't know if this is in the right section but owell..

My question is how would i make towers attack the unit that is the closest to Spot B that they can attack? Heres an example. The black line is the path the monsters will have to follow.

P.S monsters spawn at "Spot A" and need to reach "Spot B"
 

Attachments

  • Screen Shot Example.tga
    1.4 MB · Views: 82
Level 4
Joined
Mar 12, 2009
Messages
80
okay, the trigger isnt finished, but ill do it when i come home from school.
(BUT) its a beginning. Maybe youll figure it out yourself while..
111111.jpg

ScreenShotExample.jpg
 
Level 9
Joined
Aug 1, 2008
Messages
453
I made a system even though it's not the best way to do it, it is a way. If anyone knows a way of making it more efficient let me know =D

  • Unit attack
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Reds area <gen>) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Picked unit)) Not equal to Player 12 (Brown)
              • (Unit-type of (Picked unit)) Not equal to Builder (Normal)
            • Then - Actions
              • Unit - Order (Picked unit) to Attack Red_System_Attack[1]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[2]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[3]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[4]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[5]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[6]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[7]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[8]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[9]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[10]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[11]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[12]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[13]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[14]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[15]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[16]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[17]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[18]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[19]
              • Unit - Order (Picked unit) to Attack Red_System_Attack[20]
            • Else - Actions
I have a trigger that sets up the units, and at the end of the level it basicly resets.
 
Level 3
Joined
Mar 26, 2007
Messages
51
Hmm, couldn't you make like a trigger that increases the units' custom value for like every second and order towers to attack the unit with the highest custom value within range? That way the units that entered the maze first will have the highest custom value and will therefore be the first in the line (closest to B). I can't really come up with a trigger but it could be possibility.
 
Level 9
Joined
Aug 1, 2008
Messages
453
Could you make an example trigger?

EDIT: nvm.. never finished reading it.. Also it has to be able to work for multiple towers.

EDIT2: Anyone know a more efficient way.. Because this trigger isn't the best... If you guys are wondering why i want to do this is because, basically i want it so if 2 players build the same thing i want them to leak the same units with the same hp, making the game overall more balanced. If you can make this trigger a better way I will +rep. Please and thank you.
 
Status
Not open for further replies.
Top