Quazar3D: Master Tutorial
HomePreviousParentNext

Master Tutorial  »  08. Entering the helicopter, taking the helicopter outside the building

08. Entering the helicopter, taking the helicopter outside the building

test

Lesson 08

Complete lesson 07

This lesson will present how to create camera animation and how to move the helicopter outside the hangar.

  1. First in the Nodes window create a Dummy Node, name it enter_heli (Position: 0,1293; 0,1293; 1,1388). Inside enter_heli add WorldTrigger, name it EnterHeli. Change the position and size of the EnterHeli object, so it resemble the one in  in the picture below. Inside the enter_heli object add a Dummy Node, name it target_eye_position (Position: 0,0000; 0,4249: 1,9277 Rotation: 0; -90, -90).
test
  1. Go to the Flowgraph window to master_tutorial.fg.
  2. Find the block Switch - step info, open it and add following outputs: Heli: get in! and Heli: wait until heli out.
test
  1. Find Set Integer block, open it and add two elements  Step 8 with Value 8 and Step 9 with Value 9.
test
  1. Add Container block, name it Enter Helicopter. Open it, press Create and save it under EnterHelicopter, press OK.
  2. Inside the Enter Helicopter block add SignalInput block, open it and in Create new enter setActive.  Add If block, connect its Input to setActive in SignalInput block. Add Set Boolean block, connect its True to False in If block. Add Init block, connect its Output to False in Set Boolean block. Add Boolean block, name it isActive?, set it to False and connect it to Result in Set Boolean block and to Condition in If block. 
test
  1. Add three Set Property blocks, open them and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect the Output in Set Boolean block to Input of the first Set Property block. Connect the Output in the first Set Property block with Input of the second Set Property. Connect the Output in the second Set Property block with Input of the third Set Property block. Connect the isActive? block to Enabled in all three Set Property blocks. From the Nodes window in the editor drag two elements on the Flowgraph window: SELECTION_HANDLE_CV and SELECTION_HANDLE_RV. Connect the SELECTION_HANDLE_CV block to Node in the first Set Property block. Connect the SELECTION_HANDLE_RV to Node in the second Set Property block.
lesson_08_screen_05
  1. Add Set EnterCallback block, connect its Input to Output of the Init block. Add the Set LeaveCallback block, connect its Input to Output of the Set EnterCallback block. Add String block, open it and enter WorldTrigger EnterHeli and connect it to EventName in Set EnterCallback. Add String block, open it and enter WorldTrigger LeaveHeli, connect it to EventName in Set LeaveCallback block. From the Nodes window in the editor drag the EnterHeli object to Flowgraph window, connect it to Node in the last Set Property block, and to WorldTrigger in Set EnterCallback and in Set LeaveCallback blocks.
lesson_08_screen_06
  1. Add Get Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player], connect its Input to Output of Init block. Add Game block and connect it to Game in Get Property. Add Player block and connect it to Player in Get Propery block. Add WorldTrigger EnterCallback, name it WorldTrigger EnterHeli. Add WorldTrigger LeaveCallback, name it WorldTrigger LeaveHeli.
lesson_08_screen_07
  1. Add Compare Item block, connect its Input to Output in the WorldTrigger EnterHeli block. Connect the Player block to A in the Compare Item block. Add Item block and connect it to B in the Compare Item block and to Node in WorldTrigger EnterHeli block. Add Compare Item block, connect its Input to Output of WorldTrigger LeaveHeli  block. Connect the Player block to A in the new Compare Item block. Add Item block and connect it to B in the new Compare Item block and to Node in WorldTrigger LeaveHeli block.
lesson_08_screen_08
  1. Add Set Boolean block, connet its True to == in the first Compare Item block. Connect the == in the second Compare Item block to False in the Set Boolean block. Add Boolean block, name it canEnterHeli?, set it to False and connect it to Result in the Set Boolean block. Add Init block and connect its Output to False in Set Boolean block.
test
  1. Add Logic And block, connect its Input to Output of Set Boolean block. Connect the canEnterHeli? block to A in the Logic And block. Add Boolean block, name it showEnterArrow?, set it to False and connect it to Result in the Logic And block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect the Input in the Set Property to Output of Logic And block. Connect the showEnterArrow? block to Enabled in Set Property block. From the Nodes window in the editor drag the ARROW object to the Flowgraph window and connect it to the Node in the Set Property block.
test
  1. From the Embedded containers list drag the ActionClick block on the Flowgraph window. Save it as ActionClick, change its name to ClickDoorKnob. Connect the SELECTION_HANDLE_CV block to Object in ClickDoorKnob block. Add Integer block, open it and select APP_BUTTON_LEFT and connect it to APP_BUTTON in ClickDoorKnob. From the Embedded containers list drag the ActionClick block on the Flowgraph window. Save it as ActionClick, change its name to ClickDoorKnob. Connect the SELECTION_HANDLE_RV block to Object in ClickDoorKnob block. Add Integer block, open it and select APP_BUTTON_LEFT and connect it to APP_BUTTON in ClickDoorKnob.
test
  1. Add If block, connect its Input to Output of both ClickKnob blocks. Connect the Condition in the If block to isActive? block. Add If block and connect its Input to True in the previous If block. From the Embedded containers add Latch block, save it under Latch and connect its Input to False in the last If block.
lesson_08_screen_12
  1. Add Timeline block, name it Open Door. Add four inputs of Node [Data/Items/World] type. Name them as following: Doors_CV_Upper, Doors_CV_Lower, Doors_RV_Upper, Doors_RV_Lower. To Doors_CV_Upper Add property Rotation. Add two points on the Y line (green). Values for the first point: Time: 0, Value: 0. Values for the second point: Time: 4, Value: - 130.
lesson_08_screen_13
  1. To Doors_CV_Lower add property Rotation. Add two points on the Y line (green). Values for the first point: Time: 0, Value: 0. Values for the second point: Time: 4, Value:  130.
lesson_08_screen_14
  1. To Doors_RV_Upper add property Position. Add three points to X line (red), values for the first point: Time: 0, Value: 1.215. Values for the second point: Time: 1, Value:  1.235. Values for the third point: Time: 4, Value:  1.235. Add three points to Y line (green), values for the first point: Time: 0, Value: 2.175. Values for the second point: Time: 1, Value:  2.175. Values for the third point: Time: 4, Value: 1. Add three points to Z line (blue), values for the first point: Time: 0, Value: 1.801. Values for the second point: Time: 1, Value:  1.801. Values for the third point: Time: 4, Value: 1.801.
lesson_08_screen_15
  1. To Doors_RV_Lower add property Position. Add three points to X line (red), values for the first point: Time: 0, Value: 1.242. Values for the second point: Time: 2.242, Value:  1.235. Values for the third point: Time: 4, Value:  1.242. Add three points to Y line (green), values for the first point: Time: 0, Value: 1.869. Values for the second point: Time: 2.602, Value:  1.869. Values for the third point: Time: 4, Value: 1.241. Add three points to Z line (blue), values for the first point: Time: 0, Value: 1.221. Values for the second point: Time: 2.602, Value:  1.221. Values for the third point: Time: 4, Value: 1.221.
lesson_08_screen_16
  1. Connect the Output 1 in the Latch.fg block to Play in the Open Door block. From the Nodes window in the editor drag following elements on the Flowgraph window: DOORS_UPPER_CV, DOORS_LOWER_CV, DOORS_UPPER_RV, DOORS_LOWER_RV. Connect the Doors_CV_Upper in the Open door block to DOORS_UPPER_CV block. Connect the Doors_CV_Lower in the Open door block to DOORS_LOWER_CV block. Connect the Doors_RV_Upper in the Open door block to DOORS_UPPER_RV block. Connect the Doors_RV_Lower in the Open door block to DOORS_LOWER_RV block.
test
  1. Add Timeline block, name it Close Door. Add four inputs of Node [Data/Items/World] type. Name them as following: Doors_CV_Upper, Doors_CV_Lower, Doors_RV_Upper, Doors_RV_Lower. To Doors_CV_Upper Add property Rotation. Add two points on the Y line (green). Values for the first point: Time: 0, Value: -130. Values for the second point: Time: 4, Value: 0.
lesson_08_screen_18
  1. To Doors_CV_Lower add property Rotation. Add two points on the Y line (green). Values for the first point: Time: 0, Value: 130. Values for the second point: Time: 4, Value: 0.

lesson_08_screen_19
  1. To Doors_RV_Upper add property Position. Add three points to X line (red), values for the first point: Time: 0, Value: 1.235. Values for the second point: Time: 3, Value:  1.235. Values for the third point: Time: 4, Value:  1.215. Add three points to Y line (green), values for the first point: Time: 0, Value: 1. Values for the second point: Time: 3, Value:  2.125. Values for the third point: Time: 4, Value: 2.125. Add three points to Z line (blue), values for the first point: Time: 0, Value: 1.801. Values for the second point: Time: 3, Value:  1.801. Values for the third point: Time: 4, Value: 1.801.
lesson_08_screen_20
  1. To Doors_RV_Lower add property Position. Add three points to X line (red), values for the first point: Time: 0, Value: 1.242. Values for the second point: Time: 1.398, Value: 1.242. Values for the third point: Time: 4, Value:  1.242. Add three points to Y line (green), values for the first point: Time: 0, Value: 1.242. Values for the second point: Time: 1.398, Value:  1.869. Values for the third point: Time: 4, Value: 1.869. Add three points to Z line (blue), values for the first point: Time: 0, Value: 1.221. Values for the second point: Time: 1.398, Value:  1.221. Values for the third point: Time: 4, Value: 1.221.
lesson_08_screen_21
  1. Connect the Output 2 in the Latch.fg block to Play in the Close Door block. From the Nodes window in the editor drag following elements on the Flowgraph window: DOORS_UPPER_CV, DOORS_LOWER_CV, DOORS_UPPER_RV, DOORS_LOWER_RV. Connect the Doors_CV_Upper in the Close door block to DOORS_UPPER_CV block. Connect the Doors_CV_Lower in the Close door block to DOORS_LOWER_CV block. Connect the Doors_RV_Upper in the Close door block to DOORS_UPPER_RV block. Connect the Doors_RV_Lower in the Close door block to DOORS_LOWER_RV block.
test
  1. Add two Set Boolean blocks. Connect the Finished from the Open door block to True in the first Set Boolean block. Connect the OnPlay from the Close door to False in the first Set Boolean block. Connect the OnPlay from the Open door block to True in the second Set Boolean block. Connect the Finished from the Open door block to False in the second Set Boolean block. Connect the OnPlay from the Close door to True in the second Set Boolean block. Connect the Finished from the Close door block to False in the second Set Boolean block.
test
  1. Connect the Output from the first Set Boolean block to Input of the Logic And block. Add Init block and connect its Output to False in the first Set Boolean block. Add Boolean block, set it to False, name it doorsOpened? and connect it to Result in the first Set Boolean block and to B in the Logic And block. Add Boolean block, set it to False, name it doorsOpening? and connect it to the Result in the second Set Boolean block and to Condition in the If block (connections marked in yellow).
lesson_08_screen_24
  1. Add two If blocks. Connect the Output of the second Set Boolean block to Input of the first If block. Connect the True in the first If block to Input of the second If block. Connect the doorsOpening? block to Condition in the second If block. Connect the Condition in the first If block to isActive? block (connections marked in yellow).
lesson_08_screen_25
  1. Add Set Boolean block, connect its True to False in the If block and its False to True in the same If block. Add two Set Property block, open them and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect the Input of the first Set Property block with the Output of the Set Boolean block. Connect the Output of the first Set Property block with the Input of the second Set Property block. Add Boolean block, set it to False and connect it to Result in the Set Boolean block and to Enabled in both newly added Set Property blocks. Connect the Node in the first Set Property block to SELECTION_HANDLE_CV block. Connect the Node in the second Set Property with the SELECTION_HANDLE_RV block.
lesson_08_screen_26
  1. From the Embedded containers add ActionClick block, save it under ActionClick and name it Click Arrow. From the Nodes window drag the SELECTION_ARROW object to Flowgraph window and connect it to Object in Click Arrow block. Add Integer block, open it and select APP_BUTTON_LEFT, connect it to APP_BUTTON in the Click Arrow block. Add If block and connect its Input to Output of the Click Arrow block. Connect the Condition in the newly added If block to canEnterHeli? block.
lesson_08_screen_27
  1. Add If block, connect its Input to True of the If block. Connect the Condition in the newly added If block to the isActive? block. Add SignalOutput block, open it and in Create new enter Disable Configurator. Connect the True in the If block to Disable Configurator in the SignalOutput block.
lesson_08_screen_28
  1. Add Get Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player]. Connect the True in the If block to Input of the Get Property block. Add Game block and connect it to Game in the Get Property block. Add Player block and connect it to Player in the Get Property block. Add Cast block, open it and in Convert From enter Player  [Player], in Convert To enter Playeractor  [PlayerActor]. Connect the Output of the Get Property block to Input of the Cast block. Connect the Player block to Player in the Cast block. Add PlayerActor block and connect it to PlayerActor in the Cast block.
test
  1. Add Container block, name it Create PlayerDummy. Open it and save it under AddPlayerDummy. Inside the Create PlayerDummy block add SignalInput block, open it and in Create new enter Create.  Add Create PlayerDummy block, connect its Input to Create in the SIgnalInput block. Add PlayerDummy block and connect it to Result in Create PlayerDummy block. Add DataInput block, open it and in Create new enter Target PlayerActor, in Type enter Player [Data/Items/Players]. Connect the Get in DataInput block to Output of the Create PlayerDummy block. Add Player block and connect it to Target PlayerActor in DataInput block.
test
  1. Add Is Null block, connect its Input to Output of DataInput block. Connect the Item in the Is Null block to Player block. Add Cast block, open it and in Convert From enter Player  [Player], in Convert To enter Playeractor  [PlayerActor]. Connect the False in the Is Null block to Input of the Cast block. Connect the Player block to Player in the Cast block. Add PlayerActor block and connect it to PlayerActor in the Cast block.
test
  1. Add Get Property block, open it and in Type enter Playeractor [Data/Items/Players], in Property enter WorldPosition  [Vec3].  Connect the Input of the Get Property block to Succeeded in the Cast block. Connect the Player in the Get Property block to Player Actor block. Add Vec3 block and connect it to WorldPosition in the Get Property block.
test
  1. Add Get Property block, open it and in Type enter Playeractor [Data/Items/Players], in Property enter CollisionHeight  [Real]. Connect the Input of the Get Property block to Succeeded in previous Get Property block. Connect the PlayerActor in Get Property block to PlayerActor block. Add Real block and connect it to CollisionHeight in Get Property block.
test
  1. Add Get Property block, open it and in Type enter PlayerActor [Data/Items/Players], in Property enter CollisionRadius  [Real]. Connect the Input of the newly added Get Property block to Succeeded in the previous Get Property block. Connect the PlayerActor in Get Property block to PlayerActor block. Add Real block and connect it to CollisionRadius in Get Property block.
test
  1. Add Add Real block, connect its Input to Succeeded in the last Get Property block. Connect the Real block (the one connected to CollisionHeight) to A in Add Real block. Connect the Real block (the one connected to CollisionRadius) to B in Add Real block. Add new Real block and connect it to Result in Add Real block. Add Real To Vec3 block, connect its Input to Output of the Add Real block. Connect the Real block (the one connected to Result in Add Real block) to Z in the Real To Vec3 block. Add two Real blocks, connect one to X and one to Y in Real To Vec3 block. Add Vec3 block and connect it to Result in Real To Vec3 block.
lesson_08_screen_35
  1. Add Add Vec3 block, connect its Input to Output of the Real To Vec3 block. Connect the Vec3 block (the one connected to WorldPosition) to A in the Add Vec3 block. Connect the Vec3 block (the one connected to Result) to B in the Add Vec3 block. Add new Vec3 block and connect it to Result in Add Vec3 block.
lesson_08_screen_36
  1. Add Set Property block, open it and in Type select Player [Data/Items/Players], in Type select WorldPosition  [Vec3]. Connect its Input to Output of Add Vec3 block. Connect the PlayerDummy block to Player in Set Property block. Connect the Vec3 block (the one connected to Result in AddVec3 block) to WorldPosition in the Set Property block. Add Get Property block, open it and in Type enter PlayerActor [Data/Items/Players], in Property enter ViewDirection  [Vec3]. Connect its Input to Succeeded in Set Property block. Connect the PlayerActor block to PlayerActor in Get Property block. Add new Vec3 block and connect it to ViewDirection in Get Property block. Add Set Property block, open it and in Type enter Player [Data/Items/Players], in Property enter WorldDirection  [Vec3]. Connect its Input to Succeeded in Get Property block. Connect the PlayerDummy block to Player in the Set Property block. Connect the last Vec3 block to WorldDirection in the last Set Property block.
lesson_08_screen_37
  1. Add Set Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player]. Connect its Input to True in Is Null block and to Output of the previous Set Property block. Add Game block and connect it to Game in the newly added Set Property block. Connect the PlayerDummy block to Player in the Set Property block.
lesson_08_screen_38
  1. Connect the Fail from Set Property and Get Property blocks to Input of the last Set Property block (as indicated in the picture below). Add DataOutput block, open it and in Create new: Name enter Created PlayerDummy, in Type enter PlayerDummy [Data/Items/Players]. Connect the Succeeded from the last Set Property block to Set in the Data Output block. Connect the PlayerDummy block to Created PlayerDummy in DataOutput block. Add SignalInput block, open it and in Create new enter Finished. Connect the Finished in the SignalOutput block to Output of the DataOutput block.
lesson_08_screen_39
  1. Go back to EnterHelicopter.fg. Connect the Output in the Cast block to Create in the Create PlayerDummy block. Connect the PlayerActor block to Target PlayerActor in Create PlayerDummy block. Add PlayerDummy block and connect it to Created PlayerDummy in the Create PlayerDummy block.
test
  1. Add Set Property block, open it and in Type enter Player [Data/Items/Players], in Property enter ZFar  [Real]. Connect the Finished in Create PlayerDummy block to Input of the Set Property block. Connect the Player in Set Property block to PlayerDummy block. Add Real block, open it and enter 12000, name it Zfar  and connect it to ZFar in Set Property. Add another Set Property block open it and in Type enter Player [Data/Items/Players], in Property enter ZNear  [Real].  Connect its Input to Output of the previous Set Property block. Connect the Player in the new Set Property block to PlayerDummy block. Add Real block, open it and enter 0.1, name it Znear  and connect it to ZNear in Set Property.
test
  1. Add five new Set Property blocks, open them and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect the Output of the last Set Property to Input of the first of the newly added Set Property block. Connect the PlayerActor block to Node in the first Set Property block. Add Boolean block, set it to False and connect it to Enabled in the first Set Property block. Connect the remaining Set Property blocks with each other through Output - Input. Connect the Boolean block to Node in the remaining four Set Property blocks. Connect the SELECTION_HANDLE_CV block to Node in the second Set Property block. Connect the SELECTION_HANDLE_RV block to Node in the third Set Property block. Connect the ENTER_HELI block to Node in the fourth Set Property block. Connect the ARROW block to Node in the fifth Set Property block.
lesson_08_screen_42
  1. Add Get Property block, open it and in Type enter Node [Data/Items/World], in Property enter WorldRotation  [Quat]. Connect the Output from the last Set Property block to Input of the Get Property block. Add Quat block and connect it to WorldRotation in Get Property block. From the Embedded containers add MoveByTime block, save it under MoveByTime. Change its name to Move to anim position, connect its Move to Output of the GetProperty block. Connect the PlayerDummy block to Moved Node in Move to anim position block. From the Nodes window in the editor drag the target_eye_position to Flowgraph window and connect it to Node in Get Property block and to Destination Node in the Move to anim position block. Add Real block, change its name to MoveTo Position Time, open it and enter 2. Connect the MoveTo Position block to MoveTime in Move to anim position block.
lesson_08_screen_43
  1. From the Embedded containers add RotationByTime block, save it under RotationByTime. Connect the Output from the Get Property block to Move in RotationByTime block. Connect PlayerDummy block to Rotation Node in the RotationByTime block. Connect the Quat block to TargetRotation in RotationByTime block. Connect the Time in RotationByTime to MoveTo Position Time block.
lesson_08_screen_44
  1. Add Timeline block, open it and inside Add input: PlayerDummy [Data/Items/Players], change its name to Camera. To Camera add two properties: WorldPosition and WorldRotation. Select WorldPosition and add points with values as presented in the image below.
    First three lines on the Z line in World Position have different function assigned - Bezier function. The remaining points have Linear function assigned to them.
lesson_08_screen_45
  1. Select WorldRotation and add points with values as presented in the image below.
lesson_08_screen_46
  1. Connect the Rotated in the RotationByTime block to Play in the Timeline block. Connect the Camera in the Timeline block to PlayerDummy block. Connect the Finished in the Timeline block to Play in Close door block. Connect the Finished in the Timeline block to False in the first Set Boolean block. Add SIgnalOutput block, open it and in Create new enter Completed. Connect the Finished in Timeline block to Completed in SignalOutput block.
test
  1. Go to master_tutorial.fg. Find the Set String block, open it and add new element, in Name enter Heli: get in!, in Value enter Approach the helicopter door and press the door handle. Then press the arrow to get into the helicopter. If the arrow is not displayed move closer to the door. Add another element, in Name enter Heli: wait until heli out, in Value enter Wait for the helicopter to move out of the hangar.
test
  1. Connect the Heli: get in! in the Switch - step infos block to Heli: get in! in Set String block and to setActive in Enter Helicopter block. Connect the Completed in the Enter Helicopter block to Step 8 in Set Integer block.  Add Set Boolean block, connect its False to Disable configurator  in Enter Helicoipter block. Connect the Result in the Set Boolean block to isConfigEnabled? block. Connect the Output in the Set Boolean block to SetConfigButtonEnabled in Menu Control block.
lesson_08_screen_49
  1. Go to the editor and press Play, check if you can reach the step, where you can open the helicopter doors and enter the helicopter by pressing on an arrow.
  2. In the master_tutorial.fg add Container block. Change its name to Pilot Camera. Open it and save it under MoveOutHelicopter name. Inside the Pilot Camera block add SignalInput block, open it and in Create new enter setCameraActive. Add If block and connect its Input to setCameraActive in SignalInput block. Add Set Real block, opent it and change the name of Input0 to Reset Value and in Value enter 180. Connect the Reset Value in Set Real block to False in the If block.  Add Set Property block, open it and in Type select Game [Data/Items/Engine], in Property enter Player  [Player].  Connect the Output in the Set Real block to Input of the Set Property block. Add Game block and connect it to Game in the Set Property block. Add Set Boolean block, connect its True to Succeeded in  Set Property block.
lesson_08_screen_50
  1. Add SignalInput block, open it and in Create new enter setCameraInactive. Connect the setCameraInactive in the SignalInput block to False in the Set Boolean block. Add SignalInput block, open it and in Create new enter setActive. Add If block and connect its Input to setActive in SignalInput block. Add Boolean block, set it to False, name it isInitialized? and connect it to Condition in the If block. Connect the False in the If block to True in the Set Boolean block.  Add Set Boolean block, connect its True to False in the If block. Connect the isInitialized? to Result in the Set Boolean block.
test
  1. Add Get Property block, open it and in Type enter Game [Data/Items/Engine], in Property enter Player  [Player]. Connect the Input of the Get Property block to False in the If block. Add Game block and connect it to the Game in the Get Property block. Add Player block, name it Player - Current Player and connect it to Player in the Get Property block and to Player in the Set Property block.
test
  1. Add Get Property block, open it and in Type enter Player [Data/Items/Players], in Property enter Transform  [Mat4], connect its Input to Succeeded in the previous Get Property block. Connect the Player - CurrentPlayer block to Player in Get Property block. Add Mat4 block and connect it to Transform in the Get Property block. Add Decompose Mat4 block, connect its Input to Succeeded in the Get Property block. Connect the Mat4 block to Matrix in the Decompose Mat4 block. Add Quat block and connect it to Rotation in the Decompose Mat4 block.
test
  1. Add Get QuatEulerAngles block, connect its Input to Output in the Decompose Mat4 block. Connect the Quat block to Quat in Get QuatEulerAngles block. Add three Real blocks and connect one to Roll, Pitch and Yaw in Get QuatEulerAngles block. Add Add WorldChild block, connect its Input to Output of the Get QuatEulerAngles block. Connect the Player - CurrentPlayer block to Child in the Add WorldChild block. From the Nodes window in the editior drag the HELICOPTER_FBX object to the Flowgraph window and connect it to Node in the Add WorldChild block. Add Get Property block, open it and in Type enter Engine [Data/Items/Engine], in Property enter Controls  [Controls],  and connect its Input to Output of the Add WorldChild block. Add Engine block and connect it to Engine in the Get Property block. Add Controls block, change its name to Controls - currentControls and connect it to Controls in the Get Property block.
lesson_08_screen_54
  1. Add Timeline block, change its name to Doors Opening. Open the Doors Opening block and two Node [Data/Items/World] inputs. Name them Hangar_doors_1 and Hangar_doors_2. Add Position property to Hangar_doors_1. Add two points on each line (X,Y,Z) and copy values from the image below. The red line (X) has points added as Spline function for the remaining lines use Linear function.
lesson_08_screen_55
  1. Add Position property to Hangar_doors_2. Add two points on each line (X,Y,Z) and copy values from the image below. The red line (X) has points added as Spline function for the remaining lines use Linear function.
lesson_08_screen_56
  1. Go back to MoveOutHelicopter.fg and connect the Output of the Get Property block to Play in Doors Opening block. From the Nodes window in the editor drag the hall_doors_1 and hall_door_2 elements on the Flowgraph window. Connect the hall_door_1 block to Hangar_doors_1 and hall_door_2 block to Hangar_doors_2  in Doors Opening block.
test
  1. Add Timeline block and name it Platform move out. Open the Platform move out block and add Node [Data/Items/World] input. Change its name to HeliPlatform and add Position property to it. Add two points on each line (X,Y,Z) and copy values from the image below. The green line (Y) has points added as Spline function for the remaining lines use Linear function. Note that the red and blue lines have very similar values so they overlap, the red line is not visible on the image below.
lesson_08_screen_58
  1. Go back to MoveOutHelicopter.fg and connect the Finished in the Doors Opening block to Play in the Platform move out block. From the Nodes window drag the helicopter_moving_platform object to Flowgraph window and connect it to HeliPlatform in the Platform move out block. Add SignalOutput block, open it and in Create new enter Completed. Connect the Finished in the Platform move out block to Completed in the SignalOutput block.
test
  1. Add Update block, add If block and connect its Input to Output of the Update block. Add Boolean block, set it to False, name it isCameraUpdating? and connect it to Condition in the newly added If block, to the Condition of the first If block and to Result in the Set Boolean block.
lesson_08_screen_60
  1. Add If block and connect its Input to True in the If block. Add Set Real block, open it and change the name of Input0 to Reset, in Value enter 0. Connect the False from the If block to Reset in the Set Real block. Add Get Property block, open it and in Type enter Controls [Data/Items/Controls], in Property enter MouseDX  [Real], connect its Input to True in the If block. Connect the Controls - currentControls  block to Controls in the Get Property block. Add Real block, name it DX and connect it to MouseDX in Get Property block and to Result in Set Real block. Add Get Property block, open it and in Type enter Controls [Data/Items/Controls], in Property enter MouseDY  [Real], connect its Input to Output in the Get Property block. Connect the Controls - currentControls  block to Controls in the Get Property block. Add Real block, name it DY and connect it to MouseDY in Get Property block and to Result in Set Real block.
lesson_08_screen_61
  1. Add Multiply Real block, connect its Input to Output of the Get Property block and to Output of the Set Real block. Connect the A in the Multipy Real block to DX block. Add Real block, open it and enter -1, connect it to B in the Multiply Real block. Connect the Result in the Multiply Real block to DX block.
lesson_08_screen_62
  1. Add Multiply Real block, connect its Input to Output of the Multiply Real block. Connect the A in the Multipy Real block to DY block. Add Real block, open it and enter -1, connect it to B in the Multiply Real block. Connect the Result in the Multiply Real block to DY block.
test
  1. Add Add Real block, connect its Input to Output of the Multiply Real block. Connect the DX block to A in the Add Real block. Add Real block, change its name to CurrentPitch, open it and enter 180, connect it to B and Result in Add Real block and to Result in the Set Real block. Add Add Real block, connect its Input to Output of the previous Add Real block. Connect the DY block to A in the Add Real block. Add Real block, change its name to CurrentRoll, connect it to B and Result in Add Real block.
lesson_08_screen_64
  1. Add Clamp Real block, connect its Input to Output of the Add Real block. Connect the CurrentPitch block to Value and Result in the Clamp Real block. Add Real block, open it and enter value 90, connect it to Min in the Clamp Real block. Add Real block, open it and enter value 270, connect it to Max in the Clamp Real block. Add Clamp Real block, connect its Input to Output of the Clamp Real block. Connect the CurrentRoll block to Value and Result in the Clamp Real block. Add Real block, open it and enter value -40, connect it to Min in the Clamp Real block. Add Real block, open it and enter value 90, connect it to Max in the Clamp Real block.
lesson_08_screen_65
  1. Add Set Mat4ByRotateYAngle block, connect its Input to Output of the Clamp Real block. Connect the CurrentPitch block to Angle [Deg] in the Set Mat4ByRotateYAngle block. Add Mat4 block and connect it to Matrix in the Set Mat4ByRotateYAngle block. Add Set Mat4ByRotateXAngle block, connect its Input to Output of the Mat4ByRotateYAngle block. Connect the CurrentRoll block to Angle [Deg] in the Set Mat4ByRotateXAngle block. Add Mat4 block and connect it to Matrix in the Set Mat4ByRotateXAngle block.
lesson_08_screen_66
  1. Add Multiply Mat4 block, connect its Input to Output of the Set Mat4ByRotateXAngle block. Connect the first Mat4 block to A in the Multiply Mat4 block. Connect the second Mat4 block to B in the Multiply Mat4 block. Add new Mat4 block and connect it to Result in the Multiply Mat4 block. Add Multiply Mat4 block, connect its Input to Output of the previous Multiply Mat4 block. Connect the last Mat4 block to A in the Multiply Mat4 block. Connect the Mat4 block (the one connected to Matrix in the Set Mat4ByRotateXAngle block ) to B in the Multiply Mat4 block. Add new Mat4 block and connect it to Result in the Multiply Mat4 block.
lesson_08_screen_67
  1. Add Decompose Mat4 block, connect its Input to Output of Multiply Mat4 block. Connect the last Mat4 block to Matrix in the Decompose Mat4 block. Add Quat block and connect it to Rotation in the Decompose Mat4 block. Add Set Property block, open it and in Type enter Player [Data/Items/Players], in Property enter Rotation  [Quat], connect its Input to Output of the Decompose Mat4 block. Connect the Player - CurrentPlayer block to Player in the Set Property block. Connect the last Quat block to Rotation in the Set Property block.
lesson_08_screen_68
  1. Add MousePress block, add If block, connect the OnPress in the MousePress block to Input in the If block. Connect the isCameraUpdating? block to Condition in the If block. Add Set Boolean block, connect its True to True in the If block. Add MouseRelease block and connect its OnRelease to False in the Set Boolean block. Add Boolean block, name it rotateCamera? and connect it to Result in the Set Boolean block and to Condition in the If block.
lesson_08_screen_69
  1. Go back to the master_tutorial.fg and connect the Heli: wait until heli out in the Switch - step infos to Heli: wait until heli out in Set String block and to setActive in Pilot Camera block. Connect the Completed in the Pilot Camera block to Step 9 in the Set Integer block.
lesson_08_screen_70
  1. Go to the editor and press Play, check if you can reach the step, where the helicopter is moved outside the hangar.
  2. The next lesson will show you how to create interaction in the helicopter's cockpit.

 

  Previous lesson || Next lesson