Order unit to attack damage source unit when damaged

excis

Member
Reaction score
1
Hi, I'm trying to make my own version of WoW's Concecration and i suspect i would need to use a damage detecting trigger but im wondering if it is possible without.
What i want is a unit takes damage
order damaged unit to attack damage dealing unit.
 

canons200

New Member
Reaction score
50
not all people play WoW, include me. Mind you explain a bit more regarding the spell?

If the spell is excatly simple as your description, use GDD by weep. If will work fine.
 

Carnerox

The one and only.
Reaction score
84
You mean something like this?
Trigger:
  • Example
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Unit - Order (Attacked unit) to Attack (Attacking unit)
 

excis

Member
Reaction score
1
The spell is basically you activate it and fire spawns beneath you dealing dmg to all enemies who stands in it.
 

Seprest

New Member
Reaction score
15
I get the spell...

Are you trying to make it into a taunt? So that when it deals damage to a unit, it will attack it?

The trigger does not need to be complex, and I suggest the spell itself be based on an aoe, such a thunderclap ingame.

Make a trigger that goes off when an ability is cast
-condition ability = concencration


Then make a temporary unit group and set it to all the units around the casting unit (adjust the distance to correlate with how wide your concencration ability deals damage)

Do something like this:

Make a unit variable and set it to the casting unit, let's call it "Caster"

Trigger:
  • Unit Group - Pick every unit in (Units within 100.00 of (Caster))) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) belongs to an enemy of (Owner of (Caster))) Equal to True
        • Then - Actions
          • Unit - Order (Picked unit) to Attack Caster
        • Else - Actions




If you have any questions plz ask!
 

excis

Member
Reaction score
1
You dont have to make a Unit Variable right? Just set the unit to attack Casting Unit
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
[...]
Trigger:
  • Unit Group - Pick every unit in (Units within 100.00 of (Caster))) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Picked unit) belongs to an enemy of (Owner of (Caster))) Equal to True
        • Then - Actions
          • Unit - Order (Picked unit) to Attack Caster
        • Else - Actions

[...]

that trigger leaks, i would not recommend using it.

would be better if you do it somehow like this:

Trigger:
  • set TempUnitGroup = (Units within 100.00 of (Triggering Unit)))
    • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Picked unit) belongs to an enemy of (Owner of (Caster))) Equal to True
          • Then - Actions
            • Unit - Order (Picked unit) to Attack Caster
          • Else - Actions
    • call DestroyGroup (udg_TempUnitGroup)


if you dont do it this way each time this trigger is run it will take some of your memory and not give it back until the game is closed. if this trigger is run frequently it will cause lagg.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top