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

Hashtable Query

Status
Not open for further replies.
Level 7
Joined
Jul 20, 2009
Messages
295
I got a query about how to load hashtable values of a casting unit from a dummy unit.

Idea:
Once a unit begins channeling, save name of ability being cast, save caster and target, Create a dummy which dies after 3 seconds.
After dummy dies, If ability name is Cure then Heal target by 12xIntelligence of Caster.
  • Start Casting
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Not equal to Status
    • Actions
      • Set hashunit = (Triggering unit)
      • Custom script: set udg_handle = udg_hashunit
      • Hashtable - Save (Name of (Ability being cast)) as 0 of (Key handle) in Hashtable
      • Hashtable - Save Handle Of(Triggering unit) as 0 of (Key handle) in Hashtable
      • Hashtable - Save Handle Of(Target unit of ability being cast) as 1 of (Key handle) in Hashtable
      • Unit - Create 1 Wisp [Casting] for (Owner of (Triggering unit)) at TempLocation2 facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempLocation)
      • Custom script: call RemoveLocation(udg_TempLocation2)
  • Spell Effect
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Wisp [Casting]
    • Actions
      • -------- Check if Ability is Cure --------
      • -------- Then --------
      • Unit - Set life of Target to ((Life of Target) + (12.00 x (Real((Intelligence of Caster (Include bonuses))))))
      • -------- Else --------
      • -------- (Do nothing) --------
If there is a shortcut to this, please let me know.
 
Level 7
Joined
Jul 20, 2009
Messages
295
You should use the wisp as the handle unit, not the caster Since every wisp will be unique.

However you should try to make this without the wisp, or is the wisp needed for some effect?

The wisp is used as a timer in my real trigger, where his expiration timer is 0.1 s.
Yes, I'm using some effect which changes every 0.1 second.
Hmm, Maybe I should use the Event-Every 0.1 second? and add the caster to some group?

Edit:
What I'm doing is trying to convert from variables to hashtable and it seems a bit confusing but i'll try to get used to it with the help of you guys.
Imma try to fiddle with hashtable and see how it goes. If I find any problem I'll post it here, thanks. ^^
 
Status
Not open for further replies.
Top