lindenkron
You can change this now in User CP
- Reaction score
- 102
SOLVED
________________________________________________
How would one go about finding the 2 closes units, to the unit using the spell?
What I have so far
But it only finds one, since I don't know how to make that the 2 closes
Thanks,
-Lindenkron
Trigger:
- Track2nd
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Track
- Actions
- Set TempInt = 0
- For each (Integer A) from 1 to 2, do (Actions)
- Loop - Actions
- Set TempReal = 1000000000.00
- Set TempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Deer))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set TempInt = (TempInt + 1)
- Set TempLocation = (Position of (Triggering unit))
- Set TempLocation2 = (Position of (Picked unit))
- Set Distance[TempInt] = (Distance between TempLocation and TempLocation2)
- Game - Display to (All players) for 30.00 seconds the text: (String(Distance[TempInt]))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Distance[TempInt] Less than TempReal
- ((Picked unit) is in TrackGroup) Equal to False
- Then - Actions
- Set TempUnit = (Picked unit)
- Set TempReal = Distance[TempInt]
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_TempLocation2)
- Custom script: call RemoveLocation (udg_TempLocation)
- Loop - Actions
- Unit Group - Add TempUnit to TrackGroup
- Custom script: call DestroyGroup (udg_TempGroup)
- Loop - Actions
- Game - Display to (All players) for 30.00 seconds the text: ------------------2...
- Unit Group - Pick every unit in TrackGroup and do (Actions)
- Loop - Actions
- Set TempLocation = (Position of (Triggering unit))
- Set TempLocation2 = (Position of (Picked unit))
- Set TempReal = (Distance between TempLocation and TempLocation2)
- Game - Display to (All players) for 30.00 seconds the text: (Distance: + (String(TempReal)))
- Custom script: call RemoveLocation (udg_TempLocation2)
- Custom script: call RemoveLocation (udg_TempLocation)
- Unit Group - Remove (Picked unit) from TrackGroup
- Loop - Actions
- Events
________________________________________________
How would one go about finding the 2 closes units, to the unit using the spell?
What I have so far
Trigger:
- Track
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Track
- Actions
- Set TempReal2 = 1000000000.00
- Set TempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Deer))
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set TempLocation = (Position of (Triggering unit))
- Set TempLocation2 = (Position of (Picked unit))
- Set TempReal = (Distance between TempLocation and TempLocation2)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- TempReal Less than TempReal2
- Then - Actions
- Set TempReal2 = TempReal
- Set TempUnit = (Picked unit)
- Else - Actions
- If - Conditions
- Custom script: call RemoveLocation (udg_TempLocation2)
- Custom script: call RemoveLocation (udg_TempLocation)
- Loop - Actions
- Custom script: call DestroyGroup (udg_TempGroup)
- Set TempLocation = (Position of TempUnit)
- Cinematic - Ping minimap for (Player group((Owner of (Triggering unit)))) at TempLocation for 2.00 seconds
- Custom script: call RemoveLocation (udg_TempLocation)
- Events
But it only finds one, since I don't know how to make that the 2 closes
Thanks,
-Lindenkron