• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger??

Status
Not open for further replies.

Niborador

N

Niborador

I've made a map and when one of your towers get killed you get some reinforcements, (12 very powerful knights), but the only problem is that you can kill your own tower and you can get those knights without getting attacked by others, it is kind of lame, I was wondering if I have to make a trigger to make them stop attacking or should I edit it in object editor?? I really dont know, please help me.
 
This trigger will prevent any unit from attacking an ally of that unit. Instead it will re-issue a "smart" or right-click order on it.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Right-Click (Target unit of issued order)
      • Trigger - Turn on (This trigger)
The trigger is turned off/on because the order command will trigger this event, and create a repetitive loop that will crash Warcraft III.
 
This trigger will prevent any unit from attacking an ally of that unit. Instead it will re-issue a "smart" or right-click order on it.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(attack))
      • ((Triggering unit) belongs to an ally of (Owner of (Target unit of issued order))) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Triggering unit) to Right-Click (Target unit of issued order)
      • Trigger - Turn on (This trigger)
The trigger is turned off/on because the order command will trigger this event, and create a repetitive loop that will crash Warcraft III.

i think this fails. if it runs, it'll shut itself down and won't do rest of the trigger actions.

there's a trigger you could use,

  • Events
    • Unit - A unit is Attacked
  • Conditions
    • Or - Any (Conditions) are true
      • Conditions
        • ((Owner of (Attacked Unit)) is an ally of (Owner of Attacking unit))) Equal to true
        • ((Owner of (Attacked Unit)) is Equal to ((Owner of (Attacking unit)))
  • Actions
    • Unit - order (Attacking Unit) to stop
 
Thx alot Berb, it works perfectly! and I didn't really try your trigger Animoi, but I doubt it will work ;) Once again thanks :D
 
Animoi do you think your event will work? When the unit is attacked. Don't you think the unit will hit the target first?

the moment a attack order is issued, the unit can be classified as "attacking unit", from the moment you issue the order, there's still attacking time no?
unit won't insta attack. and thus the unit will be stopped

And berbs trigger wont shut itself down.
is that due to patch 1.24? because i remember it always shutting triggers down before the actions after them were completed .__."

and I didn't really try your trigger Animoi, but I doubt it will work ;)


i have it in my own map, works 100% correctly

its also posted on the hive somewhere in a tutorial, albeit a little more detailed there. search it up for it is the easiest way to counter allied/friendly attack
 
is that due to patch 1.24? because i remember it always shutting triggers down before the actions after them were completed .__."

Then you were doing something wrong. It works, and is known to work. It worked before the patch, and it works after it too.

the moment a attack order is issued, the unit can be classified as "attacking unit", from the moment you issue the order, there's still attacking time no?
unit won't insta attack. and thus the unit will be stopped

Not necessarily, if the order is issued outside of the unit's attack range then it will not immediately attack the target. Also the unit will only perform an "instant" attack if it's attack backswing time is 0.00; which in most cases it isn't - but still my method works flawlessly you can test it out yourself.
 
Not necessarily, if the order is issued outside of the unit's attack range then it will not immediately attack the target. Also the unit will only perform an "instant" attack if it's attack backswing time is 0.00; which in most cases it isn't - but still my method works flawlessly you can test it out yourself.[/QUOTE]

even if you have backswing time on zero it wont instant attack.
._.
 
Status
Not open for further replies.
Back
Top