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

Hashtable doesn't work for me...

Status
Not open for further replies.
Level 2
Joined
Jun 27, 2011
Messages
6
...Posting error

Hello everyone. I'm making a MUI spell, and i really need to save the location of the casting in a unique variable, so i created a hashtable and saved it using the unit's handle ID, but when i load it, it's pointing the center of playable map area... This is the only thing i need to fix to complete my spell, so any help will be appreciated.

Here is the all the code:
  • Inferno
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inferno
    • Actions
      • Set TempLocation = (Target point of ability being cast)
      • Hashtable - Save Handle OfTempLocation as 0 of (Key (Triggering unit)) in InfHas
      • Unit Group - Add (Triggering unit) to INFCaster
      • Trigger - Turn on InfernoEff <gen>
      • Wait 0.80 seconds
      • Unit Group - Remove (Triggering unit) from INFCaster
  • InfernoEff
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in INFCaster and do (Actions)
        • Loop - Actions
          • Set TempLocation = (Position of (Picked unit))
          • Set Temploc2 = ((Load 0 of (Key (Picked unit)) in InfHas) offset by 300.00 towards ((Facing of (Picked unit)) + (Random real number between -45.00 and 45.00)) degrees)
          • Unit - Create 1 DummyFireball for (Owner of (Picked unit)) at TempLocation facing Temploc2
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit Group - Add (Last created unit) to INFgroup
          • Trigger - Turn on InfernoLoop2 <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in INFCaster) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • InfernoLoop
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in INFgroup and do (Actions)
        • Loop - Actions
          • Set TempLocation = ((Position of (Picked unit)) offset by 56.25 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to TempLocation, facing (Facing of (Picked unit)) degrees
          • Set TempLocation = (Position of (Picked unit))
          • Set TempUnitGroup = (Units within 150.00 of TempLocation matching ((((Owner of (Picked unit)) is an enemy of (Owner of (Matching unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempUnitGroup) Not equal to 0
            • Then - Actions
              • Set TempUnit = (Picked unit)
              • Unit Group - Remove (Picked unit) from INFgroup
              • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
                • Loop - Actions
                  • Set tempreal = 151.00
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between (Position of TempUnit) and (Position of (Picked unit))) Less than tempreal
                    • Then - Actions
                      • Set tempreal = (Distance between (Position of TempUnit) and (Position of (Picked unit)))
                      • Set TempUnit2 = (Picked unit)
                    • Else - Actions
                  • Unit - Cause TempUnit to damage TempUnit2, dealing 10.00 damage of attack type Spells and damage type Magic
              • Unit - Kill (Picked unit)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in INFgroup) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Thanks
PD: Sorry for my poor english.
 
Last edited by a moderator:
Level 2
Joined
Jun 27, 2011
Messages
6
wow i thought that simply creating the variable was enough... So a hashtable must be created and asigned to the variable. Thank you.
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
You really dont need the wait 0.8, coz you can loop it by saving the 0.8 to the hash and load/reduce it in the loop...

sample:
- save the 0.8 in the hash
- load it by a real variable in the loop
- make an if/then/else condition
- if REAL is greater than zero then reduce it via...
"call SaveReal(udg_InfHas, GetHandleId(GetEnumUnit()), 1, REAL - 0.04)" <<< this uses custom script
- after it reaches zero then that's the time to remove the picked unit from the group, then off the trigger

Making MUI spells contains ZERO waits...
 
Status
Not open for further replies.
Top