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

Status
Not open for further replies.
Level 4
Joined
Jan 18, 2009
Messages
52
In my map i want these knights to attack. Then after an amount of time to come back to my base. I done the trigger so like they attack then go bck to region. But they don't attack they just go straight to the retreat position.

Is there a way i can include a time span inbetween the attack and retreat so they can get a few attacks in ??????
 
Level 9
Joined
Aug 1, 2008
Messages
453
You'll need 2 triggers for this.

You need one to count the # of attacks the knight has done so you can make him attack as many times as you want him to.

  • Attack Counter
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Footman
    • Actions
      • Set Temp_Interger = (Temp_Interger + 1)
Then you'll need another trigger that creates the units and sets them into a group.

  • Return
    • Events
    • Conditions
    • Actions
      • -------- Copy this section for each knight you want. --------
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to Temp_Group[1]
      • -------- -------------------------------- --------
      • -------- Change position of where you want the unit to move to and/or attack. --------
      • Unit Group - Pick every unit in Temp_Group[1] and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of (Playable map area))
      • -------- **If you want him to move make it so you change "Attack-Move" to "Move" or visversa --------
      • Wait until (Temp_Interger Greater than or equal to 5), checking every 1.00 seconds
      • -------- ^^ This trigger leaks im pretty sure =( ^^ **Also you can change the # to the # of attacks you want to units to have before retreating. --------
      • -------- Position of where you want the unit to move to retreat to. You'll need to change the move thing just like the other comment said. --------
      • Unit - Order (Last created unit) to Move To (Center of (Playable map area))
Hope this works. I think the unit group leaks too but im not sure.
 
Status
Not open for further replies.
Top