• 🏆 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] Custom attack spell overrides spell cast

Status
Not open for further replies.

sentrywiz

S

sentrywiz

This question is related to another thread. L I N K

  • test attack
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Target unit of issued order) belongs to an enemy of (Owner of (Ordered unit))) Equal to True
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Ordered unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of issued order)
      • Trigger - Turn on (This trigger)
I have this trigger. it works great
But now if i cast another spell that targets a unit, this trigger activates.

what can i do to it so it doesn't override any other spell cast?
i want the trigger to activate only when a player right clicks on an enemy unit
 

sentrywiz

S

sentrywiz

You have to replace the condition with "Order is equal to Order(attack)"
Ofcourse attack move still fails this but still.

did you check the link? this isn't a normal order.
the trigger orders the unit to cast a spell, not attack.
the attack is removed.

and the trigger didn't activate when i moved the unit either.
 
Level 12
Joined
May 22, 2015
Messages
1,051
It might be something like "follow" since I assume your normal unit does not have a regular attack.

You can use the trigger that prints a message for you to see and have it output the unit's orders. Then just check for the one that is used when you right click on an enemy.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
No I didnt check the link, and I still havent.
What you have to do is find out what order your attack order is.
In normal maps, it is attack.
If you use follow, then you use "follow".

What you do right now is replace all actions that are done on one target by casting your spell.
What you need is to only replace the action that you want to replace and find out it's order string (if it has none then order id) and use that as the condition instead.
 

sentrywiz

S

sentrywiz

No I didnt check the link, and I still havent.
What you have to do is find out what order your attack order is.
In normal maps, it is attack.
If you use follow, then you use "follow".

What you do right now is replace all actions that are done on one target by casting your spell.
What you need is to only replace the action that you want to replace and find out it's order string (if it has none then order id) and use that as the condition instead.

It might be something like "follow" since I assume your normal unit does not have a regular attack.

You can use the trigger that prints a message for you to see and have it output the unit's orders. Then just check for the one that is used when you right click on an enemy.

I did what you two told me, printed out the order. Its 'smart'.

So i put this condition in the trigger, so it now looks like this:

  • Unit attacks
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Target unit of issued order) belongs to an enemy of (Owner of (Ordered unit))) Equal to True
      • (String((Issued order))) Equal to smart
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Order (Ordered unit) to Night Elf Druid Of The Talon - Faerie Fire (Target unit of issued order)
      • Trigger - Turn on (This trigger)
It works as i want it now. tell me if there might be something wrong with it.
But it does the job now, i can cast separate spells now and attack at the same time without override.
+rep to both of you
 

sentrywiz

S

sentrywiz

uhm... well... because it is smart, there might be some problems because I am not quite sure what is included in "smart".
there might be some unwanted problems with it.

true. when i pick up an item, it counts as 'smart'.
idk, i guess i'll wait and see. it shouldn't be a problem though
because the map is supposed to be a hero arena.
 
If you right click with a unit towards something/somewhere it counts always as "smart".
So yes, also for clicking on items, but that's no problem here.

I don't think you need the turn on/off actions.
You might want addiotinaly add a condition for unit type of ordered unit.
Else, looks good. But of course like this there exists no "attack all units on his way" move order for example.
 
Level 12
Joined
May 22, 2015
Messages
1,051
You could actually have this whole thing trigger off of "unit is attacked". It triggers when a unit starts their attack animation. If you tell them to cast the spell, it will interrupt the attack. You could attack move this way and the unit would attack on its own. However, it would show damage on the unit's UI even though it isn't used. It would also need 2 icons - one for regular attack which isn't used and one for the attack replacing spell.
 

sentrywiz

S

sentrywiz

Nah guys, i don't need the "attack move" orders. all i wanted was that:

- unit can attack by using "A" hotkey or right click on an enemy unit (attack spell has melee range, so the unit has to run towards the enemy unit anyway to even try cast the attack spell)

- spells don't interrupt or override the attack and vice versa (spells are all based on channel disable other abilities)
 
Status
Not open for further replies.
Top