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

how can i make nonhuman controlled units walk around the map

Status
Not open for further replies.
Level 3
Joined
May 12, 2008
Messages
64
i am making a map were i need zombie like things to randomly wander around the map i tired the abilit wander but thay just get jammed i want something that makes them move around the whole map but i dont know how to make coustom abilites
 
It's called triggering.
  • Stuff
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Player 3 (Teal))) and do (Actions)
        • Loop - Actions
          • Set TempLocA = (Position of (Picked unit))
          • Set TempLocA = (TempLocA offset by (Random real number between 200.00 and 2000.00) towards (Random angle) degrees)
          • Unit - Order (Picked unit) to Attack-Move To TempLocB
          • Custom script: call RemoveLocation(udg_TempLocA)
          • Custom script: call RemoveLocation(udg_TempLocB)
 
Level 9
Joined
Oct 28, 2007
Messages
435
Remember you might have a simpler way with less typing and ignore all his custom text, but that will cause it to leak (in other words lag) more. You might not see the differance, but if you have a quite a large amount of triggers running in the background you will notice the differance.

About the varibles:
1. Create a point variable
2. Set it to the position of picked unit
3. Set the point to a offset
4. Then you have your order to move the picked unit
5. Then you remove your point. In warcraft whenever you use the position of something it store it on your pc. It then use up ram. To prevent this we remove it. As seen above you type: call RemoveLocation(udg_ + the name of your variable )
you need the udg_ when you refer to variables in custom script
6. O, I forgot. The set bj_wantDestroyGroup = true in the custom script in the first line. He does this so that warcraft automaticly remove the leak that would be caused by your unit group.
 
Status
Not open for further replies.
Top