Quazar3D: Master Tutorial
HomePreviousParentNext

Master Tutorial  »  09. Interaction inside the helicopter, adding sound and object movement

09. Interaction inside the helicopter, adding sound and object movement

test

Lesson 09

Complete lesson 08

This lesson will present how to create different types of object interaction inside the helicopter and how to add sound to application.

  1. First we need to add a new file to the project. From the //master_tutorial_basic_assets/sound/ drag the *sound* folder to the File browser window.

 Quazar3D supports following sound file formats: WAV (mono and stereo) and Ogg Vorbis (or oga, Ogg Audio Profile).

  1. From the upper toolbar press the Add a Sound Object and select Source . Press Ok, in the Select sound to load window find the *sound* file, select it and press Open. Now change the name of the radio_message_0 to radio_sound and drag the object in the Nodes window under the HEADSET object. In the Node Properties window set the values in Node and SoundSource tabs by using the Lesson 09 as a point of reference.
  1. Go to the Flowgraph window to master_tutorial.fg. Find the Switch - step infos block, open it and add five new outputs: Checklist, Checklist: start button, Checklist: radio, Checklist: CollectiveStick and Checklist windshield wipers.
test
  1. Find the Set String block, open it and add five new inputs. For the first input in Name enter Checklist in Value enter Press the highlighted checklist and read the instructions. For the second input in Name enter Checklist: start button, in Value enter Press and hold the highlighted button to start the helicopter. For the third input in Name enter Checklist: radio, in Value enter Press the headphones to contact the air traffic control. For the fourth input in Name enter Checklist: CollectiveStick, in Value enter Press and hold the yoke with the left mouse button and try to move it. For the fifth input in Name enter  Checklist: windshield wipers, in Value enter Press the highlighted button to test the wipers.
test
  1. Find the Set Integer block and add five inputs: Step 10 with Value 10, Step 11 with Value 11, Step 12 with Value 12, Step 13 with Value 13 and Step 14 with Value 14,
test
  1. Add a Container block, name it Checklist, open it, press Create and save it under Checklist name. Inside the Checklist block from the Embedded containers add ActionClick block, save it and name it Click Checklist. From the Nodes window in the editor drag the CHECKLIST object and connect it to Object in Click Checklist block. Add Integer block, open it and select APP_BUTTON_LEFT, connect it to APP_BUTTON in Click Checklist block. Add If block and connect its Input to Output of the Click Checklist block. Add Boolean block, set it to False, name it isActive? and connect it to Condition in the If block.
test
  1. Add If block, connect its Input to True of the previous If block. From the Embedded containers add Latch block, save it and connect its Input to False in the If block.
test
  1. Add Timeline block, name it Show Checklist, open it and in Add input enter Node [Data/Items/World]. Change the name of the input Data/Items/World/Node to Checklist. To Checklist add property Position. To each line (X,Y,Z) add three points with values presented in the image below.
lesson_09_screen_06
  1. To Checklist add property Rotation. To each line (X,Y,Z) add three points with values presented in the image below. Note that first two points for each lines have the same values, so they overlap on each other on the Timeline window.
lesson_09_screen_07
  1. Connect the Output 1 in the Latch block to Play in the Show Checklist block. Connect the Checklist block to Checklist in the Show Checklist block. Add Timeline block, name it Hide Checklist.
lesson_09_screen_08
  1. Open the Hide Checklist block. Add input Node [Data/Items/World]. Change the name of input Data/Items/World/Node to Checklist and add property Position. To each line (X,Y,Z) add three points with values presented in the image below.
lesson_09_screen_09
  1. To Checklist add property Rotation. To each line (X,Y,Z) add three points with values presented in the image below.Note that last two points for each lines have the same values, so they overlap on each other on the Timeline window.
lesson_09_screen_10
  1. Connect the Output 2 in the Latch block to Play in the Hide Checklist block. Connect the CHECKLIST block to Checklist in the Hide Checklist block. Add SignalInput block, open it and in Create new enter setHidden. Add If block and connect its Input to setHidden in the SignalInput block. Connect the False in the If block to Play in the Hide Checklist block.
lesson_09_screen_11
  1. Add Set Boolean block, connect its True to OnPlay and its False to Finished in Show Checklist and Hide Checklist blocks. Add Boolean block, set it to False, name it isMovig? and connect it to Result in Set Boolean block and to Condition in the If block.
lesson_09_screen_12
  1. Add Set Boolean block, connect its True to Finished in the Hide Checklist block and its False to Finished in the Show Checklist block. Add Boolean block, set it to False, name it isHidden? and connect it to Result in the Set Boolean block and to Condition in the If block. Add SIgnalOutput block, open it and in Create new enter Completed. Connect the Finished in the Show Checklist block to Completed in the SignalOutput block.
lesson_09_screen_13
  1. Add SignalInput block, open it and in Create new enter setActive. Add Set Boolean block and connect its True to setActive in the SignalInput block. Connect the isActive? block to Result in the Set Boolean block. Add Set Boolean block, connect its True to Output of the Set Boolean block and connect its False to Output of the Click Checklist block. Add Init block and connect its Output to False in the Set Boolean block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Type enter Enabled  [Boolean]. Connect its Input to Output of the Set Boolean block. From the Nodes window in the editor drag the SELECTION_CHECKLIST object and connect it to Node in the Set Property block. Add Boolean block, set it to False, name it isIndicatorVisible? and connect it to Enabled in the Set Property block and to Result in the Set Boolean block.
lesson_09_screen_14
  1. Add SignalInput block, open it and in Create new enter updateChecks. Add DataInput block, open it and Name enter isFirstTaskCompleted?, in Type enter Boolean [Data]. Connect the SetActive in SignalInput block and updateChecks in SIgnalInput block to Get in the DataInput block. Add Boolean block, set it to False, name it isFirst? and connect it to isFirstTaskCompleted? in DataInput block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect its Input to Output of the DataInput block. From the Nodes window in the editor drag the CHECK_1_YES object and connect it to Node in the Set Property block. Connect the isFirst? block to Enabled in the Set Property block.
lesson_09_screen_15
  1. Add Logic Not block, connect its Input to Succeeded in the Set Property block. Connect the isFirst? block to Value in the Logic Not block. Add Boolean block, set it to False and connect it to Result in the Logic Not block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect its Input to Output of the Logic Not block. From the Nodes window drag the CHECK_1_NO object to the Flowgraph window and connect it to Node in the Set Property block. Connect the Boolean block to Enabled in the Set Property block.
lesson_09_screen_16
  1. Add similar structures of blocks for the remaining three tasks. Remember to name the Boolean blocks properly, name the outputs in the DataInput accordingly and add correct objects from the Nodes window (CHECK_2_YES, CHECK_2_NO and so on). Use the image below as a point of reference.
lesson_09_screen_17
  1. Go to master_tutorial.fg and connect the Checklist in Switch - step infos to setActive in the Checklist block and to Checklist in the SetString block. Connect the Completed in the Checklist block to Step 10 in the Set Integer block.
lesson_09_screen_18
  1. Go to the editor and press Play, check if you can reach the step, where you can press the checklist and display it in front of the camera.
  2. Go to master_tutorial.fg, add Container block, name it Checklist Start, open it and save it under ChecklistStartButton name. Inside the Checklist Start block add SignalInput block, open it and in Create new enter setActive. Add Set Boolean block and connect its True to setActive in SignalInput block. Add Init block and connect its Output to False in the Set Boolean block. Add Boolean block, set it to False, name it isActive? and connect it to Result in the Set Boolean block.
test
  1. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect its Input to Output of the Set Boolean block. Connect the isActive? block to Enabled in the Set Property block. From the Nodes window in editor drag the SELECTION_START_BUTTON object to Flowgraph window and connect it to Node in the Set Property block.
test
  1. Below add MousePress block, to its Button connect an Integer block. Add IsMouseButton block, open it and select BUTTON_LEFT, connect its Input to OnPress in the MousePress block. Connect the Integer block to Button in the IsMouseButton block. Add If block and connect its Input to Succeeded in the IsMouseButton block and its Condition to isActive? block.
lesson_09_screen_21
  1. Below add a very similar set of blocks, replace the MousePress block with MouseRelease.
lesson_09_screen_22
  1. Add Get IntersectionMouseDirection block, connect its Input to True in the If block. Add Object block and connect it to Object in the Get IntersectionMouseDirection block. Add Compare Item block, connect its Input to Succeeded in the Get IntersectionMouseDirection block. Connect the A in the Compare Item block to SELECTION_START_BUTTON block. Connect the B in the Compare Item block to Object block.
lesson_09_screen_23
  1. Add Timeline block, open it Add input enter Node [Data/Items/World]. To input Data/Items/World/Node add property Position. To lines X and Y add two points (as Linear function), to line Z three points (as Step function) with values as preseted in the image below.
lesson_09_screen_24
  1. Connect the == in the Compare Item block to Play in the Timeline block. Connect the True in the If block to Stop in the Timeline block. from the Nodes window in the editor drag the START_BUTTON object to the Flowgraph window and connect it to Data/Items/World/Node in the Timeline block. Add SignalOutput block, open it and in Create new enter Completed. Connect the Finished in the Timeline block to Completed in the SignalOutput block.
lesson_09_screen_25
  1. Connect the Finished in the Timeline block to False in the Set Boolean block. Add Set MaterialState and connect its Input to Finished in the Timeline block. From the Nodes window in the editor drag the COCKPIT object on the Flowgraph window and connect it to Object in the Set MaterialState. Add String block, open it, enter emission and connect it to Name in the Set MaterialState block. Add Integer block, open it, enter 1 and connect it to State in the Set MaterialState block. Add Integer block, and connect it to Surface in the Set MaterialState block.
lesson_09_screen_26
  1. Add Timeline block, name it Rotors Startup. Open the Rotors Startup block, in Add input enter Node [Data/Items/World]. Change the name of Data/Items/World/Node to MainRotor. Add a property Rotation and on the Z line (blue) add two points (as Spline function) with values as presented on the screen below.
lesson_09_screen_27
  1. In Add input enter Node [Data/Items/World] Change the name of Data/Items/World/Node to TailRotor. Add a property Rotation and on the X line (red) add two points (as Spline function) with values as presented on the screen below.
lesson_09_screen_28
  1. Connect Output in the Set MaterialState block to Play in the Rotors Startup block. From the Nodes window in the editor drag elements MAIN_ROTOR_DUMMY and BACK_ROTOR_GROUP to the Flowgraph window. Connect the MAIN_ROTOR_DUMMY block to MainRotor and connect BACK_ROTOR_GROUP to TailRotor in the Rotors Startup block.
test
  1. Add Timeline block, name it Rotors Loop. Open the Rotors Loop block and in Add input enter Node [Data/Items/World], change the name of the Data/Items/World/Node input to MainRotor. Add a property Rotation and on the Z line (blue) add two points with values as presented on the screen below.
lesson_09_screen_30
  1. In Add input enter Node [Data/Items/World]. Change the name of Data/Items/World/Node to TailRotor. Add a property Rotation and on the X line (red) add two points with values as presented on the screen below.
lesson_09_screen_31
  1. Connect the Finished in the Rotors Startup block to Play in the Rotors loop block. Connect the MAIN_ROTOR_DUMMY block to MainRotor in the Rotors loop block. Connect the BACK_ROTOR_GROUP block to TailRotor in Rotors loop block. Add a Boolean block, set it to True and connect it to Loop in the Rotors loop block.
test
  1. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect its Input to Finished in the Rotors Startup block. From the Nodes window in the editor drag the BACK_ROTOR_B object and connect it to Node in the Set Property block. Add Boolean block, set it to True and connect it to Enabled in the Set Property block.

    Add second Set Property block, open it and enter the same values as in the first one. Connect its Input to Output of the first Set Property block. From the Nodes window in the editor drag the MAIN_ROTOR_B object to the Flowgraph window and connect it to Node in the second Set Property block. Connect the Boolean block to Enabled in the second Set Property block.

    Add third Set Property block, open it and enter the same values as in the first one. Connect its Input to Output of the second Set Property block. From the Nodes window in the editor drag the MAIN_ROTOR object to the Flowgraph window and connect it to Node in the third Set Property block. Add Boolean block, set it to False and connect it to Enabled in the third Set Property block.

    Add fourth Set Property block, open it and enter the same values as in the first one. Connect its Input to Output of the third Set Property block. From the Nodes window in the editor drag the BACK_ROTOR object to the Flowgraph window and connect it to Node in the third Set Property block. Connect the Boolean block to Enabled in the fourth Set Property block.
lesson_09_screen_33
  1. Go back to master_tutorial.fg. Connect the Checklist: start button in the Switch - step infos block to Checklist: start button in Set String block and to setActive in Checklist Start block. Add Set Boolean block, connect its True to Completed in the Checklist Start block. Add Boolean block, set it to False, name it firstTask and connect it to isFirstTaskCompleted? in Checklist block and to Result in the Set Boolean block. Connect the Output of the Set Boolean block to updateChecks in the Checklist block and to Step 11 in the Set Integer block.
lesson_09_screen_34
  1. Go to the editor and press Play, check if you can reach the step, where you can press start button (press and hold the button), the helicopter's rotors should start and the dashboard should become highlighted.
  2. Now lets connect the sound to the application. In the master_tutorial.fg add a Container, name it Checklist Radio, open it and save it under ChecklistRadio name. Inside the Checlist Radio block add a SignalInput block, open it and in Create new enter setActive. Add a Set Boolean block and connect its True to setActive in the SignalInput block. Add Init block and connect it to False in the Set Boolean block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. connect its Input to Output of the Set Boolean block. Add Boolean block, set it to False, name it isActive? and connect it to Result in the Set Boolean block and to Enabled in the Set Property block. From the Nodes window in the editor drag the SELECTION_HEADSET object on the Flowgraph window and connect it to Node in the Set Property block.
test
  1. From the Embedded containers add ActionClick block, connect its Object to SELECTION_HEADSET block. Add Integer block, open it and select APP_BUTTON_LEFT, connect it to APP_BUTTON in the ActionClick block. Add If block, connect its Input to Output of the ActionClick block and its Condition to isActive? block.
lesson_09_screen_36
  1. Add Play block, connect its Input to True in the If block. From the Nodes window in the editor drag the radio_sound object to the Flowgraph and connect it to SoundSource in the Play block. Add a Set Boolean block, connect its True to Output of the Play block. Connect the Output of the Set Boolean block to False in the Set Boolean block. Add Boolean block, set it to False, name it isPlaying? and connect it to Result in the Set Boolean block.
lesson_09_screen_37
  1. Add Update block and If block. Connect the Output in the Update block to Input of the If block. Connect the Condition in the If block to isPlaying? block. Add Get Property block, open it and in Type enter SoundSource [Data/Items/Sound], it Property enter Playing  [Boolean], connect its Input to True in the If block Connect the SoundSource in the Get Property block to radio_sound block. Add Boolean block, set it to False, name it isPlaying? and connect it to Playing in the Get Property block. Add If block, connect its Input to Succeeded in the Get Property block. Connect the isPlaying? block to Condition in the If block. Connect the False in the If block to False in the Set Boolean block. Add a SignalOutput block, open it and in Create new enter Completed. Connect the False in the If block to Completed in the SignalOutput block.
lesson_09_screen_38
  1. Go back to master_tutorial.fg. Connect the Checklist: radio in the Switch - step infos block to Checklist: radio in Set String block and to setActive in Checklist Radio block. Add Set Boolean block, connect its True to Completed in the Checklist Start block. Add Boolean block, set it to False, name it secondTask and connect it to isSecondTaskCompleted? in Checklist block and to Result in the Set Boolean block. Connect the Output of the Set Boolean block to updateChecks in the Checklist block and to Step 12 in the Set Integer block.
lesson_09_screen_39
  1. Go to the editor and press Play, check if you can reach the step, where you can press the headphones and hear the sound.
  2. Now lets add the movement to the collective stick. First we need to create a WorldTrigger around the collective stick. Go to the editor and from the upper toolbar press Add a Wolrd Object  , select Trigger . Place the Trigger node in the Render window (any position). Name the WorldTrigger_0 object COLLECTIVE_STICK_TRIGGER and place it inside the HELICOPTER_DUMMY object in the Nodes window. In the Node Properties, tab WorldTrigger select the box Touch. In the Render window move the COLLECTIVE_STICK_TRIGGER to position similar to the one presented on the screen. Adjust the size of the object to resemble the size of the object on the screen.
test
  1. Go to the Flowgraph window, to master_tutorial.fg. Add a Container block, name it Checklist Collective Stick. Open it and save it under the ChecklistCollectiveStick name. Inside Checklist Collective Strick block add a WorldTrigger LeaveCallback block, name it WorldTrigger LeaveCallback CollectiveStick moved. Add A SignalOutput block, open it, in the Create new enter Completed. Connect the Output of the WorldTrigger LeaveCallback CollectiveStick moved block to Completed in the SIgnalOutput block. Add Set Boolean block, connect its False to Output of the WorldTrigger LeaveCallback CollectiveStick moved block. Add SignalInput block, open it and in Create new enter setActive. Connect the setActive in the SignalInput block to True in the Set Boolean block. Add Init block and connect is Output to False in the Set Boolean block. Add Boolean block and connect it to Result in the Set Boolean block.
test
  1. Add two Set Property blocks, open them and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connenct the Output in the Set Boolean block to Input of the first Set Property block. Connect the Output of the first Set Property block to Input of the second Set Property block. Connect the Boolean block to Enabled in both Set Property blocks. From the Nodes window in the editor drag the SELECTION_COLLECTIVE_STICK object and connect it to Node in the first Set Property block.
test
  1. Add Set LeaveCallback block, connect its Input to Succeeded in the Set Property block. From the Nodes window in the editor, drag the COLLECTIVE_STICK_TRIGGER object and connect it to Node in the Set Property block and to WorldTrigger in the Set LeaveCallback block. Add String block, open it and enter WorldTrigger LeaveCallback CollectiveStick moved and connect it to EventName in the Set LeaveCallback block.
test
  1. Add Set Boolean block, connect its True to setActive in SignalInput block, connect its False to Output in the Init block. Add Boolean block, set it to False, name it isActive? and connect it to Result in the Set Boolean block. Add Get Property block, open it and in Type enter Engine [Data/Items/Engine], in Property enter Controls  [Controls]. Connect its Input to Output of the Set Boolean block. Add Engine block and connect it to Engine in the Get Property block. Add Controls block and connect it to Controls in the Get Property block.
lesson_09_screen_44
  1. Add Get Property block, open it and in Type enter Node [Data/Items/World], in Property enter WorldTransform  [Mat4]. Connect its Input to Output of the previous Get Property block. Add Mat4 block and connect it to WorldTransform in the Get Property block.
test
  1. From the Embedded containers add ActionClick block and save it. From the Nodes window in the editor drag the COLLECTIVE_STICK_1 object to the Flowgraph window and connect it to Object in the ActionClick block and to Node in the Get Property block. Add Integer block, open it, select APP_BUTTON_LEFT and connect it to APP_BUTTON in the ActionClick block. Add If block, connect its Input to Output of the ActionClick block. Connect the isActive? block to Condition in the If block. Add Set Boolean block, connect its True to True in the If block. Add Boolean block, set it to False, name it isClicked? and connect it to Result in the Set Boolean block.
lesson_09_screen_46
  1. Add Mouse Release block, add IsMouseButton block. Connect the Input in the IsMouseButton block to OnRelease in the MouseRelease block. Add Integer block an connect it to Button in the MouseRelease block and to Button in the IsMouseButton. Add If block and connect its Intput to Output of the IsMouseButton block. Connect the isActive? block to Condition in the If block. Connect the True in the If block to False in the Set Boolean block.
test
  1. Add Update block and If block. Connect the Input in the If block to Output of the Update block. Connect the isClicked? block to Condition the the If 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 block to Controls in the Get Property block. Add Real block, name it DX and connect it to MouseDX in the Get Property block. Add another Ger Property block, open it and in Type enter Controls [Data/Items/Controls], in Property enter MouseDY  [Real]. Connect its Input to Output of the previous Get Property block. Connect the Controls block to Controls in the Get Property block. Add Real block, name it DY and connect it to MouseDY in the Get Property block.
lesson_09_screen_48
  1. Add Add Real block, connect its Input to Output of the Get Property block. Connect the DX block to A in the Add Real block. Add Real block, name it CurrentPitch and connect it to B and Result in the Add 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 new Add Real block. Add Real block, name it CurrentRoll and connect it to B and Result in the new Add Real block.
lesson_09_screen_49
  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 -20, connect it to Min in the Clamp Real block. Add Real block, open it and enter 20, 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 new Clamp Real block. Add Real block, open it and enter -20, connect it to Min in the Clamp Real block. Add Real block, open it and enter 20, connect it to Max in the Clamp Real block.
lesson_09_screen_50
  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 Set 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_09_screen_51
  1. Add Multiply Mat4 block, connect its Input to Output of the Set Mat4ByRotateYAngle. 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 Mat4 block and connect it to Result in the Multiply Mat4 block.
lesson_09_screen_52
  1. 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 second to last Mat4 block to B in the Multiply Mat4 block. Add Mat4 block and connect it to Result in the Multiply Mat4 block. Add Decompose Mat4 block, connect its Input to Output of the 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.
lesson_09_screen_53
  1. Add two Set Property blocks, open them and in Type enter Node [Data/Items/World], in Property enter WorldRotation  [Quat]. Connect the Input in the first Set Property block to Output of the Decompose Ma4 block. Connect the COLLECTIVE_STICK_1 block to Node in the first Set Property block. Connect the Quat block to WorldRotation in the first Set Property block. Connect the Input in the second Set Property block to Output of the first Set Property block. From the Nodes window in the editor drag the COLLECTIVE_STICK_2 object on the Flowgraph window and connect it to Node in the second Set Property block. Connect the Quat block to WorldRotation in the second SetProperty block.
lesson_09_screen_54
  1. Go back to master_tutorial.fg. Connect the Checklist: CollectiveStick in the Switch - step infos block to Checklist: CollectiveStick in Set String block and to setActive in Checklist Collective Stick block. Add Set Boolean block, connect its True to Completed in the Checklist Collective Stick block. Add Boolean block, set it to False, name it thirdTask and connect it to isThirdTaskCompleted? in Checklist block and to Result in the Set Boolean block. Connect the Output of the Set Boolean block to updateChecks in the Checklist block and to Step 13 in the Set Integer block.
lesson_09_screen_55
  1. Go to the editor and press Play, check if you can reach the step, where move the Collective Stick.
  2. Now lets add the movement of the windshield wipers. Go to the master_tutorial.fg, add a Container block, name it Checklist wipers. Open it and save it under Checklistwipers name. Inside the Checklist wipers block add SignalInput block, open it and in Create new enter setActive. Add Set Boolean block, connect its True to setActive in the SignalInput block. Add Init block and connect its Output to False in the Set Boolean block.
test
  1. Add Boolean block, set it to False, name it isActive? and connect it to Result in the Set Boolean block. Add Set Property block, open it and in Type enter Node [Data/Items/World], in Property enter Enabled  [Boolean]. Connect its Input to Output of the Set Boolean block. Connect the isActive? block to Enabled in the Set Property block. From the Nodes window in the editor drag the SELECTION_WIPERS_BUTTON object to the Flowgraph window and connect it to Node in the Set Property block.
test
  1. From the Embedded containers add ActionClick block. Connect the SELECTION_WIPERS_BUTTON to Object in the ActionClick block. Add Integer block, open it and enter APP_BUTTON_LEFT, connect it to APP_BUTTON in the ActionClick block. Add If block, connect its Input to Output of the ActionClick block. Connect the isActive? block to Condition in the If block.
lesson_09_screen_58
  1. Add Timeline block, open it, add input Node [Data/Items/World]. In the Input properties change the name of the Data/Items/World/Node to Wipers_1. To Wipers_1 add property Rotation. To each line add five points. Points on the red line (X) are added as Bezier function. Points on the green line (Y) are added as Spline function. Points on the blue line (Z) are added as Linear function. Copy the values for each point from the image below.
lesson_09_screen_59
  1. Add input Node [Data/Items/World]. In the Input properties change the name of the Data/Items/World/Node to Wipers_2. To Wipers_2 add property Rotation. To each line add five points. Points on the red line (X) are added as Bezier function. Points on the green line (Y) are added as Spline function. Points on the blue line (Z) are added as Linear function. Copy the values for each point from the image below.

lesson_09_screen_60
  1. Connect the True in the If block to False in the Set Boolean block. Connect the True in the If block to Play in the Timeline block. From the Nodes window in the editor drag the WIPERS_1 object and connect it to Wipers_1 in the Timeline block.  From the Nodes window in the editor drag the WIPERS_2 object and connect it to Wipers_2 in the Timeline block. Add SignalOutput block, open it and in Create new enter Completed. Connect the Finished in the Timeline block to Completed in the SIgnalOutput block.
lesson_09_screen_61
  1. Go back to master_tutorial.fg. Connect the Checklist: windshield wipers in the Switch - step infos block to Checklist: windshield wipers in Set String block and to setActive in Checklist Wipers block. Add Set Boolean block, connect its True to Completed in the Checklist Wipers block. Add Boolean block, set it to False, name it fourthTask and connect it to isFourthTaskCompleted? in Checklist block and to Result in the Set Boolean block. Connect the Output of the Set Boolean block to updateChecks and setHidded in the Checklist block, to Step 14 in the Set Integer block and to setCameraInactive in the Pilot Camera block.
lesson_09_screen_62
  1. Go to the editor and press Play, check if you can reach the step, where you press the button to start the windshield wipers.
  2. The next step will show you how to change the camera and how to lift the helicopter.

 

  Previous step || Next step