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

Slash

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
what is wrong in here?
Sometimes the hero is moved normally, sometimes the hero moves only on first loop, sometimes the hero flies milion range away, sometimes this just screwes up....

  • Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slash
    • Actions
      • -------- --------------- Set Variables --------------- --------
      • Set Slash_TrigUnit = (Triggering unit)
      • Set Slash_Damage[1] = 350.00
      • Set Slash_Damage[2] = 700.00
      • Set Slash_Damage[3] = 1400.00
      • Set Slash_Damage[4] = 2800.00
      • Set Slash_Damage[5] = 5600.00
      • Set Slash_Lvl = (Level of Slash for Slash_TrigUnit)
      • Set Slash_DealingDamage = Slash_Damage[Slash_Lvl]
      • -------- --------------- Actions --------------- --------
      • For each (Integer TempInt) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set TempReal = (Facing of Slash_TrigUnit)
          • Set TempPoint = (Position of Slash_TrigUnit)
          • -------- --------------- Set Variables --------------- --------
          • Set TempPoint2 = (TempPoint offset by (100.00 x (Real(TempInt))) towards TempReal degrees)
          • Set TempUnitGroup = (Units within 225.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
          • Unit - Move Slash_TrigUnit instantly to TempPoint2
          • -------- --------------- Actions --------------- --------
          • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
            • Loop - Actions
              • Set TempPickedUnit = (Picked unit)
              • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set udg_TempPickedUnit = null
          • -------- --------------- Clear Leaks --------------- --------
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: call DestroyGroup(udg_TempUnitGroup)
          • Custom script: set udg_TempPoint = null
          • Custom script: set udg_TempPoint2 = null
          • Custom script: set udg_TempUnitGroup = null
      • Animation - Play Slash_TrigUnit's Attack Slam animation
 
Level 18
Joined
May 11, 2012
Messages
2,103
ya...
I removed the loop and I made for each part like this:
  • Slash
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slash
    • Actions
      • -------- --------------- Set Variables --------------- --------
      • Set Slash_TrigUnit = (Triggering unit)
      • Set TempReal = (Facing of Slash_TrigUnit)
      • Set Slash_Damage[1] = 350.00
      • Set Slash_Damage[2] = 700.00
      • Set Slash_Damage[3] = 1400.00
      • Set Slash_Damage[4] = 2800.00
      • Set Slash_Damage[5] = 5600.00
      • Set Slash_Lvl = (Level of Slash for Slash_TrigUnit)
      • Set Slash_DealingDamage = Slash_Damage[Slash_Lvl]
      • -------- --------------- Actions --------------- --------
      • Unit - Turn collision for Slash_TrigUnit Off
      • -------- --------------- --------------- --------------- Part 1 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 100.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • -------- --------------- --------------- --------------- Part 2 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • -------- --------------- --------------- --------------- Part 3 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • -------- --------------- --------------- --------------- Part 4 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • -------- --------------- --------------- --------------- Part 5 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • -------- --------------- --------------- --------------- Part 6 --------------- --------------- --------------- --------
      • -------- --------------- Set Variables --------------- --------
      • Set TempPoint = (Position of Slash_TrigUnit)
      • Set TempPoint2 = (TempPoint offset by 150.00 towards TempReal degrees)
      • Set TempUnitGroup = (Units within 175.00 of TempPoint2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Slash_TrigUnit)) Equal to True))))
      • -------- --------------- Actions --------------- --------
      • Unit - Move Slash_TrigUnit instantly to TempPoint2
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • Set TempPickedUnit = (Picked unit)
          • Unit - Cause Slash_TrigUnit to damage TempPickedUnit, dealing Slash_DealingDamage damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of TempPickedUnit using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: set udg_TempPickedUnit = null
      • -------- --------------- Clear Leaks --------------- --------
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: set udg_TempPoint = null
      • Custom script: set udg_TempPoint2 = null
      • Custom script: set udg_TempUnitGroup = null
      • Unit - Turn collision for Slash_TrigUnit On
Is it better now?
Now it works normally.
I know mana and cooldown doesn't triggers, I enabled ''Disable Other Abilities'' in channel spell and it's working
 
Level 18
Joined
May 11, 2012
Messages
2,103
yes I know, but here I am repeating the variables so I null'em after cleaning

Is that wrong maybe?
Can it screw up If I don't null at the end? (and I don't use again the vabs I nulled in that trigger before setting them again)
 
Status
Not open for further replies.
Top