Advertisement
Guest User

Untitled

a guest
Sep 17th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 9.71 KB | None | 0 0
  1. -- enable alerts, turn off for release version
  2. enableAlerts(0);
  3. -- disable all safe zones
  4. -- setSafeZones( 0 );
  5.  
  6. ----------------------------------------------------------------------------
  7.  
  8. function onInitialize()
  9.     -- Perform any initialization here, this is called right after the script is loaded
  10. end
  11.  
  12. ----------------------------------------------------------------------------
  13.  
  14. function onRelease()
  15.     -- Called before the script is released
  16. end
  17.  
  18. -------------------------------------------------------------------------------
  19. -- Server Side functions
  20.  
  21. function activateECCMScanner( shipId )
  22.     local count = useGadget( shipId, "P", nil, 0 );     -- activate ECCM
  23.     if count <= 0 then
  24.         scriptAlert( "Could not activate ECCM" );
  25.     end
  26.  
  27.     count = useGadget( shipId, "Y", nil, 0 );           -- activate Scanner
  28.     if count <= 0 then
  29.         scriptAlert( "Could not activate Scanner" );
  30.     end
  31. end
  32.  
  33. function getEnemyFleetId( notFleetId )
  34.     local maxFleet = fleetCount();
  35.     for i=0, maxFleet do
  36.         local checkFleetId = fleetId( i );
  37.         if not checkFleetid == notFleetId then
  38.             return checkFleetId;
  39.         end
  40.     end
  41. end
  42.  
  43. --function onSpawnCombat1( cadetId )
  44. --  local fleetId = getFleetId( cadetId );
  45. --  local enemyFleetId = fleetId + 1; -- getEnemyFleetId( fleetId );
  46.  
  47. --  local shipICC = spawnShip( "Ships\\ICC\\Destroyer\\M190 A\\SC_M190A.PRT", "Mycopia", "Schak'JaJ", fleetId );
  48. --  local shipUGTO1 = spawnShip( "Ships\\UGTO\\Frigate\\ST-6 Interceptor\\SC_ST6.prt", "Mycopia", "Mephiblo", enemyFleetId );
  49. --  local shipUGTO2 = spawnShip( "Ships\\UGTO\\Frigate\\ST-6 Interceptor\\SC_ST6.prt", "Mycopia", "Damion", enemyFleetId );
  50.  
  51. --  orderShip( shipICC, "Mycopia", 2 );
  52. --  orderShip( shipUGTO1, "Mycopia", 2 );  
  53. --      orderShip( shipUGTO2, "Mycopia", 2 );  
  54.  
  55. --  enablePointDefence( shipICC );
  56.     --enablePointDefence( shipUGTO1 );
  57. --  enablePointDefence( shipUGTO2 );
  58. --end
  59.  
  60.  
  61. function enablePointDefence( shipId )
  62.     local maxGadget = gadgetCount( shipId ) - 1;
  63.     for i = 0, maxGadget do
  64.         local gadgetId = getGadget( shipId, i );
  65.         if getGadgetType( gadgetId ) == 6 then  -- normal beam weapon
  66.             setBeamPointDefence( gadgetId, 1 );
  67.         end
  68.     end
  69. end
  70.  
  71. function doEJump( shipId )
  72.     if not isShipDestroyed( shipId ) then
  73.         useGadget( shipId, "J", nil, 1 );
  74.         startTimer( 5, "removeShip( \"" .. shipId .. "\" );" );
  75.     end
  76. end
  77.  
  78. function removeShip( shipId )
  79.     if not isShipDestroyed( shipId ) then
  80.         detachNoun( shipId );
  81.     end
  82. end
  83.  
  84. ----------------------------------------------------------------------------
  85.  
  86. -- The following callbacks are only called when running on the client
  87.  
  88. function onFleetSelect()
  89.     -- Called before the player selects a team
  90. end
  91.  
  92. function onFleetSelected( fleetId )
  93.     -- Called after the player selects a fleet, the fleet ID is passed
  94. end
  95.  
  96. function onSetFleet( fleetId )
  97.     -- called when the server assigns the players fleetId
  98. end
  99.  
  100. function onSpawnSelect()
  101.     -- called when the player enters the spawn selection screen
  102. end
  103.  
  104. function onSpawnSelected( spawnId )
  105.     -- called when the player selects a spawn point
  106. end
  107.  
  108. function onShipSelect()
  109.     messageBox( "<b>Tutorial: Bombing With Infantry(RAZING)</b>\n\nWelcome to the DarkSpace Bombing Tutorial. You may press <b>F1</b> at any time to see additional help for the Current View you're on(Map(F2), Planetary(F3), Tactical(Initial View)). For now, you only have one ship to select, once you actually get into the Main servers; you will have access to all ships that you have the rank, and badges for. Go ahead and click on the ship located in the bottom-middle of the screen.\n\nClick on the <b>OK</b> button to continue, click on the <b>Cancel</b> button to abort this tutorial. (Keep in mind, to exit the Tutorial Session you must hit Escape and then Click on \"Logoff\")\n\nIf you don't understand basic Flight control, please run the Basic Controls tutorial.","","cancelTutorial()" );
  110. end
  111.  
  112. function onShipSelected( shipName )
  113.     messageBox("<b>Great! Now in the bottom right corner you'll see a Box that has the Lore, current ship status, and the requirements to Spawn said ship(Rank, Badges, resources required, etc.) After you're familiar with the way the ship selection screen works, go ahead and click \"Launch\". \n\nClick on the <b>OK</b> button to continue, click on the <b>Cancel</b> button to abort this tutorial.", "", "cancelTutorial()");
  114. end
  115.  
  116. function onTactical()
  117.     startBombingTutorial();
  118. end
  119.  
  120. function onShipAttached( shipId )
  121. end
  122.  
  123. function onShipDetached( shipId )
  124. end
  125.  
  126. function onDeath()
  127.     -- Called when the players ship is destroyed
  128. end
  129.  
  130. function onCaptured()
  131.     -- Called when the players ship is captured
  132. end
  133.  
  134. function onDisconnected()
  135.     -- Called when connection to the server is lost
  136. end
  137.  
  138. function onEndGame()
  139.     -- Called when the scenerio or mission is completed
  140. end
  141.  
  142. function startBombingTutorial()
  143.         messageBox("<b>Good job! Now, we need to go-to Mycopia. As a refresher, press the F2 button to take you to the Map View. Once there, find the Planet \"Mycopia\" on the Planet list near the bottom left to middle side of the Screen. Then, Click the \"Orbit\" button near the bottom right side of your Screen next to the planets Portrait, and status. Or, alternatively, press the \"O\" button on your keyboard whilst clicked on the Planet you wish to goto. This will order your ship to plot a course to the Planet, once it's been plotted, your ship will align to jump, then once there will commence the orbiting sequence. Do so now. \n\nClick on the <b>OK</b> button to continue, click on the <b>Cancel</b> button to abort this tutorial.", "onWaitOrbit()", "cancelTutorial()");
  144. end
  145.  
  146. function onTacticalView()
  147. end
  148.  
  149. function onShipStatus()
  150. end
  151.  
  152. function onRepairQueue()
  153. end
  154.  
  155. function onSystemsDisplay()
  156. end
  157.  
  158. function onCargoDisplay()
  159. end
  160.  
  161. function onHelmControls()
  162. end
  163.  
  164. function onTargetDisplay()
  165. end
  166.  
  167.  
  168. end
  169.  
  170. function onNavigationView()
  171.  
  172. end
  173.  
  174. function onNavigationFocus()
  175.  
  176. end
  177.  
  178. function onNavigationContacts()
  179.     messageBox( "<con;ButtonDisplayContacts> Displayed here are your navigation contacts. You can <b>LEFT CLICK</b> on an navigation contact to target that object, and press <b>SPACEBAR</b> to center the map on that object.", "onNavigationJump()", "cancelTutorial()" );
  180. end
  181.  
  182. function onNavigationJump()
  183. end
  184.  
  185. function onNavigationOrbit()
  186.     -- short combat scene to watch
  187.     remoteCall( "Mycopia", 5, "onSpawnCombat1(\"" .. playersShip() .. "\");" );  
  188.  
  189.     messageBox( "Press the <b>O</b> key to command your ship to orbit </b>Mycopia</b> then press <b>F2</b> to return to the tactical view.", "onWaitOrbit()", "cancelTutorial()" );
  190.     end
  191.  
  192. function onWaitOrbit()
  193.     messageBox( "Usually you'll be met with resistance. But since this is a Bombing tutorial, there are no Enemy ships. Go orbit Mycopia to continue...", "cancelTutorial()" );
  194.  
  195.     if isOrbiting( playersShip(), "Mycopia" ) then
  196.         onOrbit();
  197.     else
  198.         startTimer( 1, "onWaitOrbit()" );
  199.     end
  200. end
  201.  
  202. function onOrbit()
  203.     messageBox( "You are now in orbit around the primary planet of this system. Staying within 500 gu of a planet will affect the planets faction preference. The more allied ships in orbit of an enemy planet and the more allied troops on the ground, the faster the planet will capture, whereas enemy ships and infantry will do the opposite, and make the planet harder to capture. Target <b>Mycopia</b> again if needed, the <color;00ffff>yellow</color> markers on the planets surface are drop zones should you wish to drop infantry on the planet to engage in combat with enemy infantry and aid in capturing the planet.\n\nSelect a drop zone by <b>LEFT CLICKING</b>, then press the <b>U</b> key to unload your infantry on the planet.", "onInfantryUnloaded()", "cancelTutorial()" );
  204. end
  205.  
  206. function onInfantryUnloaded()
  207.     messageBox( "Once the infantry has landed on the surface it will seek out any enemy infantry on the surface to engage in combat with. If the RAZE order is given, they will seek out structures to destroy instead. If you unload the infantry onto a Structure, they will destroy that structure first. This can be used as a tactic to circumnavigate planetary Shielding. Or to take our power to lower defenses. To give the Infantry the RAZE order, click on the infantry in your Cargo and then in the Bottom right corner of the screen, near the Portrait describing the status of the infantry. Click on the \"RAZE\" command. Which as an Alternative to bombing can be used to \"RAZE\", or Bomb the planet.\n\nKeep in mind, usually planets that you try to Bomb will have infantry of their own, which will seek out and attempt to annihilate the intruders. Once you have done so and understand how to do this, click <b>\"\OK"" to end the tutorial", "finishTutorial", "cancelTutorial()" );
  208. end
  209.  
  210. function onCombat()
  211. end
  212.  
  213. function onCombat2()
  214. end
  215.  
  216. function onWaitCapture()
  217. end
  218.  
  219. function onPlanetCaptured()
  220. end
  221.  
  222. function onLoadInfantry()
  223.     messageBox( "You may now load your infantry back onto your ship should you wish to use it to help you capture the other planets in this system, <b>Dawn</b> and <b>Lhzack</b>.\n\nTarget <b>Mycopia</b>, then you will your infantry appear on the surface at the location you unloaded them, target the infantry and press the <b>L</b> key to load the infantry back onto your ship.", "onInfantryLoaded()", "cancelTutorial()" );
  224. end
  225.  
  226. function onInfantryLoaded()
  227.     messageBox( "You may now capture <b>Dawn</b> and <b>Ihzack</b> to end this tutorial.", "endTutorial()", "cancelTutorial()" );
  228. end
  229.  
  230. function endTutorial()
  231.     messageBox( "We hope this tutorial benefits you. If you wish to <b>retry</b> the tutorial, or end it; please press <b>OK</b>, or <b>Cancel</b> respectively.", "startBombingTutorial()", "cancelTutorial" );
  232. end
  233.  
  234. function cancelTutorial()
  235.     pushChat( "Tutorial Cancelled..." );
  236. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement