• 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] Making a unit wander aimlessly... like critters

Status
Not open for further replies.
Level 3
Joined
Dec 24, 2007
Messages
29
How do I make a unit wander aimlessly like a critter after it is created? I've looked around for a proper trigger for it but I haven't found anything yet.
 
  • Like
Reactions: TKF
Level 3
Joined
Dec 24, 2007
Messages
29
Thank you... doesn't quite work for my purposes though since it makes them a little less aggressive.
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,267
btw I never used the wander ability before. What is it's special classifications? Does it make the unit invulnerable/untargetable? Or does it only walk around?

IF it does only make it wander around, thus not so very aggressive rate, I think you can put this on ordinary creeps or hostiles to make it walk a little, and they attack if they walk onto something...

____

btw I didn't know what the wander ability was for anyway. ty!
 
Level 3
Joined
Dec 24, 2007
Messages
29
I'm curious if there is a way to make them wander aimless and instantly attack any hostiles they encounter. When I tested with a group of 12 of the units I set to wander, I put them in the middle of a pack of peasants and they attacked VERY rarely.
 
Level 4
Joined
Aug 9, 2007
Messages
106
Elaboration

You could just order your units to Attack-Move to a random place in the map.

Yeah and put it on a timer of say i dunno somewhere between 1 and 5 seconds of game time....

sorta like this... (with all the units you wanna move part of a unit group..)

  • sample
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Order (Picked unit) to Attack-Move To (Random point in (Playable map area)))
or if you dont want them to move as a group then set it up for individual units...
hope that helps
 
Level 4
Joined
Apr 8, 2005
Messages
70
Only problem with KalamMekhar's trigger is that the units will move around quite erracticly and will never make a small pause just standing there.

If your going to have respawning creep you can give it the wander ability, then have a trigger.

Code:
  Event
When Unit is Attacked
  Condition
Unit Belongs to player Neutral Hostile
  Action
Remove Ability - Wander
 
Level 4
Joined
Dec 4, 2007
Messages
76
One of the best would be to periodically check if the unit has been given an order. One way to do this would be to do a check every 15 seconds of whether or not the unit has been given the patrol order (patrol will attack anything in acquisition range) and if they do have it, do nothing, else, make them patrol to a random spot. Heres a basic example:

Code:
RandomPatrol
    Events
        Time - Every 15.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Neutral Hostile) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Current order of (Picked unit)) Equal to (Order(patrol))
                    Then - Actions
                        Do nothing
                    Else - Actions
                        Unit - Order (Picked unit) to Patrol To (Random point in (Playable map area))

Now of course you could get more specific and specify regions to move to and regions in which you pick ur units (eg: Pick every unit owned by Neutral Hostile in Region <Your region>). Good luck to you =)
 
Status
Not open for further replies.
Top