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

[Trigger] Issue with Unit custom value

Status
Not open for further replies.
Level 24
Joined
Feb 9, 2009
Messages
1,787
Having an snag where the unit in motion suddenly stops upon hitting a valid target
at my wit's end with this.

  • Then - Actions
    • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
    • Set HM_TGroup = (Units within 1000.00 of HM_Point_Dummy[HM_AAAKey] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of HM_Unit_Dummy[HM_AAAKey])) Equal to True) and (((Matching unit) is visible to (Owner of HM_Unit_Dum
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random unit from HM_TGroup) Equal to No unit
      • Then - Actions
        • Set HM_Unit_Target[HM_AAAKey] = (Random unit from HM_TGroup)
        • Custom script: call DestroyGroup( udg_HM_TGroup)
      • Else - Actions
        • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
        • Custom script: call DestroyGroup( udg_HM_TGroup)
        • Set HM_Unit_Target[HM_AAAKey] = No unit
        • Set HM_Duration[HM_AAAKey] = 1.00
        • Skip remaining actions
here's the full trigger if more info is needed
  • HM Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HM_Group and do (Actions)
        • Loop - Actions
          • Set HM_AAAKey = (Custom value of (Picked unit))
          • Set HM_Unit_Dummy[HM_AAAKey] = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HM_Duration[HM_AAAKey] Greater than 0.00
            • Then - Actions
              • Set HM_Duration[HM_AAAKey] = (HM_Duration[HM_AAAKey] - 0.03)
              • -------- --------
              • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
              • Set HM_Point_Caster[HM_AAAKey] = (Position of HM_Unit_Caster[HM_AAAKey])
              • Set HM_real[1] = (Facing of HM_Unit_Dummy[HM_AAAKey])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between HM_Point_Caster[HM_AAAKey] and HM_Point_Dummy[HM_AAAKey]) Greater than or equal to 400.00
                • Then - Actions
                  • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_AAAKey] to HM_Point_Caster[HM_AAAKey])
                • Else - Actions
                  • Set HM_Point_Dummy_Offset[HM_AAAKey] = (HM_Point_Dummy[HM_AAAKey] offset by 2.50 towards HM_real[1] degrees)
                  • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_AAAKey] to HM_Point_Dummy_Offset[HM_AAAKey])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HM_real[2] - HM_real[1]) Greater than or equal to 180.00
                • Then - Actions
                  • Set HM_real[1] = (HM_real[1] + 360.00)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HM_real[2] - HM_real[1]) Less than or equal to -180.00
                    • Then - Actions
                      • Set HM_real[2] = (HM_real[2] + 360.00)
                    • Else - Actions
              • Set HM_real[3] = ((HM_real[1] + HM_real[2]) / 2.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HM_real[3] - HM_real[1]) Greater than HM_TurnRate[HM_AAAKey]
                • Then - Actions
                  • Set HM_real[3] = (HM_real[1] + HM_TurnRate[HM_AAAKey])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HM_real[3] - HM_real[1]) Less than (-1.00 x HM_TurnRate[HM_AAAKey])
                    • Then - Actions
                      • Set HM_real[3] = (HM_real[1] - HM_TurnRate[HM_AAAKey])
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[3] Less than 0.00
                • Then - Actions
                  • Set HM_real[3] = (HM_real[3] + 360.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[3] Greater than 360.00
                • Then - Actions
                  • Set HM_real[3] = (HM_real[3] - 360.00)
                • Else - Actions
              • -------- --------
              • -------- movement --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[1] Less than HM_real[3]
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HM_real[3] Equal to 0.00
                    • Then - Actions
                      • Set HM_real[3] = 0.01
                    • Else - Actions
                  • Set HM_real[4] = (HM_real[1] / HM_real[3])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HM_real[1] Greater than HM_real[3]
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[1] Equal to 0.00
                        • Then - Actions
                          • Set HM_real[1] = 0.01
                        • Else - Actions
                      • Set HM_real[4] = (HM_real[3] / HM_real[1])
                    • Else - Actions
                      • Set HM_real[4] = 1.00
              • -------- movement --------
              • -------- --------
              • -------- limit speed --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[4] Less than 0.19
                • Then - Actions
                  • Set HM_real[4] = 0.19
                • Else - Actions
              • -------- limit speed --------
              • -------- --------
              • -------- speed: max speed * factor which is dependant on angle difference --------
              • Set HM_real[5] = (HM_Speed_Max[HM_AAAKey] x HM_real[4])
              • Set HM_Point_Dummy_Offset[HM_AAAKey] = (HM_Point_Dummy[HM_AAAKey] offset by HM_real[5] towards HM_real[3] degrees)
              • Unit - Move HM_Unit_Dummy[HM_AAAKey] instantly to HM_Point_Dummy_Offset[HM_AAAKey], facing HM_real[3] degrees
              • -------- speed: max speed * factor which is dependant on angle difference --------
              • -------- --------
              • -------- --------
              • -------- --------
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Caster[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_Unit_Target[HM_AAAKey] Equal to No unit
                • Then - Actions
                  • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
                  • Set HM_TGroup = (Units within 1000.00 of HM_Point_Dummy[HM_AAAKey] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of HM_Unit_Dummy[HM_AAAKey])) Equal to True) and (((Matching unit) is visible to (Owner of HM_Unit_Dum
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random unit from HM_TGroup) Equal to No unit
                    • Then - Actions
                      • Set HM_Unit_Target[HM_AAAKey] = (Random unit from HM_TGroup)
                      • Custom script: call DestroyGroup( udg_HM_TGroup)
                    • Else - Actions
                      • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
                      • Custom script: call DestroyGroup( udg_HM_TGroup)
                      • Set HM_Unit_Target[HM_AAAKey] = No unit
                      • Set HM_Duration[HM_AAAKey] = 1.00
                      • Skip remaining actions
                • Else - Actions
                  • Set HM_AAAKey = (Custom value of (Picked unit))
                  • Set HM_Unit_Dummy[HM_AAAKey] = (Picked unit)
                  • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
                  • Set HM_Point_Target[HM_AAAKey] = (Position of HM_Unit_Target[HM_AAAKey])
                  • Set HM_Distance2[HM_AAAKey] = (Distance between HM_Point_Dummy[HM_AAAKey] and HM_Point_Target[HM_AAAKey])
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • HM_Distance2[HM_AAAKey] Less than or equal to 50.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_Unit_Target[HM_AAAKey] belongs to an enemy of (Owner of HM_Unit_Caster[HM_AAAKey])) Equal to False
                        • Then - Actions
                          • Unit - Set life of HM_Unit_Target[HM_Mui[2]] to ((Life of HM_Unit_Target[HM_Mui[2]]) + (HM_Damage[HM_Mui[2]] x 1.00))
                          • Special Effect - Create a special effect attached to the origin of HM_Unit_Target[HM_Mui[2]] using DarknessLeechTarget_Portrait.mdx
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Unit - Cause HM_Unit_Caster[HM_AAAKey] to damage HM_Unit_Target[HM_AAAKey], dealing HM_Damage[HM_AAAKey] damage of attack type Spells and damage type Normal
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_Unit_Target[HM_AAAKey] is dead) Equal to True
                            • Then - Actions
                              • Set HM_Unit_Target[HM_AAAKey] = No unit
                              • Set HM_Speed[HM_AAAKey] = 25.00
                              • Set HM_Duration[HM_AAAKey] = 0.15
                              • Special Effect - Create a special effect attached to the chest of HM_Unit_Target[HM_AAAKey] using BlueDemonHunterMissile.mdx
                              • Special Effect - Destroy (Last created special effect)
                              • Skip remaining actions
                            • Else - Actions
                      • Unit - Kill HM_Unit_Dummy[HM_AAAKey]
                      • Unit Group - Remove HM_Unit_Dummy[HM_AAAKey] from HM_Group
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in HM_Group) Less than or equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • Set HM_real[1] = (Facing of HM_Unit_Dummy[HM_Mui[2]])
                      • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_Mui[2]] to HM_Point_Target[HM_Mui[2]])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_real[2] - HM_real[1]) Greater than or equal to 180.00
                        • Then - Actions
                          • Set HM_real[1] = (HM_real[1] + 360.00)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_real[2] - HM_real[1]) Less than or equal to -180.00
                            • Then - Actions
                              • Set HM_real[2] = (HM_real[2] + 360.00)
                            • Else - Actions
                      • Set HM_real[3] = ((HM_real[1] + HM_real[2]) / 2.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_real[3] - HM_real[1]) Greater than HM_TurnRate[HM_Mui[2]]
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[1] + HM_TurnRate[HM_Mui[2]])
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_real[3] - HM_real[1]) Less than (-1.00 x HM_TurnRate[HM_Mui[2]])
                            • Then - Actions
                              • Set HM_real[3] = (HM_real[1] - HM_TurnRate[HM_Mui[2]])
                            • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[3] Less than 0.00
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[3] + 360.00)
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[3] Greater than 360.00
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[3] - 360.00)
                        • Else - Actions
                      • -------- --------
                      • -------- movement --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[1] Less than HM_real[3]
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HM_real[3] Equal to 0.00
                            • Then - Actions
                              • Set HM_real[3] = 0.01
                            • Else - Actions
                          • Set HM_real[4] = (HM_real[1] / HM_real[3])
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HM_real[1] Greater than HM_real[3]
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • HM_real[1] Equal to 0.00
                                • Then - Actions
                                  • Set HM_real[1] = 0.01
                                • Else - Actions
                              • Set HM_real[4] = (HM_real[3] / HM_real[1])
                            • Else - Actions
                              • Set HM_real[4] = 1.00
                      • -------- movement --------
                      • -------- --------
                      • -------- limit speed --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[4] Less than 0.50
                        • Then - Actions
                          • Set HM_real[4] = 0.50
                        • Else - Actions
                      • -------- limit speed --------
                      • -------- --------
                      • -------- speed: max speed * factor which is dependant on angle difference --------
                      • Set HM_real[5] = (HM_Speed_Max[HM_Mui[2]] x HM_real[4])
                      • Set HM_Point_Dummy_Offset[HM_Mui[2]] = (HM_Point_Dummy[HM_Mui[2]] offset by HM_real[5] towards HM_real[3] degrees)
                      • Unit - Move HM_Unit_Dummy[HM_Mui[2]] instantly to HM_Point_Dummy_Offset[HM_Mui[2]], facing HM_real[3] degrees
                      • -------- speed: max speed * factor which is dependant on angle difference --------
                      • -------- --------
                  • Custom script: call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Target[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
  • [trigger]
 
  • HM Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in HM_Group and do (Actions)
        • Loop - Actions
          • Set HM_AAAKey = (Custom value of (Picked unit))
          • Set HM_Unit_Dummy[HM_AAAKey] = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HM_Duration[HM_AAAKey] Greater than 0.00
            • Then - Actions
              • Set HM_Duration[HM_AAAKey] = (HM_Duration[HM_AAAKey] - 0.03)
              • -------- --------
              • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
              • Set HM_Point_Caster[HM_AAAKey] = (Position of HM_Unit_Caster[HM_AAAKey])
              • Set HM_real[1] = (Facing of HM_Unit_Dummy[HM_AAAKey])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between HM_Point_Caster[HM_AAAKey] and HM_Point_Dummy[HM_AAAKey]) Greater than or equal to 400.00
                • Then - Actions
                  • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_AAAKey] to HM_Point_Caster[HM_AAAKey])
                • Else - Actions
                  • Set HM_Point_Dummy_Offset[HM_AAAKey] = (HM_Point_Dummy[HM_AAAKey] offset by 2.50 towards HM_real[1] degrees)
                  • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_AAAKey] to HM_Point_Dummy_Offset[HM_AAAKey])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HM_real[2] - HM_real[1]) Greater than or equal to 180.00
                • Then - Actions
                  • Set HM_real[1] = (HM_real[1] + 360.00)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HM_real[2] - HM_real[1]) Less than or equal to -180.00
                    • Then - Actions
                      • Set HM_real[2] = (HM_real[2] + 360.00)
                    • Else - Actions
              • Set HM_real[3] = ((HM_real[1] + HM_real[2]) / 2.00)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (HM_real[3] - HM_real[1]) Greater than HM_TurnRate[HM_AAAKey]
                • Then - Actions
                  • Set HM_real[3] = (HM_real[1] + HM_TurnRate[HM_AAAKey])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (HM_real[3] - HM_real[1]) Less than (-1.00 x HM_TurnRate[HM_AAAKey])
                    • Then - Actions
                      • Set HM_real[3] = (HM_real[1] - HM_TurnRate[HM_AAAKey])
                    • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[3] Less than 0.00
                • Then - Actions
                  • Set HM_real[3] = (HM_real[3] + 360.00)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[3] Greater than 360.00
                • Then - Actions
                  • Set HM_real[3] = (HM_real[3] - 360.00)
                • Else - Actions
              • -------- --------
              • -------- movement --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[1] Less than HM_real[3]
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HM_real[3] Equal to 0.00
                    • Then - Actions
                      • Set HM_real[3] = 0.01
                    • Else - Actions
                  • Set HM_real[4] = (HM_real[1] / HM_real[3])
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • HM_real[1] Greater than HM_real[3]
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[1] Equal to 0.00
                        • Then - Actions
                          • Set HM_real[1] = 0.01
                        • Else - Actions
                      • Set HM_real[4] = (HM_real[3] / HM_real[1])
                    • Else - Actions
                      • Set HM_real[4] = 1.00
              • -------- movement --------
              • -------- --------
              • -------- limit speed --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_real[4] Less than 0.19
                • Then - Actions
                  • Set HM_real[4] = 0.19
                • Else - Actions
              • -------- limit speed --------
              • -------- --------
              • -------- speed: max speed * factor which is dependant on angle difference --------
              • Set HM_real[5] = (HM_Speed_Max[HM_AAAKey] x HM_real[4])
              • Set HM_Point_Dummy_Offset[HM_AAAKey] = (HM_Point_Dummy[HM_AAAKey] offset by HM_real[5] towards HM_real[3] degrees)
              • Unit - Move HM_Unit_Dummy[HM_AAAKey] instantly to HM_Point_Dummy_Offset[HM_AAAKey], facing HM_real[3] degrees
              • -------- speed: max speed * factor which is dependant on angle difference --------
              • -------- --------
              • -------- --------
              • -------- --------
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Caster[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HM_Unit_Target[HM_AAAKey] Equal to No unit
                • Then - Actions
                  • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
                  • Set HM_TGroup = (Units within 1000.00 of HM_Point_Dummy[HM_AAAKey] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of HM_Unit_Dummy[HM_AAAKey])) Equal to True) and (((Matching unit) is visible to (Owner of HM_Unit_Dum
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Random unit from HM_TGroup) Equal to No unit
                    • Then - Actions
                      • Set HM_Unit_Target[HM_AAAKey] = (Random unit from HM_TGroup)
                      • Custom script: call DestroyGroup( udg_HM_TGroup)
                    • Else - Actions
                      • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
                      • Custom script: call DestroyGroup( udg_HM_TGroup)
                      • Set HM_Unit_Target[HM_AAAKey] = No unit
                      • Set HM_Duration[HM_AAAKey] = 1.00
                      • Skip remaining actions
                • Else - Actions
                  • Set HM_AAAKey = (Custom value of (Picked unit))
                  • Set HM_Unit_Dummy[HM_AAAKey] = (Picked unit)
                  • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
                  • Set HM_Point_Target[HM_AAAKey] = (Position of HM_Unit_Target[HM_AAAKey])
                  • Set HM_Distance2[HM_AAAKey] = (Distance between HM_Point_Dummy[HM_AAAKey] and HM_Point_Target[HM_AAAKey])
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • HM_Distance2[HM_AAAKey] Less than or equal to 50.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_Unit_Target[HM_AAAKey] belongs to an enemy of (Owner of HM_Unit_Caster[HM_AAAKey])) Equal to False
                        • Then - Actions
                          • Unit - Set life of HM_Unit_Target[HM_Mui[2]] to ((Life of HM_Unit_Target[HM_Mui[2]]) + (HM_Damage[HM_Mui[2]] x 1.00))
                          • Special Effect - Create a special effect attached to the origin of HM_Unit_Target[HM_Mui[2]] using DarknessLeechTarget_Portrait.mdx
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                          • Unit - Cause HM_Unit_Caster[HM_AAAKey] to damage HM_Unit_Target[HM_AAAKey], dealing HM_Damage[HM_AAAKey] damage of attack type Spells and damage type Normal
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_Unit_Target[HM_AAAKey] is dead) Equal to True
                            • Then - Actions
                              • Set HM_Unit_Target[HM_AAAKey] = No unit
                              • Set HM_Speed[HM_AAAKey] = 25.00
                              • Set HM_Duration[HM_AAAKey] = 0.15
                              • Special Effect - Create a special effect attached to the chest of HM_Unit_Target[HM_AAAKey] using BlueDemonHunterMissile.mdx
                              • Special Effect - Destroy (Last created special effect)
                              • Skip remaining actions
                            • Else - Actions
                      • Unit - Kill HM_Unit_Dummy[HM_AAAKey]
                      • Unit Group - Remove HM_Unit_Dummy[HM_AAAKey] from HM_Group
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in HM_Group) Less than or equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
                      • Set HM_real[1] = (Facing of HM_Unit_Dummy[HM_Mui[2]])
                      • Set HM_real[2] = (Angle from HM_Point_Dummy[HM_Mui[2]] to HM_Point_Target[HM_Mui[2]])
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_real[2] - HM_real[1]) Greater than or equal to 180.00
                        • Then - Actions
                          • Set HM_real[1] = (HM_real[1] + 360.00)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_real[2] - HM_real[1]) Less than or equal to -180.00
                            • Then - Actions
                              • Set HM_real[2] = (HM_real[2] + 360.00)
                            • Else - Actions
                      • Set HM_real[3] = ((HM_real[1] + HM_real[2]) / 2.00)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (HM_real[3] - HM_real[1]) Greater than HM_TurnRate[HM_Mui[2]]
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[1] + HM_TurnRate[HM_Mui[2]])
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (HM_real[3] - HM_real[1]) Less than (-1.00 x HM_TurnRate[HM_Mui[2]])
                            • Then - Actions
                              • Set HM_real[3] = (HM_real[1] - HM_TurnRate[HM_Mui[2]])
                            • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[3] Less than 0.00
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[3] + 360.00)
                        • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[3] Greater than 360.00
                        • Then - Actions
                          • Set HM_real[3] = (HM_real[3] - 360.00)
                        • Else - Actions
                      • -------- --------
                      • -------- movement --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[1] Less than HM_real[3]
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HM_real[3] Equal to 0.00
                            • Then - Actions
                              • Set HM_real[3] = 0.01
                            • Else - Actions
                          • Set HM_real[4] = (HM_real[1] / HM_real[3])
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • HM_real[1] Greater than HM_real[3]
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • HM_real[1] Equal to 0.00
                                • Then - Actions
                                  • Set HM_real[1] = 0.01
                                • Else - Actions
                              • Set HM_real[4] = (HM_real[3] / HM_real[1])
                            • Else - Actions
                              • Set HM_real[4] = 1.00
                      • -------- movement --------
                      • -------- --------
                      • -------- limit speed --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HM_real[4] Less than 0.50
                        • Then - Actions
                          • Set HM_real[4] = 0.50
                        • Else - Actions
                      • -------- limit speed --------
                      • -------- --------
                      • -------- speed: max speed * factor which is dependant on angle difference --------
                      • Set HM_real[5] = (HM_Speed_Max[HM_Mui[2]] x HM_real[4])
                      • Set HM_Point_Dummy_Offset[HM_Mui[2]] = (HM_Point_Dummy[HM_Mui[2]] offset by HM_real[5] towards HM_real[3] degrees)
                      • Unit - Move HM_Unit_Dummy[HM_Mui[2]] instantly to HM_Point_Dummy_Offset[HM_Mui[2]], facing HM_real[3] degrees
                      • -------- speed: max speed * factor which is dependant on angle difference --------
                      • -------- --------
                  • Custom script: call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Target[udg_HM_AAAKey])
              • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])

It feels like a monster of a GUI trigger, but I'll see what I can fix or optimize with this.

EDIT:

Sorry for the double post, sloppy internet...

EDIT 2:

It's quite a headache in GUI to debug. Is it okay if you can copy the trigger, and convert the copy to custom text?
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
Sure
function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func003Func001C takes nothing returns boolean
if ( not ( ( udg_HM_real[2] - udg_HM_real[1] ) <= -180.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func003C takes nothing returns boolean
if ( not ( ( udg_HM_real[2] - udg_HM_real[1] ) >= 180.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func005Func001C takes nothing returns boolean
if ( not ( ( udg_HM_real[3] - udg_HM_real[1] ) < ( -1.00 * udg_HM_TurnRate[udg_HM_Mui[2]] ) ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func005C takes nothing returns boolean
if ( not ( ( udg_HM_real[3] - udg_HM_real[1] ) > udg_HM_TurnRate[udg_HM_Mui[2]] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func006C takes nothing returns boolean
if ( not ( udg_HM_real[3] < 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func007C takes nothing returns boolean
if ( not ( udg_HM_real[3] > 360.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func001Func002C takes nothing returns boolean
if ( not ( udg_HM_real[1] == 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func001C takes nothing returns boolean
if ( not ( udg_HM_real[1] > udg_HM_real[3] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func002C takes nothing returns boolean
if ( not ( udg_HM_real[3] == 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010C takes nothing returns boolean
if ( not ( udg_HM_real[1] < udg_HM_real[3] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func014C takes nothing returns boolean
if ( not ( udg_HM_real[4] < 0.50 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func023C takes nothing returns boolean
if ( ( udg_HM_Distance2[udg_HM_AAAKey] <= 50.00 ) ) then
return true
endif
return false
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func024Func002C takes nothing returns boolean
if ( not ( IsUnitDeadBJ(udg_HM_Unit_Target[udg_HM_AAAKey]) == true ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func024C takes nothing returns boolean
if ( not ( IsUnitEnemy(udg_HM_Unit_Target[udg_HM_AAAKey], GetOwningPlayer(udg_HM_Unit_Caster[udg_HM_AAAKey])) == false ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010Func027C takes nothing returns boolean
if ( not ( CountUnitsInGroup(udg_HM_Group) <= 0 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func010C takes nothing returns boolean
if ( not Trig_HM_Loop_Copy_Func001Func003Func001Func010Func023C() ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func012Func002C takes nothing returns boolean
if ( not ( IsUnitAliveBJ(udg_t_unit) == true ) ) then
return false
endif
if ( not ( IsUnitAlly(udg_t_unit, udg_Temp_Player) == false ) ) then
return false
endif
if ( not ( IsUnitVisible(udg_t_unit, udg_Temp_Player) == true ) ) then
return false
endif
if ( not ( GetUnitAbilityLevelSwapped('Aeth', udg_t_unit) < 0 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func012A takes nothing returns nothing
set udg_t_unit = GetEnumUnit()
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func012Func002C() ) then
set udg_HM_AAAKey = GetUnitUserData(udg_Temp_Unit)
set udg_HM_Unit_Dummy[udg_HM_AAAKey] = udg_Temp_Unit
set udg_HM_Unit_Target[udg_HM_AAAKey] = udg_t_unit
call RemoveLocation (udg_TempPoint)
else
call GroupRemoveUnitSimple( udg_t_unit, GetLastCreatedGroup() )
set udg_HM_AAAKey = GetUnitUserData(udg_Temp_Unit)
set udg_HM_Unit_Dummy[udg_HM_AAAKey] = udg_Temp_Unit
set udg_HM_Unit_Target[udg_HM_AAAKey] = udg_t_unit
set udg_HM_Duration[udg_HM_AAAKey] = 1.00
call RemoveLocation (udg_TempPoint)
return
endif
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001Func013C takes nothing returns boolean
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func001C takes nothing returns boolean
if ( not ( udg_HM_Unit_Target[udg_HM_AAAKey] == null ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func009C takes nothing returns boolean
if ( not ( DistanceBetweenPoints(udg_HM_Point_Caster[udg_HM_AAAKey], udg_HM_Point_Dummy[udg_HM_AAAKey]) >= 400.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func010Func001C takes nothing returns boolean
if ( not ( ( udg_HM_real[2] - udg_HM_real[1] ) <= -180.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func010C takes nothing returns boolean
if ( not ( ( udg_HM_real[2] - udg_HM_real[1] ) >= 180.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func012Func001C takes nothing returns boolean
if ( not ( ( udg_HM_real[3] - udg_HM_real[1] ) < ( -1.00 * udg_HM_TurnRate[udg_HM_AAAKey] ) ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func012C takes nothing returns boolean
if ( not ( ( udg_HM_real[3] - udg_HM_real[1] ) > udg_HM_TurnRate[udg_HM_AAAKey] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func013C takes nothing returns boolean
if ( not ( udg_HM_real[3] < 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func014C takes nothing returns boolean
if ( not ( udg_HM_real[3] > 360.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func017Func001Func002C takes nothing returns boolean
if ( not ( udg_HM_real[1] == 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func017Func001C takes nothing returns boolean
if ( not ( udg_HM_real[1] > udg_HM_real[3] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func017Func002C takes nothing returns boolean
if ( not ( udg_HM_real[3] == 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func017C takes nothing returns boolean
if ( not ( udg_HM_real[1] < udg_HM_real[3] ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003Func021C takes nothing returns boolean
if ( not ( udg_HM_real[4] < 0.19 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001Func003C takes nothing returns boolean
if ( not ( udg_HM_Duration[udg_HM_AAAKey] > 0.00 ) ) then
return false
endif
return true
endfunction

function Trig_HM_Loop_Copy_Func001A takes nothing returns nothing
set udg_HM_AAAKey = GetUnitUserData(GetEnumUnit())
set udg_HM_Unit_Dummy[udg_HM_AAAKey] = GetEnumUnit()
if ( Trig_HM_Loop_Copy_Func001Func003C() ) then
set udg_HM_Duration[udg_HM_AAAKey] = ( udg_HM_Duration[udg_HM_AAAKey] - 0.03 )
//
set udg_HM_Point_Dummy[udg_HM_AAAKey] = GetUnitLoc(udg_HM_Unit_Dummy[udg_HM_AAAKey])
set udg_HM_Point_Caster[udg_HM_AAAKey] = GetUnitLoc(udg_HM_Unit_Caster[udg_HM_AAAKey])
set udg_HM_real[1] = GetUnitFacing(udg_HM_Unit_Dummy[udg_HM_AAAKey])
if ( Trig_HM_Loop_Copy_Func001Func003Func009C() ) then
set udg_HM_real[2] = AngleBetweenPoints(udg_HM_Point_Dummy[udg_HM_AAAKey], udg_HM_Point_Caster[udg_HM_AAAKey])
else
set udg_HM_Point_Dummy_Offset[udg_HM_AAAKey] = PolarProjectionBJ(udg_HM_Point_Dummy[udg_HM_AAAKey], 2.50, udg_HM_real[1])
set udg_HM_real[2] = AngleBetweenPoints(udg_HM_Point_Dummy[udg_HM_AAAKey], udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
endif
if ( Trig_HM_Loop_Copy_Func001Func003Func010C() ) then
set udg_HM_real[1] = ( udg_HM_real[1] + 360.00 )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func010Func001C() ) then
set udg_HM_real[2] = ( udg_HM_real[2] + 360.00 )
else
endif
endif
set udg_HM_real[3] = ( ( udg_HM_real[1] + udg_HM_real[2] ) / 2.00 )
if ( Trig_HM_Loop_Copy_Func001Func003Func012C() ) then
set udg_HM_real[3] = ( udg_HM_real[1] + udg_HM_TurnRate[udg_HM_AAAKey] )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func012Func001C() ) then
set udg_HM_real[3] = ( udg_HM_real[1] - udg_HM_TurnRate[udg_HM_AAAKey] )
else
endif
endif
if ( Trig_HM_Loop_Copy_Func001Func003Func013C() ) then
set udg_HM_real[3] = ( udg_HM_real[3] + 360.00 )
else
endif
if ( Trig_HM_Loop_Copy_Func001Func003Func014C() ) then
set udg_HM_real[3] = ( udg_HM_real[3] - 360.00 )
else
endif
//
// movement
if ( Trig_HM_Loop_Copy_Func001Func003Func017C() ) then
if ( Trig_HM_Loop_Copy_Func001Func003Func017Func002C() ) then
set udg_HM_real[3] = 0.01
else
endif
set udg_HM_real[4] = ( udg_HM_real[1] / udg_HM_real[3] )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func017Func001C() ) then
if ( Trig_HM_Loop_Copy_Func001Func003Func017Func001Func002C() ) then
set udg_HM_real[1] = 0.01
else
endif
set udg_HM_real[4] = ( udg_HM_real[3] / udg_HM_real[1] )
else
set udg_HM_real[4] = 1.00
endif
endif
// movement
//
// limit speed
if ( Trig_HM_Loop_Copy_Func001Func003Func021C() ) then
set udg_HM_real[4] = 0.19
else
endif
// limit speed
//
// speed: max speed * factor which is dependant on angle difference
set udg_HM_real[5] = ( udg_HM_Speed_Max[udg_HM_AAAKey] * udg_HM_real[4] )
set udg_HM_Point_Dummy_Offset[udg_HM_AAAKey] = PolarProjectionBJ(udg_HM_Point_Dummy[udg_HM_AAAKey], udg_HM_real[5], udg_HM_real[3])
call SetUnitPositionLocFacingBJ( udg_HM_Unit_Dummy[udg_HM_AAAKey], udg_HM_Point_Dummy_Offset[udg_HM_AAAKey], udg_HM_real[3] )
// speed: max speed * factor which is dependant on angle difference
//
//
//
call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
call RemoveLocation (udg_HM_Point_Caster[udg_HM_AAAKey])
call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
else
if ( Trig_HM_Loop_Copy_Func001Func003Func001C() ) then
set udg_Temp_Unit = GetEnumUnit()
set udg_TempPoint = GetUnitLoc(udg_Temp_Unit)
set udg_Temp_Player = GetOwningPlayer(udg_Temp_Unit)
//
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(1000.00, udg_TempPoint), function Trig_HM_Loop_Copy_Func001Func003Func001Func012A )
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func013C() ) then
else
endif
else
set udg_HM_Point_Dummy[udg_HM_AAAKey] = GetUnitLoc(udg_HM_Unit_Dummy[udg_HM_AAAKey])
set udg_HM_Point_Target[udg_HM_AAAKey] = GetUnitLoc(udg_HM_Unit_Target[udg_HM_AAAKey])
set udg_HM_Distance2[udg_HM_AAAKey] = DistanceBetweenPoints(udg_HM_Point_Dummy[udg_HM_AAAKey], udg_HM_Point_Target[udg_HM_AAAKey])
//
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010C() ) then
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func024C() ) then
call SetUnitLifeBJ( udg_HM_Unit_Target[udg_HM_Mui[2]], ( GetUnitStateSwap(UNIT_STATE_LIFE, udg_HM_Unit_Target[udg_HM_Mui[2]]) + ( udg_HM_Damage[udg_HM_Mui[2]] * 1.00 ) ) )
call AddSpecialEffectTargetUnitBJ( "origin", udg_HM_Unit_Target[udg_HM_Mui[2]], "DarknessLeechTarget_Portrait.mdx" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
else
call UnitDamageTargetBJ( udg_HM_Unit_Caster[udg_HM_AAAKey], udg_HM_Unit_Target[udg_HM_AAAKey], udg_HM_Damage[udg_HM_AAAKey], ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func024Func002C() ) then
set udg_HM_Unit_Target[udg_HM_AAAKey] = null
set udg_HM_Speed[udg_HM_AAAKey] = 25.00
set udg_HM_Duration[udg_HM_AAAKey] = 0.15
call AddSpecialEffectTargetUnitBJ( "chest", udg_HM_Unit_Target[udg_HM_AAAKey], "BlueDemonHunterMissile.mdx" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
return
else
endif
endif
call KillUnit( udg_HM_Unit_Dummy[udg_HM_AAAKey] )
call GroupRemoveUnitSimple( udg_HM_Unit_Dummy[udg_HM_AAAKey], udg_HM_Group )
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func027C() ) then
call DisableTrigger( GetTriggeringTrigger() )
else
endif
else
set udg_HM_real[1] = GetUnitFacing(udg_HM_Unit_Dummy[udg_HM_Mui[2]])
set udg_HM_real[2] = AngleBetweenPoints(udg_HM_Point_Dummy[udg_HM_Mui[2]], udg_HM_Point_Target[udg_HM_Mui[2]])
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func003C() ) then
set udg_HM_real[1] = ( udg_HM_real[1] + 360.00 )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func003Func001C() ) then
set udg_HM_real[2] = ( udg_HM_real[2] + 360.00 )
else
endif
endif
set udg_HM_real[3] = ( ( udg_HM_real[1] + udg_HM_real[2] ) / 2.00 )
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func005C() ) then
set udg_HM_real[3] = ( udg_HM_real[1] + udg_HM_TurnRate[udg_HM_Mui[2]] )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func005Func001C() ) then
set udg_HM_real[3] = ( udg_HM_real[1] - udg_HM_TurnRate[udg_HM_Mui[2]] )
else
endif
endif
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func006C() ) then
set udg_HM_real[3] = ( udg_HM_real[3] + 360.00 )
else
endif
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func007C() ) then
set udg_HM_real[3] = ( udg_HM_real[3] - 360.00 )
else
endif
//
// movement
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010C() ) then
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func002C() ) then
set udg_HM_real[3] = 0.01
else
endif
set udg_HM_real[4] = ( udg_HM_real[1] / udg_HM_real[3] )
else
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func001C() ) then
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func010Func001Func002C() ) then
set udg_HM_real[1] = 0.01
else
endif
set udg_HM_real[4] = ( udg_HM_real[3] / udg_HM_real[1] )
else
set udg_HM_real[4] = 1.00
endif
endif
// movement
//
// limit speed
if ( Trig_HM_Loop_Copy_Func001Func003Func001Func010Func014C() ) then
set udg_HM_real[4] = 0.50
else
endif
// limit speed
//
// speed: max speed * factor which is dependant on angle difference
set udg_HM_real[5] = ( udg_HM_Speed_Max[udg_HM_Mui[2]] * udg_HM_real[4] )
set udg_HM_Point_Dummy_Offset[udg_HM_Mui[2]] = PolarProjectionBJ(udg_HM_Point_Dummy[udg_HM_Mui[2]], udg_HM_real[5], udg_HM_real[3])
call SetUnitPositionLocFacingBJ( udg_HM_Unit_Dummy[udg_HM_Mui[2]], udg_HM_Point_Dummy_Offset[udg_HM_Mui[2]], udg_HM_real[3] )
// speed: max speed * factor which is dependant on angle difference
//
endif
call RemoveLocation (udg_HM_Point_Dummy_Offset[udg_HM_AAAKey])
endif
call RemoveLocation (udg_HM_Point_Target[udg_HM_AAAKey])
call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
endif
endfunction

function Trig_HM_Loop_Copy_Actions takes nothing returns nothing
call ForGroupBJ( udg_HM_Group, function Trig_HM_Loop_Copy_Func001A )
endfunction

//===========================================================================
function InitTrig_HM_Loop_Copy takes nothing returns nothing
set gg_trg_HM_Loop_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_HM_Loop_Copy, 0.03 )
call TriggerAddAction( gg_trg_HM_Loop_Copy, function Trig_HM_Loop_Copy_Actions )
endfunction

In my first post there was an isolation of where the trigger goes awry: [this one]
  • Then - Actions
    • Set HM_Point_Dummy[HM_AAAKey] = (Position of HM_Unit_Dummy[HM_AAAKey])
    • Set HM_TGroup = (Units within 1000.00 of HM_Point_Dummy[HM_AAAKey] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of HM_Unit_Dummy[HM_AAAKey])) Equal to True) and (((Matching unit) is visible to (Owner of HM_Unit_Dum
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Random unit from HM_TGroup) Equal to No unit
      • Then - Actions
        • Set HM_Unit_Target[HM_AAAKey] = (Random unit from HM_TGroup)
        • Custom script: call DestroyGroup( udg_HM_TGroup)
      • Else - Actions
        • Custom script: call RemoveLocation (udg_HM_Point_Dummy[udg_HM_AAAKey])
        • Custom script: call DestroyGroup( udg_HM_TGroup)
        • Set HM_Unit_Target[HM_AAAKey] = No unit
        • Set HM_Duration[HM_AAAKey] = 1.00
        • Skip remaining actions
So overall I'm looking for an alternative to selecting units within range outside of a unit group since trying to film inception in with custom unit values is so precarious
 
Last edited:
Status
Not open for further replies.
Top