• 🏆 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] Hashtable question

Status
Not open for further replies.
Level 9
Joined
Dec 6, 2007
Messages
233
So i've got these two triggers to spawn a dummy rocket. They use a hashtable timer so that the rockets spawn in salvo of 5 (btw other trigger make the rockets move, but those work for sure). The unit this is triggered for has a cooldown of 7, so it goes like this:

unit attacks

5 rockets spawn in a salvo of 1 per half second

cooldown for 4.5 sec

But, it doesn't appear the timer is working, because when the unit attacks another unit, the rockets start firing, but never stop firing. What is wrong with my triggers? triggers below.

  • hash
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Rocket_Salvo_Hash = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Attack_Target_Hash = (Last created hashtable)
  • rocket salvo hash
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Carrier
    • Actions
      • Unit Group - Add (Attacking unit) to Rocket_Salvo_Hash_Group
      • Hashtable - Save 5 as Rocket_Salvo_Key_Timer of (Key (Attacking unit)) in Rocket_Salvo_Hash
      • Hashtable - Save Handle Of(Attacked unit) as Attack_Target_Unit of (Key (Attacking unit)) in Attack_Target_Hash
      • Trigger - Turn on rocket salvo hashtimer <gen>
  • rocket salvo hashtimer
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Rocket_Salvo_Hash_Group and do (Actions)
        • Loop - Actions
          • Set Rocket_Salvo_Trigger_Unit = (Key (Picked unit))
          • Set Rocket_Salvo_Int = (Load Rocket_Salvo_Key_Timer of Rocket_Salvo_Trigger_Unit from Rocket_Salvo_Hash)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rocket_Salvo_Int Greater than 0
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Hashtable - Save (Rocket_Salvo_Int - 1) as Rocket_Salvo_Int of Rocket_Salvo_Trigger_Unit in Rocket_Salvo_Hash
              • Set Attack_Target_Loc = (Position of (Load Attack_Target_Unit of (Key (Picked unit)) in Attack_Target_Hash))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 1 (Red)
                • Then - Actions
                  • Set Shooter_Owner = Player 11 (Dark Green)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Equal to Player 2 (Blue)
                    • Then - Actions
                      • Set Shooter_Owner = Player 12 (Brown)
                    • Else - Actions
              • Set Rocket_Point1 = (Position of (Picked unit))
              • Set Rocket_Point3 = Attack_Target_Loc
              • Set Rocket_Point2 = (Rocket_Point1 offset by 0.00 towards ((Facing of (Picked unit)) + 90.00) degrees)
              • Unit - Create 1 Dummy Rocket for Shooter_Owner at Rocket_Point2 facing Rocket_Point3
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit Group - Add (Last created unit) to Rocket_Shell
              • Custom script: call RemoveLocation(udg_Rocket_Point2)
              • Custom script: call RemoveLocation(udg_Rocket_Point1)
              • Custom script: call RemoveLocation(udg_Rocket_Point3)
              • Trigger - Turn on rocket launcher shell <gen>
            • Else - Actions
              • Hashtable - Clear all child hashtables of child Rocket_Salvo_Trigger_Unit in Rocket_Salvo_Hash
              • Unit Group - Remove (Picked unit) from Rocket_Salvo_Hash_Group
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Rocket_Salvo_Hash_Group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
NOTE: the offset when setting Rocket_Point2 is for if i decide to change the spot on the unit the rocket is fired from

EDIT: and yell if there are any leaks, i've been having problems with lag
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
where is the turn on rocket laungher shell trigger?

as you mention about point2 I see no point in to change

I have no idea why it shouldnt stop shooting, if it were indexing, I would have seen it but as I'm a sucker at hashtable I can't figure out why it wont stop
 
Level 9
Joined
Dec 6, 2007
Messages
233
At least i'm not the only one confuzzled i guess

rocket launcher shell is my trigger for rocket movement, i'll post it in case it's something there, but i highly doubt it.

  • rocket launcher shell
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Rocket_Shell and do (Actions)
        • Loop - Actions
          • Set Rocket_Unit = (Picked unit)
          • Set Rocket_Point3 = (Position of Rocket_Unit)
          • Set Rocket_Path_Chooser = (Random real number between 0.00 and 6.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rocket_Path_Chooser Less than or equal to 1.00
            • Then - Actions
              • Set Rocket_Path = R_Path_1
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Rocket_Path_Chooser Greater than 1.00
                      • Rocket_Path_Chooser Less than or equal to 2.00
                • Then - Actions
                  • Set Rocket_Path = R_Path_2
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • Rocket_Path_Chooser Greater than 2.00
                          • Rocket_Path_Chooser Less than or equal to 3.00
                    • Then - Actions
                      • Set Rocket_Path = R_Path_3
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • Rocket_Path_Chooser Greater than 3.00
                              • Rocket_Path_Chooser Less than or equal to 4.00
                        • Then - Actions
                          • Set Rocket_Path = R_Path_4
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • Rocket_Path_Chooser Greater than 4.00
                                  • Rocket_Path_Chooser Less than or equal to 5.00
                            • Then - Actions
                              • Set Rocket_Path = R_Path_5
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • Rocket_Path_Chooser Greater than 5.00
                                      • Rocket_Path_Chooser Less than or equal to 6.00
                                • Then - Actions
                                  • Set Rocket_Path = R_Path_6
                                • Else - Actions
          • Set Rocket_Point4 = (Rocket_Point3 offset by 50.00 towards ((Facing of (Picked unit)) + (Random real number between -30.00 and 30.00)) degrees)
          • Unit - Move (Picked unit) instantly to Rocket_Point4
          • Set Rocket_Group = (Units within 50.00 of Rocket_Point4 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A peon-type unit) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of Rocket_Unit)) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Rocket_Group is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in Laser_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Laser_Unit to damage (Picked unit), dealing 75.00 damage of attack type Pierce and damage type Normal
              • Unit - Kill Rocket_Unit
              • Unit Group - Remove Rocket_Unit from Rocket_Shell
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Rocket_Shell is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_Rocket_Group)
          • Custom script: call RemoveLocation(udg_Rocket_Point3)
          • Custom script: call RemoveLocation(udg_Rocket_Point4)
Here is the test map in full. I'm just running through and making sure the systems work before i make full maps of this.

View attachment spacebattletest.w3x

EDIT: about the sheild triggers: they all work flawlessly, however, large battles with sheilds enabled causes a lot of lag. If you wish to try to figure out why, it would be a huge help
 
Last edited:
At least i'm not the only one confuzzled i guess

rocket launcher shell is my trigger for rocket movement, i'll post it in case it's something there, but i highly doubt it.

  • rocket launcher shell
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Rocket_Shell and do (Actions)
        • Loop - Actions
          • Set Rocket_Unit = (Picked unit)
          • Set Rocket_Point3 = (Position of Rocket_Unit)
          • Set Rocket_Path_Chooser = (Random real number between 0.00 and 6.00)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Rocket_Path_Chooser Less than or equal to 1.00
            • Then - Actions
              • Set Rocket_Path = R_Path_1
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Rocket_Path_Chooser Greater than 1.00
                      • Rocket_Path_Chooser Less than or equal to 2.00
                • Then - Actions
                  • Set Rocket_Path = R_Path_2
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • Rocket_Path_Chooser Greater than 2.00
                          • Rocket_Path_Chooser Less than or equal to 3.00
                    • Then - Actions
                      • Set Rocket_Path = R_Path_3
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • And - All (Conditions) are true
                            • Conditions
                              • Rocket_Path_Chooser Greater than 3.00
                              • Rocket_Path_Chooser Less than or equal to 4.00
                        • Then - Actions
                          • Set Rocket_Path = R_Path_4
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • And - All (Conditions) are true
                                • Conditions
                                  • Rocket_Path_Chooser Greater than 4.00
                                  • Rocket_Path_Chooser Less than or equal to 5.00
                            • Then - Actions
                              • Set Rocket_Path = R_Path_5
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • And - All (Conditions) are true
                                    • Conditions
                                      • Rocket_Path_Chooser Greater than 5.00
                                      • Rocket_Path_Chooser Less than or equal to 6.00
                                • Then - Actions
                                  • Set Rocket_Path = R_Path_6
                                • Else - Actions
          • Set Rocket_Point4 = (Rocket_Point3 offset by 50.00 towards ((Facing of (Picked unit)) + (Random real number between -30.00 and 30.00)) degrees)
          • Unit - Move (Picked unit) instantly to Rocket_Point4
          • Set Rocket_Group = (Units within 50.00 of Rocket_Point4 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A peon-type unit) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of Rocket_Unit)) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Rocket_Group is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in Laser_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Laser_Unit to damage (Picked unit), dealing 75.00 damage of attack type Pierce and damage type Normal
              • Unit - Kill Rocket_Unit
              • Unit Group - Remove Rocket_Unit from Rocket_Shell
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Rocket_Shell is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_Rocket_Group)
          • Custom script: call RemoveLocation(udg_Rocket_Point3)
          • Custom script: call RemoveLocation(udg_Rocket_Point4)
Here is the test map in full. I'm just running through and making sure the systems work before i make full maps of this.

View attachment 71951

EDIT: about the sheild triggers: they all work flawlessly, however, large battles with sheilds enabled causes a lot of lag. If you wish to try to figure out why, it would be a huge help

Dont destroy rocket_group because its a global, if you destroy it on first run you cannot use it again.....

and, if Rocket_Group is empty the trigger won't check if the rocket_shell is empty because you placed the rocket_shell check inside the actions done when Rocket_Group is not empty.... which will be always true after the first run because the group is destroyed....
 
Level 9
Joined
Dec 6, 2007
Messages
233
rocket_group isn't a global, i create it in that very trigger. It gets set every run as units within 50 of bla bla bla...

Rocket_Shell IS a global, it's the unit group for all rockets in existence. So just because Rocket_Group is dead doesn't mean Rocket_Shell is empty.

Anyways, the problem remains that my hashtable doesn't seem to be counting down.
 
Level 9
Joined
Dec 6, 2007
Messages
233
Yup, salvo works. Thanks, but now i have another kinda-hashtable related question. I'm working on a system for armor. The armor is like a second set of hitpoints, but stored in a hashtable, and represented by the charges remaining in an item. Before you ask why not just give the unit more hitpoints instead of armor, i have some stuff planned that damages internal systems like engines and weapons when the ship loses hitpoints. Armour would be a way for the ship to take physical damage while protecting those systems, and it allows for a greater division of labor among ships.

The amount of armor is accurately represented in the inventory by the charges, but when the unit receives damage from a shell, the damage isn't correctly absorbed by the armor (in fact, armor is ignored completely). Here are the armor triggers, along with the trigger that includes shell damage:


  • cannon shell
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Cannon_Shell and do (Actions)
        • Loop - Actions
          • Set Cannon_Unit = (Picked unit)
          • Set Cannon_Point3 = (Position of Cannon_Unit)
          • Set Cannon_Point4 = (Cannon_Point3 offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Cannon_Point4
          • Set Cannon_Group = (Units within 75.00 of Cannon_Point4 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A peon-type unit) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of Cannon_Unit)) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Cannon_Unit is alive) Equal to True
              • (Cannon_Group is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in Cannon_Group and do (Actions)
                • Loop - Actions
                  • Set Temp_Unit = (Picked unit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key armorvalue) of (Key Temp_Unit) from armorhash) Greater than or equal to 75.00
                    • Then - Actions
                      • Hashtable - Save ((Load (Key armorvalue) of (Key Temp_Unit) from armorhash) - 75) as (Key armorvalue) of (Key Temp_Unit) in armorhash
                    • Else - Actions
                      • Unit - Cause Cannon_Unit to damage Temp_Unit, dealing (75.00 - (Load (Key armorvalue) of (Key Temp_Unit) from armorhash)) damage of attack type Spells and damage type Normal
                      • Hashtable - Save 0.00 as (Key armorvalue) of (Key Temp_Unit) in armorhash[/COLOR]
              • Unit - Kill Cannon_Unit
              • Unit Group - Remove Cannon_Unit from Cannon_Shell
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Cannon_Shell is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_Cannon_Group)
          • Custom script: call RemoveLocation(udg_Cannon_Point3)
          • Custom script: call RemoveLocation(udg_Cannon_Point4)
  • armordisplay
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in armorgroup and do (Actions)
        • Loop - Actions
          • Item - Set charges remaining in (Item carried by (Picked unit) in slot 1) to ((Load (Key armorvalue) of (Key (Picked unit)) from armorhash) / 10)
  • removal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in armorhash
Any ideas why the armor is being ignored?
 
Level 9
Joined
Dec 6, 2007
Messages
233
still same thing, here is the new trigger

  • cannon shell
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Cannon_Shell and do (Actions)
        • Loop - Actions
          • Set Cannon_Unit = (Picked unit)
          • Set Cannon_Point3 = (Position of Cannon_Unit)
          • Set Cannon_Point4 = (Cannon_Point3 offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Cannon_Point4
          • Set Cannon_Group = (Units within 75.00 of Cannon_Point4 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A sapper) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of Cannon_Unit)) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Cannon_Unit is alive) Equal to True
              • (Cannon_Group is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in Cannon_Group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key armorvalue) of (Key (Picked unit)) from armorhash) Greater than or equal to 75.00
                    • Then - Actions
                      • Hashtable - Save ((Load (Key armorvalue) of (Key (Picked unit)) from armorhash) - 75) as (Key armorvalue) of (Key (Picked unit)) in armorhash
                    • Else - Actions
                      • Unit - Cause Cannon_Unit to damage (Picked unit), dealing (75.00 - (Load (Key armorvalue) of (Key (Picked unit)) from armorhash)) damage of attack type Spells and damage type Normal
                      • Hashtable - Save 0.00 as (Key armorvalue) of (Key (Picked unit)) in armorhash
              • Unit - Kill Cannon_Unit
              • Unit Group - Remove Cannon_Unit from Cannon_Shell
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Cannon_Shell is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_Cannon_Group)
          • Custom script: call RemoveLocation(udg_Cannon_Point3)
          • Custom script: call RemoveLocation(udg_Cannon_Point4)
EDIT: oops, i now realize i forgot a trigger in my previous post, here it is:

  • armorhash
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set nonarmorgroup = (Units in (Playable map area) matching ((((Matching unit) is in armorgroup) Equal to False) and (((Matching unit) is A sapper) Equal to False)))
      • Unit Group - Pick every unit in nonarmorgroup and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to armorgroup
          • Set Temp_Unit_Loc = (Position of (Picked unit))
          • Item - Create Armor at Temp_Unit_Loc
          • Unit - Order (Picked unit) to Right-Click (Last created item)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Frigate
            • Then - Actions
              • Hashtable - Save 500 as (Key armorvalue) of (Key (Picked unit)) in armorhash
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Carrier
                • Then - Actions
                  • Hashtable - Save 750 as (Key armorvalue) of (Key (Picked unit)) in armorhash
                • Else - Actions
      • Custom script: call DestroyGroup(udg_nonarmorgroup)
      • Custom script: call RemoveLocation(udg_Temp_Unit_Loc)
 
Level 9
Joined
Dec 6, 2007
Messages
233
if that was true the units would never receive damage. The units are damaged as if the armor isn't there, and the armorvalue never drops, the trigger never even sets it to zero like it should. Am i screwing up the save to armorvalue line?
 
Level 9
Joined
Dec 6, 2007
Messages
233
mmk, i got the armor to absorb damage, but it never dies now. New trigger:

  • cannon shell
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Cannon_Shell and do (Actions)
        • Loop - Actions
          • Set Cannon_Unit = (Picked unit)
          • Set Cannon_Point3 = (Position of Cannon_Unit)
          • Set Cannon_Point4 = (Cannon_Point3 offset by 100.00 towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to Cannon_Point4
          • Set Cannon_Group = (Units within 75.00 of Cannon_Point4 matching (((((Matching unit) is alive) Equal to True) and (((Matching unit) is A sapper) Equal to False)) and (((Owner of (Matching unit)) is an enemy of (Owner of Cannon_Unit)) Equal to True)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Cannon_Unit is alive) Equal to True
              • (Cannon_Group is empty) Equal to False
            • Then - Actions
              • Unit Group - Pick every unit in Cannon_Group and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load (Key armorvalue) of (Key (Picked unit)) from armorhash) Greater than or equal to 75.00
                    • Then - Actions
                      • Hashtable - Save ((Load (Key armorvalue) of (Key (Picked unit)) from armorhash) - 75) as (Key armorvalue) of (Key (Picked unit)) in armorhash
                    • Else - Actions
                      • Unit - Cause Cannon_Unit to damage (Picked unit), dealing (75.00 - (Real((Load (Key armorvalue) of (Key (Picked unit)) from armorhash)))) damage of attack type Spells and damage type Normal
                      • Hashtable - Save 0.00 as (Key armorvalue) of (Key (Picked unit)) in armorhash
              • Unit - Kill Cannon_Unit
              • Unit Group - Remove Cannon_Unit from Cannon_Shell
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Cannon_Shell is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
          • Custom script: call DestroyGroup(udg_Cannon_Group)
          • Custom script: call RemoveLocation(udg_Cannon_Point3)
          • Custom script: call RemoveLocation(udg_Cannon_Point4)
 
Level 9
Joined
Dec 6, 2007
Messages
233
i'm confused on whats a real number and whats an integer, i know hashtables are all integers, but every thing else i don't know the difference. This map is my first experiment with hashtables and complex triggers, so bear with me throughout my confusions. Thanks for the help :D
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • If - Conditions
    • (Load (Key armorvalue) of (Key (Picked unit)) from armorhash) Greater than or equal to 75.00
  • Then - Actions
    • Hashtable - Save ((Load (Key armorvalue) of (Key (Picked unit)) from armorhash) - 75) as (Key armorvalue) of (Key (Picked unit)) in armorhash

75.00 is real, 75 is integer. You saved the armor value as an integer if I remember correctly, then you compare it to real value, and things go wrong.
 
Status
Not open for further replies.
Top