• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Force to attack unit

Status
Not open for further replies.
Level 14
Joined
Oct 16, 2010
Messages
762
Hi,

In my map I have a spell which randomly makes them target a nearby unit (ally or enemy). This is meant to be so that they start attacking their allies or it backfires and they attack you instead. This target wouldn't change until the target dies.

So anyway I was thinking of changing it so that the entire spell is about them being forced to attack specific targets but I don't know how I'd make any other orders to attack other units would be overridden.

Thoughts?
 
1)You change owner of forced units to a temporary player, so their owners can't control them to stop.

2)First you order your units to attack, then you periodically order them again and again.There are 2 ways of doing this.You either need to use a periodic trigger with low timeout, or you will have another trigger that detects order.
 
In the second one what would I need to detect? I know you can detect all orders but wouldn't it cause an infinite loop if they attack the target then get re-ordered to attack them via trigger constantly? How would I filter whether they are attacking their target?
 
Well, you simply won't reorder if unit is again attacking the target you want.All other orders including attack will be reordered, except that one case.
 
Status
Not open for further replies.
Back
Top