- 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.
Here comes the Loop trigger.
The height of the CAMERA.
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))
-
If - Conditions
-
Else - Actions
- Set Fly_Animation_Timer[Fly_Index] = (Fly_Animation_Timer[Fly_Index] + 0.03)
-
If - Conditions
- -------- 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
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
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
-
If - Conditions
- 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
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
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
-
If - Conditions
- 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
-
If - Conditions
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- -------- 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
-
If - Conditions
- -------- 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 - Conditions
-
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
-
If - Conditions
- -------- 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
-
If - Conditions
- Else - Actions
-
If - Conditions
- -------- RemoveLeaks --------
- Custom script: call RemoveLocation (udg_TempPoint[1])
- Custom script: call RemoveLocation (udg_TempPoint[2])
-
Loop - Actions
-
For each (Integer Fly_Index) from 1 to Fly_Index_Max, do (Actions)
-
Events