• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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