[General] Need different attack missile for attacking ally

Level 3
Joined
May 7, 2016
Messages
38
I am creating a mage that heals allied units by attacking them.
I know how to implement it trigger-wise, but is there a way to change the model of the attack missile object editor-wise?

Response highly valued :)
 
Last edited:
Sorry, I forgot to say that I tried to do the 2 attack thing, but the unit keeps using the same attack(first)
https://i.imgur.com/nzo7nv3.png
You have to also change the target units classification.

Or you can use some passive transformation system to change the unit type to an identical unit with a different missile every time it attacks a friend.

Orbs also enables the secondary attack if that's any help.
 
Level 3
Joined
May 7, 2016
Messages
38
Soo the ally/friend, enemy seems to do nothing...
And the only thing that helps is by making a unit classify as a ward hah :D

I suspect I do the second one with some spell?

How does that help when the unit already has both attacks enabled?
 
Level 3
Joined
May 7, 2016
Messages
38
Yep, Even tho I set target only to friend/ally it attacks the enemy with it also... it is broken
you run into same prob when assigning what are the targets for the orb thing

I am tempted to just set missile art to none and implement it trigger-wise..
tho I will try the transformation thing... tho it looks like I have to copy everything
 
tho I will try the transformation thing... tho it looks like I have to copy everything
You basically just make two identical units with different projectile arts and morph them into each other based on their orders.

Event:
Unit is issued an order targeting an object

Conditions:
Targeted unit belongs to an ally of owner of triggering unit equal to true.

Issued order equal to attack.

Unit type of triggering unit equal to mage.

Actions:
Add ability to unit.
Remove ability from unit.



Then you just do the same in reverse when it attacks an enemy unit.

I'm not by my computer so I'm not able to actually construct the triggers or test it myself but this should work perfectly.
 
Level 34
Joined
Feb 27, 2007
Messages
4,579
Instead of using abilities you can modify the projectile art directly with the ‘set unit string field’ action. This would be a case for the ‘a unit is attacked’ event because you need to catch slightly before the attack is fired and the ‘issued order’ event will not fire when the unit auto acquires a target.
 
Level 34
Joined
Feb 27, 2007
Messages
4,579
Well it would look something like this:
  • GUI Test
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Triggering unit)) is an ally of (Owner of (Attacking unit))) Equal to True
        • Then - Actions
          • Custom script: call BJDebugMsg("ally")
          • Unit - Set Unit: (Attacking unit)'s Weapon String Field: Attack Projectile Art ('ua1m')at Index:0 to Value: Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
        • Else - Actions
          • Custom script: call BJDebugMsg("enemy")
          • Unit - Set Unit: (Attacking unit)'s Weapon String Field: Attack Projectile Art ('ua1m')at Index:0 to Value: Abilities\Spells\Undead\DeathCoil\DeathCoilMissile.mdl
However it appears as though while the function to change the string field exists it doesn't actually change anything yet. Blizzard will hopefully get these functions working soon, so for now you cannot do this and must use an ability to change projectile instead.
 
An orb based approach is to give an orb ability to the attacking unit every time it attacks an enemy unit and then removing it when it attacks a friendly unit.

Just remember to remove the attachment model and beneficial effects from the orb ability.

EDIT: You probably won't even need to remove the orb ability if you change the ability targets allowed to enemy only.
 
Last edited:
Top