• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Triggers messing with each other

Status
Not open for further replies.
Level 9
Joined
Dec 6, 2007
Messages
233
So i have these 3 triggers

  • Set lev
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Leviathan
    • Actions
      • Hashtable - Save Handle Of(Summoning unit) as Leviathan_Unit of (Key (Summoned unit)) in Leviathan_Hash
      • Set Temp_Loc = ((Position of (Summoning unit)) offset by 500.00 towards 0.00 degrees)
      • Unit - Move (Summoned unit) instantly to Temp_Loc
      • Unit Group - Add (Summoned unit) to Leviathan_Unit_Group
      • Unit - Create 1 Leviathan Cannon for (Owner of (Triggering unit)) at Temp_Loc facing Default building facing degrees
      • Hashtable - Save Handle Of(Last created unit) as Leviathan_Cannon of (Key (Picked unit)) in Leviathan_Hash
      • Custom script: call RemoveLocation(udg_Temp_Loc)
  • Leviathan movement
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Leviathan_Unit_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Custom value of (Summoned unit)) Equal to 360
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to 1
            • Else - Actions
              • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
          • Set Temp_Unit_Loc = (Position of (Load Leviathan_Unit of (Key (Picked unit)) in Leviathan_Hash))
          • Set Temp_Unit_Loc2 = (Temp_Unit_Loc offset by 600.00 towards (Real((Custom value of (Picked unit)))) degrees)
          • Set Temp_Unit = (Picked unit)
          • Custom script: call SetUnitX(udg_Temp_Unit, GetLocationX(udg_Temp_Unit_Loc2))
          • Custom script: call SetUnitY(udg_Temp_Unit, GetLocationY(udg_Temp_Unit_Loc2))
          • Unit - Make (Picked unit) face ((Real((Custom value of (Picked unit)))) + 90.00) over 0.00 seconds
          • Custom script: call RemoveLocation(udg_Temp_Unit_Loc)
          • Custom script: call RemoveLocation(udg_Temp_Unit_Loc2)
  • Leviathan cannon
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Leviathan_Unit_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit_Loc3 = (Position of (Picked unit))
          • Set Temp_Unit2 = (Load Leviathan_Cannon of (Key (Picked unit)) in Leviathan_Hash)
          • Custom script: call SetUnitX(udg_Temp_Unit2, GetLocationX(udg_Temp_Unit_Loc3))
          • Custom script: call SetUnitY(udg_Temp_Unit2, GetLocationY(udg_Temp_Unit_Loc3))
          • Custom script: call RemoveLocation(udg_Temp_Unit_Loc3)

For some odd reason, when the third trigger is active, the second one spazzes out and Leviathan shoots off the map. Any ideas how trigger #3 is messing with trigger #2?

EDIT: the 2nd trigger moves a unit in a circle around it's spawner, the third keeps a dummy at the same point as the other unit.

EDIT2: SOLVED, i had to change the original values of the hashtable's integer values.
 
Last edited:
Status
Not open for further replies.
Top