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

Aggressive Wander?

Status
Not open for further replies.
Level 3
Joined
Oct 7, 2010
Messages
30
Is it possible to trigger or modify something to work just like the wander ability, but without stopping the unit with the ability from attacking?

Closest idea i've had is to remove the wander ability then somehow give it back, but the "Unit Within Range" trigger, which looks perfect for what I want to do, will only allow me to use it with units already placed inside the editor :/
 
Level 3
Joined
Oct 7, 2010
Messages
30
Well, excuse my horrid triggering lol but...
Got it working alright like this, not perfect but I guess it does what I want.

  • RandomWander
    • Events
      • Time - Every (Random real number between 1.00 and 6.00) seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Random (Random integer number between 0 and (Number of living Marine units owned by Player 2 (Blue))) units from (Units owned by Player 2 (Blue) of type Marine)) and do (Unit - Order (Picked unit) to Attack-Move To ((Position of (Picked unit)) offset by ((Random real number between -200.00 and 200.00), (Random real number between -200.00 and 200.00))))
 
Level 3
Joined
Oct 7, 2010
Messages
30
Ok well, this is working
  • RandomWander Copy
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Random (Random integer number between 0 and (Number of units in (Units owned by Player 2 (Blue) of type Marine))) units from (Units owned by Player 2 (Blue) of type Marine)) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To ((Position of (Picked unit)) offset by ((Random real number between -200.00 and 200.00), (Random real number between -200.00 and 200.00)))
I tried adding in a wait time like below to try and spread out their movements so however many selected units don't all try to move at the same time
  • RandomWander Copy
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Random (Random integer number between 0 and (Number of units in (Units owned by Player 2 (Blue) of type Marine))) units from (Units owned by Player 2 (Blue) of type Marine)) and do (Actions)
        • Loop - Actions
          • Wait (Random real number between 0.00 and 5.00) seconds
          • Unit - Order (Picked unit) to Attack-Move To ((Position of (Picked unit)) offset by ((Random real number between -200.00 and 200.00), (Random real number between -200.00 and 200.00)))
Adding in that wait breaks it though.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
^and also that
or you do this
  • Set Group = (Random (Random integer number between 0 and (Number of units in (Units owned by Player 2 (Blue) of type Marine))) units from (Units owned by Player 2 (Blue) of type Marine))
then destroy it
  • Custom script - call DestroyGroup(udg_Group)
oh and also this is still has a leaks (Units owned by Player 2 (Blue) of type Marine) will always leaks, try to avoid this
check this out, to know which one is leaks and which one is not
 
Last edited:
Level 18
Joined
Sep 14, 2012
Messages
3,413
RHoooooooooooooooo !
Again ?
JASS:
debug local Brain DivineLightsBrain = Brain.create()
debug local Debugger Wrathion = Debugger.create()
debug local DebugMessage Message = DebugMessage.create()
debug set DivineLightsBrain = GetBrain( DivineLight )
debug call DebugMessage.DebuggerSendDebugMessage( Wrathion, DivineLightsBrain, Message )
debug call Brain.DebugBrainConnections( DivineLightsBrain )
//debug DivineLightsBrain.destroy() ?
//debug Wrathion.destroy() ?
//debug Message.destroy() ?
//debug set DivineLightsBrain = null ?
//debug set Wrathion = null ?
//debug set Message = null ?
 
Status
Not open for further replies.
Top