• 🏆 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!

Fan of Knives

Status
Not open for further replies.
Level 20
Joined
Aug 29, 2012
Messages
826
It behaves like a regular AoE, so you can just pick every enemy unit in an X radius around your hero and deal damage.

If you're worried about dealing damage when projectiles hit the target, you could calculate the distance between the caster and the target and divide it by the projectile speed, but that's very superfluous.
 
Level 7
Joined
May 14, 2019
Messages
255
Think it would be easier to use it as a dummy ability and set the damage to 0 then use a trigger to damage all the enemies based on agility.

Fan of knives can be the dummy ability if u want to make it seem like the projectile is comming from the casting unit.
 
Level 8
Joined
May 21, 2019
Messages
435
You can make a generic "Takes damage" event using unit groups. Simply add the units that you wanna damage, and generate a "takes damage" event in the trigger that does the Fan of Knives damage. Then deal the extra damage to any unit taking damage from Fan of Knives based on the casting units agility.
 
Level 9
Joined
Feb 20, 2014
Messages
409
I made a simple version but it killed me...
What's wrong ? It is supposed to kill ennemy units.

  • Unit - A unit Starts to cast an ability
  • Conditions
    • (Ability being cast) Equal to Fan of Knives
  • Actions
    • Set agilityE = (Agility of (Triggering unit) (Inclure bonuses))
    • Set agility = (Real(agilityE))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Level of Fan of Knives (GOT) for (Triggering unit)) Equal à 1
      • Alors - Actions
        • Groupe unité - Pick every unit in (Units within 400.00 of (Position of (Triggering unit)) matching (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal à TRUE)) and do (Actions)
          • Boucle - Actions
            • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (100000.00 + (agility x 1.00)) damage of attack type Sorts and damage type Universel
      • Sinon - Actions
 
Level 9
Joined
Feb 20, 2014
Messages
409
You're using (picked unit) in your unit in your initial unit group check, if you use matching unit you must use (matching unit)

Additionally consider this tutorial on the subject:
Convenient Unit Group Filtering in GUI

I read the tutorial you sent me (very useful thanks) now it works BUT it only kills 1 ennemy unit (in the range). It doesn't kil all of them.

  • Event
    • Unit - A unit starts to cast an ability
  • Conditions
    • (Ability being cast) Equal to Fan of Knives
  • Actions
    • Set caster = (Triggering unit)
    • Set Player = (Triggering player)
    • Set UnitGroup = (Units within 600.00 of (Position of caster))
    • Set agilityE = (Agility of (Triggering unit) (Inclure bonuses))
    • Set agility = (Real(agilityE))
    • Unit Group - Pick every unit in UnitGroup and do (Actions)
      • Boucle - Actions
        • Set TempUnit = (Picked unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • (TempUnit is alive) Equal to TRUE
        • (TempUnit belongs to an enemy of Player) Equal to TRUE
        • (Level of Fan of Knives (GOT) for (Triggering unit)) Equal to 1
      • Alors - Actions
        • Unit - Cause caster to damage TempUnit, dealing (100000.00 + (agility x 1.00)) damage of attack type Sorts and damage type Universel
      • Sinon - Actions
  • What is wrong?
 
Level 8
Joined
May 21, 2019
Messages
435
I read the tutorial you sent me (very useful thanks) now it works BUT it only kills 1 ennemy unit (in the range). It doesn't kil all of them.

  • Event
    • Unit - A unit starts to cast an ability
  • Conditions
    • (Ability being cast) Equal to Fan of Knives
  • Actions
    • Set caster = (Triggering unit)
    • Set Player = (Triggering player)
    • Set UnitGroup = (Units within 600.00 of (Position of caster))
    • Set agilityE = (Agility of (Triggering unit) (Inclure bonuses))
    • Set agility = (Real(agilityE))
    • Unit Group - Pick every unit in UnitGroup and do (Actions)
      • Boucle - Actions
        • Set TempUnit = (Picked unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • (TempUnit is alive) Equal to TRUE
        • (TempUnit belongs to an enemy of Player) Equal to TRUE
        • (Level of Fan of Knives (GOT) for (Triggering unit)) Equal to 1
      • Alors - Actions
        • Unit - Cause caster to damage TempUnit, dealing (100000.00 + (agility x 1.00)) damage of attack type Sorts and damage type Universel
      • Sinon - Actions
  • What is wrong?

This trigger should only kill 1 target. What you are doing in your "pick every unit" loop is going through every unit, and then setting a single unit variable to that unit.
In other words, if you get 4 units with that pick loop, this will happen:
-TempUnit = Unit 1
-TempUnit = Unit 2
-TempUnit = Unit 3
-TempUnit = Unit 4

End result: TempUnit = Unit 4.
You have no reference to Unit 1, 2, and 3.

Instead, you need to put the IF statement into the unit group loop and run the actions from there.

  • Event
    • Unit - A unit starts to cast an ability
  • Conditions
    • (Ability being cast) Equal to Fan of Knives
  • Actions
    • Set caster = (Triggering unit)
    • Set Player = (Triggering player)
    • Set UnitGroup = (Units within 600.00 of (Position of caster))
    • Set agilityE = (Agility of (Triggering unit) (Inclure bonuses))
    • Set agility = (Real(agilityE))
    • Unit Group - Pick every unit in UnitGroup and do (Actions)
      • Boucle - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Si - Conditions
            • ((Picked Unit) is alive) Equal to TRUE
            • ((Picked Unit) belongs to an enemy of Player) Equal to TRUE
            • (Level of Fan of Knives (GOT) for (Triggering unit)) Equal to 1
          • Alors - Actions
            • Unit - Cause caster to damage (Picked Unit), dealing (100000.00 + (agility x 1.00)) damage of attack type Sorts and damage type Universel
          • Sinon - Actions
Something like this should work. There may be a formatting issue as I text edited it though.
 
Last edited:
Level 9
Joined
Feb 20, 2014
Messages
409
This trigger should only kill 1 target. What you are doing in your "pick every unit" loop is going through every units, and then setting a single unit variable to that unit.
In other words, if you get 4 units with that pick loop, this will happen:
-TempUnit = Unit 1
-TempUnit = Unit 2
-TempUnit = Unit 3
-TempUnit = Unit 4

End result: TempUnit = Unit 4.
You have no reference to Unit 1, 2, and 3.

Instead, you need to put the IF statement into the unit group loop and run the actions from there.

  • Event
    • Unit - A unit starts to cast an ability
  • Conditions
    • (Ability being cast) Equal to Fan of Knives
  • Actions
    • Set caster = (Triggering unit)
    • Set Player = (Triggering player)
    • Set UnitGroup = (Units within 600.00 of (Position of caster))
    • Set agilityE = (Agility of (Triggering unit) (Inclure bonuses))
    • Set agility = (Real(agilityE))
    • Unit Group - Pick every unit in UnitGroup and do (Actions)
      • Boucle - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Si - Conditions
            • ((Picked Unit) is alive) Equal to TRUE
            • ((Picked Unit) belongs to an enemy of Player) Equal to TRUE
            • (Level of Fan of Knives (GOT) for (Triggering unit)) Equal to 1
          • Alors - Actions
            • Unit - Cause caster to damage (Picked Unit), dealing (100000.00 + (agility x 1.00)) damage of attack type Sorts and damage type Universel
          • Sinon - Actions
Something like this should work. There may be a formatting issue as I text edited it though.

It works thank you very much :)
 
Status
Not open for further replies.
Top