• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Problem with Camera Trigger

Status
Not open for further replies.
Level 3
Joined
May 24, 2008
Messages
53
Well, I have a trigger that it's supposed to follow the player unit and rotate and everything..
It works only for the "choose hero" part of the map.. (which is the first part)
but when the chosen hero is created and placed where it belongs, right after being chosen, the camera get's locked or something. It just stay in the "hero selection" area of the map..
I'll paste the code here.. I hope someone can help me with this..

  • Set Camera 1
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in Player Group - Player 1 (Red) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CurrentCamera[(Player number of (Picked player))] Equal to 1
            • Then - Actions
              • Camera - Apply Camera 001 <gen> for (Picked player) over 0.00 seconds
              • Camera - Set (Picked player)'s camera Rotation to (Facing of PlayersHero[(Player number of (Picked player))]) over 0.00 seconds
              • Camera - Lock camera target for (Picked player) to PlayersHero[(Player number of (Picked player))], offset by (0.00, 0.00) using The unit's rotation
            • Else - Actions
      • Player Group - Pick every player in Player Group - Player 2 (Blue) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CurrentCamera[(Player number of (Picked player))] Equal to 1
            • Then - Actions
              • Camera - Apply Camera 001 <gen> for (Picked player) over 0.00 seconds
              • Camera - Set (Picked player)'s camera Rotation to (Facing of PlayersHero[(Player number of (Picked player))]) over 0.00 seconds
            • Else - Actions
      • Player Group - Pick every player in Player Group - Player 3 (Teal) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CurrentCamera[(Player number of (Picked player))] Equal to 1
            • Then - Actions
              • Camera - Apply Camera 001 <gen> for (Picked player) over 0.00 seconds
              • Camera - Set (Picked player)'s camera Rotation to (Facing of PlayersHero[(Player number of (Picked player))]) over 0.00 seconds
            • Else - Actions
      • Player Group - Pick every player in Player Group - Player 4 (Purple) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CurrentCamera[(Player number of (Picked player))] Equal to 1
            • Then - Actions
              • Camera - Apply Camera 001 <gen> for (Picked player) over 0.00 seconds
              • Camera - Set (Picked player)'s camera Rotation to (Facing of PlayersHero[(Player number of (Picked player))]) over 0.00 seconds
            • Else - Actions
 
You can make it even easier:
  • Trigger
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • ((Sold unit) is a Hero) Equal to True
  • Actions
    • Set PlayersHero[Player number of (Owner of (Sold unit))] = (Sold unit)
    • Player Group - Add (Owner of (Sold unit)) to CameraGroup
    • Trigger - Turn on Trig <gen>
    • Camera - Lock camera target for (Owner of (Sold unit)) to PlayersHero[(Player number of (Owner of (Sold unit)))], offset by (0.00, 0.00) using The unit's rotation
  • Trig
  • Events
    • Time - Every 0.03 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Number of players in CameraGroup) Greater than 0
      • Then - Actions
        • Player Group - Pick every player in CameraGroup and do (Actions)
          • Loop - Actions
            • Camera - Set (Picked player)'s camera Rotation to (Facing of PlayersHero[(Player number of (Picked player))]) over 0.00 seconds
      • Else - Actions
        • Trigger - Turn off (This trigger)
But, to your problem, you are using "Camera - Apply Camera 001 <gen>", which is a static camera and you periodically set the players' camera at that spot.
 
Level 3
Joined
May 24, 2008
Messages
53
what type of variable is CameraGroup? Player Group not array?
if i'm periodically setting the camera at the units position, shouldn't it work??
how can i make it work with what i have?
 
Status
Not open for further replies.
Top