• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Hashtable Help

Status
Not open for further replies.
Level 6
Joined
Jul 24, 2008
Messages
180
Alright so i started using hashtables 3 days ago and i've had minor success. This trigger worked originally with variables, but it could only be done once at a time. I attempted to make it MUI with hashtables today and it doesn't work any more.

This trigger is supposed to identify the variables and start the following triggers.

  • Pyre
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to Pyre
  • Actions
    • Unit Group - Add (Target unit of ability being cast) to PyreUnits
    • Unit Group - Pick every unit in PyreUnits and do (Actions)
      • Loop - Actions
        • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key unit) of (Key (Picked unit)) in Pyretable
        • Hashtable - Save Handle OfNo unit as (Key target) of (Key (Picked unit)) in Pyretable
        • Hashtable - Save 0 as (Key orb angle) of (Key (Picked unit)) in Pyretable
        • Hashtable - Save 0 as (Key timer) of (Key (Picked unit)) in Pyretable
        • Hashtable - Save 0.00 as (Key angle) of (Key (Picked unit)) in Pyretable
        • Hashtable - Save 0.00 as (Key distance) of (Key (Picked unit)) in Pyretable
    • Trigger - Turn on Pyre Revolve <gen>
This trigger should make orbs circle the target until the effect wears off or it is attacked.

  • Pyre Revolve
  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • Unit Group - Pick every unit in PyreUnits and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Load (Key timer) of (Key (Picked unit)) from Pyretable) Equal to ((Level of Pyre for WizardActive) x 6)
          • Then - Actions
            • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key unit) of (Key (Picked unit)) in Pyretable
            • Hashtable - Save 0 as (Key orb angle) of (Key (Picked unit)) in Pyretable
            • Hashtable - Save 0 as (Key timer) of (Key (Picked unit)) in Pyretable
            • Trigger - Turn off (This trigger)
          • Else - Actions
            • Hashtable - Save ((Load (Key timer) of (Key (Picked unit)) from Pyretable) + (1 / 10)) as (Key timer) of (Key (Picked unit)) in Pyretable
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Load (Key orb angle) of (Key (Picked unit)) from Pyretable) Equal to 324
              • Then - Actions
                • Hashtable - Save 0 as (Key orb angle) of (Key (Picked unit)) in Pyretable
              • Else - Actions
                • Hashtable - Save ((Load (Key orb angle) of (Key (Picked unit)) from Pyretable) + 36) as (Key orb angle) of (Key (Picked unit)) in Pyretable
    • Special Effect - Create a special effect at ((Position of (Load (Key unit) of (Key (Picked unit)) in Pyretable)) offset by 50.00 towards (Real((Load (Key orb angle) of (Key (Picked unit)) from Pyretable))) degrees) using Abilities\Weapons\LordofFlameMissile\LordofFlameMissile.mdl
    • Special Effect - Destroy (Last created special effect)
The next trigger identifies the target and runs the last trigger.

  • Pyre Move
  • Actions
    • Unit - A unit Is attacked
  • Conditions
  • Events
    • Unit Group - Pick every unit in PyreUnits and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Attacked unit) Equal to (Load (Key unit) of (Key (Picked unit)) in Pyretable)
          • Then - Actions
            • Unit - Remove Pyre buff from (Load (Key unit) of (Key (Picked unit)) in Pyretable)
            • Hashtable - Save 0 as (Key orb angle) of (Key (Picked unit)) in Pyretable
            • Hashtable - Save Handle Of(Attacking unit) as (Key target) of (Key (Picked unit)) in Pyretable
            • Hashtable - Save Handle Of(Position of (Load (Key unit) of (Key (Picked unit)) in Pyretable)) as (Key fire location) of (Key (Picked unit)) in Pyretable
            • Trigger - Turn off (This trigger)
            • Trigger - Turn off Pyre Revolve <gen>
            • Trigger - Turn on Pyre Move Attack <gen>
          • Else - Actions
            • Do nothing
This last trigger should create a wall of fire at the buffed unit that will follow the attacker indefinitely (If it runs from it, the wall will follow). When the fire contacts the unit, it will explode dealing AoE damage.

  • Pyre Move Attack
  • Actions
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Events
    • Unit Group - Pick every unit in PyreUnits and do (Actions)
      • Loop - Actions
        • Hashtable - Save (Distance between (Load (Key fire location) of (Key (Picked unit)) in Pyretable) and (Position of (Load (Key target) of (Key (Picked unit)) in Pyretable))) as (Key distance) of (Key (Picked unit)) in (Last created hashtable)
        • Hashtable - Save (Angle from (Load (Key fire location) of (Key (Picked unit)) in Pyretable) to (Position of (Load (Key target) of (Key (Picked unit)) in Pyretable))) as (Key angle) of (Key (Picked unit)) in (Last created hashtable)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Load (Key distance) of (Key (Picked unit)) from Pyretable) Less than or equal to 10.00
          • Then - Actions
            • Hashtable - Save Handle OfNo unit as (Key target) of (Key (Picked unit)) in Pyretable
            • Hashtable - Save 0.00 as (Key angle) of (Key (Picked unit)) in (Last created hashtable)
            • Hashtable - Save 0.00 as (Key distance) of (Key (Picked unit)) in (Last created hashtable)
            • Special Effect - Create a special effect at (Load (Key fire location) of (Key (Picked unit)) in Pyretable) using war3mapImported\ExplosionBIG.mdx
            • Unit - Cause WizardActive to damage circular area after 0.00 seconds of radius 200.00 at (Load (Key fire location) of (Key (Picked unit)) in Pyretable), dealing (Real(((Level of Pyre for WizardActive) x 125))) damage of attack type Siege and damage type Fire
            • Special Effect - Destroy (Last created special effect)
            • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Pyretable
            • Trigger - Turn on Pyre Move <gen>
            • Trigger - Turn off (This trigger)
          • Else - Actions
            • Hashtable - Save Handle Of((Load (Key fire location) of (Key (Picked unit)) in Pyretable) offset by 10.00 towards (Load (Key angle) of (Key (Picked unit)) from Pyretable) degrees) as (Key fire location) of (Key (Picked unit)) in Pyretable
            • Special Effect - Create a special effect at (Load (Key fire location) of (Key (Picked unit)) in Pyretable) using war3mapImported\flames&smoke.MDX
            • Unit - Cause WizardActive to damage circular area after 0.00 seconds of radius 50.00 at (Load (Key fire location) of (Key (Picked unit)) in Pyretable), dealing (Real(((Level of Pyre for WizardActive) x 25))) damage of attack type Spells and damage type Fire
            • Special Effect - Destroy (Last created special effect)
Is there anything critical I've left out? Or is it not possible to do this with hashtables?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
This is hurting my brain, I have no idea what your triggers are supposed to do (and I always use hashtables nowadays).
The first trigger looks messed up to me, but please.. tell me what it's supposed to do first.

I could derive this from your post:
You target a unit, the targetted unit will get orbs circling around him until either the effect wears off or the unit is attacked.
Uhmm... a wall of fire is also created, don't know why, when or what it does.

It's probably possible with hashtables, but... I just can't understand what you are doing in the first trigger xD

(you add the targetted unit to a unit group, you pick all units inside that group, resetting everything and saving the targetted unit for the picked unit...).
 
Level 6
Joined
Jul 24, 2008
Messages
180
Sorry. I add it to group so I can call the Picked Unit's handle to isolate it and change the values (Each unit should have distance, angle, targets, etc.). I reset the values in beginning so I can change them later. The wall is for effect+damage to units in it. Pyre Revolve and Pyre Move Attack are initially off.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Hashtable - Save Handle OfNo unit as (Key target) of (Key (Picked unit)) in Pyretable
I'm fairly sure this doesn't work.

If the unit has a previous unit save as target, this won't change it.

What I did with my own spell was that I wanted to set the target to no unit after certain event. I used that same piece of code, but it didn't work. Then I just saved the original caster as the target, and created a condition that checked that the target is not the caster.

This kills the Death Knight for example, even though I save "no unit" after it. No unit is basically null, it doesn't do anything.

  • Untitled Trigger 099
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in Region 016 <gen>) and do (Actions)
        • Loop - Actions
          • Hashtable - Save Handle OfDeath Knight 0178 <gen> as (Key target) of (Key (Picked unit)) in _Hash
          • Hashtable - Save Handle OfNo unit as (Key target) of (Key (Picked unit)) in _Hash
      • Unit Group - Pick every unit in (Units in Region 016 <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Load (Key target) of (Key (Picked unit)) in _Hash)
In the second trigger you use this:
  • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key unit)
but there's no "Target unit of ability being cast".

I didn't check the rest of the triggers.
 
Status
Not open for further replies.
Top