• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Death Grip (Hero Ability) 1.07

This is my version of the Death Grip spell from WoW

Features:

-Damages the target based in the percentage of it's current life (configurable)
-Grips the target and the aplies the damage over the time it is being moved
-Fully configurable (damage, final "distance" between caster and target, effect used and duration via the Config Trigger)
-Can be easily installed in your map (one CnP of the trigger category and one CnP of the ability)

  • DG Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Creating the Hashtable --------
      • Hashtable - Create a hashtable
      • Set HashGrip = (Last created hashtable)
      • -------- Set the Total Damage for each level of the ability --------
      • Set DG_Damage[1] = 0.15
      • Set DG_Damage[2] = 0.30
      • Set DG_Damage[3] = 0.45
      • -------- Casting Time --------
      • Set DG_CastingTime = 1.35
      • -------- Set Effects to be used --------
      • Set DG_TargetEffect = Abilities\Spells\Undead\DarkSummoning\DarkSummonMissile.mdl
      • Set DG_Attach_Target = chest
      • -------- Set Collision of the Caster --------
      • Set DG_Collision = 125.00
      • -------- Set the used Ability --------
      • Set DGAbility = Death Grip
  • DG Target
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DGAbility
    • Actions
      • -------- Turn on the loop --------
      • Trigger - Turn on DG Loop <gen>
      • -------- Setting variables --------
      • Set DG_Caster = (Triggering unit)
      • Set DG_Target = (Target unit of ability being cast)
      • Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)
      • Set DGPoint1 = (Position of DG_Caster)
      • Set DGPoint2 = (Position of DG_Target)
      • Set DG_Angle = (Angle from DGPoint2 to DGPoint1)
      • Set DG_Timer = DG_CastingTime
      • Set DG_CurrentDist = (((Distance between DGPoint1 and DGPoint2) - DG_Collision) x (0.03 / DG_Timer))
      • Set DG_Life = (Life of DG_Target)
      • Set DGDamageLoop = ((DG_Life x DG_Damage[(Level of DGAbility for DG_Caster)]) / (DG_CastingTime / 0.03))
      • -------- Check if Unit is already with Special Effect, if not, create the special effect --------
      • If ((3 is stored as a Handle of DGTargetKey in HashGrip) Equal to True) then do (-------- Do Nothing --------) else do (Special Effect - Create a special effect attached to the DG_Attach_Target of DG_Target using DG_TargetEffect)
      • -------- Removing Leaks --------
      • Custom script: call RemoveLocation(udg_DGPoint1)
      • Custom script: call RemoveLocation(udg_DGPoint2)
      • -------- Saving values in the Hashtable --------
      • Hashtable - Save DG_Angle as 0 of DGTargetKey in HashGrip
      • Hashtable - Save DG_CurrentDist as 1 of DGTargetKey in HashGrip
      • Hashtable - Save DG_Timer as 2 of DGTargetKey in HashGrip
      • Hashtable - Save Handle Of(Last created special effect) as 3 of DGTargetKey in HashGrip
      • Hashtable - Save DGDamageLoop as 4 of DGTargetKey in HashGrip
      • Hashtable - Save Handle OfDG_Caster as 5 of DGTargetKey in HashGrip
      • -------- Add the target to the unit group --------
      • Unit Group - Add DG_Target to DG_Group
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • Set DG_Target = (Picked unit)
          • Custom script: set udg_DGTargetKey = GetHandleId(udg_DG_Target)
          • -------- Load values from the Hashtable --------
          • Set DG_Timer = (Load 2 of DGTargetKey from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of (Load 5 of DGTargetKey in HashGrip)) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • Set DGPoint1 = (Position of DG_Target)
              • Set DGPoint2 = (DGPoint1 offset by (Load 1 of DGTargetKey from HashGrip) towards (Load 0 of DGTargetKey from HashGrip) degrees)
              • Unit - Move DG_Target instantly to DGPoint2
              • Custom script: call RemoveLocation(udg_DGPoint1)
              • Custom script: call RemoveLocation(udg_DGPoint2)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of DGTargetKey in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DG_Target to ((Life of DG_Target) - (Load 4 of DGTargetKey from HashGrip))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Special Effect - Destroy (Load 3 of DGTargetKey in HashGrip)
              • Hashtable - Clear all child hashtables of child DGTargetKey in HashGrip
              • Unit Group - Remove DG_Target from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
The trigger above is initially off and is turned on while the spell is "working".




If you use the ability I used on the map, maybe you must enter the "DG Configuration" trigger and do this:

  • -------- Set the used Ability --------
  • Set DGAbility = Death Grip
I think that's all guys. Feedback, constructive criticism and help is welcome.



1.00 - Uploaded
1.01a - Fixed an action that was calculating the damage the wrong way
1.01b - Turned on the instructions in the test map
1.02 - Stored (Picked Unit) into a variable in the Loop trigger
1.03a - Fixed an issue that was calculating the damage using the wrong value
1.03b - Removed leak in Loop trigger
1.03c - The Loop trigger now is turned off when the unit group is empty
1.03d - The effect leak is fixed (now you can cast twice in the same unit)
1.04 - Polished the triggers
1.04a - Polished the triggers
1.04b - Polished the Triggers
1.04c - Fixed Loop trigger
1.05 - Polished Triggers
1.05a - Polished Triggers
1.06 - Remade the movement action, removed variables from the loop and stored damage and handle of caster in the hashtable
1.06a - Polished the triggers :)
1.06b - Polished the triggers...
1.07 - Effect is no longer removed and created again, removed useless variables, changed the icon (now icon has disabled variation), hashtable is now created in the configuration trigger. The location variable is now in the right place, inside the "then" actions, in the loop...


Credits:

- Maker (for great tips and a good review (preview))
- Forsaken (for giving me the idea and requesting this via PM, and review)
- deathismyfriend (for great tips on the triggers)

Fell free to change the icon and the values to fit your map.

Give credits if you use/edit this spell.

Keywords:
Death Knight, Death, Grip, Knockback, Movement, DoT, Damage, Damage Over Time, Undead, WOW, World of Warcraft.
Contents

Death Grip by Laercio (Map)

Reviews
Death Grip 1.06b | Reviewed by Maker | 23rd Jul 2013 APPROVED A useful spell Instead of destroying/recreating the effect, don't destroy the effect and don't create an new one Don't set temp point in the looping...

Moderator

M

Moderator


Death Grip 1.06b | Reviewed by Maker | 23rd Jul 2013
APPROVED


126248-albums6177-picture66521.png


  • A useful spell
126248-albums6177-picture66523.png


  • Instead of destroying/recreating the effect,
    don't destroy the effect and don't create an new one
  • Don't set temp point in the looping trigger if you don't need it
  • You don't need four point variables for the spell,
    only two
  • Create the hashtable in DG Configuration and delete Create HashGrip
  • The ability is missing disabled version of the icon
[tr]



Death Grip (Hero Ability) 1.05a | Reviewed by Maker | 30th Jun 2013
NEEDS FIX


126248-albums6177-picture66522.png


  • You leak the offset point when you move a unit
  • You set a point and instantly remove it in the looping trigger
    without doing anything with the point
126248-albums6177-picture66523.png


  • Don't set variables if you don't need them, in the looping
  • Store the damage in the cast trigger
    trigger
[tr]
 
Level 6
Joined
Nov 12, 2012
Messages
153
is death grip like wow death grip?

nice idea

Thank you, but I'm not the first to make one, I just made a version with three levels for myself, to use as a hero ability (not ultimate)...

It may be a bit (or a lot) different from the WoW death grip, but I think it will suffice...

-It is not MUI, if you cast the spell on the same unit, the effect leaks and stays there forever
-You leak a location in the looping trigger
-Turn the trigger off when the unit group is empty, don't turn it on in the looping trigger

-The effect does not leak anymore
-Moved the custom script down to remove the location after moving the unit and then set the second location to be removed as well (if it is wrong, tell me)
-Now the loop trigger turns off when unit group is empty

Let me know if I'm missing something yet...

Thank you...

I want vJASS :D :D
If you can ;) ;)[
+ REPT

Sorry, I'm a GUI user, I have not yet learned vJass ;P

But thanks anyway

to learn how to do MUI u can use the method i use called indexed arrays. check out my tutorial things a GUIer should know. the chapter called how to index.

Whoa, I just readed your post after the 1.03 update, but thanks anyway...
I know the indexing and I know that it is a lot easier to use (I'm talking about bribe's) arrays, but I just wanted to do it the hard way ;P

Thank you, I'll read your tutorial now (or maybe later, you know, its 1:05 am here :p)
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
-Only check if the group is empty when removing a unit from it
-You don't need a variable for the special effect, Destroy load 3... and you can save last created special effect
-The proper way to destroy the effect is first to check if it exists, Boolean - Hashtable value exists. 3 is saved as a handle
 
Level 6
Joined
Nov 12, 2012
Messages
153
this isnt needed.
  • Set DGTempPoint = (Position of DGTempUnit)
  • Custom script: call RemoveLocation(udg_DGTempPoint)
this leaks change it to the variable u set right above it.
  • Unit - Move DGTempUnit instantly to ((Position of DGTempUnit) offset by DG_CurrentDist towards DG_Angle degrees)

Whoa, I haven't noticed that... I'll change it... Thank you...
 
Level 6
Joined
Nov 12, 2012
Messages
153
Set DGTempPoint = (Position of DGTempUnit)
Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)


Here you need to set another point for the polar offset, because this leaks

That position is destroyed with each loop, as the position of the unit (the point you are speaking of) is set before the movement and is destroyed with each loop (every 0.03 seconds) . I think the leak in this point does not exists, but thanks anyway... :)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
That position is destroyed with each loop, as the position of the unit (the point you are speaking of) is set before the movement and is destroyed with each loop (every 0.03 seconds) . I think the leak in this point does not exists, but thanks anyway... :)

no he is correct. this specifically leaks.
  • (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
whenever u offset it creates a new point/location which leaks.
 
Level 6
Joined
Nov 12, 2012
Messages
153
no he is correct. this specifically leaks.
  • (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
whenever u offset it creates a new point/location which leaks.

At first I removed both locations inside the loop, and that was like removing the same location twice (the first time being as the offset location and the second time as the first location), them you came and said it was not necessary, that made sense to me, since the unit location was removed with each loop.

Now what would really make sense is to remove the position of the unit in the "Else" actions of the loop...

As I see now, I am removing the current position/location of the unit and, as that action creates a second location (the offset location), that second location is removed when the trigger "loops" and, when the spell is done, the final location is removed too.

But as I am learning how to make spells, I may be wrong tough... Let me now if I am (or if you did not understand what I said above)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
ur storing picked unit in the wrong way.

change this
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • -------- Load values from the Hashtable --------
          • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
          • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
          • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
          • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of DG_Caster) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • Set DGTempUnit = (Picked unit)
              • Set DGTempPoint = (Position of DGTempUnit)
              • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
              • Custom script: call RemoveLocation(udg_DGTempPoint)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Set DGTempPoint = (Position of (Picked unit))
              • Custom script: call RemoveLocation(udg_DGTempPoint)
              • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
              • Special Effect - Destroy DG_Target_Effect
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
              • Unit Group - Remove (Picked unit) from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
to this and change every picked unit to the temp unit variable
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • Set DGTempUnit = (Picked unit)
          • Set DGTempPoint = (Position of DGTempUnit)
          • -------- Load values from the Hashtable --------
          • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
          • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
          • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
          • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of DG_Caster) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • -------- fix the line under this --------
              • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
              • Special Effect - Destroy DG_Target_Effect
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
              • Unit Group - Remove (Picked unit) from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
          • Custom script: call RemoveLocation(udg_DGTempPoint)
also use the variable u have set above these. and use that variable
  • Hashtable - Save DG_Angle as 0 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_CurrentDist as 1 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_Timer as 2 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save Handle Of(Last created special effect) as 3 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_Life as 4 of (Key (Target unit of ability being cast)) in HashGrip
 
Level 6
Joined
Nov 12, 2012
Messages
153
ur storing picked unit in the wrong way.

change this
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • -------- Load values from the Hashtable --------
          • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
          • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
          • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
          • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of DG_Caster) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • Set DGTempUnit = (Picked unit)
              • Set DGTempPoint = (Position of DGTempUnit)
              • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
              • Custom script: call RemoveLocation(udg_DGTempPoint)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Set DGTempPoint = (Position of (Picked unit))
              • Custom script: call RemoveLocation(udg_DGTempPoint)
              • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
              • Special Effect - Destroy DG_Target_Effect
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
              • Unit Group - Remove (Picked unit) from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
to this and change every picked unit to the temp unit variable
  • DG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DG_Group and do (Actions)
        • Loop - Actions
          • Set DGTempUnit = (Picked unit)
          • Set DGTempPoint = (Position of DGTempUnit)
          • -------- Load values from the Hashtable --------
          • Set DG_Angle = (Load 0 of (Key (Picked unit)) from HashGrip)
          • Set DG_CurrentDist = (Load 1 of (Key (Picked unit)) from HashGrip)
          • Set DG_Timer = (Load 2 of (Key (Picked unit)) from HashGrip)
          • Set DG_Life = (Load 4 of (Key (Picked unit)) from HashGrip)
          • -------- ----------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DG_Timer Greater than 0.00
              • (Life of DG_Caster) Greater than 0.00
            • Then - Actions
              • -------- Moving unit --------
              • -------- fix the line under this --------
              • Unit - Move DGTempUnit instantly to (DGTempPoint offset by DG_CurrentDist towards DG_Angle degrees)
              • -------- Decrease Timer for the movement of the unit --------
              • Hashtable - Save (DG_Timer - 0.03) as 2 of (Key (Picked unit)) in HashGrip
              • -------- Apply the damage on the unit --------
              • Unit - Set life of DGTempUnit to ((Life of DGTempUnit) - ((DG_Life x DG_Damage[(Level of Death Grip for DG_Caster)]) / (DG_CastingTime / 0.03)))
            • Else - Actions
              • -------- When the spell is done, clear the values... --------
              • Set DG_Target_Effect = (Load 3 of (Key (Picked unit)) in HashGrip)
              • Special Effect - Destroy DG_Target_Effect
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in HashGrip
              • Unit Group - Remove (Picked unit) from DG_Group
              • -------- This actions checks if the unit group is empty and turns off the trigger if that case --------
              • If ((DG_Group is empty) Equal to True) then do (Trigger - Turn off (This trigger)) else do (-------- Do Nothing :) --------)
          • Custom script: call RemoveLocation(udg_DGTempPoint)
also use the variable u have set above these. and use that variable
  • Hashtable - Save DG_Angle as 0 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_CurrentDist as 1 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_Timer as 2 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save Handle Of(Last created special effect) as 3 of (Key (Target unit of ability being cast)) in HashGrip
  • Hashtable - Save DG_Life as 4 of (Key (Target unit of ability being cast)) in HashGrip

Now I understood (I'm a bit slow, is midnight here, I'm very tired rsrs)

I'm gonna change that right now :)

Edit: About the variable to use on saving the hashtable, it was not a handle, it was a unit variable used to set the angle. But setting a handle/variable is really more efficient, thanks for pointing that...

Edit Edit: I'm going pretty bad... next time I'll make a spell using an index ;-P
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
u should use the variable u set picked unit to in this rather than picked unit again.

  • Set DGTempUnit = (Picked unit)
  • Set DGTempPoint = (Position of DGTempUnit)
  • Set DGTarget = (Key (Picked unit))
and change this one also
  • Set DG_Target = (Target unit of ability being cast)
  • Set DGTarget = (Key (Target unit of ability being cast))
 
Level 6
Joined
Nov 12, 2012
Messages
153
u should use the variable u set picked unit to in this rather than picked unit again.

  • Set DGTempUnit = (Picked unit)
  • Set DGTempPoint = (Position of DGTempUnit)
  • Set DGTarget = (Key (Picked unit))
and change this one also
  • Set DG_Target = (Target unit of ability being cast)
  • Set DGTarget = (Key (Target unit of ability being cast))

I used the DG_Target (Unit variable) instead of DGTempUnit (Unit Variable) as I used in the "Cast" Trigger now. (That's what I understood, I may be wrong)

I also changed the name of the variable DGTarget (Integer variable) to DGTargetKey (IntegerVariable), so it will not be confusing anymore :)

Thanks...
 
Level 6
Joined
Nov 12, 2012
Messages
153
u didnt update wat i said in my last post

  • Set DG_Target = (Picked unit)
  • Set DGTempPoint = (Position of DG_Target)
  • Set DGTargetKey = (Key (Picked unit))
If you are talking about this section:
DG_Target is a unit variable I use in the loop
DGTempPoint is a point variable used to remove a leak
DGTargetKey is an integer used to load the values in the hashtable (as you recommended)

How can I set DGTargetKey = (Key DG_Target), if DG_Target is not a handle variable? To do that I would have to create a handle variable and set it to (Picked Unit), as well as setting the DG_Target (unit variable) to the same (Picked Unit)

Why should I set a variable to a handle that is used only once per loop? (I may be wrong also, I'm asking because I still don't know how to do what you pointed in the present situation)
 
Last edited:
Level 6
Joined
Nov 12, 2012
Messages
153
u can change this
  • Set DG_Target = (Picked unit)
  • Set DGTempPoint = (Position of DG_Target)
  • Set DGTargetKey = (Key (Picked unit))
to this
  • Set DG_Target = (Picked unit)
  • Set DGTempPoint = (Position of DG_Target)
  • Set DGTargetKey = (Key DG_Target)

Thanks... Changes were made in the last update.

Since I couldn't find a way of setting that variable in GUI, I used a custom script and it worked (Maker told me to use that). Thank you very much for your help, it really helped me improve this...
 
Top