• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Computer player and issued orders

Status
Not open for further replies.
So, does computer players not actually issue attack orders?
Here is a gui version of what I want to do (going to do it in jass if I actually manage to find a way around this problem):

  • Lunge
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Ordered unit)) Equal to Walking Corpse
      • (Distance between (Position of (Ordered unit)) and (Position of (Target unit of issued order))) Less than or equal to 500.00
      • (Issued order) Equal to (Order(attack))
    • Actions
      • Unit - Create 1 Dummy Caster for (Owner of (Ordered unit)) at (Position of (Ordered unit)) facing (Facing of (Ordered unit)) degrees
      • Unit - Add Lunge (Dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Ordered unit)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Game - Display to (All players) the text: Lunge
It triggers if I control the unit, but not if it is controlled by neutral hostile units or a "non-ai" controlled computer player. I have the same for some other triggers.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
They use orders, but they might use different orders. You are looking for the attack order on a specific target. You could also use right click (smart) instead or use the attack command on a location. If the attack is ordered at a location your second condition will probably return false.

Units also automatically attack nearby enemies without the player issuing any order.
 
Level 13
Joined
May 10, 2009
Messages
868
upload_2018-5-30_10-54-12.png

They do actually fire those events, but it depends on the AI script itself. Auto-acquiring targets does not trigger them, though.
You can go with what MyPad already suggested, or use the specific unit event: Acquires a target, but you'll have to worry about registering units and recycling triggers after several deaths, like the way how some DDSs do.
 
Level 10
Joined
Jan 13, 2017
Messages
88

They do actually fire those events, but it depends on the AI script itself. Auto-acquiring targets does not trigger them, though.
You can go with what MyPad already suggested, or use the specific unit event: Acquires a target, but you'll have to worry about registering units and recycling triggers after several deaths, like the way how some DDSs do.

Oh, interesting! i guess its only triggers then
 
Since the event is based on an attack order, could you intercept it instead using a generic Unit is attacked event?

Sadly, i need the trigger to fire before they attack as they aquire the target. The effect gives a movement speed buff as they come close to the enemy.


They do actually fire those events, but it depends on the AI script itself. Auto-acquiring targets does not trigger them, though.
You can go with what MyPad already suggested, or use the specific unit event: Acquires a target, but you'll have to worry about registering units and recycling triggers after several deaths, like the way how some DDSs do.

Too bad, 'acquire target' is probably the effect I need. Will have to test more.
 
Just tested, neither seems to be issued. It does seem like Auto-acquiring targets or attacking as a result does not trigger issued orders.

I wonder if I can somehow use "frenzy" to detect it. Although i would have to do it in a way that does not interrupt the unit, which is why i did not use that ability in the first place.

Update:
Ok, found a solution that works for me. And only because the unit in question is going to be ai anyway. Just giving the unit frenzy, and ordering it to stop as it is being cast works seamlessly.
 
Last edited:
Yeah, but as BloodSoul said. That is "specific unit" only.

Anyhow.
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Frenzy
    • Actions
      • Unit - Order (Triggering unit) to Stop
      • Unit - Create 1 Dummy Caster for (Owner of (Casting unit)) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
      • Unit - Add Lunge (Dummy) to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Casting unit)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
works for my purpose.
A bit ironic to use frenzy in what is essentially a frenzy spell, but without the unit stopping to cast the spell.
 
Last edited:
Status
Not open for further replies.
Top