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

Hurl Meteor v1.2

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Hurl Meteor
By Vitchie08


  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hastable - Create a hashtable
      • Set Hastable = (Last created hashtable)
  • Hurl Meteor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hurl Meteor
    • Actions
      • Set HM_Caster = (Triggering unit)
      • Set HM_owner = (Owner of HM_Caster)
      • Set HM_StartPoint = (Position of HM_Caster)
      • Set HM_EndPoint = (Target point of ability being cast)
      • Set HM_Speed = 20.00
      • Set HM_Facing = (Angle from HM_StartPoint to HM_EndPoint)
      • Set HM_CasterAbilityLevel = (Level of Hurl Meteor for HM_Caster)
      • Unit - Create 1 Dummy for HM_owner at HM_StartPoint facing HM_Facing degrees
      • Unit Group - Add (Last created unit) to HM_Dummies
      • Unit - Set level of Dummy Ability for (Last created unit) to HM_CasterAbilityLevel
      • Set HM_MissilePoint = Position of (Last created unit))
      • Set HM_Damage[1] = 150
      • Set HM_Damage[2] = 300
      • Set HM_Damage[3] = 450
      • Hashtable - Save HM_Facing as 0 of (Key(Last created unit)) in Hashtable
      • Hashtable - Save Handle OfHM_MissilePoint as 1 of (Key(Last created unit)) in Hashtable
      • Hashtable - Save Handle OfHM_owner as 1 of (Key(Last created unit)) in Hashtable
      • Trigger - Turn on Hurl Move <gen>
      • Custom script: call RemoveLocation(udg_HM_StartPoint)
      • Custom script: call RemoveLocation(udg_HM_EndPoint)
  • Hurl Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HM_Dummies and do (Actions)
        • Loop - Actions
          • Set HM_Load1 = (Load 0 of (Key (Picked unit)) from Hashtable)
          • Set HM_Load2 = (Load 1 of (Key (Picked unit)) in Hashtable
          • Set HM_Load3 = (Load 2 of (Key (Picked unit)) in Hashtable
          • Set HM_AbilityLevel = (Level of Dummy Ability for (Picked unit))
          • Set HM_Missile = (Picked unit)
          • Set HM_DummyPosition = (Position of HM_Missile)
          • Set HM_DummyOffset = (HM_DummyPosition offset by HM_Speed towards HM_Load 1 degrees)
          • Set HM_KBPick = (Units within 120 of HM_Dummy Position matching ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of HM_Load3) Equal to True) and ((((Matching unit)is alive) Equal to True))))
          • Unit - Move (Picked unit) instantly to HM_DummyOffset
          • If (All Conditions are True) the do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between HM_Load2 and HM_DummyPosition) Greater that of equal to 800.00
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit Group - Remove (Picked unit) from HM_Dummies
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
            • Else - Actions
          • Unit Group - Pick every unit in (Random 1 units from HM_KBPick) and do (Actions)
            • Loop - Actions
              • Unit - Cause HM_Missile to damage (Picked unit), dealing (Real(HM_Damage[HM_AbilityLevel])) damage of attack type Hero and damage type Magic
              • Unit - Kill HM_Missile
              • Unit Group - Remove HM_Missile from HM_Dummies
              • Set KB_I = (KB_I + 1)
              • Set KB_Speed[KB_I] = 10.00
              • Set KB_Reduce_Speed[Kb_I] = 0.00
              • Set KB_TargetPosition = (Position of (Picked unit))
              • Set KB_Facing[KB_I] = (Angle from HM_DummyPosition to KB_TargetPosition)
              • Unit - Set custom value of (Picked unit) to KB_I
              • Unit Group - Add (Picked unit) to KB_Group
              • Trigger - Turn on HM Simple Knock <gen>
              • Custom script: call RemoveLocation(udg_KB_TargetPosition)
          • Custom script: call RemoveLocation(udg_HM_DummyPosition)
          • Custom script: call RemoveLocation(udg_HM_DummyOffset)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in HM_Dummies) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • HM Simple Knock
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in KB_Group and do (Actions)
        • Set KB_CustomVal = (Custom value of (Picked unit))
        • Set KB_Reduce_Speed[KB_CustomVal] = (KB_Reduce_Speed[KB_CustomVal] + 0.01)
        • Set KB_Speed[KB_CustomVal] = (KB_Speed[KB_CustomVal] - KB_Reduce_Speed[KB_CustomVal])
        • Set KB_KnockPosition = (Position of (Picked unit))
        • Set KB_KnockOffset = (KB_KnockPosition offset by KB_Speed[KB_CustomVal] towards KB_Facing[KB_CustomVal] degrees)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KB_Speed[KB_CustomVal] Greater than 0.00
        • Then - Actions
          • Unit - Move (Picked unit) instantly to KB_KnockOffset
          • Special Effect - Create a special effect at KB_KnockPosition using Abilities\Weapons\AncientProtectorMissile.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Hashtable - Clear all child hashtables of child (Key (Picked unit) in Hashtable
          • Unit Group - Remove (Picked unit) from KB_Group
        • Custom script: call RemoveLocation(udg_KB_KnockPosition)
        • Custom script: call RemoveLocation(udg_KB_KnockOffset)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Number of units in KB_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • Hurl HashChild Remove
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Dummy
    • Actions
      • Hashtable - Clear all child hashtable of child (Key (Dying unit) in Hashtable

  • Hashtable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ---------------- --------
      • -------- Hashtable --------
      • -------- ---------------- --------
      • Hastable - Create a hashtable
      • Set Hastable = (Last created hashtable)
      • -------- ---------------- --------
      • -------- Configurable --------
      • -------- ---------------- --------
      • -------- ---------------- --------
      • -------- Damage --------
      • -------- ---------------- --------
      • Set HM_Damage[1] = 150
      • Set HM_Damage[2] = 300
      • Set HM_Damage[3] = 450
      • -------- ---------------- --------
      • -------- Speed ---------
      • -------- ---------------- --------
      • -------- This Sets the Missile Speed --------
      • Set HM_Speed = 20.00
      • -------- This Sets the KnockBack Speed --------
      • Set KB_Real_Speed = 15.00
      • -------- This Variable Reduce the KnockBack Speed --------
      • -------- ---------------- --------
      • -------- Animation Size --------
      • -------- ---------------- --------
      • -------- 100 means 1 and 1 is the default size for units --------
      • Set HM_Animated_Size = 100
      • -------- 7 means .07 will add to your missile size --------
      • Set HM_Animated_Size_Increase = 7.00
      • -------- ---------------- --------
      • ----------- Area of Effect --------
      • -------- ---------------- --------
      • Set HM_Real_Area = 100
      • -------- ---------------- --------
      • -------- Max Distance --------
      • -------- ---------------- --------
      • -------- This sets how far your missile run --------
      • Set Max_Distance = 800.00
  • Hurl Meteor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hurl Meteor
    • Actions
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
      • Set HM_Anim_I = (HM_Anim_I + 1)
      • Set HM_Caster = (Triggering unit)
      • Set HM_owner = (Owner of HM_Caster)
      • Set HM_StartPoint = (Position of HM_Caster)
      • Set HM_EndPoint = (Target point of ability being cast)
      • Set HM_Facing = (Angle from HM_StartPoint to HM_EndPoint)
      • Set HM_CasterAbilityLevel = (Level of Hurl Meteor for HM_Caster)
      • Unit - Create 1 Dummy for HM_owner at HM_StartPoint facing HM_Facing degrees
      • Unit Group - Add (Last created unit) to HM_Dummies
      • Unit - Set level of Dummy Ability for (Last created unit) to HM_CasterAbilityLevel
      • Set HM_Animation_Sizer[HM_Anim_I] = HM_Animated_Size
      • Set HM_Area[HM_Anim_I] = HM_Real_Area
      • Animation - Change (Last created unit)'s size to (HM_Animated_Size%,HM_Animated_Size%,HM_Animated_Size%) of its original size
      • Set HM_MissilePoint = Position of (Last created unit))
      • Hashtable - Save HM_Facing as 0 of (Key(Last created unit)) in Hashtable
      • Hashtable - Save Handle OfHM_MissilePoint as 1 of (Key(Last created unit)) in Hashtable
      • Hashtable - Save Handle OfHM_owner as 1 of (Key(Last created unit)) in Hashtable
      • Trigger - Turn on Hurl Move <gen>
      • Custom script: call RemoveLocation(udg_HM_StartPoint)
      • Custom script: call RemoveLocation(udg_HM_EndPoint)
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
  • Hurl Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
      • Unit Group - Pick every unit in HM_Dummies and do (Actions)
        • Loop - Actions
          • Set HM_DumVal = (Custom value of (Picked unit))
          • Set HM_Load1 = (Load 0 of (Key (Picked unit)) from Hashtable)
          • -------- ---------------- --------
          • Set HM_Load2 = (Load 1 of (Key (Picked unit)) in Hashtable
          • -------- ---------------- --------
          • Set HM_Load3 = (Load 2 of (Key (Picked unit)) in Hashtable
          • -------- ---------------- --------
          • Set HM_AbilityLevel = (Level of Dummy Ability for (Picked unit))
          • Set HM_Missile = (Picked unit)
          • Set HM_DummyPosition = (Position of HM_Missile)
          • Set HM_DummyOffset = (HM_DummyPosition offset by HM_Speed towards HM_Load 1 degrees)
          • Set HM_Area[HM_DumVal] = (HM_Area[HM_DumVal] + 1.00)
          • Set HM_KBPick = (Units within HM_Area[HM_DumVal] of HM_Dummy Position matching ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) belongs to an enemy of HM_Load3) Equal to True) and ((((Matching unit)is alive) Equal to True))))
          • Unit - Move (Picked unit) instantly to HM_DummyOffset
          • Set HM_Animation_Sizer[HM_DumVal] = (HM_Animation_Sizer[HM_DumVal] + HM_Animated_Size_Increase)
          • Animation - Change (Picked unit)'s size to (HM_Animation_Sizer%,HM_Animation_Sizer%,HM_Animation_Sizer%) of its original size
          • If (All Conditions are True) the do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between HM_Load2 and HM_DummyPosition) Greater that of equal to 800.00
            • Then - Actions
              • Unit - Kill (Picked unit)
              • Unit Group - Remove (Picked unit) from HM_Dummies
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Hashtable
            • Else - Actions
          • Unit Group - Pick every unit in (HM_KBPick) and do (Actions)
            • Loop - Actions
              • Custom script : set udg_KB_Picked_Unit = FirstOfGroup(udg_HM_KBPick) = Added
              • Unit - Cause HM_Missile to damage (KB_Picked_Unit), dealing (Real(HM_Damage[HM_AbilityLevel])) damage of attack type Hero and damage type Magic
              • Unit - Kill HM_Missile
              • Unit Group - Remove HM_Missile from HM_Dummies
              • Set KB_I = (KB_I + 1)
              • Set KB_Speed[KB_I] = KB_Real_Speed
              • Set KB_Reduce_Speed[Kb_I] = KB_Real_Speed_Reduce
              • Set KB_TargetPosition = (Position of KB_Picked_Unit)
              • Set KB_Facing[KB_I] = (Angle from HM_DummyPosition to KB_TargetPosition)
              • Unit - Set custom value of KB_Picked_Unit to KB_I
              • Unit Group - Add KB_Picked_Unit to KB_Group
              • Trigger - Turn on HM Simple Knock <gen>
              • Custom script: call RemoveLocation(udg_KB_TargetPosition)
          • Custom script: call RemoveLocation(udg_HM_DummyPosition)
          • Custom script: call RemoveLocation(udg_HM_DummyOffset)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in HM_Dummies) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
  • HM Simple Knock
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
      • Unit Group - Pick every unit in KB_Group and do (Actions)
        • Set KB_CustomVal = (Custom value of (Picked unit))
        • Set KB_Reduce_Speed[KB_CustomVal] = (KB_Reduce_Speed[KB_CustomVal] + KB_Reduce_Speed[KB_CustomVal])
        • Set KB_Speed[KB_CustomVal] = (KB_Speed[KB_CustomVal] - KB_Reduce_Speed[KB_CustomVal])
        • Set KB_KnockPosition = (Position of (Picked unit))
        • Set KB_KnockOffset = (KB_KnockPosition offset by KB_Speed[KB_CustomVal] towards KB_Facing[KB_CustomVal] degrees)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KB_Speed[KB_CustomVal] Greater than 0.00
        • Then - Actions
          • Unit - Move (Picked unit) instantly to KB_KnockOffset
          • Special Effect - Create a special effect at KB_KnockPosition using Abilities\Weapons\AncientProtectorMissile.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Hashtable - Clear all child hashtables of child (Key (Picked unit) in Hashtable
          • Unit Group - Remove (Picked unit) from KB_Group
        • Custom script: call RemoveLocation(udg_KB_KnockPosition)
        • Custom script: call RemoveLocation(udg_KB_KnockOffset)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Number of units in KB_Group) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • -------- -------------------------------------------- --------
      • -------- DO NOT CHANGE ANYTHING HERE !! --------
      • -------- -------------------------------------------- --------
  • Hurl HashChild Remove
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Dummy
    • Actions
      • Hashtable - Clear all child hashtable of child (Key (Dying unit) in Hashtable

Hurl Meteor v1
  • Initial Release
Hurl Meteor v1.2
  • Fixed Unconfigurable Variables
  • Add increasing size and area of pick or effect
  • Group Leak Fixed
    Later
    • Unit Group - Pick every unit in (Random 1 units from HM_KBPick) and do (Actions)
    Now
    • Unit Group - Pick every unit in HM_KBPick and do (Actions)
  • Add
    • Custom script: set udg_KB_Picked_Unit = FirstOfGroup(udg_HM_KBPick)
    to Hurl Move trigger

Please Give a Credit!

Keywords:
Hurl
Contents

Hurl Meteor By Vitchie08 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long as NeedsFix. Rejected. 00:51, 25th Oct 2012 Magtheridon96: The modification of custom values is totally bad. Custom values are global data for a unit, meaning that if a user implements this system into his...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long as NeedsFix. Rejected.

00:51, 25th Oct 2012
Magtheridon96:

  • The modification of custom values is totally bad. Custom values are global data for a unit, meaning that if a user implements this system into his map, he can never use custom values for anything, or use any other resource that uses custom values. This is why people use UnitIndexers. UnitIndexers assign unique indexes for units and store them as the custom value so you can use that index for data storage in arrays. Check out Bribe's GUI UnitIndexer. It will set the custom values of units to unique ids so that you can attach data to a unit. Unit Indexers are the ONLY resources allowed to modify the custom value of a unit.
  • Simply increasing an index by 1 in order to assign a unique id isn't good because of the array index limit. In order to pull of good indexing, you should probably take a look at Hanky's Dynamic Indexing Template.
  • You can get rid of this:
    Custom script: set udg_KB_Picked_Unit = FirstOfGroup(udg_HM_KBPick)
    And just use (Picked unit). Apparently, you were initially getting a random unit from a group that you were iterating over. If you're iterating over a group, you're going to run code for every single unit in this group. If you want to do this for only one unit in the group, you shouldn't be picking, you should just be setting the unit variable using the line of code I gave you and then using it as a random unit from the group.

    Actually, I see your mistake now. Get rid of the "Pick every unit in ()" line, and just set the KB_Picked_Unit variable to FirstOfGroup(udg_HM_KBPick), then do the actions you were doing inside the group loop to this unit. Currently, it appears that your code is looping over the group and doing actions for the same unit depending on how many units are in the HM_KBPick group.

Note: I have updated the review.
 
Replace all possible unit selectors with (triggering unit) when applicable, i.e. (dying unit)

Avoid the use of custom values, shouldn't be too significant of an issue but it's still bad practice and -could - on occasion cause issues

you only need one loop and it should run every 0.03 seconds, not 0.02

  • Unit Group - Pick every unit in (Random 1 units from HM_KBPick) and do (Actions)
Why use a random unit and not just all when they're in a close enough proximity? will almost always give only 1 unit return anyway. Also you need to put this in a variable and clear it or use bjWantDestroyGroup()

  • Set HM_Damage[1] = 150
If you're going to use constant values - this should be in the configuration trigger or "hashtable" as you call it, although that name is Ambiguous and shouldn't really be used for a trigger

Using co-ordinates rather than locations would also heavily improve this
 
Top