• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Need help with trigger

Status
Not open for further replies.
Level 4
Joined
Sep 8, 2008
Messages
73
I need help making a trigger for a grouping system.
I have one global array for storing the group leader, udg_e.
I have one global array for storing the group, udg_g
the groups index in the array is the custom value that each unit is assigned.

What i need is a trigger that makes the whole group preform the same order that the leader is given. GUI or JASS; doesent matter. I have tried some, but it's real tricky to make it work somehow.

For example: the group leader is ordered to attack unit x, thus the rest of the group will do so too. And if the leader is ordered to move, the group will follow.

Very thankful for answers.
 
Level 5
Joined
May 27, 2007
Messages
126
Heya, make a variable called UnitFollow (unit variable) with array: 1

whenever the Captain unit attacks another unit the 4 footman will help.

Hope this somehow helps you, you just have to make variables, I might have forgotten something but I tested it ingame and it worked

  • trigger
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Captain
    • Actions
      • Set UnitFollow[1] = <Your support unit 001>
      • Set UnitFollow[2] = <Your support unit 002>
      • Set UnitFollow[3] = <Your support unit 003>
      • Set UnitFollow[4] = <Your support unit 004>
      • Unit - Order UnitFollow[1] to Attack (Ordered unit)
      • Unit - Order UnitFollow[2] to Attack (Ordered unit)
      • Unit - Order UnitFollow[3] to Attack (Ordered unit)
      • Unit - Order UnitFollow[4] to Attack (Ordered unit)
and with moving

  • trigger
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to Captain
    • Actions
      • Set UnitFollow[1] = Footman 0001 <gen>
      • Set UnitFollow[2] = Footman 0002 <gen>
      • Set UnitFollow[3] = Footman 0003 <gen>
      • Set UnitFollow[4] = Footman 0004 <gen>
      • Unit - Order UnitFollow[1] to Follow (Attacked unit)
      • Unit - Order UnitFollow[2] to Follow (Attacked unit)
      • Unit - Order UnitFollow[3] to Follow (Attacked unit)
      • Unit - Order UnitFollow[4] to Follow (Attacked unit)
 
Status
Not open for further replies.
Top