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

Cant Fix the Camera for my system HELP!

Status
Not open for further replies.
Level 9
Joined
May 27, 2012
Messages
116
Hello im making a Fly system there you controll a unit with the arrow keys as it flies. The system is working realy good every thing is perfect but one thing...
The height of the CAMERA. :vw_wtf:

Here comes the Loop trigger.

  • Fly Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Fly_Index) from 1 to Fly_Index_Max, do (Actions)
        • Loop - Actions
          • Set TempINT = (Player number of (Owner of Fly_Flyer[Fly_Index]))
          • Set TempPoint[1] = (Position of Fly_Flyer[Fly_Index])
          • Set TempPoint[2] = (TempPoint[1] offset by Fly_Speed_XY[Fly_Index] towards (Facing of Fly_Flyer[Fly_Index]) degrees)
          • -------- Animation --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_Animation_Timer[Fly_Index] Greater than or equal to Fly_Animation_Time[Fly_Index]
            • Then - Actions
              • Set Fly_Animation_Timer[Fly_Index] = 0.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Fly_Animation[Fly_Index] Equal to -1
                • Then - Actions
                  • Animation - Play Fly_Flyer[Fly_Index]'s walk animation
                • Else - Actions
                  • Custom script: call SetUnitAnimationByIndex((udg_Fly_Flyer[udg_Fly_Index]),(udg_Fly_Index))
            • Else - Actions
              • Set Fly_Animation_Timer[Fly_Index] = (Fly_Animation_Timer[Fly_Index] + 0.03)
          • -------- Height Change --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_State[TempINT] Equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current flying height of Fly_Flyer[Fly_Index]) Greater than or equal to 0.00
                • Then - Actions
                  • Custom script: set udg_TempReal = GetLocationZ (udg_TempPoint[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Greater than 0.00
                    • Then - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] - TempReal) at 0.00
                    • Else - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] + TempReal) at 0.00
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_State[TempINT] Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current flying height of Fly_Flyer[Fly_Index]) Greater than or equal to 0.00
                • Then - Actions
                  • Set Fly_Height[Fly_Index] = (Fly_Height[Fly_Index] - Fly_Speed_Z[Fly_Index])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Fly_Height[Fly_Index] Less than 0.50
                    • Then - Actions
                      • Set Fly_Height[Fly_Index] = 0.50
                    • Else - Actions
                  • Custom script: set udg_TempReal = GetLocationZ (udg_TempPoint[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Greater than 0.00
                    • Then - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] - TempReal) at 0.00
                    • Else - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] + TempReal) at 0.00
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_State[TempINT] Equal to 2
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current flying height of Fly_Flyer[Fly_Index]) Less than Fly_MaxHeight[Fly_Index]
                • Then - Actions
                  • Set Fly_Height[Fly_Index] = (Fly_Height[Fly_Index] + Fly_Speed_Z[Fly_Index])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Fly_Height[Fly_Index] Greater than Fly_MaxHeight[Fly_Index]
                    • Then - Actions
                      • Set Fly_Height[Fly_Index] = Fly_MaxHeight[Fly_Index]
                    • Else - Actions
                  • Custom script: set udg_TempReal = GetLocationZ (udg_TempPoint[2])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • TempReal Greater than 0.00
                    • Then - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] - TempReal) at 0.00
                    • Else - Actions
                      • Animation - Change Fly_Flyer[Fly_Index] flying height to (Fly_Height[Fly_Index] + TempReal) at 0.00
                • Else - Actions
            • Else - Actions
          • -------- Move --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current flying height of Fly_Flyer[Fly_Index]) Greater than 1.00
            • Then - Actions
              • Unit - Move Fly_Flyer[Fly_Index] instantly to TempPoint[2]
            • Else - Actions
          • -------- Angle --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_Key_Left[TempINT] Equal to True
            • Then - Actions
              • Unit - Make Fly_Flyer[Fly_Index] face ((Facing of Fly_Flyer[Fly_Index]) + Fly_AngelSpeed[Fly_Index]) over 0.00 seconds
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Fly_Key_Right[TempINT] Equal to True
            • Then - Actions
              • Unit - Make Fly_Flyer[Fly_Index] face ((Facing of Fly_Flyer[Fly_Index]) - Fly_AngelSpeed[Fly_Index]) over 0.00 seconds
            • Else - Actions
          • -------- Player Camera --------
          • Camera - Set (Player(TempINT))'s camera Distance to target to 700.00 over 0.03 seconds
          • Camera - Set (Player(TempINT))'s camera Rotation to (Facing of Fly_Flyer[Fly_Index]) over 0.03 seconds
          • Camera - Set (Player(TempINT))'s camera Angle of attack to 342.01 over 0.03 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • 1 Equal to 0
            • Then - Actions
              • Custom script: set udg_TempReal = GetLocationZ (udg_TempPoint[2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TempReal Greater than 0.00
                • Then - Actions
                  • Camera - Set (Player(TempINT))'s camera Height Offset to (Fly_Height[Fly_Index] + (100.00 - TempReal)) over 0.03 seconds
                • Else - Actions
                  • Camera - Set (Player(TempINT))'s camera Height Offset to (Fly_Height[Fly_Index] + (100.00 + TempReal)) over 0.03 seconds
            • Else - Actions
          • -------- RemoveLeaks --------
          • Custom script: call RemoveLocation (udg_TempPoint[1])
          • Custom script: call RemoveLocation (udg_TempPoint[2])
 
Level 9
Joined
May 27, 2012
Messages
116
Ok the problem is that then i come over terrain with the camera as the unit is flies then the height under me changes so dose the camera and its suposed to hold its height as the unit dose the units flying height is not dependent on the height under it. The Cameras height changes but it shouldent it should be constant as the flying units height is (it changes by your command) what im trying to do is make the cameras height dependent on the units height not the ground under it.
 
Level 9
Joined
May 27, 2012
Messages
116
lol the rotasion needs to be upgraded and so on... Els it wont be a third person camera ^^.
problem is height if put it outside the loop it wont work... Then the camera wont rotate and the angel of attack might be changd by scrolling on the mouse the problem is that the height changes and i need it to not do that.
 
  • Camera adjustment
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • Selected_Bool Equal to True
    • Actions
      • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of Cam_Unit) over 0.30 seconds
      • Camera - Set Player 1 (Red)'s camera Angle of attack to Real_Cam[2] over 0.50 seconds
      • Camera - Set Player 1 (Red)'s camera Height Offset to ((Current_Hight + Real_Cam[3]) over 0.00 seconds
      • Camera - Set Player 1 (Red)'s camera Distance to target to Real_Cam[4] over 0.40 seconds
You want something like this. Give rep to Icemanbo :) He did it.
 
Status
Not open for further replies.
Top