whats the best way of

nomadian

Member
Reaction score
9
What is the best way of picking every player's random unit and panning the camera to it at the start.

See the one I use but is pretty horrendous is:
Trigger:
  • For each (Integer A) from 1 to 10, do (Unit Group - Pick every unit in (Units in (Playable map area)) and do (If ((Owner of (Picked unit)) Equal to (Player((Integer A)))) then do (Camera - Pan camera for (Picked player) to (Position of (Picked unit)) over 0.00 seconds) else do (Do nothing)))


Actually that is wrong because that will camera hop multiple times. But I think what I'm trying to do is shown there.

(apologies for title- couldn't really sum it up as a few words)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I think this should work ;):
Trigger:
  • For each (Integer A) from 1 to 10, do (Actions)
    • Loop - Actions
      • Set Temp_Group = (Units owned by (Player((Integer A))))
      • Set Temp_Group2 = (Random 1 units from Temp_Group)
      • Unit Group - Pick every unit in Temp_Group2 and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • Camera - Pan camera for (Owner of (Picked unit)) to TempPoint over 0.00 seconds
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_Temp_Group)
      • Custom script: call DestroyGroup(udg_Temp_Group2)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top