• 🏆 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!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

unit changes targeting after being ensnared or entangled but not after thunderbolt?

Status
Not open for further replies.
Level 7
Joined
Sep 9, 2007
Messages
253
Hey so I'm making a tag map and I don't want to the computer taggers to destroy buildings unless theyre blocked, that is all working relatively well except.....

3 different runners each have a different ability. Ensnare/Entangle/Storm Bolt. If a tagger is Ensnared or Entangled then it will attack a nearby tower once the disable has worn off. However if Storm Bolt is used the tagger will go back to the runner.

I even have a trigger which adds the tagger to a unit group (of CCd taggers) and use the following trigger.

  • Kodo CC wears off
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Kodo_Group_CCd and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Entangling Roots) Equal to False
              • ((Picked unit) has buff Ensnare (Ground)) Equal to False
              • ((Picked unit) has buff Stunned (Pause)) Equal to False
            • Then - Actions
              • Unit - Order (Picked unit) to Attack (Load 3 of (Key (Picked player)) in KodoHashtable)
              • Unit Group - Remove (Picked unit) from Kodo_Group_CCd
              • Floating Text - Create floating text that reads (Name of (Owner of (Load 3 of (Key (Picked unit)) in KodoHashtable))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (80.00%, 20.00%, 20.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 0.10 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 24.00 towards 90.00 degrees
            • Else - Actions
              • Floating Text - Create floating text that reads CC'd above (Picked unit) with Z offset 0.00, using font size 10.00, color (20.00%, 80.00%, 20.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 0.10 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 24.00 towards 90.00 degrees
This trigger should detect when the snare/entangle wears off and then remove the unit from the CC'd unit group and force it to attack a runner (from a hashtable which I use as targetting AI). Even though the tagger is ordered to attack a runner it will still attack a tower if there is one nearby. I'm thinking this has something to do with the tagger being attacked by the tower as it won't target other buildings but this is only a problem after the abilities I mentioned.
 
Level 7
Joined
Sep 9, 2007
Messages
253
The buff is definitely correct. it's just strange that storm bolt lets them pursue the same target but the other 2 abilities cause them to switch to towers.... I don't want the taggers to switch to towers unless they cannot path to their target runner.
 
Status
Not open for further replies.
Top