Constant wander

eightbraker

New Member
Reaction score
1
is there any way to make a certain type of unit only, randomly wander around the map, sorta like the wander ability but they don't stop moving, it would also be good if you had no control over them, like in castle fight.
 

Ashlebede

New Member
Reaction score
43
Ward classification = no control over the unit. The only order you'll have to cancel is the order "smart" (maybe "right-click" in GUI). You can make the unit wander using periodic events or timers

Trigger:
  • //Hand-Written ; function names and such may not be the same
    • Events
      • Time - Every 0.50 seconds of game-time
    • Conditions
    • Actions
      • -------- Requires 2 point-type variables named loc & loc2 --------
      • Trigger - Turn off {Other trigger}
      • Custom Script : set bj_wantDestroyGroup = true
      • Unit Group - For each unit in (Units matching (Unit-type of (Matching unit))Equal to {Unit-type})
        • Loop - Actions
          • Set loc = Position of (Picked unit)
          • Set loc2 = loc offset by 500.00 towards (Random real from 0.00 to 360.00)
          • Custom Script : call RemoveLocation(udg_loc)
          • Unit - Order (Picked unit) to "move" to loc2
          • Custom Script : call RemoveLocation(udg_loc2)
        • Trigger - Turn on {Other trigger}


Trigger:
  • //Hand-written
    • Events
      • A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is a Ward) Equal to True
    • Actions
      • Unit - Order (Triggering unit) to "stop"


Something along these lines.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
@Ashlebede: but with the second trigger the unit will stop whenever it is ordered something. the author wanted the wander part to keep without a break.

however, what you could use is just the tornado wander ability. its doing basically what you want. of course, you still need the triggers of Ashlebede to make the unit uncontrollable for the owner. alternately you might want to add the locust ability to make the unit unselectable as well but this depends on what you need this unit for.

when using the wander ability be sure to set the area of effect and cast range values to proper numbers. because as far as i know if the unit leaves the area of effect range it will die, like the tornado.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top