Skip to content

Commit

Permalink
Merge branch 'tutorial-scenario'
Browse files Browse the repository at this point in the history
I'll carry on working on the tutorial mainly in the branch, but I'd rather be able to get it tested via nightlies a bit at a time to spread out the feedback. The scenario support and new start menu are also needing testing. So further merges from this branch will happen in future.
  • Loading branch information
cim-- committed Dec 8, 2013
2 parents dbcd7f0 + d9f1b66 commit b17b39a
Show file tree
Hide file tree
Showing 31 changed files with 5,537 additions and 147 deletions.
1 change: 1 addition & 0 deletions GNUmakefile.postamble
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ after-all::
$(CP) $(CP_FLAGS) Resources/InfoPlist.strings $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/AIs $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/Config $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/Scenarios $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/Scripts $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/Shaders $(PROGDIR)/Resources
$(CP) $(CP_FLAGS) Resources/Binary/Images $(PROGDIR)/Resources
Expand Down
25 changes: 24 additions & 1 deletion Resources/Config/descriptions.plist
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,28 @@
"load-previous-commander-yes" = "y"; // Defines the key that corresponds to the yes answer to load-previous-commander.
"load-previous-commander-no" = "n"; // Defines the key that corresponds to the no answer to load-previous-commander.

"oolite-start-option-1" = " Start New Commander ";
"oolite-start-option-2" = " Load Commander ";
"oolite-start-option-3" = " View Ship Library ";
"oolite-start-option-4" = " Manage Expansion Packs "; // not yet implemented
"oolite-start-option-5" = " Exit Game ";

"oolite-newgame-title" = "Start New Commander";

"oolite-ship-library-title" = "Ship Library";
"oolite-ship-library-exit" = "Press space to exit ship library";

"oolite-loadsave-exit" = "Return to Menu";
"oolite-scenario-exit" = "Return to Menu";
"oolite-scenario-standard-name" = "Normal Start";
"oolite-scenario-strict-name" = "Strict Mode";
"oolite-scenario-tutorial-name" = "Tutorial";
"oolite-scenario-standard-description" = "Start with a Cobra Mk III and 100 credits at Lave station, and try to make a living.";
"oolite-scenario-strict-description" = "Strict Mode starts like the normal start, but all expansion packs are permanently disabled for this Commander.";
"oolite-scenario-tutorial-description" = "Take a standard Cooperative flight training course, including simulated combat and docking practice.";



// Loading screen (currently Mac only), also logged under start.progress
"loading-ships" = "Loading ship data";
"populating-space" = "Populating space";
Expand Down Expand Up @@ -1111,6 +1133,7 @@
"options-save-commander" = " Save Commander ";
"options-load-commander" = " Load Commander ";
"options-begin-new-game" = " Begin New Game ";
"options-return-to-menu" = " End Game and Return to Menu ";
"options-game-options" = " Game Options… ";
"options-exit-game" = " Exit Game ";
"options-reset-to-unrestricted-play" = " Reset and enable OXPs ";
Expand Down Expand Up @@ -1294,7 +1317,7 @@
"shipyard-price-@" = " Price %@.";

// Load/Save screens shared information
"loadsavescreen-commander-name" = "Commander Name";
"loadsavescreen-commander-name" = "Commander";
"loadsavescreen-rating" = "Rating";
"loadsavescreen-no-commanders-found" = "No commanders found";
"loadsavescreen-commander-@-rated-@-has-@-legal-status-@-ship-@-location-@-g-@-timestamp-@" = "Commander %@ is rated %@ and has %@ in the bank. Legal status: %@. Ship: %@. Location: %@ (G%d). Timestamp: %@";
Expand Down
14 changes: 14 additions & 0 deletions Resources/Config/equipment.plist
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,19 @@
{
available_to_player = false;
}
),
/* condition script blocks this one from appearing normally */
(
100, 500000, "Tutorial Controls",
"EQ_OOLITE_TUTORIAL_CONTROLS",
"Tutorial Controls.",
{
condition_script = "oolite-conditions.js";
script = "oolite-tutorial-equipment.js";
available_to_all = true;
visible = false; // Hidden on status screen.
damage_probability = 0;
}
)

)
15 changes: 13 additions & 2 deletions Resources/Config/hud.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
{ // scanner zoom indicator
alpha = 1.0;
selector = "drawScannerZoomIndicator:";
x = 108;
y = 32;
x = 100;
y = 36;
y_origin = -1;
},
//{ // stick sensitivity indicator
Expand Down Expand Up @@ -233,13 +233,15 @@
y_origin = -1;
height = 20;
width = 10;
with_dial = "drawForwardShieldBar:";
},
{ text = "AFT";
x = -262;
y = 66;
y_origin = -1;
height = 20;
width = 10;
with_dial = "drawAftShieldBar:";
},
{
text = "FUEL";
Expand All @@ -248,6 +250,7 @@
y_origin = -1;
height = 14;
width = 9;
with_dial = "drawFuelBar:";
},
{
text = "CT";
Expand All @@ -256,6 +259,7 @@
y_origin = -1;
height = 14;
width = 9;
with_dial = "drawCabinTempBar:";
},
{
text = "LT";
Expand All @@ -264,6 +268,7 @@
y_origin = -1;
height = 14;
width = 9;
with_dial = "drawWeaponTempBar:";
},
{
text = "ALT";
Expand All @@ -272,6 +277,7 @@
y_origin = -1;
height = 14;
width = 9;
with_dial = "drawAltitudeBar:";
},
{
text = "MISS";
Expand All @@ -280,6 +286,7 @@
y_origin = -1;
height = 16;
width = 10;
with_dial = "drawMissileDisplay:";
},
{ // RHS
text = "SPD";
Expand All @@ -288,6 +295,7 @@
y_origin = -1;
height = 20;
width = 10;
with_dial = "drawSpeedBar:";
},
{
text = "ROLL";
Expand All @@ -296,6 +304,7 @@
y_origin = -1;
height = 12;
width = 9;
with_dial = "drawRollBar:";
},
//{ // yaw bar legend, disabled by default
// // uncomment as required to enable
Expand All @@ -304,6 +313,7 @@
// y = -138;
// height = 12;
// width = 9;
// with_dial = "drawYawBar:";
//},
{
text = "PITCH";
Expand All @@ -312,6 +322,7 @@
y_origin = -1;
height = 12;
width = 9;
with_dial = "drawPitchBar:";
}
);
multi_function_displays = (
Expand Down
94 changes: 94 additions & 0 deletions Resources/Config/missiontext.plist
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,98 @@

"oolite-primablemanager-completed" = "Equipment configuration is complete.\n\nFirst fast activation (defensive):\n [oolite-primable-a]\n\nSecond fast activation (offensive):\n [oolite-primable-b]";


// tutorial
"oolite-tutorial-no-witchspace" = "Witchspace controls are not available in this simulator.";

"oolite-tutorial-no-death" = "If this wasn't a simulator, that would have killed you. Be more careful this time!";


"oolite-tutorial-0-0-title" = "Flight Training Course";
"oolite-tutorial-0-0-message" = "Welcome to the Cooperative Flight Training Course, pilot. This course will demonstrate the basic functionality of Cooperative ships to you, in a specially-prepared simulator.\n\nThe course is in multiple sections. While in the simulator, you can use the '[oolite_key_activate_equipment]' key to advance to the next entry in the current lesson, and the '[oolite_key_mode_equipment]' key to go to the next lesson, if you wish to skip sections you have previously completed.\n\nOnce the simulation begins, a panel on your screen will display instructions, which you should follow to progress through the course. If you wish to temporarily hide the panel, press the '[oolite_key_cycle_mfd]' key. You can bring it back with the same key, or it will automatically reappear when there are new instructions.\n\nWhere an instruction asks you to press a letter key, press the letter key alone if it is lower case (e.g. 'i'), and press shift and the key together if it is upper case (e.g. 'K').\n\nWhen you are ready, press the Enter key to begin the simulation with the first lesson.";
"oolite-tutorial-0-0-choices" = { "1" = "Begin Course"; };

"oolite-tutorial-0-2" = "Welcome to the pilot's training course. The lesson information will be displayed on this panel.\n\nYou will often need to press '[oolite_key_activate_equipment]' to go to the next step - do this now to start the first lesson.\n\nRemember, you can also press '[oolite_key_mode_equipment]' to skip to the next lesson.";

"oolite-tutorial-1-0" = "Lesson 1: the HUD\nThis lesson introduces the HUD components in turn.\nFor now, the HUD components have all been hidden. As you go through this lesson, they will be made visible and introduced.";

"oolite-tutorial-1-1" = "Energy banks: 1/3\nThe energy bank gauge shows the stored energy in your ship's capacitors, which are used to power various high-energy systems.\nThey are continually recharged from your ship's power plant, but intensive activity will drain them faster than they can be charged.";

"oolite-tutorial-1-2" = "Energy banks: 2/3\nA crucial system powered by the banks is the emergency hull shield. This will protect your ship and most of its systems from high-energy impact. If your energy banks are too empty to power this shield, this may be fatal.";

"oolite-tutorial-1-3" = "Energy banks: 3/3\nIf your energy banks are low, the gauge will change colour to alert you. Watch how long it takes to recharge from nearly empty, and avoid placing too much strain on the banks.";

"oolite-tutorial-1-4" = "Primary Shields: 1/3\nTo protect your ship further from high energy impacts it is fitted with two shield generators. A pre-charged shield is much more reliable than the emergency hull shield.\nOne generator protects your forward arc...\n";

"oolite-tutorial-1-5" = "Primary Shields: 2/3\n...while the other protects your aft.\nThe charge levels are independent, so try to take impacts on the stronger shield.";

"oolite-tutorial-1-6" = "Primary Shields: 3/3\nThe shields will slowly recharge from the energy banks if they are drained, and the bars will change colour to highlight a drained state. As with the energy banks, a full recharge will take some time.";

"oolite-tutorial-1-7" = "Fuel: 1/2\nThis bar shows the amount of witchspace fuel currently available. The full capacity is sufficient for a seven light-year witchspace jump. With the correct equipment, fuel can also be used to significantly boost your speed in normal space.";

"oolite-tutorial-1-8" = "Fuel: 2/2\nThe vertical line shows the amount of fuel needed to reach the currently selected witchspace destination. If the fuel is insufficient, this will change colour.";

"oolite-tutorial-1-9" = "Cabin Temperature: 1/2\nIn normal flight, your ship will maintain a steady-state temperature, with waste heat gradually being radiated into space. If you are near a hot object such as a star, or travelling quickly through a planet's upper atmosphere, the temperature will rise.";

"oolite-tutorial-1-10" = "Cabin Temperature: 2/2\nAt extremely high temperatures your life support systems will fail. Emergency loops will drain power from your shields and energy banks to buy a few more seconds, but you should have got out long before then.";

"oolite-tutorial-1-11" = "Laser Temperature: 1/2\nFiring your laser generates a significant amount of waste heat. Coolant pumps will diffuse it harmlessly through the much greater mass of your ship, but most types of laser generate heat far faster than the pumps can remove it.";

"oolite-tutorial-1-12" = "Laser Temperature: 2/2\nHold the '[oolite_key_fire_lasers]' key to fire your laser for a while, and note the temperature slowly rises. More powerful lasers generate a much larger volume of waste heat. At high temperatures, your laser will automatically cut out to prevent meltdown.";

"oolite-tutorial-1-13" = "Altitude:\nThis bar shows your height above the nearest major body - a star, planet or moon. Your ship is neither authorised nor equipped for planetary approach. As long as you remain in the upper atmosphere or higher - some bar still showing - you will be safe.";

"oolite-tutorial-1-14" = "Speed:\nThis bar shows your flight speed as a proportion of the maximum speed generated by your ship's inertialess drive. Use the '[oolite_key_increase_speed]' and '[oolite_key_decrease_speed]' keys to speed up and slow down.";

"oolite-tutorial-1-15" = "Roll:\nYour ship's rate of roll is indicated by this dial. Use the '[oolite_key_roll_left]' and '[oolite_key_roll_right]' keys to turn.";

"oolite-tutorial-1-16" = "Pitch:\nYour ship's rate of pitch is indicated by this dial. Use the '[oolite_key_pitch_forward]' and '[oolite_key_pitch_back]' keys to turn in this axis.\nNotice that the dial is relative to your ship's maximum turn rate in the axis. Almost all ships can roll faster than they can pitch.";

"oolite-tutorial-1-17" = "Pylon Status:\nThe icons here show the missiles, mines and other deployable equipment attached to your external pylons. Currently your ship has three standard missiles fitted. Other types of pylon-mounted item have different icons.";

"oolite-tutorial-1-18" = "Scanner:\nThe scanner is perhaps the most important part of your HUD, and using it to locate and identify nearby objects will be the subject of the next lesson.";

"oolite-tutorial-1-19" = "Compass:\nThe compass is used to locate more distant objects outside scanner range. The basic model is used to detect the system's major planet, which appears as a circle on the compass. If the circle is green, the planet is in front of you. Otherwise, it is behind you. Use of the compass for navigation will be covered in a later lesson.";

"oolite-tutorial-1-20" = "Status light: 1/2\nThe status light summarises the local situation. If it is green, as now, there are no large or powered objects nearby. Yellow, which is most common, indicates that there are nearby large or powered objects, and care should be taken while flying.";

"oolite-tutorial-1-21" = "Status light: 2/2\nA red status light indicates that something nearby presents a direct danger to your ship. An alarm will sound to indicate a change to this status.";

"oolite-tutorial-1-22" = "Clock: 1/2\nThe clock shows the current galactic standard time. The first seven digit number is the count of standard days since the start of the calendar. The remaining digits are the time on that standard day. For historical reasons, the standard day does not correspond exactly to that of any Cooperative planet, though it is close to many.";

"oolite-tutorial-1-23" = "Clock: 2/2\nIf the clock becomes unsynchronised with standard time, it will display 'adjusting' while it resynchronises. This is normal after witchspace jumps and when restarting the system after maintenance.";

"oolite-tutorial-1-24" = "This concludes the introduction to the HUD. There are a few additional HUD indicators which depend either on particular equipment or special circumstances, and these will be described in later lessons.";

"oolite-tutorial-2-0" = "Lesson 2: Using the Scanner\nThis lesson introduces use of the scanner for navigation and identification, and the basic flight controls used in space.\n\nStart by bringing your ship to a complete stop using the '[oolite_key_decrease_speed]' key, then press '[oolite_key_activate_equipment]' to start the lesson.";

"oolite-tutorial-2-1-error" = "First bring your ship to a complete stop using the '[oolite_key_decrease_speed]' key.";

"oolite-tutorial-2-1" = "Scanner use: 1/8\nWe have added several asteroids around you, which appear on your scanner as a white marker.\nThe circle of the scanner represents the horizontal plane around your ship, with the lines forward approximately indicating your field of view.";

"oolite-tutorial-2-2" = "Scanner use: 2/8\nThe position of an object above or below the plane is then marked with a stick. The further the object is from the plane, the longer the stick will be.";

"oolite-tutorial-2-3" = "Scanner use: 3/8\nTo bring an object on the scanner into your forward view, first roll your ship with the '[oolite_key_roll_left]' and '[oolite_key_roll_right]' keys until the object is on the forward/back line of the scanner. Then, use the '[oolite_key_pitch_forward]' and '[oolite_key_pitch_back]' keys to turn your ship so that it is in front of you.";

"oolite-tutorial-2-4" = "Scanner use: 4/8\nThe scanner can detect objects up to a substantial distance. Pick one of the asteroids and fly towards it. Accelerate with the '[oolite_key_increase_speed]' key, and decelerate again when nearby with the '[oolite_key_decrease_speed]' key.\nBe careful not to collide with it!";

"oolite-tutorial-2-5" = "Scanner use: 5/8\nWhen concentrating on close-up objects, it may be useful to zoom the scanner, sacrificing range for detail. Press the '[oolite_key_scanner_zoom]' key to zoom in, up to 5x zoom.\nYou can reset the zoom to maximum range using the '[oolite_key_scanner_unzoom]' key. Note the zoom level indicator by the scanner.";

"oolite-tutorial-2-6" = "Scanner use: 6/8\nThe colour of the marker is used to indicate something about its nature. Asteroids are unpowered objects and appear white. Other objects which will appear white include debris, cargo containers, and escape capsules";

"oolite-tutorial-2-7" = "Scanner use: 7/8\nPowered ships usually appear yellow on the scanner, unless they are attacking, when they appear red. Don't worry - this one isn't actually attacking!\nPolice and other official ships are indicated with a purple marker - be careful not to accidentally hit them as this is an illegal act.";

"oolite-tutorial-2-8" = "Scanner use: 8/8\nOther common colours include yellow/green flashing for navigation buoys, light blue for missiles, and red/yellow flashing for mines. Again, don't worry, these are all disarmed!";

"oolite-tutorial-2-9" = "View controls: 1/x\nYour ship is fitted with four view cameras. Use the '[oolite_key_view_forward]', '[oolite_key_view_aft]', '[oolite_key_view_port]' and '[oolite_key_view_starboard]' keys to switch between them. The view lines on the scanner will move as you do. Notice that the crosshair is replaced on the other views, as you have no other weapons mounted.";

"oolite-tutorial-2-10" = "View controls: 2/x\nYour ship can also simulate an external view for you. Press '[oolite_key_custom_view]' to switch to external view mode and to cycle through the available external views. Any of the internal view keys will return you to internal viewing.";

"oolite-tutorial-3-0" = "Lesson 3: Flight Training\nThis lesson gives you opportunity to practice basic piloting skills in a relatively safe environment.";


"oolite-tutorial-end-title" = "Course Complete";
"oolite-tutorial-end-message" = "You have now completed the Pilot's Training Course.";
"oolite-tutorial-end-choices" = { "1" = "Exit Simulator"; };

}
21 changes: 21 additions & 0 deletions Resources/Config/scenarios.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(
{
"file" = "oolite-standard.oolite-save";
"name" = "[oolite-scenario-standard-name]";
"description" = "[oolite-scenario-standard-description]";
"model" = "cobra3-trader";
},
{
"file" = "oolite-tutorial.oolite-save";
"name" = "[oolite-scenario-tutorial-name]";
"description" = "[oolite-scenario-tutorial-description]";
"model" = "coriolis-station";
"scenario" = "oolite-tutorial";
},
{
"file" = "oolite-strict.oolite-save";
"name" = "[oolite-scenario-strict-name]";
"description" = "[oolite-scenario-strict-description]";
"model" = "cobra3-trader";
}
)
36 changes: 35 additions & 1 deletion Resources/Config/shipdata.plist
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,15 @@
};
};
};
"oolite_template_tutorial-buoy" =
{
like_ship = "oolite_template_buoy";
is_template = 1;
beacon = "Buoy (training)";
beacon_label = "Training Buoy";
name = "Training Buoy";
roles = "oolite-tutorial-buoy";
};
"oolite_template_buoy-witchpoint" =
{
like_ship = "oolite_template_buoy";
Expand Down Expand Up @@ -2946,6 +2955,7 @@
max_flight_speed = 1000;
model = "qbomb.dat";
name = "Quirium Cascade Mine";
scan_class = "CLASS_MINE";
roles = "energy-bomb EQ_QC_MINE";
thrust = 0;
};
Expand Down Expand Up @@ -3087,7 +3097,20 @@
weapon_position_port = "-9.0 0.0 11.5";
weapon_position_starboard = "9.0 0.0 11.5";
};
"oolite_template_sidewinder" = {
"oolite_template_tutorial-station" =
{
is_template = 1;
like_ship = "oolite_template_coriolis-station";
ai_type = "nullAI.plist";
is_carrier = 1;
market = "none";
name = "Tutorial Station";
roles = "oolite-tutorial-station";
rotating = no;
scan_class = "CLASS_NO_DRAW";
};
"oolite_template_sidewinder" =
{
aft_eject_position = "0.0 -11.5 -22.5";
ai_type = "oolite-pirateAI.js";
auto_ai = yes;
Expand Down Expand Up @@ -4046,6 +4069,17 @@
};
/* Begin definitions for entities used in the tutorial */
"oolite-tutorial-station" =
{
like_ship = "oolite_template_tutorial-station";
};
"oolite-tutorial-buoy" =
{
"like_ship" = "oolite_template_tutorial-buoy";
};
/* Begin subentity definitions. Subentities do not have templates. */

// subentity, doesn't need template
Expand Down
4 changes: 3 additions & 1 deletion Resources/Config/world-scripts.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"oolite-cloaking-device-mission.js",
"oolite-nova-mission.js",
"oolite-thargoid-plans-mission.js",
"oolite-trumbles-mission.js"
"oolite-trumbles-mission.js",

/* Tutorial */
"oolite-tutorial.js"
)
Loading

4 comments on commit b17b39a

@AnotherCommander
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two bugs found with this commit on Windows:

  1. Crash at end of tutorial. After clicking Exit Simulator at the end of the course, I am booted back to desktop, with nothing of interest in Latest.log and the following line in stderr,txt:
    AL lib: (EE) alc_cleanup: 1 device not closed
  2. Exception in pollDemoControls when selecting Load Commander from the start-up screen and then trying to use Return to Menu. Latest.log is full of lines like the ones below:
    08:29:40.089 [exception]: ***** Exception checking controls [pollDemoControls]: NSRangeException : Index -3 is out of range 4 (in 'objectAtIndex:')
    08:29:40.222 [exception]: ***** Exception checking controls [pollDemoControls]: NSRangeException : Index -3 is out of range 4 (in 'objectAtIndex:')
    08:29:40.292 [exception]: ***** Exception checking controls [pollDemoControls]: NSRangeException : Index -3 is out of range 4 (in 'objectAtIndex:')
    (...)
    The bugs happen both with and without OXPs.

@JensAyton
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During a very quick smoke test, I got this on launching in the tutorial:

Exception: Error: Native exception: -[__NSCFString appendString:]: nil argument
    Active script: oolite-tutorial 1.79
    oolite-tutorial.js, line 195:
                player.ship.setMultiFunctionText("oolite-tutorial",expandMissionText(key),true);

@cim--
Copy link
Member Author

@cim-- cim-- commented on b17b39a Dec 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Okay, on a successful ending of the tutorial I get
18:10:59.298 [script.javascript.init.error]: JavaScript processes still pending. Can't reset JavaScript engine.
18:10:59.298 [script.javascript.init.error]: Scheduling new JavaScript reset.

in the log. That might be causing the problems on Windows. I'll have a look at solutions to that.

  1. Yes, same here. I'm sure that worked at some point...

I think I know where the appendString exception is coming from, too, though that doesn't happen here either.

@cim--
Copy link
Member Author

@cim-- cim-- commented on b17b39a Dec 9, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5ac0101 in the branch should fix these up. Only the demoControls exception happened here though, so the others are a bit speculative.

Please sign in to comment.