• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Why this ability is not works when i use Dummy?

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,205
Hello everyone. I am trying to create one of champions from League of Legends and everything was working until...

Skill 1 After small delay, this unit deals damage units within area.

  • Veigar W Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Veigar W //
    • Actions
      • Set TempPointVeigarW = (Target point of ability being cast)
      • Special Effect - Create a special effect at TempPointVeigarW using Abilities\Spells\Other\HowlOfTerror\HowlTarget.mdl
      • Set TempEffectVeigarW = (Last created special effect)
      • Animation - Reset Hero_Veigar's animation
      • Wait 1.00 seconds
      • Special Effect - Destroy TempEffectVeigarW
      • Special Effect - Create a special effect at TempPointVeigarW using Units\NightElf\Wisp\WispExplode.mdl
      • Wait 0.25 seconds
      • Unit - Create 1 DUMMY [JFA] for (Owner of (Casting unit)) at TempPointVeigarW facing Default building facing degrees
      • Set VeigarDummyW = (Last created unit)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Pick every unit in (Units within 200.00 of TempPointVeigarW matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Unit - Cause VeigarDummyW to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Unknown
      • Set TempEffectVeigarW = (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Destroy TempEffectVeigarW
      • Custom script: call RemoveLocation(udg_TempPointVeigarW)
Skill 2: Hero creates magical area that stuns enemies within area. Stun duration is 0.50 seconds.

  • Veigar E Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Veigar E //
    • Actions
      • Set TempPointVeigarE = (Target point of ability being cast)
      • Set Veigar_E_Caster = (Casting unit)
      • Set VeigarE_Prison = 0.00
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect at (TempPointVeigarE offset by 250.00 towards VeigarE_Prison degrees) using Abilities\Spells\Orc\SpikeBarrier\SpikeBarrier.mdl
          • Set VeigarEffect = (VeigarEffect + 1)
          • Set VeigarEffect2[VeigarEffect] = (Last created special effect)
          • Set VeigarE_Prison = (VeigarE_Prison + 30.00)
      • Wait 1.00 seconds
      • Trigger - Turn on Veigar E Stun <gen>
      • Wait 4.00 seconds
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Special Effect - Destroy VeigarEffect2[(Integer A)]
      • Set VeigarEffect = 0
      • Custom script: call RemoveLocation(udg_TempPointVeigarE)
      • Trigger - Turn off Veigar E Stun <gen>
And this is the trigger.

  • Veigar E Stun
    • Events
      • Time - Every 0.75 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 320.00 of TempPointVeigarE) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to False
              • ((Picked unit) is Mechanical) Equal to False
              • ((Picked unit) is alive) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of Veigar_E_Caster)) Equal to True
            • Then - Actions
              • Unit - Create 1 DUMMY [JFA] for (Owner of Veigar_E_Caster) at TempPointVeigarE facing Default building facing degrees
              • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Picked unit)
            • Else - Actions
Now let me tell you what happens. Both of the triggers works without any issues.
But if i will cast second skill, my first skill doesn't deals damage enemies within magical area
Skill W: Works and deals damage enemies
Skill E: Works and stuns enemies within area


Skill W NOT WORKS when the enemies within Area created by Skill E


I have solved this issue by changing this

  • Unit Group - Pick every unit in (Units within 200.00 of TempPointVeigarW matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is Mechanical) Equal to False)))) and do (Actions)
    • Loop - Actions
      • Unit - Cause VeigarDummyW to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Unknown
With this

  • Unit - Cause Hero_Veigar to damage (Picked unit), dealing 100.00 damage of attack type Chaos and damage type Unknown
When dummy tries to pick and damage, not works within the area. But it works when i will use caster instead of dummy unit.

I have solved the issue but i want to learn why this is happening. What am i missing?
 
Level 23
Joined
Feb 27, 2019
Messages
767
My guess is that its because you were using (Owner of (Casting unit)) which isnt valid after an amount of time. I use Triggering unit as often as possible since it doesnt have that issue. I was linked a thread about myths of event variables not acting as local variables that contained information about the behavior of event variables, which would be helpful here, but I forgot to bookmark it. In summary, many event variables act as local variables while others are only valid for an amount of time.
 
Level 42
Joined
Feb 27, 2007
Messages
5,326
I forgot to bookmark it
 
Status
Not open for further replies.
Top