• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Help trigger folow unit camera

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2009
Messages
658
It looks you'll need a periodic trigger that sets your selected units either to a unit or unit group variable. Then you tell the trigger to set the camera to your selected units and clear the variables. At least that's what I think. I've never tried that yet so there might be better ways to do it.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
What bout this ?:
  • Camera Copy
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- Makes the trigger run for each player set to play: --------
      • Set _Camera_Integer = 1
      • For each (Integer integer) from 1 to _AmountPlayers_2D, do (Actions)
        • Loop - Actions
          • -------- (Not gravity, sets camera:) --------
          • Set temppoint[_Camera_Integer] = (Position of hero[_Camera_Integer])
          • Camera - Pan camera for (Player(_Camera_Integer)) to temppoint[_Camera_Integer] over 0.15 seconds
          • Camera - Lock camera target for (Player(_Camera_Integer)) to hero[_Camera_Integer], offset by (0.00, 0.00) using Default rotation
          • Camera - Set (Player(_Camera_Integer))'s camera Angle of attack to 200.00 over 0.00 seconds
        • Set _Camera_Integer = ( _Camera_Integer + 1 )
        • Custom script: call RemoveLocation(udg_temppoint[udg__Camera_Integer])
It's MPI
 
U don't need to pan camera so u can get rid of that. Also since u lock the camera u should not use event .03

To stop the camera lock u will need a second trigger and just set a condition in that trigger for that player. So a condition array keyed to the players number. Then u rested the game camera. In the trigger that jonhysome posted change the few things I said then use a condition check if the condition for that player is false then the trigger won't fire.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I translated death's idea . Thanks to him


  • Camera Copy
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- Makes the trigger run for each player set to play: --------
      • Set _Camera_Integer = 1
      • For each (Integer integer) from 1 to _AmountPlayers_2D, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • camera_lock[_Camera_Integer] Equal to True
            • Then - Actions
              • -------- (Not gravity, sets camera:) --------
              • Set temppoint[_Camera_Integer] = (Position of hero[_Camera_Integer])
              • Camera - Pan camera for (Player(_Camera_Integer)) to temppoint[_Camera_Integer] over 0.15 seconds
              • Camera - Lock camera target for (Player(_Camera_Integer)) to hero[_Camera_Integer], offset by (0.00, 0.00) using Default rotation
              • Camera - Set (Player(_Camera_Integer))'s camera Angle of attack to 200.00 over 0.00 seconds
          • Set _Camera_Integer = ( _Camera_Integer + 1 )
          • Custom script: call RemoveLocation(udg_temppoint[udg__Camera_Integer])
            • Else - Actions
  • Stop camera lock
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
    • Conditions
    • Actions
      • Set camera_lock[(Player number of (Triggering player))] = False
 
remove these.
  • Set temppoint[_Camera_Integer] = (Position of hero[_Camera_Integer])
  • Camera - Pan camera for (Player(_Camera_Integer)) to temppoint[_Camera_Integer] over 0.15 seconds
and these
  • Camera - Set (Player(_Camera_Integer))'s camera Angle of attack to 200.00 over 0.00 seconds
  • Set _Camera_Integer = ( _Camera_Integer + 1 )
  • Custom script: call RemoveLocation(udg_temppoint[udg__Camera_Integer])
unless he wants the camera angle.

change this to unit select event.
  • Time - Every 0.03 seconds of game time
take out ITE and move this to top condition.
  • camera_lock[_Camera_Integer] Equal to True
change _Camera_Integer to player number of triggering player
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Also, don't forget to reset all properties of camera to default when he hits the off button (in this case, it's in the Stop camera lock trigger).

For instance, Unlock the camera, instead of just letting it locked to the unit.

  • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
 
Status
Not open for further replies.
Top