• 🏆 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 D.O.T. A.O.E. bug

Status
Not open for further replies.
Level 10
Joined
Feb 20, 2008
Messages
448
D.O.T. A.O.E. bug [HASHTABLE]

i am new 2 hashtable i read tutorial but i think its miss few things so im bugged here!!

im tryng to do a damage over time into a aoe of the caster when he cast thunder clap.... but nothing going on

edit : i think i set some key wrong

p.s.yes i did created hashtable in the int



  • DOT AOE
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DOT AOE
    • Actions
      • -------- here we prepare variable to be add in hashtable --------
      • Set Trigger_Unit = (Triggering unit)
      • Set DOT_Dmg = 2000.00
      • Set DOT_AOE = 400.00
      • Set DOT_Duration = 10.00
      • Set DOT_PointTrigger = (Position of Trigger_Unit)
      • Set DamageOverTimeUnits = (Units within 600.00 of DOT_PointTrigger matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Trigger_Unit)) Equal to True)))
      • Unit Group - Pick every unit in DamageOverTimeUnits and do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle OfTrigger_Unit as (Key unit) of (Key (Picked unit)) in DamageOverTime
          • Unit Group - Add (Picked unit) to DamageOverTimeUnits
      • -------- BELOW we are storing variable in hashtable :) --------
      • Hashtable - Save DOT_AOE as (Key aoe) of (Key (Picked unit)) in DamageOverTime
      • Hashtable - Save DOT_Dmg as (Key damage) of (Key (Picked unit)) in DamageOverTime
      • -------- Store the duration in the Hashtable under the Picked unit's Handle ID --------
      • Hashtable - Save DOT_Duration as 0 of (Key (Picked unit)) in DamageOverTime
      • -------- - --------
      • -------- removing leak location becuz its useless --------
      • Custom script: call RemoveLocation(udg_DOT_PointTrigger)
      • Custom script: call DestroyGroup(udg_DamageOverTimeUnits)
  • DOT AOE loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set DamageOverTimeUnits = (Load (Key group) of (Key (Picked unit)) in DamageOverTime)
      • Unit Group - Pick every unit in DamageOverTimeUnits and do (Actions)
        • Loop - Actions
          • Set Trigger_Unit = (Load (Key unit) of (Key (Picked unit)) in DamageOverTime)
          • Set DOT_AOE = (Load (Key aoe) of (Key (Picked unit)) from DamageOverTime)
          • Set DOT_Dmg = (Load (Key damage) of (Key (Picked unit)) from DamageOverTime)
          • -------- Get the remaining time in seconds --------
          • Set RemainingTime = (Load 0 of (Key (Picked unit)) from DamageOverTime)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RemainingTime Greater than 0.00
            • Then - Actions
              • -------- Heal the unit and update the time remaining --------
              • Hashtable - Save (RemainingTime - 1.00) as 0 of (Key (Picked unit)) in DamageOverTime
              • Unit - Cause Trigger_Unit to damage (Picked unit), dealing DOT_Dmg damage of attack type Spells and damage type Magic
            • Else - Actions
              • -------- The healing is done, clean up --------
              • Unit Group - Remove (Picked unit) from DamageOverTimeUnits
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in DamageOverTime
 
Last edited:
Level 9
Joined
May 9, 2009
Messages
536
youve made it so that it only targets allies of the casting unit. for DamageOverTimeUnits variable, make it a unit that belongs to an enemy of the casting unit that way your allies are not targeted, only the enemy.

Problem: DamageOverTimeUnits selects allies only
 
Level 4
Joined
Apr 23, 2009
Messages
65
The problem is that when you save your hastables you do not have a picked unit but sitll use the picked unit function. And when you load the DamageOverTimeUnits you also do not have a picked unit. You would be better off adding all the enemy units in range to a unit group.Then pick that unit group and save the variables with "picked unit" as the handle key. Then in the DOT AOE Loop trigger you pick every unit in that group and do actions. When the action is complete set the time to w/e. If remaining time is 0 then remove the unit from the group.
 
Level 10
Joined
Feb 20, 2008
Messages
448
There are no bugs with hashtables, please name your topic better next time. All that "This function bugs, this too" topics are really annoying, because in 99% of them its the users fault.

if i wrote hashtable in topics that was 2 explain the type of code i use!! and DOT mean damage over time with area of effect where the meaning from AOE!

and if they really no bugg in hashtable tell me why my WE crash when i select unit pool!!

plz stay on the main idea of this thread, so my code dont work, sometime poeple do answer on topic, becuz i also dont want other types of code instead of hashtable!

i did edited trigger and updated it nothing worked any idea i think some key are wrong but idk!!
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
In the first trigger:

  • Set Temp_Group_1 = Units within 600...
  • Pick every unit in Temp_Group
    • Loop
      • Save hashtable thingies, use <picked unit> as the key, not <triggering unit>
      • Add <picked unit> to unit group
Remove unit group leak too.

Second trigger:

The latter "Pick every unit..." is useless. You don't need that location. Use <picked unit> instead of <triggering unit>.
 
  • Hashtable - Save DOT_AOE as (Key aoe) of (Key (Picked unit)) in DamageOverTime
  • Hashtable - Save DOT_Dmg as (Key damage) of (Key (Picked unit)) in DamageOverTime
  • -------- Store the duration in the Hashtable under the Picked unit's Handle ID --------
  • Hashtable - Save DOT_Duration as 0 of (Key (Picked unit)) in DamageOverTime
There is no picked unit at that point.
 
Level 10
Joined
Feb 20, 2008
Messages
448
  • Hashtable - Save DOT_AOE as (Key aoe) of (Key (Picked unit)) in DamageOverTime
  • Hashtable - Save DOT_Dmg as (Key damage) of (Key (Picked unit)) in DamageOverTime
  • -------- Store the duration in the Hashtable under the Picked unit's Handle ID --------
  • Hashtable - Save DOT_Duration as 0 of (Key (Picked unit)) in DamageOverTime
There is no picked unit at that point.

so should i change them key for Target unit ?
 
Status
Not open for further replies.
Top