• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] HashTable stack system problem!!!

Status
Not open for further replies.
Level 5
Joined
Nov 17, 2010
Messages
28
Hello people, I'm new hash tables, and I have no idea todabia quite complex on I can do.

On this map I want to make a system of accumulation, but as you can see is bugged and no longer hurt.

:vw_sad:

PLEASE HELPME


  • Attack
    • Events
      • Unit - A unit is attacked
    • Conditions
      • ((Attacking unit) is in (Units owned by Player 1 (red))) Equal to True
    • Actions
      • Set Attacking = (Attacking unit)
      • Set Attacked = (Attacked unit)
      • Set Damage = 2.00 in Set
      • Special Effect - Create a special effect attached to the chest of (Attacked unit) using Abilities\Spells\Other\BreathOfFire\BreathOfFireDamage.mdl
      • Set Effect = (Last created special effect)
      • Set Time = 0.00
      • Set Boolean = True
      • Set Attacks = (Attacks + 1)
      • Hash table - Save Handle OfAttacking as 0 of (Key (Attacked unit)) in HashTable
      • Hash table - Save Handle OfAttacked as 1 of (Key (Attacked unit)) in HashTable
      • Hash table - Save Damage as 2 of (Key (Attacked unit)) in HashTable
      • Hash table - Save as OfEffect Handle 3 of (Key (Attacked unit)) in HashTable
      • Hash table - Save Time as 4 of (Key (Attacked unit)) in HashTable
      • Hash table - Save Boolean as 5 of (Key (Attacked unit)) in HashTable
      • Hash table - Save Attacks as 6 of (Key (Attacked unit)) in HashTable
      • If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
        • If: Conditions
          • (Group is empty) Equal to True
        • Then: Actions
          • Trigger - Turn on Damage <gen>
        • Other: Actions
      • Unit Group - Add to Group Attacked
  • Damage
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick Every unit in Group and do (Actions)
        • Loop: Actions
          • Set Attacking = (Load 0 of (Key (Picked unit)) in HashTable)
          • Set Attacked = (Load 1 of (Key (Picked unit)) in HashTable)
          • Set Damage = (Load 2 of (Key (Picked unit)) from HashTable)
          • Set Effect = (Load 3 of (Key (Picked unit)) in HashTable)
          • Set Time = (Load 4 of (Key (Picked unit)) from HashTable)
          • Set Boolean = (Load 5 of (Key (Picked unit)) from HashTable)
          • Set Attacks = (Load 6 of (Key (Picked unit)) from HashTable)
          • If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
            • If: Conditions
              • Time Less than 5.00
            • Then: Actions
              • Set Time = (Time + 1.00)
              • Unit - Cause Attacked Attacking to damage, dealing (Damage x (Real (Attacks))) damage "type of attack HÃ © roe and Damage type Normal
            • Other: Actions
              • Special Effect - Destroy Effect
              • Unit Group - Remove from Group Attacked
      • If (All Conditions Are True) then do (Then Actions) else do (Else Actions)
        • If: Conditions
          • (Group is empty) Equal to True
        • Then: Actions
          • Trigger - Turn off (This trigger)
        • Other: Actions


:vw_wtf:
 

Attachments

  • test.w3x
    10.5 KB · Views: 67
Level 37
Joined
Mar 6, 2006
Messages
9,243
I improved it a bit:

*Now there can be only one special effect on a unit
*Flushes the child hashtable
*Doesn't save the unit for itself. There's no need, the attacked is the picked unit.
*Only loads the effect when neede. The separete load action is still unnecessary, it could be combined with the destroy action.
*Correctly updates the time
*Moved the group empty -check to correct place

http://www.hiveworkshop.com/forums/pastebin.php?id=svo3iv
 
Status
Not open for further replies.
Top