Position of Matching unit leak

Angel_Island

Much long, many time, wow
Reaction score
56
Trigger:
  • Set GhostShipPickedUnit = (Units within 500.00 of GhostShipPosition matching ((Distance between GhostShipPosition and (Position of (Matching unit))) Greater than or equal to 300.00))


How do I make (Position of (Matching unit)) not leaking? You can't set it to a variable.
 

ludnica

Long gone
Reaction score
61
How can you not set it to a variable?

Trigger:
  • Set Variable = (Position of (Matching unit))

Or I didn't understand what you want to do there.
 

Angel_Island

Much long, many time, wow
Reaction score
56
When should you set it? That example you gave me sets (Position of No unit), because there is no matching unit.
 

Tom Jones

N/A
Reaction score
437
Compare the distance between the units inside the group selection instead. Alternatively you could learn jass :thup:
 

Tom Jones

N/A
Reaction score
437
Trigger:
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
    • Set Point_A = (Position of GhostShip)
    • Unit Group - Pick every unit in (Units within 500.00 of Point_A) and do (Actions)
      • Loop - Actions
        • Set Point_B = (Position of (Picked Unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between Point_A and Point_B) Greater than or equal to 300.00
          • Then - Actions
            • -------- Apply actions to the picked unit. --------
          • Else - Actions
        • Custom script: call RemoveLocation(udg_Point_B)
    • Custom script: call RemoveLocation(udg_Point_A)
 

Angel_Island

Much long, many time, wow
Reaction score
56
Thx, I got it to work, but I wonder what does "Custom script: set bj_wantDestroyGroup = true" do?
 

Tom Jones

N/A
Reaction score
437
Removes the group. GUI group selections will destroy the group when done using it, if the globel bj_wantDestroyGroup is equal to true. It's an alternative to destroying the group manually.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top