• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Some enemies won't take damage

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Hi

I have this lesser condition complexed ability. It goes like this:

Whirlwind:
Nearby enemies take damage equal to 50% AP and 100% Agility. If a second ability is learned, named Blademaster, he will deal 4% increased damage for each level in a third ability, named Combat Skill. If Blademaster is activated, Whirlwind will deal an additional 200% extra damage.

Some times when used, some enemies take way less, if even any damage at all. I do not know what I have done wrong. Some times it works, some times it don't. Hope you can help.

So far the trigger goes like this:

  • Whirlwind
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Commander (Whirlwind)
    • Actions
      • Set A_Caster = (Triggering unit)
      • Set A_Counter = (Level of Combat Skill for A_Caster)
      • Set A_Damage = ((0.50 x (Real(Player_Hero_AP_Skillup[(Player number of (Owner of A_Caster))]))) + (1.00 x (Real((Agility of A_Caster (Include bonuses))))))
      • Set A_Real = (1.00 + (0.04 x (Real(A_Counter))))
      • Set A_Real1 = (2.00 x (A_Damage x A_Real))
      • Set A_Real = (A_Real x A_Damage)
      • Set A_Point = (Position of A_Caster)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of A_Point) and do (Actions)
        • Loop - Actions
          • Set A_AreaTarget_Enemy = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (A_AreaTarget_Enemy is A structure) Not equal to True
              • (A_AreaTarget_Enemy is dead) Not equal to True
              • (A_AreaTarget_Enemy belongs to an enemy of (Owner of A_Caster)) Equal to True
              • A_AreaTarget_Enemy Not equal to A_Caster
              • (A_AreaTarget_Enemy is Magic Immune) Not equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Commander (Blademaster) for A_Caster) Equal to 1
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (A_Caster has buff Blademaster (Commander)) Equal to True
                    • Then - Actions
                      • Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real1 damage of attack type Spells and damage type Normal
                    • Else - Actions
                      • Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real damage of attack type Spells and damage type Normal
                • Else - Actions
                  • Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Damage damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation (udg_A_Point)
Edit:
I notice now that other nearby enemies are neglected taking damage, if 1 already dies to the trigger. How do I prevent that?
 
Last edited:
Level 7
Joined
Jan 23, 2011
Messages
350
How about if you put some debug texts to see which damage the unit is taking or if the unit is correctly indexed in the group?

Also

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinminus.gif
    cond.gif
    If - Conditions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      line.gif
      joinbottom.gif
      if.gif
      (Level of Commander (Blademaster) for A_Caster) Equal to 1
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinminus.gif
    actions.gif
    Then - Actions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      line.gif
      joinbottomminus.gif
      if.gif
      If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinminus.gif
        cond.gif
        If - Conditions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          joinbottom.gif
          if.gif
          (A_Caster has buff Blademaster (Commander)) Equal to True
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinminus.gif
        actions.gif
        Then - Actions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          joinbottom.gif
          unit.gif
          Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real1 damage of attack type Spells and damage type Normal
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinbottomminus.gif
        actions.gif
        Else - Actions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          empty.gif
          joinbottom.gif
          unit.gif
          Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real damage of attack type Spells and damage type Normal
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinbottomminus.gif
    actions.gif
    Else - Actions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      empty.gif
      joinbottom.gif
      unit.gif
      Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Damage damage of attack type Spells and damage type Normal

All this could be outside the group array, instead of deals damage. Use set A_Dmg variable
 
Level 8
Joined
Jun 13, 2010
Messages
344
How about if you put some debug texts to see which damage the unit is taking or if the unit is correctly indexed in the group?

Also

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinminus.gif
    cond.gif
    If - Conditions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      line.gif
      joinbottom.gif
      if.gif
      (Level of Commander (Blademaster) for A_Caster) Equal to 1
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinminus.gif
    actions.gif
    Then - Actions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      line.gif
      joinbottomminus.gif
      if.gif
      If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinminus.gif
        cond.gif
        If - Conditions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          joinbottom.gif
          if.gif
          (A_Caster has buff Blademaster (Commander)) Equal to True
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinminus.gif
        actions.gif
        Then - Actions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          joinbottom.gif
          unit.gif
          Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real1 damage of attack type Spells and damage type Normal
      • empty.gif
        line.gif
        empty.gif
        empty.gif
        line.gif
        empty.gif
        line.gif
        empty.gif
        joinbottomminus.gif
        actions.gif
        Else - Actions
        • empty.gif
          line.gif
          empty.gif
          empty.gif
          line.gif
          empty.gif
          line.gif
          empty.gif
          empty.gif
          joinbottom.gif
          unit.gif
          Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Real damage of attack type Spells and damage type Normal
  • empty.gif
    line.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    joinbottomminus.gif
    actions.gif
    Else - Actions
    • empty.gif
      line.gif
      empty.gif
      empty.gif
      line.gif
      empty.gif
      empty.gif
      joinbottom.gif
      unit.gif
      Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Damage damage of attack type Spells and damage type Normal

All this could be outside the group array, instead of deals damage. Use set A_Dmg variable

How do you mean set it out of the group array, how do I then make the individual unit take the right damage?
 
Level 8
Joined
Jun 13, 2010
Messages
344
Instead of unit deals damage, use set A_Dmg variable. In the group array, you just use "deals A_Dmg to picked unit"

It's just a lil bit of better triggering

This is still GUI?
Do you have a fast example, because I'm not quite sure I follow.. Although it may be pretty simple when I realise..
 
Level 7
Joined
Jan 23, 2011
Messages
350
  • Acciones
    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si: Condiciones
        • (Level of Fan of Knives for (Triggering unit)) Mayor que (>) 0
      • Entonces: Acciones
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Si: Condiciones
            • ((Triggering unit) has buff Strong Knife) Igual a (==) True
          • Entonces: Acciones
            • Set DamageEventAmount = 500.00
          • Otros: Acciones
            • Set DamageEventAmount = 250.00
      • Otros: Acciones
        • Set DamageEventAmount = 100.00
    • Grupo de unidad - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Bucle: Acciones
        • Unidad - Cause (Triggering unit) to damage (Picked unit), dealing DamageEventAmount damage of attack type Conjuros and damage type Normal
This is what i meant
 
Level 8
Joined
Jun 13, 2010
Messages
344
This is what i meant

Like this?:

  • Whirlwind
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Commander (Whirlwind)
    • Actions
      • Set A_Caster = (Triggering unit)
      • Set A_Point = (Position of A_Caster)
      • Set A_Damage = ((0.50 x (Real(Player_Hero_AP_Skillup[(Player number of (Owner of A_Caster))]))) + (1.00 x (Real((Agility of A_Caster (Include bonuses))))))
      • Set A_Real = (1.00 + (0.04 x (Real((Level of Combat Skill for A_Caster)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Commander (Blademaster) for A_Caster) Equal to 1
        • Then - Actions
          • Set A_Damage = (A_Damage x A_Real)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (A_Caster has buff Blademaster (Commander)) Equal to True
            • Then - Actions
              • Set A_Damage = (A_Damage x 2.00)
            • Else - Actions
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 400.00 of A_Point) and do (Actions)
        • Loop - Actions
          • Set A_AreaTarget_Enemy = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (A_AreaTarget_Enemy is A structure) Not equal to True
              • (A_AreaTarget_Enemy is dead) Not equal to True
              • (A_AreaTarget_Enemy belongs to an enemy of (Owner of A_Caster)) Equal to True
              • A_AreaTarget_Enemy Not equal to A_Caster
              • (A_AreaTarget_Enemy is Magic Immune) Not equal to True
            • Then - Actions
              • Unit - Cause A_Caster to damage A_AreaTarget_Enemy, dealing A_Damage damage of attack type Spells and damage type Normal
            • Else - Actions
      • Custom script: call RemoveLocation (udg_A_Point)
Would that prevent the error with surrounding enemies not taking damage, just because 1 unit dies by to the trigger damage?

Edit:
It seems it does, but I do not understand why. Can someone explain to me why?
Is it because when you make a unit group with too many If/then/else, things get messy?
 
Status
Not open for further replies.
Top