From: <pyr...@us...> - 2008-12-20 18:13:41
|
Revision: 12507 http://vegastrike.svn.sourceforge.net/vegastrike/?rev=12507&view=rev Author: pyramid3d Date: 2008-12-20 18:13:27 +0000 (Sat, 20 Dec 2008) Log Message: ----------- (1) tutorial with stationary cockpit sound ***WARNING new binary required to run properly*** (2) added display of docking distance for planets (by kraehe) (3) renaming of sprites, also those hardcoded ***WARNING mods need to rename extensions for quit, died, pause, jump-hud, sun-hud, planet-hud, and nav-hud to .sprites*** Modified Paths: -------------- trunk/data/modules/quests/quest_tutorial.py trunk/data/units/units.csv trunk/vegastrike/src/cmd/script/mission.h trunk/vegastrike/src/cmd/script/script_callbacks.cpp trunk/vegastrike/src/gfx/cockpit.cpp trunk/vegastrike/src/gfx/vdu.cpp trunk/vegastrike/src/python/star_system_exports.h trunk/vegastrike/src/universe_util.cpp trunk/vegastrike/src/universe_util.h Added Paths: ----------- trunk/data/sprites/died.sprite trunk/data/sprites/jump-hud.sprite trunk/data/sprites/pause.sprite trunk/data/sprites/planet-aeratrantor-hud.sprite trunk/data/sprites/planet-aridmethane-hud.sprite trunk/data/sprites/planet-biodiverse-hud.sprite trunk/data/sprites/planet-biodiversemethane-hud.sprite trunk/data/sprites/planet-biosimple-hud.sprite trunk/data/sprites/planet-biosimplemethane-hud.sprite trunk/data/sprites/planet-carribean-hud.sprite trunk/data/sprites/planet-desert-hud.sprite trunk/data/sprites/planet-dirt-hud.sprite trunk/data/sprites/planet-earth-hud.sprite trunk/data/sprites/planet-frozenammonia-hud.sprite trunk/data/sprites/planet-gasgiant-hud.sprite trunk/data/sprites/planet-gasgiantdwarf-hud.sprite trunk/data/sprites/planet-hud.sprite trunk/data/sprites/planet-jclass-hud.sprite trunk/data/sprites/planet-lava-hud.sprite trunk/data/sprites/planet-mars-hud.sprite trunk/data/sprites/planet-molten-hud.sprite trunk/data/sprites/planet-moon-hud.sprite trunk/data/sprites/planet-ocean-hud.sprite trunk/data/sprites/planet-oceanicammonia-hud.sprite trunk/data/sprites/planet-overgrown-hud.sprite trunk/data/sprites/planet-overgrownmethane-hud.sprite trunk/data/sprites/planet-rlaantrantor-hud.sprite trunk/data/sprites/planet-rocky-hud.sprite trunk/data/sprites/planet-snow-hud.sprite trunk/data/sprites/planet-university-hud.sprite trunk/data/sprites/quit.sprite trunk/data/sprites/sun-hud.sprite trunk/data/units/factions/neutral/nebula/nebula-hud.sprite trunk/data/units/factions/neutral/nebula_veryhuge/nebula-hud.sprite Removed Paths: ------------- trunk/data/sprites/died.spr trunk/data/sprites/jump-hud.spr trunk/data/sprites/pause.spr trunk/data/sprites/planet-aeratrantor-hud.spr trunk/data/sprites/planet-aridmethane-hud.spr trunk/data/sprites/planet-biodiverse-hud.spr trunk/data/sprites/planet-biodiversemethane-hud.spr trunk/data/sprites/planet-biosimple-hud.spr trunk/data/sprites/planet-biosimplemethane-hud.spr trunk/data/sprites/planet-carribean-hud.spr trunk/data/sprites/planet-desert-hud.spr trunk/data/sprites/planet-dirt-hud.spr trunk/data/sprites/planet-earth-hud.spr trunk/data/sprites/planet-frozenammonia-hud.spr trunk/data/sprites/planet-gasgiant-hud.spr trunk/data/sprites/planet-gasgiantdwarf-hud.spr trunk/data/sprites/planet-hud.spr trunk/data/sprites/planet-jclass-hud.spr trunk/data/sprites/planet-lava-hud.spr trunk/data/sprites/planet-mars-hud.spr trunk/data/sprites/planet-molten-hud.spr trunk/data/sprites/planet-moon-hud.spr trunk/data/sprites/planet-ocean-hud.spr trunk/data/sprites/planet-oceanicammonia-hud.spr trunk/data/sprites/planet-overgrown-hud.spr trunk/data/sprites/planet-overgrownmethane-hud.spr trunk/data/sprites/planet-rlaantrantor-hud.spr trunk/data/sprites/planet-rocky-hud.spr trunk/data/sprites/planet-snow-hud.spr trunk/data/sprites/planet-university-hud.spr trunk/data/sprites/quit.spr trunk/data/sprites/sun-hud.spr trunk/data/units/factions/neutral/nebula/nebula-hud.spr trunk/data/units/factions/neutral/nebula_veryhuge/nebula-hud.spr Modified: trunk/data/modules/quests/quest_tutorial.py =================================================================== --- trunk/data/modules/quests/quest_tutorial.py 2008-12-18 21:23:00 UTC (rev 12506) +++ trunk/data/modules/quests/quest_tutorial.py 2008-12-20 18:13:27 UTC (rev 12507) @@ -10,7 +10,7 @@ # of the License, or (at your option) any later version. # # Author: pyramid -# Version: 2008-12-17 +# Version: 2008-12-19 # #--------------------------------------------------------------------------------- @@ -24,7 +24,7 @@ # (a) include other tutorial parts: targetting, weapons, ... # (b) change the mission name that appears on the hud - not possible currently # (c) make tutorial repeatable after some time -# (d) there should be negative relation adjustment when oswald gets destroyed +# (d) there should be a negative relation adjustment when oswald gets destroyed # (e) fix mission name and delete mission targets after each stage # import used libraries @@ -53,901 +53,902 @@ # the class that will be executed class quest_tutorial (quest.quest): - # initialize quest variables - def __init__ (self): - # initialize variables - self.stage = STAGE_DOCKED # tutorial stage - self.practice = 0 #sequence within a practice function - self.system = VS.getSystemName() # starting system - self.player = VS.getPlayer() - self.playerhull = VS.getPlayer().GetHull() - self.drone = VS.Unit() - self.droneshield = 1 # shield before fight - self.fight = 0 # how many fight rounds - self.dockeddistance = 0 - self.timer = VS.GetGameTime() # controls the stage timing - self.talktime = VS.GetGameTime() #controls individual talk time within animation - self.anitime = VS.GetGameTime() # controls the animation time - self.stayputtime = 0 - self.msgColor = "#FFFF99" - self.objectives = [] # list of objectives - self.objective = 0 # current objective - self.startobjectname = "" - self.animations = [["com_tutorial_oswald.ani",2]] # the actors and ani duration - self.speech = [] # has a list of current sound files for speech - self.newsplayed = 0 + # initialize quest variables + def __init__ (self): + # initialize variables + self.stage = STAGE_DOCKED # tutorial stage + self.practice = 0 #sequence within a practice function + self.system = VS.getSystemName() # starting system + self.player = VS.getPlayer() + self.playerhull = VS.getPlayer().GetHull() + self.drone = VS.Unit() + self.droneshield = 1 # shield before fight + self.fight = 0 # how many fight rounds + self.dockeddistance = 0 + self.timer = VS.GetGameTime() # controls the stage timing + self.talktime = VS.GetGameTime() #controls individual talk time within animation + self.anitime = VS.GetGameTime() # controls the animation time + self.stayputtime = 0 + self.msgColor = "#FFFF99" + self.objectives = [] # list of objectives + self.objective = 0 # current objective + self.startobjectname = "" + self.animations = [["com_tutorial_oswald.ani",2]] # the actors and ani duration + self.speech = [] # has a list of current sound files for speech + self.newsplayed = 0 - def putSaveValue(self,value, key=SAVE_KEY): - Director.eraseSaveData(self.player.isPlayerStarship(),key,0) - Director.pushSaveData(self.player.isPlayerStarship(),key,value) - return 1 + def putSaveValue(self,value, key=SAVE_KEY): + Director.eraseSaveData(self.player.isPlayerStarship(),key,0) + Director.pushSaveData(self.player.isPlayerStarship(),key,value) + return 1 - def getSaveValue(self,key=SAVE_KEY): - if Director.getSaveDataLength(self.player.isPlayerStarship(),key) > 0: - #print "----getSaveValue---", int(Director.getSaveData(self.player.isPlayerStarship(),key,0)) - return int(Director.getSaveData(self.player.isPlayerStarship(),key,0)) - return 0 + def getSaveValue(self,key=SAVE_KEY): + if Director.getSaveDataLength(self.player.isPlayerStarship(),key) > 0: + #print "----getSaveValue---", int(Director.getSaveData(self.player.isPlayerStarship(),key,0)) + return int(Director.getSaveData(self.player.isPlayerStarship(),key,0)) + return 0 - # checks if the player has undocked from Atlantis. If so sets next stage. - # Has been replaced by the more generic function playerIsUndocked - def hasUndockedFromAtlantis(self): - # get the planet object - self.startobject = unit.getUnitByName('Atlantis') - # target the departing planet to see the distance - self.player.SetTarget(self.startobject) - # verify if player is still docked at the planet - if (self.startobject.isDocked(self.player)): - self.dockeddistance = self.startobject.getDistance(self.player) - # if the player is not docked and at least 5km away then set next stage number - if (not self.startobject.isDocked(self.player) and self.startobject.getDistance(self.player)>(self.dockeddistance+5000)): - self.stage = STAGE_AWAY - return 0 + # checks if the player has undocked from Atlantis. If so sets next stage. + # Has been replaced by the more generic function playerIsUndocked + def hasUndockedFromAtlantis(self): + # get the planet object + self.startobject = unit.getUnitByName('Atlantis') + # target the departing planet to see the distance + self.player.SetTarget(self.startobject) + # verify if player is still docked at the planet + if (self.startobject.isDocked(self.player)): + self.dockeddistance = self.startobject.getDistance(self.player) + # if the player is not docked and at least 5km away then set next stage number + if (not self.startobject.isDocked(self.player) and self.startobject.getDistance(self.player)>(self.dockeddistance+5000)): + self.stage = STAGE_AWAY + return 0 - # checks if the player has undocked. if so sets next stage - def playerIsUndocked(self): - # dockedobject and dockeddistance must be global, i.e prefixed with self - # otherwise the script will advance to next stage just after undocking - # get the planet object - self.dockedobject = universe.getDockedBase() - name = self.dockedobject.getName() - # verify if player is still docked and set the reference distance - if (not name==""): - self.dockeddistance = self.dockedobject.getDistance(self.player) - self.startobjectname = name - # when starting from Atlantis, target the departing planet to see the distance - if (name=="Atlantis"): - self.player.SetTarget(self.dockedobject) - # if the player was never docked or is not docked and at least 1km away then set next stage number - if (name=="" or ((not self.startobjectname=="") and (not self.startobjectname=="Atlantis") and self.dockedobject.getDistance(self.player)>(self.dockeddistance+1000))): - self.stage = STAGE_AWAY - self.timer = VS.GetGameTime()+5 - return 0 + # checks if the player has undocked. if so sets next stage + def playerIsUndocked(self): + # dockedobject and dockeddistance must be global, i.e prefixed with self + # otherwise the script will advance to next stage just after undocking + # get the planet object + self.dockedobject = universe.getDockedBase() + name = self.dockedobject.getName() + # verify if player is still docked and set the reference distance + if (not name==""): + self.dockeddistance = self.dockedobject.getDistance(self.player) + self.startobjectname = name + # when starting from Atlantis, target the departing planet to see the distance + if (name=="Atlantis"): + self.player.SetTarget(self.dockedobject) + # if the player was never docked or is not docked and at least 1km away then set next stage number + if (name=="" or ((not self.startobjectname=="") and (not self.startobjectname=="Atlantis") and self.dockedobject.getDistance(self.player)>(self.dockeddistance+1000))): + self.stage = STAGE_AWAY + self.timer = VS.GetGameTime()+5 + return 0 - def LightMinuteToMeter(self,lightminute): - meter = 17987547500 * lightminute - return meter + def LightMinuteToMeter(self,lightminute): + meter = 17987547500 * lightminute + return meter - # launches a unit aka the drone - def launchNewDrone (self): - if (not self.player.isNull()): - # get the player's position - vec = self.player.Position() - # set drone position 1000m away from the player - vec = Vector.Add(vec,(1000,0,0)) - # launch the tutorial drone. - #VS.launch(name,type,faction,unittype,ai,nr,nrwaves,pos,squadlogo): - self.drone = VS.launch("Oswald","Robin","klkk_citizen","unit","default",1,1,vec,'') - # upgrade drone - self.drone.upgrade("quadshield15",0,0,1,0) - self.drone.upgrade("armor06",0,0,1,0) - # when launching give the player some text and ask him to decide if he wants to participate - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Hello traveler.") - VS.IOmessage (3,"Oswald","Privateer",self.msgColor+"My name is Oswald and I am offering flight assistance.") - VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Would you like to refresh your space faring skills?") - VS.IOmessage (12,"Oswald","Privateer",self.msgColor+"To participate in my tutorial mission, cut your engines with the #9999FFBACKSPACE"+self.msgColor+" key, let me approach you, and stay put until I contact you again.") - #VS.playSound("com_tutorial_oswald/oswald_greet.ogg", self.player.Position(), (0,0,0)) - #VS.musicPlaySong("com_tutorial_oswald/oswald_greet.ogg") - # set comm animation parameters - # list [start,duration,anilist_entry] - self.sequence = [[0,1,0],[3,3,0],[8,2,0],[12,7,0]] - # set speech files - self.speech = ["com_tutorial_oswald/oswald_greet_01.ogg", "com_tutorial_oswald/oswald_greet_02.ogg", "com_tutorial_oswald/oswald_greet_03.ogg", "com_tutorial_oswald/oswald_greet_04.ogg"] - #set talktime start - self.talktime = VS.GetGameTime() - # on launching the drone, set its position near the player - vec = self.player.Position() - vec = Vector.Add (vec,(vsrandom.uniform(-2000,2000), - vsrandom.uniform(-2000,2000), - vsrandom.uniform(-2000,2000))) - self.drone.SetPosition(vec) - # get rid of all orders, so that strange maneouvers don't happen - self.drone.PrimeOrders() - # display the drone on HUD - self.player.SetTarget(self.drone) - # remember the initial shield strength - self.droneshield = unit.getShieldPercent(self.drone) - self.fight = 0 - self.stage += 1 - #self.stage = COMPLETE_TUTORIAL3 # debug - # duration of this part until end of animation - self.timer = VS.GetGameTime() + 20 - return 0 + # launches a unit aka the drone + def launchNewDrone (self): + if (not self.player.isNull()): + # get the player's position + vec = self.player.Position() + # set drone position 1000m away from the player + vec = Vector.Add(vec,(1000,0,0)) + # launch the tutorial drone. + #VS.launch(name,type,faction,unittype,ai,nr,nrwaves,pos,squadlogo): + self.drone = VS.launch("Oswald","Robin.tutorial","klkk_citizen","unit","default",1,1,vec,'') + # upgrade drone + self.drone.upgrade("quadshield15",0,0,1,0) + self.drone.upgrade("armor06",0,0,1,0) + # when launching give the player some text and ask him to decide if he wants to participate + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Hello traveler.") + VS.IOmessage (3,"Oswald","Privateer",self.msgColor+"My name is Oswald and I am offering flight assistance.") + VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Would you like to refresh your space faring skills?") + VS.IOmessage (12,"Oswald","Privateer",self.msgColor+"To participate in my tutorial mission, cut your engines with the #9999FFBACKSPACE"+self.msgColor+" key, let me approach you, and stay put until I contact you again.") + #VS.playSound("com_tutorial_oswald/oswald_greet.ogg", self.player.Position(), (0,0,0)) + #VS.musicPlaySong("com_tutorial_oswald/oswald_greet.ogg") + # set comm animation parameters + # list [start,duration,anilist_entry] + self.sequence = [[0,1,0],[3,3,0],[8,2,0],[12,7,0]] + # set speech files + self.speech = ["com_tutorial_oswald/oswald_greet_01.ogg", "com_tutorial_oswald/oswald_greet_02.ogg", "com_tutorial_oswald/oswald_greet_03.ogg", "com_tutorial_oswald/oswald_greet_04.ogg"] + #set talktime start + self.talktime = VS.GetGameTime() + # on launching the drone, set its position near the player + vec = self.player.Position() + vec = Vector.Add (vec,(vsrandom.uniform(-2000,2000), + vsrandom.uniform(-2000,2000), + vsrandom.uniform(-2000,2000))) + self.drone.SetPosition(vec) + # get rid of all orders, so that strange maneouvers don't happen + self.drone.PrimeOrders() + # display the drone on HUD + self.player.SetTarget(self.drone) + # remember the initial shield strength + self.droneshield = unit.getShieldPercent(self.drone) + self.fight = 0 + self.stage += 1 + #self.stage = COMPLETE_TUTORIAL3 # debug + # duration of this part until end of animation + self.timer = VS.GetGameTime() + 20 + return 0 - # check if drone has been attacked - # if so branch off to attack lesson - def checkDroneHealth (self): - if (unit.getShieldPercent(self.drone)<self.droneshield*0.90): - self.drone.PrimeOrders() - self.drone.SetTarget(self.player) - self.drone.LoadAIScript("fighter.ace") - self.drone.setFgDirective("a.") - self.savestage = self.stage - self.practice = 0 - #if (self.fight<2): - self.fight += 1 - self.stage = 96 - return 0 + # check if drone has been attacked + # if so branch off to attack lesson + def checkDroneHealth (self): + if (unit.getShieldPercent(self.drone)<self.droneshield*0.90): + self.drone.PrimeOrders() + self.drone.SetTarget(self.player) + self.drone.LoadAIScript("fighter.ace") + self.drone.setFgDirective("a.") + self.savestage = self.stage + self.practice = 0 + #if (self.fight<2): + self.fight += 1 + self.stage = 96 + return 0 - # checks distance to drone - # if player is too far, the tutorial breaks off - def checkDistance (self): - if (self.drone.getDistance(self.player)>20000): - self.practice = 0 - self.stage = 97 - return 0 + # checks distance to drone + # if player is too far, the tutorial breaks off + def checkDistance (self): + if (self.drone.getDistance(self.player)>20000): + self.practice = 0 + self.stage = 97 + return 0 - # keeps the drone near the player - # the drone doesn't quite orbit - # it will approach the player until 1000 meters and then stop - def orbitMe (self): - #self.player.SetTarget(self.drone) - # if the drone is more than 1000m away it will start instructions - if (self.drone.getDistance(self.player)>=1100): - # orientate the nose of the drone towards the player ship - vec = Vector.Sub(self.player.Position(),self.drone.Position()) - self.drone.SetOrientation((1,0,0),vec) - # set velocity proportional to distance from player - vec = Vector.Scale(Vector.SafeNorm(vec),self.drone.getDistance(self.player)/10) - self.drone.SetVelocity(vec) - #self.stayputtime = VS.GetGameTime() - # if drone has approached player until 1000m then stop it - if (self.drone.getDistance(self.player)<1100): - self.drone.SetVelocity((0,0,0)) - # this is also needed to stop rotation of the drone - self.drone.SetAngularVelocity((0,0,0)) - return 0 + # keeps the drone near the player + # the drone doesn't quite orbit + # it will approach the player until 1000 meters and then stop + def orbitMe (self): + #self.player.SetTarget(self.drone) + # if the drone is more than 1000m away it will start instructions + if (self.drone.getDistance(self.player)>=1100): + # orientate the nose of the drone towards the player ship + vec = Vector.Sub(self.player.Position(),self.drone.Position()) + self.drone.SetOrientation((1,0,0),vec) + # set velocity proportional to distance from player + vec = Vector.Scale(Vector.SafeNorm(vec),self.drone.getDistance(self.player)/10) + self.drone.SetVelocity(vec) + #self.stayputtime = VS.GetGameTime() + # if drone has approached player until 1000m then stop it + if (self.drone.getDistance(self.player)<1100): + self.drone.SetVelocity((0,0,0)) + # this is also needed to stop rotation of the drone + self.drone.SetAngularVelocity((0,0,0)) + return 0 - # check if player stays put close to the drone to accept tutorial - def acceptTutorial (self): - velocity = Vector.Mag(self.player.GetVelocity()) - # if the offer has been placed, and player is put for 10s and drone is near - if (VS.GetGameTime()>self.timer and self.drone.getDistance(self.player)<1100 and velocity<=10): - self.player.SetTarget(self.drone) - self.timer = VS.GetGameTime() - self.complete = self.getSaveValue() - if (self.complete>0): - self.stage = self.complete - else: - self.stage = STAGE_ACCEPT - if (VS.GetGameTime()>self.timer and velocity>=10): - # allow some time for slowing down and approach if ships were moving - if (self.stayputtime>60): - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Have a nice journey and come back for a space faring refresher anytime here in Cephid 17.") - self.speech = ["com_tutorial_oswald/oswald_bye.ogg"] - VS.playSound(self.speech[0], self.player.Position(), (0,0,0)) - self.player.commAnimation("com_tutorial_oswald.ani") - self.stage = STAGE_DECLINE - self.timer = VS.GetGameTime() - else: - self.stayputtime += 10 - self.timer = VS.GetGameTime() + 10 - return 0 + # check if player stays put close to the drone to accept tutorial + def acceptTutorial (self): + velocity = Vector.Mag(self.player.GetVelocity()) + # if the offer has been placed, and player is put for 10s and drone is near + if (VS.GetGameTime()>self.timer and self.drone.getDistance(self.player)<1100 and velocity<=10): + self.player.SetTarget(self.drone) + self.timer = VS.GetGameTime() + self.complete = self.getSaveValue() + if (self.complete>0): + self.stage = self.complete + else: + self.stage = STAGE_ACCEPT + if (VS.GetGameTime()>self.timer and velocity>=10): + # allow some time for slowing down and approach if ships were moving + if (self.stayputtime>60): + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Have a nice journey and come back for a space faring refresher anytime here in Cephid 17.") + self.speech = ["com_tutorial_oswald/oswald_bye.ogg"] + VS.playSoundCockpit(self.speech[0]) + self.player.commAnimation("com_tutorial_oswald.ani") + self.stage = STAGE_DECLINE + self.timer = VS.GetGameTime() + else: + self.stayputtime += 10 + self.timer = VS.GetGameTime() + 10 + return 0 - # play the first part of the tutorial - def tutorialComm (self): - if (self.practice==0): - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Glad I can be of help.") - VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"In the first place let's have a look at your heads up display (HUD).") - VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"Please do not move your ship in order to better focus on my instructions.") - VS.IOmessage (15,"Oswald","Privateer",self.msgColor+"In the upper left corner you can see the communication messages.") - VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"Each communication message shows the sender, the game time of the sending, and the message itself, like this one.") - VS.IOmessage (25,"Oswald","Privateer",self.msgColor+"To scroll the messages back and forth use the #9999FFPage Up"+self.msgColor+" and #9999FFPage Down"+self.msgColor+" keys. Try it out now.") - VS.IOmessage (35,"Oswald","Privateer",self.msgColor+"Good.") - VS.IOmessage (37,"Oswald","Privateer",self.msgColor+"Now you can send me a message by pressing the #9999FFF1"+self.msgColor+" key.") - # set comm animation parameters - self.sequence = [[0,1,0],[5,4,0],[10,4,0],[15,4,0],[20,4,0],[25,5,0],[35,1,0],[37,4,0]] - # set speech files - self.speech = ["com_tutorial_oswald/oswald_comm_01.ogg", "com_tutorial_oswald/oswald_comm_02.ogg", "com_tutorial_oswald/oswald_comm_03.ogg", "com_tutorial_oswald/oswald_comm_04.ogg", "com_tutorial_oswald/oswald_comm_05.ogg", "com_tutorial_oswald/oswald_comm_06.ogg", "com_tutorial_oswald/oswald_comm_07.ogg", "com_tutorial_oswald/oswald_comm_08.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+45 - self.practice = 1 - if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==1 and VS.GetGameTime()>=self.timer): - self.practice = 2 - if (self.practice==2 and VS.GetGameTime()>self.timer): - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Usually, messages assigned to keys #9999FFF1"+self.msgColor+" and #9999FFF2"+self.msgColor+" are friendly messages which slightly increase you relation with a faction, while the other keys #9999FFF3"+self.msgColor+" and #9999FFF4"+self.msgColor+" decrease your relationship.") - VS.IOmessage (14,"Oswald","Privateer",self.msgColor+"Sometimes it can be very useful to send multiple friendly messages to improve your relation with a hostile faction or taunt an enemy into attacking you instead of a ship you are protecting.") - VS.IOmessage (26,"Oswald","Privateer",self.msgColor+"That's about it on the messages display.") - # set comm animation parameters - self.sequence = [[0,12,0],[14,12,0],[26,2,0]] - # set speech files - self.speech = ["com_tutorial_oswald/oswald_comm_09.ogg", "com_tutorial_oswald/oswald_comm_10.ogg", "com_tutorial_oswald/oswald_comm_11.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+30 - self.practice = 3 - if (self.practice==3 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==3 and VS.GetGameTime()>=self.timer): - self.practice = 4 - if (self.practice==4 and VS.GetGameTime()>self.timer): - # make sure to reset the counter for the next practice loops - self.practice = 0 - self.timer = VS.GetGameTime()+0 - self.stage = COMPLETE_TUTORIAL1 - self.putSaveValue(self.stage) - return 0 + # play the first part of the tutorial + def tutorialComm (self): + if (self.practice==0): + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Glad I can be of help.") + VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"In the first place let's have a look at your heads up display (HUD).") + VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"Please do not move your ship in order to better focus on my instructions.") + VS.IOmessage (15,"Oswald","Privateer",self.msgColor+"In the upper left corner you can see the communication messages.") + VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"Each communication message shows the sender, the game time of the sending, and the message itself, like this one.") + VS.IOmessage (25,"Oswald","Privateer",self.msgColor+"To scroll the messages back and forth use the #9999FFPage Up"+self.msgColor+" and #9999FFPage Down"+self.msgColor+" keys. Try it out now.") + VS.IOmessage (35,"Oswald","Privateer",self.msgColor+"Good.") + VS.IOmessage (37,"Oswald","Privateer",self.msgColor+"Now you can send me a message by pressing the #9999FFF1"+self.msgColor+" key.") + # set comm animation parameters + self.sequence = [[0,1,0],[5,4,0],[10,4,0],[15,4,0],[20,4,0],[25,5,0],[35,1,0],[37,4,0]] + # set speech files + self.speech = ["com_tutorial_oswald/oswald_comm_01.ogg", "com_tutorial_oswald/oswald_comm_02.ogg", "com_tutorial_oswald/oswald_comm_03.ogg", "com_tutorial_oswald/oswald_comm_04.ogg", "com_tutorial_oswald/oswald_comm_05.ogg", "com_tutorial_oswald/oswald_comm_06.ogg", "com_tutorial_oswald/oswald_comm_07.ogg", "com_tutorial_oswald/oswald_comm_08.ogg"] + self.talktime = VS.GetGameTime() + self.timer = VS.GetGameTime()+45 + self.practice = 1 + if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): + for index in range (len(self.sequence)): + if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): + self.player.commAnimation(self.animations[self.sequence[index][2]][0]) + # play each soundfile once + if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): + VS.playSoundCockpit(self.speech[index]) + self.anitime = VS.GetGameTime()+2 + if (self.practice==1 and VS.GetGameTime()>=self.timer): + self.practice = 2 + if (self.practice==2 and VS.GetGameTime()>self.timer): + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Usually, messages assigned to keys #9999FFF1"+self.msgColor+" and #9999FFF2"+self.msgColor+" are friendly messages which slightly increase you relation with a faction, while the other keys #9999FFF3"+self.msgColor+" and #9999FFF4"+self.msgColor+" decrease your relationship.") + VS.IOmessage (14,"Oswald","Privateer",self.msgColor+"Sometimes it can be very useful to send multiple friendly messages to improve your relation with a hostile faction or taunt an enemy into attacking you instead of a ship you are protecting.") + VS.IOmessage (26,"Oswald","Privateer",self.msgColor+"That's about it on the messages display.") + # set comm animation parameters + self.sequence = [[0,12,0],[14,12,0],[26,2,0]] + # set speech files + self.speech = ["com_tutorial_oswald/oswald_comm_09.ogg", "com_tutorial_oswald/oswald_comm_10.ogg", "com_tutorial_oswald/oswald_comm_11.ogg"] + self.talktime = VS.GetGameTime() + self.timer = VS.GetGameTime()+30 + self.practice = 3 + if (self.practice==3 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): + for index in range (len(self.sequence)): + if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): + self.player.commAnimation(self.animations[self.sequence[index][2]][0]) + # play each soundfile once + if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): + VS.playSoundCockpit(self.speech[index]) + self.anitime = VS.GetGameTime()+2 + if (self.practice==3 and VS.GetGameTime()>=self.timer): + self.practice = 4 + if (self.practice==4 and VS.GetGameTime()>self.timer): + # make sure to reset the counter for the next practice loops + self.practice = 0 + self.timer = VS.GetGameTime()+0 + self.stage = COMPLETE_TUTORIAL1 + self.putSaveValue(self.stage) + return 0 - def tutorialNav (self): - if (self.practice==0): - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Now, let's review the navigation information on your HUD. We'll do theory first, then some practice.") - VS.IOmessage (9,"Oswald","Privateer",self.msgColor+"In the lower left corner you will find your ship's shield status in blue, and armor status in orange.") - VS.IOmessage (16,"Oswald","Privateer",self.msgColor+"We will come to the text indicators later.") - VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"In the middle of the bottom part you have your dashboard with the front radar on the left side and the rear radar on the right side.") - VS.IOmessage (29,"Oswald","Privateer",self.msgColor+"The active target will display as a small cross on your radar. Other targets will be dots with their colors representing your relation to them.") - VS.IOmessage (38,"Oswald","Privateer",self.msgColor+"Green is friendly, red is hostile, and yellow is neutral. An attacking ship is blue, a targetting ship is light blue, and a locking ship is violet. Neutral and significant objects like planets, stations, wormholes, or suns are white.") - VS.IOmessage (53,"Oswald","Privateer",self.msgColor+"The top center part of the dashboard has four round indicators which begin flashing when the following events occur:") - VS.IOmessage (59,"Oswald","Privateer",self.msgColor+" (L) means a hostile has missile lock on you") - VS.IOmessage (63,"Oswald","Privateer",self.msgColor+" (J) means you are in range of a jump point and your jump drive is ready") - VS.IOmessage (67,"Oswald","Privateer",self.msgColor+" (S) means your SPEC drive, needed for faster-than-light (FTL) travel, is activated") - VS.IOmessage (73,"Oswald","Privateer",self.msgColor+" (E) means your electronic counter measures (ECM) are active") - VS.IOmessage (77,"Oswald","Privateer",self.msgColor+"Below the round indicators are three colored bars") - VS.IOmessage (81,"Oswald","Privateer",self.msgColor+" (CAPACITOR) shows your weapons capacitor charge") - VS.IOmessage (86,"Oswald","Privateer",self.msgColor+" (DRIVES) shows your SPEC and jump drives energy charge") - VS.IOmessage (91,"Oswald","Privateer",self.msgColor+" (FUEL) shows you capacity for in-system travel and overdrive propulsion") - VS.IOmessage (97,"Oswald","Privateer",self.msgColor+"The numbers below the bars are your current speed to the left and your set speed to the right.") - VS.IOmessage (105,"Oswald","Privateer",self.msgColor+"Below that is the effective SPEC velocity to the left and the flight computer (FCMP) mode to the right.") - # set comm animation parameters #8 #13 - self.sequence = [[0,8,0],[9,6,0],[16,2,0],[20,8,0],[29,8,0],[38,14,0],[53,6,0],[59,3,0],[63,4,0],[67,6,0],[73,4,0],[77,4,0],[81,4,0],[86,4,0],[91,5,0],[97,6,0],[105,6,0]] - self.speech = ["com_tutorial_oswald/oswald_nav_01.ogg", "com_tutorial_oswald/oswald_nav_02.ogg", "com_tutorial_oswald/oswald_nav_03.ogg", "com_tutorial_oswald/oswald_nav_04.ogg", "com_tutorial_oswald/oswald_nav_05.ogg", "com_tutorial_oswald/oswald_nav_06.ogg", "com_tutorial_oswald/oswald_nav_07.ogg", "com_tutorial_oswald/oswald_nav_08.ogg", "com_tutorial_oswald/oswald_nav_09.ogg", "com_tutorial_oswald/oswald_nav_10.ogg", "com_tutorial_oswald/oswald_nav_11.ogg", "com_tutorial_oswald/oswald_nav_12.ogg", "com_tutorial_oswald/oswald_nav_13.ogg", "com_tutorial_oswald/oswald_nav_14.ogg", "com_tutorial_oswald/oswald_nav_15.ogg", "com_tutorial_oswald/oswald_nav_16.ogg", "com_tutorial_oswald/oswald_nav_17.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+112 - self.practice = 1 - if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==1 and VS.GetGameTime()>=self.timer): - self.practice = 2 - if (self.practice==2 and VS.GetGameTime()>self.timer): - # make sure to reset the counter for the next practice loops - self.practice = 0 - self.timer = VS.GetGameTime()+0 - self.stage = COMPLETE_TUTORIAL2 - self.putSaveValue(self.stage) - return 0 + def tutorialNav (self): + if (self.practice==0): + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Now, let's review the navigation information on your HUD. We'll do theory first, then some practice.") + VS.IOmessage (9,"Oswald","Privateer",self.msgColor+"In the lower left corner you will find your ship's shield status in blue, and armor status in orange.") + VS.IOmessage (16,"Oswald","Privateer",self.msgColor+"We will come to the text indicators later.") + VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"In the middle of the bottom part you have your dashboard with the front radar on the left side and the rear radar on the right side.") + VS.IOmessage (29,"Oswald","Privateer",self.msgColor+"The active target will display as a small cross on your radar. Other targets will be dots with their colors representing your relation to them.") + VS.IOmessage (38,"Oswald","Privateer",self.msgColor+"Green is friendly, red is hostile, and yellow is neutral. An attacking ship is blue, a targetting ship is light blue, and a locking ship is violet. Neutral and significant objects like planets, stations, wormholes, or suns are white.") + VS.IOmessage (53,"Oswald","Privateer",self.msgColor+"The top center part of the dashboard has four round indicators which begin flashing when the following events occur:") + VS.IOmessage (59,"Oswald","Privateer",self.msgColor+" (L) means a hostile has missile lock on you") + VS.IOmessage (63,"Oswald","Privateer",self.msgColor+" (J) means you are in range of a jump point and your jump drive is ready") + VS.IOmessage (67,"Oswald","Privateer",self.msgColor+" (S) means your SPEC drive, needed for faster-than-light (FTL) travel, is activated") + VS.IOmessage (73,"Oswald","Privateer",self.msgColor+" (E) means your electronic counter measures (ECM) are active") + VS.IOmessage (77,"Oswald","Privateer",self.msgColor+"Below the round indicators are three colored bars") + VS.IOmessage (81,"Oswald","Privateer",self.msgColor+" (CAPACITOR) shows your weapons capacitor charge") + VS.IOmessage (86,"Oswald","Privateer",self.msgColor+" (DRIVES) shows your SPEC and jump drives energy charge") + VS.IOmessage (91,"Oswald","Privateer",self.msgColor+" (FUEL) shows you capacity for in-system travel and overdrive propulsion") + VS.IOmessage (97,"Oswald","Privateer",self.msgColor+"The numbers below the bars are your current speed to the left and your set speed to the right.") + VS.IOmessage (105,"Oswald","Privateer",self.msgColor+"Below that is the effective SPEC velocity to the left and the flight computer (FCMP) mode to the right.") + # set comm animation parameters #8 #13 + self.sequence = [[0,8,0],[9,6,0],[16,2,0],[20,8,0],[29,8,0],[38,14,0],[53,6,0],[59,3,0],[63,4,0],[67,6,0],[73,4,0],[77,4,0],[81,4,0],[86,4,0],[91,5,0],[97,6,0],[105,6,0]] + self.speech = ["com_tutorial_oswald/oswald_nav_01.ogg", "com_tutorial_oswald/oswald_nav_02.ogg", "com_tutorial_oswald/oswald_nav_03.ogg", "com_tutorial_oswald/oswald_nav_04.ogg", "com_tutorial_oswald/oswald_nav_05.ogg", "com_tutorial_oswald/oswald_nav_06.ogg", "com_tutorial_oswald/oswald_nav_07.ogg", "com_tutorial_oswald/oswald_nav_08.ogg", "com_tutorial_oswald/oswald_nav_09.ogg", "com_tutorial_oswald/oswald_nav_10.ogg", "com_tutorial_oswald/oswald_nav_11.ogg", "com_tutorial_oswald/oswald_nav_12.ogg", "com_tutorial_oswald/oswald_nav_13.ogg", "com_tutorial_oswald/oswald_nav_14.ogg", "com_tutorial_oswald/oswald_nav_15.ogg", "com_tutorial_oswald/oswald_nav_16.ogg", "com_tutorial_oswald/oswald_nav_17.ogg"] + self.talktime = VS.GetGameTime() + self.timer = VS.GetGameTime()+112 + self.practice = 1 + if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): + for index in range (len(self.sequence)): + if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): + self.player.commAnimation(self.animations[self.sequence[index][2]][0]) + # play each soundfile once + if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): + VS.playSoundCockpit(self.speech[index]) + self.anitime = VS.GetGameTime()+2 + if (self.practice==1 and VS.GetGameTime()>=self.timer): + self.practice = 2 + if (self.practice==2 and VS.GetGameTime()>self.timer): + # make sure to reset the counter for the next practice loops + self.practice = 0 + self.timer = VS.GetGameTime()+0 + self.stage = COMPLETE_TUTORIAL2 + self.putSaveValue(self.stage) + return 0 - def practiceNav (self): - # practice intro - if (self.practice==0): - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"So much for theory. Let's do some practice now.") - VS.IOmessage (4,"Oswald","Privateer",self.msgColor+"First we'll do some basic navigation and targetting.") - self.sequence = [[0,3,0],[4,3,0]] - self.speech = ["com_tutorial_oswald/oswald_target_01.ogg", "com_tutorial_oswald/oswald_target_02.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+10 - self.practice = 1 - if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==1 and VS.GetGameTime()>=self.timer): - self.practice = 3 - if (self.practice==3): - # explain basic targetting if drone is not already target - if (unit.getUnitFullName(self.player.GetTarget()) != unit.getUnitFullName(self.drone)): - nam = unit.getUnitFullName(self.drone) - self.objective = VS.addObjective("Target %s" % nam) - self.objectives+=[int(self.objective)] - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"In the lower right corner you can see the target video display unit (VDU) where you can see your current target.") - VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Target me by repeatedly toggling the #9999FFT"+self.msgColor+" key until you see my ship on the right VDU.") - VS.IOmessage (16,"Oswald","Privateer",self.msgColor+"Should you pass me, you may reverse the target selection sequence by pressing the #9999FFShift+T"+self.msgColor+" keys.") - # set comm animation parameters - self.sequence = [[0,7,0],[8,7,0],[16,6,0]] - self.speech = ["com_tutorial_oswald/oswald_target_03.ogg", "com_tutorial_oswald/oswald_target_04.ogg", "com_tutorial_oswald/oswald_target_05.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+23 - self.practice = 4 - else: - self.practice = 5 - if (self.practice==4 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==4 and VS.GetGameTime()>=self.timer): - self.practice = 5 - # make the drone the players target - if (self.practice==5 and unit.getUnitFullName(self.player.GetTarget())==unit.getUnitFullName(self.drone)): + def practiceNav (self): + # practice intro + if (self.practice==0): + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"So much for theory. Let's do some practice now.") + VS.IOmessage (4,"Oswald","Privateer",self.msgColor+"First we'll do some basic navigation and targetting.") + self.sequence = [[0,3,0],[4,3,0]] + self.speech = ["com_tutorial_oswald/oswald_target_01.ogg", "com_tutorial_oswald/oswald_target_02.ogg"] + self.talktime = VS.GetGameTime() + self.timer = VS.GetGameTime()+10 + self.practice = 1 + if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): + for index in range (len(self.sequence)): + if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): + self.player.commAnimation(self.animations[self.sequence[index][2]][0]) + # play each soundfile once + if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): + VS.playSoundCockpit(self.speech[index]) + self.anitime = VS.GetGameTime()+2 + if (self.practice==1 and VS.GetGameTime()>=self.timer): + self.practice = 3 + if (self.practice==3): + # explain basic targetting if drone is not already target + if (unit.getUnitFullName(self.player.GetTarget()) != unit.getUnitFullName(self.drone)): nam = unit.getUnitFullName(self.drone) - self.objective = VS.addObjective("Face %s" % nam) + self.objective = VS.addObjective("Target %s" % nam) self.objectives+=[int(self.objective)] - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"OK. Now, orient your ship so that your targetting reticule (cross) points directly at me.") - VS.IOmessage (7,"Oswald","Privateer",self.msgColor+"To get my ship into your visual range just turn in the direction of the white target arrow at the edge of your HUD.") - VS.IOmessage (14,"Oswald","Privateer",self.msgColor+"When my ship is in your visual range you will notice that it is framed by a target box.") - VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"Align your targetting reticule with my ship.") + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"In the lower right corner you can see the target video display unit (VDU) where you can see your current target.") + VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Target me by repeatedly toggling the #9999FFT"+self.msgColor+" key until you see my ship on the right VDU.") + VS.IOmessage (16,"Oswald","Privateer",self.msgColor+"Should you pass me, you may reverse the target selection sequence by pressing the #9999FFShift+T"+self.msgColor+" keys.") # set comm animation parameters - self.sequence = [[0,6,0],[7,6,0],[14,5,0],[20,3,0]] - self.speech = ["com_tutorial_oswald/oswald_target_06.ogg", "com_tutorial_oswald/oswald_target_07.ogg", "com_tutorial_oswald/oswald_target_08.ogg", "com_tutorial_oswald/oswald_target_09.ogg"] + self.sequence = [[0,7,0],[8,7,0],[16,6,0]] + self.speech = ["com_tutorial_oswald/oswald_target_03.ogg", "com_tutorial_oswald/oswald_target_04.ogg", "com_tutorial_oswald/oswald_target_05.ogg"] self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+24 - self.practice = 6 - if (self.practice==6 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==6 and VS.GetGameTime()>=self.timer): - self.practice = 7 - if (self.practice==7): - # check if the player is facing the drone - angle = unit.facingAngleToUnit(self.player,self.drone) - #print "facing: " + str(angle) - if (angle<=0.05): - VS.setCompleteness(self.objectives[self.objective],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Well done.") - VS.IOmessage (2,"Oswald","Privateer",self.msgColor+"Now, turn your ship away from my ship and accelerate to full speed using the #9999FF\\"+self.msgColor+" key.") - self.player.commAnimation("com_tutorial_oswald.ani") - self.objective = VS.addObjective("Set max velocity") - self.objectives+=[int(self.objective)] - self.sequence = [[0,1,0],[2,6,0]] - self.speech = ["com_tutorial_oswald/oswald_nav_21.ogg", "com_tutorial_oswald/oswald_nav_22.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+9 - self.practice = 8 - if (self.practice==8 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==8 and VS.GetGameTime()>=self.timer): - self.practice = 9 - if (self.practice==9): - # check if the player is facing away - angle = unit.facingAngleToUnit(self.player,self.drone) - velocity = Vector.Mag(self.player.GetVelocity()) - #check if angle to drone is at least 22 degrees (0.20 radians) - if (angle>=0.20 and velocity>=295): - VS.setCompleteness(self.objectives[self.objective],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"And now set your velocity reference to zero by pressing the #9999FFBACKSPACE"+self.msgColor+" key and come to a complete stop.") - self.player.commAnimation("com_tutorial_oswald.ani") - self.player.commAnimation("com_tutorial_oswald.ani") - VS.playSound("com_tutorial_oswald/oswald_nav_23.ogg", self.player.Position(), (0,0,0)) - self.objective = VS.addObjective("Set full stop") - self.objectives+=[int(self.objective)] - self.timer = VS.GetGameTime()+9 - self.practice = 10 - if (self.practice==10): - # check if the player is stopped - velocity = Vector.Mag(self.player.GetVelocity()) - if (velocity<=2): - VS.setCompleteness(self.objectives[self.objective],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"You can also increment your velocity gradually with the #9999FF+"+self.msgColor+" key. Accelerate to 100 m/s now.") - self.player.commAnimation("com_tutorial_oswald.ani") - VS.playSound("com_tutorial_oswald/oswald_nav_24.ogg", self.player.Position(), (0,0,0)) - self.objective = VS.addObjective("Set velocity reference to 100m/s") - self.objectives+=[int(self.objective)] - self.timer = VS.GetGameTime()+9 - self.practice = 11 - if (self.practice==11): - # check if the player has velocity >100 - velocity = Vector.Mag(self.player.GetVelocity()) - if (velocity>=98 and velocity<=110): - VS.setCompleteness(self.objectives[3],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"In the same way you can reduce your velocity gradually with the #9999FF-"+self.msgColor+" key. Deccelerate to 50 m/s.") - self.player.commAnimation("com_tutorial_oswald.ani") - VS.playSound("com_tutorial_oswald/oswald_nav_25.ogg", self.player.Position(), (0,0,0)) - self.objective = VS.addObjective("Set velocity reference to 50m/s") - self.objectives+=[int(self.objective)] - self.timer = VS.GetGameTime()+9 - self.practice = 12 - if (self.practice==12): - # check if the player has velocity <50 - velocity = Vector.Mag(self.player.GetVelocity()) - if (velocity<=55 and velocity>=40): - VS.setCompleteness(self.objectives[self.objective],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Great. If you further deccelerate your velocity with the #9999FF-"+self.msgColor+" key you can actually reverse your thrust. Deccelerate now to -20 m/s.") - self.player.commAnimation("com_tutorial_oswald.ani") - VS.playSound("com_tutorial_oswald/oswald_nav_26.ogg", self.player.Position(), (0,0,0)) - self.objective = VS.addObjective("Set velocity reference to -20m/s") - self.objectives+=[int(self.objective)] - self.timer = VS.GetGameTime()+12 - self.practice = 13 - if (self.practice==13): - # check if the player has velocity <=-20m/s - velocity = unit.getSignedVelocity(self.player) - if (velocity<=-18): - VS.setCompleteness(self.objectives[self.objective],1.0) - VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Excellent.") - VS.IOmessage (2,"Oswald","Privateer",self.msgColor+"You have learned how to target, orient your ship, accellerate, decellerate, and bring your ship to a stop.") - VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"I'm sure this will come in handy during your future endeavors.") - # set comm animation parameters - self.sequence = [[0,1,0],[2,7,0],[10,4,0]] - self.speech = ["com_tutorial_oswald/oswald_nav_27.ogg", "com_tutorial_oswald/oswald_nav_28.ogg", "com_tutorial_oswald/oswald_nav_29.ogg"] - self.talktime = VS.GetGameTime() - self.timer = VS.GetGameTime()+15 - self.practice = 14 - if (self.practice==14 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): - for index in range (len(self.sequence)): - if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): - self.player.commAnimation(self.animations[self.sequence[index][2]][0]) - # play each soundfile once - if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): - VS.playSound(self.speech[index], self.player.Position(), (0,0,0)) - self.anitime = VS.GetGameTime()+2 - if (self.practice==14 and VS.GetGameTime()>=self.timer): - self.practice = 15 - if (self.practice==15): - # make sure to reset the counter for the next practice loops - self.practice = 0 - self.timer = VS.GetGameTime()+10 - self.stage = COMPLETE_TUTORIAL3 - self.putSaveValue(self.stage) - #print "NAV - save: " + str(self.getSaveValue()) - return 0 - - def practiceSpec (self): - # practice intro - if (self.practice==0): - #self.jump = universe.getRandomJumppoint() - self.jump = unit.getUnitByName('JumpToOldziey') - nam = unit.getUnitFullName(self.jump) - self.objective = VS.addObjective("Target %s" % nam) + self.timer = VS.GetGameTime()+23 + self.practice = 4 + else: + self.practice = 5 + if (self.practice==4 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime): + for index in range (len(self.sequence)): + if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]): + self.player.commAnimation(self.animations[self.sequence[index][2]][0]) + # play each soundfile once + if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1): + VS.playSoundCockpit(self.speech[index]) + self.anitime = VS.GetGameTime()+2 + if (self.practice==4 and VS.GetGameTime()>=self.timer): + self.practice = 5 + # make the drone the players target + if (self.practice==5 and unit.getUnitFullName(self.player.GetTarget())==unit.getUnitFullName(self.drone)): + nam = unit.getUnitFullName(self.drone) + self.objective = VS.addObjective("Face %s" % nam) + self.objectives+=[int(self.objective)] + VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"OK. Now, orient your ship so that your targetting reticule (cross) points directly at me.") + VS.IOmessage (7,"Oswald","Privateer",self.msgColor+"To get my ship into your visual range just turn in the dir... [truncated message content] |