• 🏆 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!

Camera not Adjusting

Status
Not open for further replies.
Level 6
Joined
Dec 9, 2014
Messages
176
I wanted to have a simple trigger to adjust the camera angle when the hero walks up a ramp and onto a higher platform. However, no matter what I do the angle won't change. I have it set to adjust when entering the base of the ramp and again when going back down the ramp. I've already made the boolean variable for RampUsed false at the start of the map. Please let me know what I messed up, thanks!

  • Camera Ini
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Camera - Lock camera target for Player 1 (Red) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
      • Trigger - Turn on Camera Normal <gen>
      • Selection - Select (Triggering unit) for Player 1 (Red)
      • Camera - Change camera smoothing factor to 2500.00
      • Visibility - Enable fog of war
      • Environment - Set sky to Dalaran Sky
      • Set RampUsed = False
  • Camera Ramp Adjust
    • Events
      • Unit - A unit enters Camera Adjust1 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RampUsed Equal to False
        • Then - Actions
          • Set RampUsed = True
          • Trigger - Turn off Camera Normal <gen>
          • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
          • Camera - Lock camera target for Player 1 (Red) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
          • Trigger - Turn on Camera Heightened <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RampUsed Equal to True
        • Then - Actions
          • Set RampUsed = False
          • Trigger - Turn off Camera Heightened <gen>
          • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
          • Camera - Lock camera target for Player 1 (Red) to (Triggering unit), offset by (0.00, 0.00) using Default rotation
          • Trigger - Turn on Camera Normal <gen>
        • Else - Actions
Initially Off:
  • Camera Normal
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Camera - Set Player 1 (Red)'s camera Distance to target to 500.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to 343.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Height Offset to 70.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Sorceress) over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Wizard) over 0.10 seconds
Initially Off:
  • Camera Heightened
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Camera - Set Player 1 (Red)'s camera Distance to target to 600.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to 290.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Height Offset to 80.00 over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Sorceress) over 0.10 seconds
      • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Wizard) over 0.10 seconds
 
You do "Set RampUsed = True"... so the next check if "RampUsed == True" will always become true.
Remove the second If/Then/Else block and just move it's actions into the "Else" part of the first If/Then/Else.

You also could have only one periodic trigger that runs permantly. And instead of using constant values for distance/angle... you use variables that can be changed.
 
Level 6
Joined
Dec 9, 2014
Messages
176
You do "Set RampUsed = True"... so the next check if "RampUsed == True" will always become true.
Remove the second If/Then/Else block and just move it's actions into the "Else" part of the first If/Then/Else.

You also could have only one periodic trigger that runs permantly. And instead of using constant values for distance/angle... you use variables that can be changed.

Ok, I'll try that.

Edit: Yay, it worked, thank you!
 
Last edited:
Level 10
Joined
May 21, 2006
Messages
323
  • Camera
    • Events
      • Zeit - Every 0.03 seconds of game time
    • Conditions
      • GlobalCameraOn[1] Gleich (==) False
      • ScriptisRunning Gleich (==) False
    • Actions
      • Set TempInteg = HeroNumber
      • Set TempPlayer = Player 1
      • Set TempReal = 329.00
      • Camera - Lock camera target for TempPlayer to Hero[TempInteg], offset by (0.00, 0.00) using Die Drehung der Einheit
      • Kamera - Set TempPlayer's camera Perspektive to TempReal over 0.00 seconds
      • Set TempReal = 500.00
      • Kamera - Set TempPlayer's camera Entfernung zum Ziel to TempReal over 0.00 seconds
      • Set TempReal = 120.00
      • Kamera - Set TempPlayer's camera Sichtfeld to TempReal over 0.00 seconds
      • Set TempReal = 9999.00
      • Kamera - Set TempPlayer's camera Fernes Z to TempReal over 0.00 seconds
      • Set TempPoint = (Position of Hero[TempInteg])
      • Gebiet - Center CamRec[TempInteg] on TempPoint
      • Set TempReal = ((Height of CamRec[TempInteg]) + 150.00)
      • Kamera - Set TempPlayer's camera Höhen-Offset to TempReal over 0.00 seconds
      • Set TempReal = (Facing of Hero[TempInteg])
      • Kamera - Set TempPlayer's camera Drehung to TempReal over 0.00 seconds
      • Set TempReal = 0.00
      • Set TempInteg = 0

Look especially at the bottom of my trigger. There I am adjusting the Camera Height with the Z of the Position of the Camera locked Unit. It works pretty well.
 
Status
Not open for further replies.
Top