diff --git a/Aircraft/c172p/Tutorials/startup.xml b/Aircraft/c172p/Tutorials/startup.xml index 174bf69a5..f16a6a4fb 100644 --- a/Aircraft/c172p/Tutorials/startup.xml +++ b/Aircraft/c172p/Tutorials/startup.xml @@ -7,6 +7,7 @@ This tutorial will take you through the pre-startup checklist and starting the C Aircraft/c172p/Tutorials/startup morning + KLVK 1 @@ -58,28 +59,31 @@ This tutorial will take you through the pre-startup checklist and starting the C Welcome to Livermore Municipal Airport. In this lesson we'll go through the pre-startup checks and start the aircraft. + 10 Before we start up, we need to brief what we'll do in case of an engine fire on startup. As this isn't our aircraft, and we're fully insured, we'll simply open the door and run away. + 10 Next, we check our seatbelts, and seat adjustments. Cessnas can get worn seat rails that sometimes cause the seat to slip backwards, often just as you take off, so make sure it is secure. + 10 - The fuel selector is set to BOTH, the Mixture control is fully rich, and the carb heat is off. + The fuel selector is set to BOTH, the Mixture control is fully rich, and the carb heat is off. - 347.2 - -21.8 + 344.0 + -48.7 0.0 -0.2 - 0.3 - 0.4 - 55.0 + 0.235 + 0.36 + 37.0 @@ -138,6 +142,7 @@ This tutorial will take you through the pre-startup checklist and starting the C Now, we'll check no-one is about to walk into our propeller. + 2 44.0 -15.7 @@ -151,6 +156,7 @@ This tutorial will take you through the pre-startup checklist and starting the C Looks clear. + 2 296.6 -10.4 @@ -183,6 +189,10 @@ This tutorial will take you through the pre-startup checklist and starting the C /sim/panel-hotspots true + + /sim/model/hide-yoke + true + Click the middle hotspot three times, so both magnetos are on and the key is set to BOTH. @@ -262,6 +272,10 @@ This tutorial will take you through the pre-startup checklist and starting the C /sim/panel-hotspots false + + /sim/model/hide-yoke + false + You can release the starter motor now - the engine is running diff --git a/Nasal/tutorial/tutorial.nas b/Nasal/tutorial/tutorial.nas index 6d1a5f74d..86b243eca 100644 --- a/Nasal/tutorial/tutorial.nas +++ b/Nasal/tutorial/tutorial.nas @@ -2,8 +2,8 @@ # --------------------------------------------------------------------------------------- -var step_interval = 0.0; # time between tutorial steps (default is set below) -var exit_interval = 0.0; # time between fulfillment of a step and the start of the next step (default is set below) +var step_interval = 0; # time between tutorial steps (default is set below) +var exit_interval = 0; # time between fulfillment of a step and the start of the next step (default is set below) var loop_id = 0; var tutorialN = nil; @@ -67,8 +67,8 @@ var startTutorial = func { last_step_time = time_elapsedN.getValue(); steps = tutorialN.getChildren("step"); - step_interval = read_double(tutorialN, "step-time", 5.0); # time between tutorial steps - exit_interval = read_double(tutorialN, "exit-time", 1.0); # time between fulfillment of steps + step_interval = read_int(tutorialN, "step-time", 5); # time between tutorial steps + exit_interval = read_int(tutorialN, "exit-time", 1); # time between fulfillment of steps run_nasal(tutorialN); set_models(tutorialN.getNode("models")); @@ -133,9 +133,12 @@ var stopTutorial = func { # - Otherwise display the instructions for the step. # var step_tutorial = func(id) { + + # Check to ensure that this is the currently running tutorial. id == loop_id or return; - var continue_after = func(n, dflt) { - settimer(func { step_tutorial(id) }, read_double(n, "wait", dflt)); + + var continue_after = func(n, w) { + settimer(func { step_tutorial(id) }, w); } # @@ -159,7 +162,10 @@ var step_tutorial = func(id) { step_countN.setIntValue(step_iter_count = 0); do_group(step, "Tutorial step " ~ current_step); - return continue_after(step, step_interval); + + # A tag affects only the initial entry to the step + var w = read_int(step, "wait", step_interval); + return continue_after(step, w); } step_countN.setIntValue(step_iter_count += 1); @@ -197,7 +203,7 @@ var step_tutorial = func(id) { step_start_time = time_elapsedN.getValue(); do_group(step, "Tutorial step " ~ current_step); } - return continue_after(exit, step_interval); + return continue_after(exit, exit_interval); } do_group(exit); @@ -221,12 +227,11 @@ var do_group = func(node, default_msg = nil) { run_nasal(node); } - -var read_double = func(node, child, default) { +var read_int = func(node, child, default) { var c = node.getNode(child); if (c == nil) return default; - c = c.getValue(); + c = int(c.getValue()); return c != nil ? c : default; }