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

[Trigger] Cleaning hashtable bugs

Status
Not open for further replies.
Level 10
Joined
Sep 21, 2007
Messages
517
alright guys, basically this is what i did:
  • Unit Group - Pick every unit in AB_DmgGroup and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load AB_i[2] of (Key (Picked unit)) from AB_HT) Not equal to 1
        • Then - Actions
          • Hashtable - Save 1 as AB_i[2] of (Key (Picked unit)) in AB_HT
          • Unit - Cause AB_Axe[AB_i[2]] to damage (Picked unit), dealing AB_SpellDmgPercent[AB_i[2]] damage of attack type AB_AttackType and damage type Normal
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using AB_DeathSFX
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
pretend this is a group of units, of which when i hit them once, i stop hitting them, dealing a fixed amount of damage. as you can see i saved integer 1 as an index id attached to the unit being attacked. After this i just clear the child AB_i[2] but it doesnt seem to work correctly, im having some bugs i believe, any advice?
 
Level 10
Joined
Sep 21, 2007
Messages
517
heh its not one static group, im using arrays for this ^^ but its good idea bro, and its not a one time thing, its something dynamic, i tried using groups but in another way but it bugged, it worked, but not as an array with the index number, only when it wasnt MUI, so i used hashtables, and there are few errors ^^ Thanks for your suggestion!
tho its not a one time thing :p roflmao i deleted the spell anyways,

btw the methods i use was: put unit into unit group [ current index] if unit not in that group then damage and put in, else nothing (it worked for one group, but as a group array it bugged on me :/
and hashtables attaching an integer to a handle, atleast this one works fr the first time, and bugs a bit after roflmao

The wonders and magic of GUI!
Im pretty sure htere isnt anything else to do for this in terms of arrays, hashtables or loops with waits not working properly really proved to me that GUI is really... not suitable for higher level coding u know? Gotta stick to stuff like ur simple spell pack ;) I think when blizz fixes hashtables and makes it not crash then maybe il continue using jass for higher level stuff xD
 
Status
Not open for further replies.
Top