• 🏆 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!

[Trigger] Need to check

Status
Not open for further replies.
Level 8
Joined
May 9, 2010
Messages
266
Hello guys! I am learning MUI using hash-tables this time but dont sure that make everything correctly.
I have created test map that contains 2 easy spells using hash-tables. Plzzz check it=)

  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to На цель
  • Actions
  • Set STH_Duration = 5.00
  • Set STH_hps = (20.00 x 0.04)
  • Set STH_Caster = (Triggering unit)
  • Set STH_Target = (Target unit of ability being cast)
  • Set STH_CL = (Position of STH_Caster)
  • Set STH_TL = (Position of STH_Target)
  • Lightning - Destroy (Load 7 of (Key (Target unit of ability being cast)) in STH_hash)
  • Lightning - Create a Drain Life lightning effect from source STH_CL to target STH_TL
  • Custom script: set udg_YOURKEY = GetHandleId(udg_STH_Target)
  • Hashtable - Save STH_Duration as 1 of YOURKEY in STH_hash
  • Hashtable - Save STH_hps as 2 of YOURKEY in STH_hash
  • Hashtable - Save Handle OfSTH_Caster as 3 of YOURKEY in STH_hash
  • Hashtable - Save Handle OfSTH_Target as 4 of YOURKEY in STH_hash
  • Hashtable - Save Handle OfSTH_CL as 5 of YOURKEY in STH_hash
  • Hashtable - Save Handle OfSTH_TL as 6 of YOURKEY in STH_hash
  • Hashtable - Save Handle Of(Last created lightning effect) as 7 of YOURKEY in STH_hash
  • -------- ------------------------------------------------------------------------------------------------------------ --------
  • -------- ------------------------------------------------------------------------------------------------------------ --------
  • Unit - Set (Triggering unit) movement speed to (0.50 x (Current movement speed of (Triggering unit)))
  • Unit - Turn collision for (Target unit of ability being cast) Off
  • Unit Group - Add (Target unit of ability being cast) to STH_group
  • Custom script: call RemoveLocation(udg_STH_CL)
  • Custom script: call RemoveLocation(udg_STH_TL)
Thanks to jakeZinc for the triggers.
 

Attachments

  • HASHTABLE.w3x
    22.8 KB · Views: 33
Last edited:
However I have one specific question. For example this is a spell on a point and I set Target point of ability being cast to a variable. Then load this variable to hash-table. Buy if I try to remove point after loading(using call RemoveLocation()), spell doesnt work correctly. What should I do?

Just keep it until you are finished with the spell. Whenever you load it from the hashtable, it isn't creating a new location. It is just pointing to the same location you stored before.

After you are done using it completely (as in, the spell is finished), just load it from the hashtable and remove it.
 
Level 8
Joined
May 9, 2010
Messages
266
Just keep it until you are finished with the spell. Whenever you load it from the hashtable, it isn't creating a new location. It is just pointing to the same location you stored before.

After you are done using it completely (as in, the spell is finished), just load it from the hashtable and remove it.

oh, thanks, I have understood this.
+rep
 
Level 8
Joined
May 9, 2010
Messages
266
Status
Not open for further replies.
Top