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

[Spell] Stealth

Status
Not open for further replies.
Level 7
Joined
Sep 8, 2011
Messages
211
Hey guys I need some help with my ability Camouflage. I want to make the ability so if your in Camouflage and you go with in 200 range of an enemy unit (player 12 is the only enemy unit) that unit will look at you. If you go within 150 range the enemy unit will attack you.

I have tried to do this with triggers but the only thing that works with range is if you go in range of a SPECIFIC unit. I don't want to repeat that trigger for the hundreds of zombies on the map. Anyone got any ideas?
 
Level 7
Joined
Sep 8, 2011
Messages
211
Thanks PurgeandFire111 I'll try that idea out.

mckill I don't want it to be a specific target face the hero, I am trying to make it so any unit that is a zombie controlled by player 12 will aggro at 150 range. I did try what you suggested and it did work, there are just a lot of zombies :p.
 
Level 11
Joined
Nov 15, 2007
Messages
800
  • Camouflage
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set point = (Position of (camouflaged_unit))
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units within 200.00 of point matching ((Unit-type of (Matching unit)) Equal to Zombie)) and do (Actions)
        • Loop - Actions
          • Set point2 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between point and point2) Less than or equal to 150.00
            • Then - Actions
              • Unit - Order (Picked unit) to Attack camouflaged_unit
            • Else - Actions
              • Unit - Make (Picked unit) face point over 0.20 seconds
          • Custom script: call RemoveLocation(udg_point2)
      • Custom script: call RemoveLocation(udg_point)
The custom script is for removing leaks. If you're using multiple types of zombie, use an "Or" condition when matching the unit type for every additional type of zombie. camouflaged_unit has to be set beforehand, and this trigger won't be MUI. If you need it to be MUI you can add all camouflaged units to a group and check based on the group instead, removing them from the group when they're no longer camouflaged.
 
Hey guys I need some help with my ability Camouflage. I want to make the ability so if your in Camouflage and you go with in 200 range of an enemy unit (player 12 is the only enemy unit) that unit will look at you. If you go within 150 range the enemy unit will attack you.

I have tried to do this with triggers but the only thing that works with range is if you go in range of a SPECIFIC unit. I don't want to repeat that trigger for the hundreds of zombies on the map. Anyone got any ideas?

If you have only 1unit per player, why you don't make :
A unit enter within 150 range of Hero
Triggering Unit = Zombie
Issue order to Trig Unit to attack Hero.
 
Status
Not open for further replies.
Top