home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58b_TRIBES.iso / Tribes / base / scripts.vol / Training_Welcome.cs < prev    next >
Encoding:
Text File  |  1998-12-16  |  11.4 KB  |  251 lines

  1. //Training_welcome.cs
  2. //-------------------------------------
  3. exec("game.cs");
  4. exec("Training_AI.cs");
  5.  
  6. //Globals
  7. //////////////////////
  8. $Train::missionType = "WELCOME";
  9.  
  10. //--------------------------------
  11. //TrainingWelcome::start()
  12. //--------------------------------
  13. function TrainingWelcome::Start(%playerId)
  14. {
  15.    //this mess will give us sensor ping
  16.    %group = "MissionGroup\\teams\\team1\\sensor";  
  17.    %sensor = Group::getObject(%group, 0);  
  18.    %sensor.origPos = "\"808.601 -196.23 99.1342\"";
  19.    %sensor.pingPos = "\"-16.8637 -28.1507 155.878\"";
  20.    %position = "-16.8635 -28.1505 155.876";
  21.    
  22.    %x = getWord(%position, 0);
  23.    %y = getWord(%position, 1);
  24.    GameBase::startFadeOut(%sensor);
  25.    
  26.    //display the proper bitmap in our objective screen
  27.    Training::displayBitmap(0);
  28.    
  29.    //this needs to be redone. Patch?
  30.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>This mission will provide instruction on basic player movement and your heads-up display.\", 10);", 5);
  31.    schedule("messageAll(0, \"~wshell_click.wav\");", 5);
  32.    
  33.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>Let's get started.....\", 5);", 10);
  34.    schedule("messageAll(0, \"~wshell_click.wav\");", 10);
  35.    
  36.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>We will start with the heads-up display, or HUD.\", 10);", 15);
  37.    schedule("messageAll(0, \"~wshell_click.wav\");", 15); 
  38.    
  39.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>In the upper left hand corner of the screen there are two meters.  The green meter is your armor meter, the blue is your energy meter.\", 20);", 25);
  40.    schedule("messageAll(0, \"~wshell_click.wav\");", 25);
  41.    schedule("flashIcon(\"healthHud\", 20, 0.5);", 25);
  42.    schedule("flashIcon(\"jetPackHud\", 20, 0.5);", 25);
  43.    
  44.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>The green meter displays the current status of your armor. When it falls to zero, you will die. The blue meter displays your current energy reserves. When it falls to zero, your jump jets and all equipment requiring energy will not function.\", y);", 45);
  45.    schedule("messageAll(0, \"~wshell_click.wav\");", 45);
  46.    schedule("flashIcon(\"healthHud\", 10, 0.5);", 45);
  47.    schedule("flashIcon(\"jetPackHud\", 10, 0.5);", 55);
  48.    
  49.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>In the upper right-hand corner of the screen is your compass. This is a versatile feature for setting and finding waypoints in the vast landscapes of the game.\", 20);", 65);
  50.    schedule("messageAll(0, \"~wshell_click.wav\");", 65);
  51.    schedule("flashIcon(\"compassHud\", 20, 0.5);", 65);
  52.    
  53.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>When you have been assigned a waypoint, a solid triangle will appear in the middle of your compass to guide you to your destination. The distance to the waypoint is displayed in meters.\", 20);", 85);
  54.    schedule("messageAll(0, \"~wshell_click.wav\");", 85);
  55.    schedule("issueCommand(" @ %playerId @ ", " @ %playerId @ ", 0, \"Waypoint set to tower switch.\", " @ %x @ ", " @ %y @ ");", 85);
  56.    
  57.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>The red line on the compass shows you which direction you are heading. To get to the waypoint, line the triangle up with the red line and move in that direction.\", 20);", 105);
  58.    schedule("messageAll(0, \"~wshell_click.wav\");", 105);
  59.    
  60.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>At the bottom left of your screen is your Weapon/Pack Bar, displaying the weapons and pack that you presently possess.\", 20);", 125);
  61.    schedule("messageAll(0, \"~wshell_click.wav\");", 125);
  62.    
  63.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>  The number next to the weapon icons displays how much ammo remains for that weapon. If the weapon uses energy for ammo, the infinity symbol replaces the number.\", 20);", 145);
  64.    schedule("messageAll(0, \"~wshell_click.wav\");", 145);
  65.    schedule("flashIcon(\"weaponHud\", 20, 0.5);", 125);
  66.    
  67.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>The weapon you are currently using will be highlighted  Press 1 to bring up your blaster, your most basic weapon.\", 20);", 165);
  68.    schedule("messageAll(0, \"~wshell_click.wav\");", 165);
  69.    
  70.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>At the top of the screen is the chat display. Messages from teammates and mission updates will be displayed here.\", 20);", 185);
  71.    schedule("messageAll(0, \"~wshell_click.wav\");", 185);
  72.    schedule("flashIcon(\"chatDisplayHud\", 20, 0.5);", 185);
  73.    
  74.    schedule("control::setVisible(\"sensorHUD\", true);", 204);
  75.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>The small radar dish icon in the upper right hand corner of the screen is the Sensor icon. When you are being scanned by enemy sensors, it will flash red.\", 20);", 205);
  76.    schedule("messageAll(0, \"~wshell_click.wav\");", 205);
  77.    schedule("GameBase::setPosition(" @ %sensor @ ", " @ %sensor.pingPos @ ");", 205);
  78.    schedule("flashIcon(\"sensorHUD\", 20, 0.5);", 204);
  79.   
  80.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>This concludes the HUD Tutorial. If you would like to adjust the position of any of the icons that are part of your HUD, in other missions you may use the K key to drag them to other locations, and toggle them on or off.\", 20);", 225);
  81.    schedule("messageAll(0, \"~wshell_click.wav\");", 225);
  82.    schedule("GameBase::setPosition(" @ %sensor @ ", " @ %sensor.origPos @ ");", 225);
  83.    
  84.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>Using your jump jets is one of the most important things to learn. The default key for jetting is the right mouse button. You can climb to a fairly high altitude, but you will take damage when trying to land from a great height.\", 20);", 245);
  85.    schedule("messageAll(0, \"~wshell_click.wav\");", 245);
  86.    
  87.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>To run forward, use the W key. To sidestep left, use the A key.  To sidestep right, use the D key. To jump, use the space bar.\", 20);", 265);
  88.    schedule("messageAll(0, \"~wshell_click.wav\");", 265);
  89.    
  90.    schedule("bottomprint(" @ %playerId @ ", \"<f1><jc>Familiarize yourself with the movement keys. When you are ready, jet your way up to the highest platform arranged around your base and hit the switch to end this introduction.\", 20);", 285);
  91.    schedule("messageAll(0, \"~wshell_click.wav\");", 285);                                                               
  92. }
  93.  
  94. //----------------------------------------
  95. //TowerSwitch::onCollision()
  96. //---------------------------------------
  97. function TowerSwitch::onCollision(%this, %object)
  98. {
  99.     %playerId = Player::getClient(%object);
  100.     messageAll(0, "~wCapturedTower.wav");
  101.     bottomprint(%playerId, "<f1><jc>You have completed the introduction!", 8);
  102.     messageAll(0, "~wshell_click.wav");
  103.     schedule("Training::missionComplete(" @ %playerId @ ");", 8);
  104. }
  105.  
  106. //-----------------------------------------
  107. //Game::playerSpawned()
  108. //-----------------------------------------
  109. function Game::playerSpawned(%pl, %clientId, %armor, %respawn)
  110. {
  111.    Player::setItemCount(%clientId,$ArmorName[%armor],1);
  112.    Player::setItemCount(%clientId,Blaster,1);
  113.    Player::setItemCount(%clientId,Chaingun,1);
  114.    Player::setItemCount(%clientId,DiscLauncher,1);
  115.    Player::setItemCount(%clientId,Plasmagun,1);
  116.    Player::setItemCount(%clientId,Mortar,1);
  117.    Player::setItemCount(%clientId,grenadelauncher,1); 
  118.    Player::setItemCount(%clientId,Energyrifle,1);
  119.    Player::setItemCount(%clientId,DiscLauncher,1);
  120.    Player::setItemCount(%clientId,laserrifle,1);
  121. }
  122.  
  123. //----------------------------------------
  124. //Game::initialMissionDrop()
  125. //---------------------------------------
  126. function Game::initialMissionDrop(%clientId)
  127. {
  128.     GameBase::setTeam(%clientId, 0);
  129.     Client::setGuiMode(%clientId, $GuiModePlay);
  130.     Game::playerSpawn(%clientId, false);
  131.  
  132.     schedule("bottomprint(" @ %clientId @ ", \"<f1><jc>Training Mission 1 - Introduction and basic player movement.\", 5);", 0);
  133.     schedule("messageAll(0, \"~wshell_click.wav\");", 0);
  134.     schedule("welcome::checkIcons();", 3);
  135.     ObjectiveScreen();
  136.     TrainingWelcome::Start(%clientId);
  137. }
  138.  
  139. //----------------------------------------
  140. //ObjectiveScreen()
  141. //----------------------------------------
  142. function ObjectiveScreen()
  143. {
  144.    %time = getSimTime() - $MatchStartTime;
  145.    
  146.    Training::displayBitmap(0);
  147.    Team::setObjective(0, 1, "<f5><jl>Mission Completion:");
  148.    Team::setObjective(0, 2, "<f1>   -Collision with control switch");
  149.    Team::setObjective(0, 3, "\n");
  150.    Team::setObjective(0, 4, "<f5><jl>Mission Information:");
  151.    Team::setObjective(0, 5, "<f1>   -Mission Name: Introduction to TRIBES");
  152.    Team::setObjective(0, 6, "\n");
  153.    
  154.    Team::setObjective(0, 7, "<f5><j1>Mission Objectives:");
  155.    Team::setObjective(0, 8, "<f1>   -Learn the main game screen icons and basic player movement.");
  156.    Team::setObjective(0, 9, "\n");
  157.    
  158.    Team::setObjective(0, 10, "\n");
  159.    Team::setObjective(0, 11, "\n");
  160.    Team::setObjective(0, 12, "\n");
  161.    Team::setObjective(0, 13, "\n");
  162.    Team::setObjective(0, 14, "\n");
  163. }
  164.  
  165.  
  166. //------------------------------------------
  167. //flashIcon()
  168. //------------------------------------------
  169. function flashIcon(%icon, %time, %increment)
  170. {
  171.     %off = "true";
  172.     for(%i = 0; %i <= %time; %i = %i + %increment)
  173.     {
  174.         if(%off)
  175.         {   
  176.             schedule("control::setVisible(" @ %icon @ ", " @ %off @ ");", %i);
  177.             %off = "false";
  178.         }
  179.         else
  180.         {
  181.             schedule("control::setVisible(" @ %icon @ ", " @ %off @ ");", %i);
  182.             %off = "true";
  183.         }
  184.     }
  185. }
  186.  
  187. //------------------------------------
  188. //missionSummary()
  189. //------------------------------------
  190. function missionSummary()
  191. {
  192.    %time = getSimTime() - $MatchStartTime;
  193.    Training::displayBitmap(0);
  194.    Team::setObjective(0, 1, "<f5><jl>Mission Completion:");
  195.    Team::setObjective(0, 2, "<f1>   -Completed:");
  196.    Team::setObjective(0, 3, "\n");
  197.    
  198.    Team::setObjective(0, 4, "<f5><jl>Mission Information:");
  199.    Team::setObjective(0, 5, "<f1>   -Mission Name: Introduction to TRIBES");
  200.    Team::setObjective(0, 6, "\n");
  201.    
  202.    Team::setObjective(0, 7, "<f5><j1>Mission Objectives:");
  203.    Team::setObjective(0, 8, "<f1>   -Total Mission Time: " @ "<f1>" @ Time::getMinutes(%time) @ " Minutes " @ Time::getSeconds(%time) @ " Seconds");
  204.    Team::setObjective(0, 9, "\n");
  205.    
  206.    Team::setObjective(0, 10, "\n");
  207.    Team::setObjective(0, 11, "\n");
  208.    Team::setObjective(0, 12, "\n");
  209.    Team::setObjective(0, 13, "\n");
  210.    Team::setObjective(0, 14, "\n");
  211. }
  212.  
  213. //------------------------------------
  214. //Training::missionComplete()
  215. //------------------------------------
  216. function Training::missionComplete(%cl)
  217. {
  218.     schedule("Client::setGuiMode(" @ %cl @ ", " @ $GuiModeObjectives @ ");", 0);
  219.     missionSummary();
  220.     remoteEval(2049, TrainingEndMission);
  221. }
  222.  
  223. //------------------------------------
  224. //remoteTrainingEndMission()
  225. //------------------------------------
  226. function remoteTrainingEndMission()
  227. {
  228.    schedule("EndGame();", 8);
  229. }
  230.  
  231. //------------------------------
  232. //Welcome::CheckIcon()
  233. //------------------------------
  234. function Welcome::CheckIcons()
  235. {
  236.    $AI_SaveHealth = Control::getVisible("healthHud");
  237.    $AI_SaveJett = Control::getVisible("jetPackHud");
  238.    $AI_SaveWeapons = Control::getVisible("weaponHud");
  239.    $AI_SaveCompass = Control::getVisible("compassHud");
  240.    $AI_SaveChat = Control::getVisible("chatDisplayHud");
  241.    $AI_SavePing = Control::getVisible("sensorHUD");
  242. }
  243.  
  244. //do nothing functions
  245. function remoteScoresOn(%clientId)
  246. {
  247. }
  248.  
  249. function remoteScoresOff(%clientId)
  250. {
  251. }