• 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] Keep Units Moving (Again)

Status
Not open for further replies.
Level 7
Joined
Jul 24, 2008
Messages
294
Hello there everyone, I'm looking for some help regarding a trigger. What i'm trying to do is to keep units moving, when there not moving.. Another way to describe this is..

When a unit stops moving, wait several secconds then order him to move to random point in playable area.

Below is what i was working on but i can't get it to work saddly.


  • Keep Units Moving
    • Events
    • Conditions
      • (Current order of (Triggering unit)) Equal to (Order(stop))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Ranger - |cffffcc00Level 1|r Level 1
              • (Unit-type of (Triggering unit)) Equal to Ranger - |cffffcc00Level 2|r Level 2
              • (Unit-type of (Triggering unit)) Equal to Ranger - |cffffcc00Level 3|r Level 3
              • (Unit-type of (Triggering unit)) Equal to Warrior - |cffffcc00Level 1|r Level 1
              • (Unit-type of (Triggering unit)) Equal to Warrior - |cffffcc00Level 2|r Level 2
              • (Unit-type of (Triggering unit)) Equal to Warrior - |cffffcc00Level 3|r Level 3
              • (Unit-type of (Triggering unit)) Equal to Knight - |cffffcc00Level 1|r Level 1
              • (Unit-type of (Triggering unit)) Equal to Knight - |cffffcc00Level 2|r Level 2
              • (Unit-type of (Triggering unit)) Equal to Knight - |cffffcc00Level 3|r Level 3
        • Then - Actions
          • Unit - Order (Triggering unit) to Attack-Move To (Random point in (Playable map area))
        • Else - Actions
          • Do nothing
 
Level 7
Joined
Jul 24, 2008
Messages
294
You need an event...
And get rid of "Do Nothing", it's useless.
You could jsut give the units the ability "Wander", then they'd wander around at will, randomly...

Well you see, The problem is i can't think of an event to trigger it.

As for wander, that would make the map un-playable.

I need help with getting the trigger to work as in finding a way to get the event started so i could have my 'Units' attack move randomly on the map.
 
Level 7
Joined
Jul 24, 2008
Messages
294
"Time - Every 5 seconds of gameplay" or something..? Would that suit your needs?

No, Because then it wouldn't work with the Condition

  • Conditions
    • (Current order of (Triggering unit)) Equal to (Order(stop))
If you can think of another way for it to work?

how about

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(stop))
    • Actions
      • Unit - Order (Ordered unit) to Attack-Move To (Random point in (Playable map area))

I don't think that will work, (But i will try it). Because the unit to be issued a order the (Player) would have to issue the order, The player has no controll of the units, that is why the trigger is needed.
 
Maybe this'll work:
  • Keep Them Moving
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Ranger) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions
      • Unit Group - Pick every unit in (Units of type Warrior) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions
      • Unit Group - Pick every unit in (Units of type Knight) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions
 
Level 7
Joined
Jul 24, 2008
Messages
294
Maybe this'll work:
  • Keep Them Moving
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Ranger) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions
      • Unit Group - Pick every unit in (Units of type Warrior) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions
      • Unit Group - Pick every unit in (Units of type Knight) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current movement speed of (Picked unit)) Less than or equal to 10.00
            • Then - Actions
              • Set temp_loc = (Random point in (Playable map area))
              • Unit - Order (Picked unit) to Attack-Move To temp_loc
              • Custom script: call RemoveLocation(udg_temp_loc)
            • Else - Actions


That would work if--

That would make every unit of unit type to all move to the same location, the point of the generic Trigger was so that every unit moved to different locations.

Thanks for trying though.
 
Level 7
Joined
Jul 24, 2008
Messages
294
it does go to different points:
Pick every unit in blahblah is a loop, so for every unit, it sets a new point, and so they will all get to different points


Hmm, Didn't notice that.
Thanks for the help, I'm going to mess around with it. Any more suggestions would be greatfull.

One question, how did you Set Loc=((RandomPoint))
I can set loc to several options, none being RandomPoint in Playable Map
 
Status
Not open for further replies.
Top