• 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.

[Trigger] Triple Blink [malfunction]

Status
Not open for further replies.
Level 7
Joined
Oct 10, 2009
Messages
111
I'm creating a simple "Triple Blink" (Triangular ability, stacking three points (one initial and two additional based on that one) which also damages enemy units in a small cone. What does the ability do? Well ... it does all required. However, in addition, it ignores the cooldown (meaning there is not one) and also damages Hero in the process. I know it has something to do with "Unit Group" but I'm not sure whether I should pre-define it or there's just some miss or something alike in the actual trigger.

  • Triangular BlinkINT
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Triangular Blink
    • Actions
      • Set TB_Caster = (Triggering unit)
      • Set TB_Damage = (Agility of TB_Caster (Include bonuses))
      • Set TB_Range = 400
      • Set TB_DMG_RAD = 250
      • Set TB_Temp_Points[0] = (Target point of ability being cast)
      • Set TB_Temp_Points[1] = (TB_Temp_Points[0] offset by (Real(TB_Range)) towards 20.00 degrees)
      • Set TB_Temp_Points[2] = (TB_Temp_Points[1] offset by (Real(TB_Range)) towards 90.00 degrees)
      • Unit - Move TB_Caster instantly to TB_Temp_Points[0]
      • Unit Group - Pick every unit in (Units within (Real(TB_DMG_RAD)) of (Position of TB_Caster) matching (((Picked unit) belongs to an enemy of (Owner of TB_Caster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause TB_Caster to damage (Triggering unit), dealing (Real(TB_Damage)) damage of attack type Pierce and damage type Normal
          • Special Effect - Create a special effect at TB_Temp_Points[0] using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.40 seconds
      • Unit - Move TB_Caster instantly to TB_Temp_Points[1]
      • Unit Group - Pick every unit in (Units within (Real(TB_DMG_RAD)) of TB_Temp_Points[1] matching (((Picked unit) belongs to an enemy of (Owner of TB_Caster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause TB_Caster to damage (Triggering unit), dealing (Real(TB_Damage)) damage of attack type Pierce and damage type Normal
          • Special Effect - Create a special effect at TB_Temp_Points[1] using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Wait 0.40 seconds
      • Unit - Move TB_Caster instantly to TB_Temp_Points[2]
      • Unit Group - Pick every unit in (Units within (Real(TB_DMG_RAD)) of TB_Temp_Points[2] matching (((Picked unit) belongs to an enemy of (Owner of TB_Caster)) Equal to True)) and do (Actions)
        • Loop - Actions
          • Unit - Cause TB_Caster to damage (Triggering unit), dealing (Real(TB_Damage)) damage of attack type Pierce and damage type Normal
          • Special Effect - Create a special effect at TB_Temp_Points[2] using Abilities\Spells\Items\SpellShieldAmulet\SpellShieldCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TB_Temp_Points[0])
      • Custom script: call RemoveLocation(udg_TB_Temp_Points[1])
      • Custom script: call RemoveLocation(udg_TB_Temp_Points[2])
 
Level 7
Joined
Oct 10, 2009
Messages
111
First set the position of the caster to a location variable that will be removed at the end :)
Set picked unit instead of triggering unit.

It ignores the cd ? What does this mean ?
It damages the caster hero ?

I figured out the damage caster problem by making Hero invulnerable before teleporting and reverting back afterwards, but the cooldown problem is still there - the spell never goes on cooldown meaning it can be cast endlessly.
 
Level 13
Joined
Mar 29, 2012
Messages
542
You can do like this on using unit group :
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set Caster = (Triggering unit)
      • Set Owner = (Owner of Caster)
      • Set TempPoint = (Target point of ability being cast)
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 512.00 of TempPoint) and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit belongs to an enemy of Owner) Equal to True
            • Then - Actions
              • -------- Put your action here --------
            • Else - Actions
      • -------- Now, the group above has been destroyed automatically --------
      • Custom script: call RemoveLocation(udg_TempPoint)
The "set bj_wantDestroyGroup = true" determines if you want the going to be created group to be destroyed after using it or not

Also using 'if' inside group loop action to check the picked unit will reduce lag AFAICT... :D
 
An if inside the loop does not reduce lag. It adds readability. However, it's easier to simply pick every unit in range matching condition.

You never null TempUnit, Caster or Owner, which causes a leak.

He wants to triple blink, not to pick every unit somewhere and do something else other than move to the target point and two more points in a matter of 0.80 seconds.
 
An if inside the loop does not reduce lag. It adds readability. However, it's easier to simply pick every unit in range matching condition.

You never null TempUnit, Caster or Owner, which causes a leak.

He wants to triple blink, not to pick every unit somewhere and do something else other than move to the target point and two more points in a matter of 0.80 seconds.

using the ITE makes it easier to read and more efficient because you can't set matching unit to a variable when it's used twice or more.

not nulling does not cause leak.
 
Status
Not open for further replies.
Top