• 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.

[Trigger] Why isn't this trigger working? [GUI]

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
Right now im am trying to make a unit tower that will go to, and attack all units within 300 of the base tower. Heres my setup triggger
  • Soldier Tower set up
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to |cffBB9910Lv. 1 Soldier (Base)
    • Actions
      • Wait 0.10 seconds
      • Unit - Create 1 Lv. 1 Soldier (NEW) for (Owner of (Constructed structure)) at (Position of (Constructed structure)) facing Default building facing degrees
      • Set Customvalue[1] = (Customvalue[1] + 2)
      • Set Customvalue[2] = (Point-value of (Unit-type of (Last created unit)))
      • Unit - Set the custom value of (Last created unit) to (Customvalue[1] - 1)
      • Unit - Set the custom value of (Constructed structure) to (Customvalue[1] + 0)
      • Wait 0.10 seconds
      • Unit - Move (Last created unit) instantly to (Center of (Region centered at (Position of (Constructed structure)) with size (1.00, 1.00)))
Here is my trigger that's the attacking trigger
  • Soldier Tower Attacking
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Lv. 1 Soldier (NEW)
    • Actions
      • Set Temp_Interger = ((Custom value of (Attacking unit)) + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Region centered at Positionoftower[Temp_Interger] with size (150.00, 150.00)) contains (Position of (Attacked unit))) Equal to True
        • Then - Actions
          • Set Positionoftower[Temp_Interger] = (Position of (Attacking unit))
          • Set Positionofenemy[(Custom value of (Attacking unit))] = (Position of (Attacked unit))
          • Unit - Move (Attacking unit) instantly to Positionofenemy[(Custom value of (Attacking unit))]
        • Else - Actions
          • Unit - Order (Triggering unit) to Move To Positionoftower[((Custom value of (Triggering unit)) + 1)]
And my question is why is it letting the unit chase down units that are a mile away? Will +rep if helped!
 
Status
Not open for further replies.
Top