From 86de5faa16832f26540585f68f6d479451e914e0 Mon Sep 17 00:00:00 2001 From: cim Date: Mon, 16 Dec 2013 18:09:29 +0000 Subject: [PATCH 1/2] Fix typos in tutorial briefing text --- Resources/Config/missiontext.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/Config/missiontext.plist b/Resources/Config/missiontext.plist index c024ad4f..f6092788 100644 --- a/Resources/Config/missiontext.plist +++ b/Resources/Config/missiontext.plist @@ -266,9 +266,9 @@ "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-9" = "View controls: 1/2\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-2-10" = "View controls: 2/2\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. Your ship has been disarmed temporarily to focus on movement over weapon use."; From d5093e241248f9e560f5b5b166f93879b738c25e Mon Sep 17 00:00:00 2001 From: cim Date: Tue, 17 Dec 2013 13:05:18 +0000 Subject: [PATCH 2/2] Tutorial lessons 4 and 5 --- Resources/Config/missiontext.plist | 44 +++++++- Resources/Config/shipdata.plist | 16 ++- Resources/Scripts/oolite-tutorial.js | 150 +++++++++++++++++++++++++-- 3 files changed, 198 insertions(+), 12 deletions(-) diff --git a/Resources/Config/missiontext.plist b/Resources/Config/missiontext.plist index f6092788..f3ada689 100644 --- a/Resources/Config/missiontext.plist +++ b/Resources/Config/missiontext.plist @@ -276,7 +276,7 @@ "oolite-tutorial-3-2" = "We have added a dense asteroid cluster nearby. Use your scanner to locate the buoy within it, then fly within 500m of the buoy and come to a complete stop."; - "oolite-tutorial-3-3-error" = "To continue, come to a stop near the buoy."; + "oolite-tutorial-3-3-error" = "To continue, come to a stop near the buoy. Use your '[oolite_key_scanner_unzoom]' key to maximise scan range if you are having trouble finding it."; "oolite-tutorial-3-3" = "Some of the asteroids will now start moving towards you. Staying within 5000m of the buoy, use your scanner to spot the moving asteroids, and the movement controls to avoid them.\nTo help you, the asteroids will be highlighted red on your scanner. Keep moving!\nIf it gets too much, just fly further from the buoy."; @@ -290,6 +290,48 @@ "oolite-tutorial-3-4b" = "You survived [mission_oolite_tutorial_asteroids] seconds without scanner assistance.\nIt's probably time to press '[oolite_key_mode_equipment]' to go to the next stage of the course, but you can have another go with '[oolite_key_activate_equipment]' if you want."; + "oolite-tutorial-4-0" = "Lesson 4: Weapons systems\nThis lesson will give you the chance to practice basic targeting and laser usage skills."; + + "oolite-tutorial-4-1" = "Three asteroids have been added near you. Use the '[oolite_key_ident_system]' key to activate your identification system. Then, turn your ship so that one of the asteroids is directly in front of you. The ident system will then lock on to the asteroid."; + + "oolite-tutorial-4-2" = "Three splinters (tiny rock fragments) have also been added now. Press '[oolite_key_ident_system]' again to reset the identification system to search mode, making sure you are not pointed at an asteroid. Then, use your scanner to search for the splinters. You may find you need to move closer to effectively identify such a small object."; + + "oolite-tutorial-4-3" = "The rocks have now been removed. As your identification system loses a target, it will automatically reset to search mode. The 'Scanner Targeting Enhancement' and 'Target System Memory Expansion' optional addons will further improve the operation of the ident system."; + + "oolite-tutorial-4-4" = "Your ship is equipped with a basic pulse laser. This weapon is not recommended for use in live combat, due to its slow rate of fire, but that property makes it an ideal training weapon.\nIt also has the advantage that it will take much longer to overheat than a beam laser."; + + "oolite-tutorial-4-5" = "The '[oolite_key_fire_lasers]' key is used to fire your laser. We have added five stationary asteroids to use as target practice. Once you are confident of your ability to hit a large unmoving target, move on to the next stage.\nNote that your laser has a maximum range of 12.5km, so you may need to get closer."; + + "oolite-tutorial-4-6" = "For the second stage, we have added some smaller boulders, and set them moving. Again, move on once you are confident in your ability to destroy these targets."; + + "oolite-tutorial-4-7" = "Finally, we have added some tiny rock splinters for you to hunt down. Make sure your aim is precise! Once you are ready, press '[oolite_key_activate_equipment]' to start the next lesson."; + + "oolite-tutorial-5-0" = "Lesson 5: Missiles\nThis lesson covers basic missile use and anti-missile tactics."; + + "oolite-tutorial-5-1" = "The Cobra III can carry up to four pylon weapons. We have loaded three of them with standard ship-to-ship missiles. Press '[oolite_key_target_missile]' to arm a missile. The missile icon will turn yellow."; + + "oolite-tutorial-5-2" = "We have added two asteroids, specially toughened so that your pulse laser will be ineffective. Turn to face one of them, and the armed missile will turn red as it locks on. You can use '[oolite_key_untarget_missile]' to break the lock, or '[oolite_key_target_missile]' to try to lock on to another target."; + + "oolite-tutorial-5-3" = "If you wish to change the missile you are using, press '[oolite_key_next_missile]'. As for now all your missiles are identical, however, you can launch the missile with '[oolite_key_launch_missile]'. If it doesn't destroy the asteroid, launch another!"; + + "oolite-tutorial-5-4" = "You can launch missiles, but what if a missile is launched at you? A standard missile contains enough explosives to destroy or seriously damage a Cobra III. The second half of this lesson describes missile avoidance techniques."; + + "oolite-tutorial-5-5" = "Missile avoidance: 1/6\nMissiles can be destroyed by laser fire, but this is tricky to get right, especially with only a pulse laser, so for now we recommend that you try to avoid them. Use your scanner to locate the light blue marker, and try to keep it behind you and off to one side as it closes in."; + + "oolite-tutorial-5-6" = "Missile avoidance: 2/6\nOnce the missile gets closer, start making sharp turns away from it to throw it off. Even if you don't avoid it, if it explodes behind you then your engines are likely to help you away from the blast, reducing the damage you take. A head-on collision is likely to be lethal."; + + "oolite-tutorial-5-7" = "Missile avoidance: 3/6\nIf you find missile avoidance difficult, the 'ECM (Electronic Counter-Measures) System' is available from most shipyards as an addon to your ship. It will confuse most but not all missiles into losing you as a target, and they will harmlessly self-destruct."; + + "oolite-tutorial-5-8" = "Missile avoidance: 4/6\nIn live combat, if you do not have an ECM, one of your enemies might. So, if you get a missile fired at you, fire one right back at them - the ECM field is indiscriminate and will destroy both missiles."; + + "oolite-tutorial-5-9" = "Missile avoidance: 5/6\nAnother approach is to outrun the missile - their fuel supply is extremely limited. If the missile has been fired from long-range, turning away from it and flying at full speed may get you clear."; + + "oolite-tutorial-5-10" = "Missile avoidance: 6/6\nOkay, that's enough talking - time for some practice. When you next press '[oolite_key_activate_equipment]', we will fire a missile at you. Avoid it by whatever means you can, and note the warnings your HUD gives."; + + "oolite-tutorial-5-11" = "Here it comes. Good luck!\n\nOnce you have survived the missile, press '[oolite_key_activate_equipment]' to start the next lesson."; + + + "oolite-tutorial-end-mfd" = "You have completed the course. Press '[oolite_key_activate_equipment]' to view your test scores."; "oolite-tutorial-end-title" = "Course Complete"; diff --git a/Resources/Config/shipdata.plist b/Resources/Config/shipdata.plist index 1cdbe1ce..b660cc12 100644 --- a/Resources/Config/shipdata.plist +++ b/Resources/Config/shipdata.plist @@ -566,6 +566,14 @@ }; model = "oolite_alt_asteroid.dat"; }; + "oolite_template_tutorial-asteroid" = + { + like_ship = "oolite_template_asteroid"; + is_template = 1; + energy_recharge_rate = 50; // effectively immune to pulse fire + name = "Training Asteroid"; + roles = "tutorial-asteroid"; + }; "oolite_template_barrel" = { ai_type = "dumbAI.plist"; @@ -4073,14 +4081,18 @@ /* Begin definitions for entities used in the tutorial */ - "oolite-tutorial-station" = + "oolite-tutorial-asteroid" = { - like_ship = "oolite_template_tutorial-station"; + "like_ship" = "oolite_template_tutorial-asteroid"; }; "oolite-tutorial-buoy" = { "like_ship" = "oolite_template_tutorial-buoy"; }; + "oolite-tutorial-station" = + { + "like_ship" = "oolite_template_tutorial-station"; + }; /* Begin subentity definitions. Subentities do not have templates. */ diff --git a/Resources/Scripts/oolite-tutorial.js b/Resources/Scripts/oolite-tutorial.js index 3f7bed25..ef58fa0b 100644 --- a/Resources/Scripts/oolite-tutorial.js +++ b/Resources/Scripts/oolite-tutorial.js @@ -61,7 +61,9 @@ this.startUp = function() 25, // stage 1: HUD displays 11, // stage 2: scanner and views 6, // stage 3: basic flight challenge - 0, // stage 4: (not yet started) + 8, // stage 4: targeting + lasers + 12, // stage 5: missiles + avoidance + 0, // stage 6: (not yet started) ]; this.$shipList = []; @@ -103,6 +105,7 @@ this.startUp = function() { player.ship.targetSystem = 55; player.ship.hudHidden = true; + player.ship.hideHUDSelector("drawPrimedEquipment:"); mission.runScreen( { titleKey: "oolite-tutorial-0-0-title", @@ -318,15 +321,10 @@ this.startUp = function() player.ship.awardEquipment("EQ_MISSILE"); } this._resetHUDItems(); + this._resetShips(); this._setFrameCallback(null); + player.ship.hideHUDSelector("drawPrimedEquipment:"); player.ship.hudHidden = false; - for (i=this.$shipList.length-1;i>=0;i--) - { - if (this.$shipList[i] && this.$shipList[i].isShip) - { - this.$shipList[i].remove(); - } - } var fc = addFrameCallback(function(delta) { player.ship.velocity = player.ship.thrustVector; @@ -335,6 +333,17 @@ this.startUp = function() } + this._resetShips = function() + { + for (var i=this.$shipList.length-1;i>=0;i--) + { + if (this.$shipList[i] && this.$shipList[i].isShip) + { + this.$shipList[i].remove(); + } + } + } + this._addShips = function(role,num,pos,rad) { var arr = system.addShips(role,num,pos,rad); @@ -807,10 +816,133 @@ this.startUp = function() rocks[i].remove(); } //... move this line to later when there are more sections - this._setInstructions("oolite-tutorial-end-mfd"); + this._setInstructions("oolite-tutorial-4-0"); } + this.__stage4sub1 = function() + { + this._setInstructions("oolite-tutorial-4-1"); + this._addShips("asteroid",3,player.ship.position,20E3); + } + + this.__stage4sub2 = function() + { + this._setInstructions("oolite-tutorial-4-2"); + this._addShips("splinter",3,player.ship.position,20E3); + } + + this.__stage4sub3 = function() + { + this._setInstructions("oolite-tutorial-4-3"); + this._resetShips(); + } + + this.__stage4sub4 = function() + { + this._setInstructions("oolite-tutorial-4-4"); + } + + this.__stage4sub5 = function() + { + this._setInstructions("oolite-tutorial-4-5"); + this._addShips("asteroid",5,player.ship.position,20E3); + } + + this.__stage4sub6 = function() + { + this._setInstructions("oolite-tutorial-4-6"); + var ships = this._addShips("boulder",5,player.ship.position,10E3); + for (var i=0;i<5;i++) + { + ships[i].velocity = Vector3D.random(150); + } + } + + this.__stage4sub7 = function() + { + this._setInstructions("oolite-tutorial-4-7"); + var ships = this._addShips("splinter",5,player.ship.position,10E3); + for (var i=0;i<5;i++) + { + ships[i].velocity = Vector3D.random(150); + } + } + + this.__stage5sub0 = function() + { + this._setInstructions("oolite-tutorial-5-0"); + } + + this.__stage5sub1 = function() + { + this._setInstructions("oolite-tutorial-5-1"); + } + + this.__stage5sub2 = function() + { + this._setInstructions("oolite-tutorial-5-2"); + this._addShips("tutorial-asteroid",2,player.ship.position,20E3); + } + + this.__stage5sub3 = function() + { + this._setInstructions("oolite-tutorial-5-3"); + } + + this.__stage5sub4 = function() + { + this._setInstructions("oolite-tutorial-5-4"); + } + + this.__stage5sub5 = function() + { + this._setInstructions("oolite-tutorial-5-5"); + } + + this.__stage5sub6 = function() + { + this._setInstructions("oolite-tutorial-5-6"); + } + + this.__stage5sub7 = function() + { + this._setInstructions("oolite-tutorial-5-7"); + } + + this.__stage5sub8 = function() + { + this._setInstructions("oolite-tutorial-5-8"); + } + + this.__stage5sub9 = function() + { + this._setInstructions("oolite-tutorial-5-9"); + } + + this.__stage5sub10 = function() + { + this._setInstructions("oolite-tutorial-5-10"); + } + + this.__stage5sub11 = function() + { + this._setInstructions("oolite-tutorial-5-11"); + var adder = this._addShips("[adder]",1,player.ship.position.add([6E3,6E3,6E3]),0)[0]; + adder.target = player.ship; + adder.fireMissile(); + adder.remove(); + } + + + + + + this.__stage6sub0 = function() + { + this._setInstructions("oolite-tutorial-end-mfd"); + } + this._endTutorial = function() { player.ship.hudHidden = true;