Cancel Cast on Burrowed Unit

Kam

Kam

Community Development Manager
Level 37
Joined
Aug 3, 2004
Messages
2,754
I use this trigger with numerous spells and have had no issues. When I call for it to be used on a burrowed unit the spell is still cast. Thoughts?

  • Dark Mark Try B
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Executioner
      • (Issued order) Equal to (Order(bloodlust))
      • (Unit-type of (Target unit of ability being cast)) Equal to Burrowed Scourge
    • Actions
      • Wait 0.00 seconds
      • Set ErrorPlayer = (Owner of (Triggering unit))
      • Unit - Order (Triggering unit) to Stop
      • Set ErrorMessage = Unable to target burrowed units.
      • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
 
Level 23
Joined
Feb 18, 2014
Messages
3,423
What's the point of the wait 0.00 second anyway?
And what do you mean the spell is still casting which one is it? And since you unable to target burrowed unit that might be the answer to the question, is that right?
 
Level 36
Joined
Jul 22, 2015
Messages
3,491
(Unit-type of (Target unit of ability being cast)) Equal to Burrowed Scourge

you said equal to true

when it should be not equal to true.
He wants it to work for Burrowed Scourge. You are partially right though, the issue is with his condition statement. It should be changed to this:
  • (Unit-type of (Target unit of issued order)) Equal to Burrowed Scourge
I'm pretty sure (Target unit of ability being cast) with this event will return null.
 
Level 23
Joined
Feb 18, 2014
Messages
3,423
He wants it to work for Burrowed Scourge. You are partially right though, the issue is with his condition statement. It should be changed to this:
  • (Unit-type of (Target unit of issued order)) Equal to Burrowed Scourge
I'm pretty sure (Target unit of ability being cast) with this event will return null.

Casting an ability isn't considred an issued order?
 
Level 36
Joined
Jul 22, 2015
Messages
3,491
Casting an ability isn't considred an issued order?

It is, but he uses the "A unit Is issued an order targeting an object" event. There is no ability here, so GetSpellTargetUnit() will return nothing (or null, I still don't get this programming lingo) if you attempt to call it.
  • No text will appear
    • Get Name
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Set TempUnit = (Target unit of ability being cast)
        • -------- --------
        • Game - Display to (All players) the text: (Name of TempUnit)

  • Text will appear
    • Get Name
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Set TempUnit = (Target unit of issued order)
        • -------- --------
        • Game - Display to (All players) the text: (Name of TempUnit)
 
Level 36
Joined
Jul 22, 2015
Messages
3,491
Have you tried my suggestion?

the issue is with his condition statement. It should be changed to this:
  • (Unit-type of (Target unit of issued order)) Equal to Burrowed Scourge
I'm pretty sure (Target unit of ability being cast) with this event will return null.

he uses the "A unit Is issued an order targeting an object" event. There is no ability here, so GetSpellTargetUnit() will return nothing (or null, I still don't get this programming lingo) if you attempt to call it.
  • No text will appear
    • Get Name
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Set TempUnit = (Target unit of ability being cast)
        • -------- --------
        • Game - Display to (All players) the text: (Name of TempUnit)

  • Text will appear
    • Get Name
      • Events
        • Unit - A unit Is issued an order targeting an object
      • Conditions
      • Actions
        • Set TempUnit = (Target unit of issued order)
        • -------- --------
        • Game - Display to (All players) the text: (Name of TempUnit)
 
  • Like
Reactions: Kam
Top