Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
quest_tutorial Class Reference
Inheritance diagram for quest_tutorial:
quest

Public Member Functions

def __init__
 
def putSaveValue
 
def getSaveValue
 
def playSoundCockpit
 
def hasUndockedFromAtlantis
 
def playerIsUndocked
 
def LightMinuteToMeter
 
def launchNewDrone
 
def checkDroneHealth
 
def checkDistance
 
def orbitMe
 
def acceptTutorial
 
def tutorialComm
 
def tutorialNav
 
def practiceNav
 
def practiceSpec
 
def tutorialIntermezzo
 
def Execute
 
- Public Member Functions inherited from quest
def NoSignificantsNear
 
def SignificantsNear
 
def setOwner
 
def removeQuest
 
def makeQuestPersistent
 
def isPersistent
 
def Execute
 

Data Fields

 stage
 
 practice
 
 system
 
 player
 
 playerhull
 
 drone
 
 droneshield
 
 fight
 
 dockeddistance
 
 timer
 
 talktime
 
 anitime
 
 stayputtime
 
 msgColor
 
 objectives
 
 objective
 
 startobjectname
 
 animations
 
 speech
 
 newsplayed
 
 startobject
 
 dockedobject
 
 sequence
 
 savestage
 
 complete
 
 jump
 
 destination
 
 distance
 
 playernum
 
 name
 
- Data Fields inherited from quest
 name
 
 playernum
 

Detailed Description

Definition at line 55 of file quest_tutorial.py.

Constructor & Destructor Documentation

def __init__ (   self)

Definition at line 57 of file quest_tutorial.py.

57 
58  def __init__ (self):
59  # initialize variables
60  self.stage = STAGE_DOCKED # tutorial stage
61  self.practice = 0 #sequence within a practice function
62  self.system = VS.getSystemName() # starting system
63  self.player = VS.getPlayer()
64  self.playerhull = VS.getPlayer().GetHull()
65  self.drone = VS.Unit()
66  self.droneshield = 1 # shield before fight
67  self.fight = 0 # how many fight rounds
68  self.dockeddistance = 0
69  self.timer = VS.GetGameTime() # controls the stage timing
70  self.talktime = VS.GetGameTime() #controls individual talk time within animation
71  self.anitime = VS.GetGameTime() # controls the animation time
72  self.stayputtime = 0
73  self.msgColor = "#FFFF99"
74  self.objectives = [] # list of objectives
75  self.objective = 0 # current objective
76  self.startobjectname = ""
77  self.animations = [["com_tutorial_oswald.ani",2]] # the actors and ani duration
78  self.speech = [] # has a list of current sound files for speech
79  self.newsplayed = 0

Member Function Documentation

def acceptTutorial (   self)

Definition at line 227 of file quest_tutorial.py.

References quest_disappear.drone, quest_drone.drone, quest_tutorial.drone, Vector.Mag(), quest_shipyardbomb.player, quest_dispute.player, quest_blockade.player, quest_debug.player, quest_tutorial.player, ambush.timer, quest_disappear.timer, quest_teleport.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, and Profile.timer.

228  def acceptTutorial (self):
229  velocity = Vector.Mag(self.player.GetVelocity())
230  # if the offer has been placed, and player is put for 10s and drone is near
231  if (VS.GetGameTime()>self.timer and self.drone.getDistance(self.player)<1100 and velocity<=10):
232  self.player.SetTarget(self.drone)
233  self.timer = VS.GetGameTime()
234  self.complete = self.getSaveValue()
235  if (self.complete>0):
236  self.stage = self.complete
237  else:
238  self.stage = STAGE_ACCEPT
239  if (VS.GetGameTime()>self.timer and velocity>=10):
240  # allow some time for slowing down and approach if ships were moving
241  if (self.stayputtime>60):
242  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Have a nice journey and come back for a space faring refresher anytime here in Cephid 17.")
243  self.speech = ["com_tutorial_oswald/oswald_bye.ogg"]
244  self.playSoundCockpit(self.speech[0])
245  self.player.commAnimation("com_tutorial_oswald.ani")
246  self.stage = STAGE_DECLINE
247  self.timer = VS.GetGameTime()
248  else:
249  self.stayputtime += 10
250  self.timer = VS.GetGameTime() + 10
251  return 0
def checkDistance (   self)

Definition at line 199 of file quest_tutorial.py.

References quest_shipyardbomb.player, quest_dispute.player, quest_blockade.player, quest_debug.player, quest_tutorial.player, quest_tutorial.practice, quest_rlaan_spy.stage, quest_drone.stage, quest_rogue_militia.stage, quest_racene.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, and quest_debug.stage.

200  def checkDistance (self):
201  if (self.drone.getDistance(self.player)>20000):
202  self.practice = 0
203  self.stage = 97
204  return 0
def checkDroneHealth (   self)

Definition at line 184 of file quest_tutorial.py.

References quest_disappear.drone, quest_drone.drone, quest_tutorial.drone, quest_tutorial.droneshield, unit.getShieldPercent(), quest_shipyardbomb.player, quest_dispute.player, quest_blockade.player, quest_debug.player, and quest_tutorial.player.

185  def checkDroneHealth (self):
186  if (unit.getShieldPercent(self.drone)<self.droneshield*0.90):
187  self.drone.PrimeOrders()
188  self.drone.SetTarget(self.player)
189  self.drone.LoadAIScript("fighter.ace")
190  self.drone.setFgDirective("a.")
191  self.savestage = self.stage
192  self.practice = 0
193  #if (self.fight<2):
194  self.fight += 1
195  self.stage = 96
196  return 0
def Execute (   self)

Definition at line 834 of file quest_tutorial.py.

References quest_tutorial.acceptTutorial(), quest_tutorial.animations, quest_dispute.animations, quest_dispute.anitime, quest_tutorial.anitime, quest_tutorial.checkDistance(), quest_tutorial.checkDroneHealth(), quest_tutorial.complete, quest_tutorial.getSaveValue(), quest_disappear.launchNewDrone(), quest_drone.launchNewDrone(), quest_tutorial.launchNewDrone(), quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, quest_tutorial.msgColor, quest_tutorial.newsplayed, quest_tutorial.orbitMe(), quest_debug.playerIsUndocked(), quest_tutorial.playerIsUndocked(), quest_tutorial.playSoundCockpit(), quest_tutorial.practiceNav(), quest_tutorial.practiceSpec(), news.publishNews(), quest_tutorial.putSaveValue(), quest_dispute.sequence, quest_tutorial.sequence, quest_tutorial.speech, quest_rlaan_spy.stage, quest_drone.stage, quest_rogue_militia.stage, quest_racene.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, quest_debug.stage, SystemInformation.system, quest_slaver.system, quest_shipyardbomb.system, quest_blockade.system, InSystemCondition.system, quest_tutorial.system, ChangeSystemOwner.system, quest_dispute.talktime, quest_tutorial.talktime, quest_teleport.timer, ambush.timer, quest_disappear.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, Profile.timer, quest_tutorial.tutorialComm(), quest_tutorial.tutorialIntermezzo(), and quest_tutorial.tutorialNav().

835  def Execute (self):
836  # do not do anything before the player undocks
837  if (self.stage==STAGE_DOCKED):
838  self.complete = self.getSaveValue()
839  if (self.complete==0) and (self.newsplayed==0):
840  # publish news
841  text = "CEPHID SECURITY INITIATIVE GIVES TRAINING FOR FLIGHT SAFETY\\\The Cephid Security Initiative (CSI) is offering training for pilots with the purpose of enhancing flight safety in and out of the system. "
842  text += "A representative said, this training is sponsored by volunteer contributors and open for pilots of all vessel classes. "
843  text += "No matter if you're a greenhorn in space faring or a long-time pilot you may meet one of the volunteers when leaving from a planet or station into space and participate in the training or refresher."
844  news.publishNews(text)
845  self.newsplayed = 1
846  if (self.complete>=98):
847  self.stage = self.complete
848  if (self.complete<98):
849  self.playerIsUndocked()
850 
851  # launch drone if the player did not die
852  if (not self.player.isNull()):
853  # when in space, launch the drone
854  if (self.stage==STAGE_AWAY and VS.GetGameTime()>self.timer):
855  self.launchNewDrone()
856  #self.stage = 7 #debug
857  # play the talk animation
858  if (self.stage==2 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
859  for index in range (len(self.sequence)):
860  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
861  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
862  # play each soundfile once
863  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
864  self.playSoundCockpit(self.speech[index])
865  self.anitime = VS.GetGameTime()+2
866  if (self.stage==2 and VS.GetGameTime()>=self.timer):
867  self.stage = 3
868 
869  if (not self.player.isNull() and not self.drone.isNull()):
870  # check if player is attacking drone
871  if (self.stage<90):
872  self.checkDroneHealth()
873  # check if player is still in system
874  if (self.stage<90 and not VS.getSystemName()==self.system):
875  self.stage = 97
876  # check if player is flying off
877  if (self.stage<90 and self.stage!=COMPLETE_TUTORIAL3 and self.stage!=COMPLETE_TUTORIAL4):
878  self.checkDistance()
879  # when drone is launched, then follow player
880  if (self.stage==3):
881  self.orbitMe()
882  self.acceptTutorial()
883  if (self.stage==STAGE_ACCEPT):
884  self.tutorialComm()
885  if (self.stage==COMPLETE_TUTORIAL1):
886  self.tutorialNav()
887  if (self.stage==COMPLETE_TUTORIAL2):
888  self.practiceNav()
889  if (self.stage==COMPLETE_TUTORIAL3):
890  self.orbitMe()
891  self.practiceSpec()
892  # tutorial is incomplete, so a nice excuse is required
893  if (self.stage==COMPLETE_TUTORIAL4 and VS.GetGameTime()>self.timer):
894  VS.IOmessage (0,"Oswald","player",self.msgColor+"Oops. Sorry, pal. My boss at the Cephid Safety Initiative has an emergency situation I must handle now. I apologize.")
895  VS.IOmessage (9,"Oswald","player",self.msgColor+"Have a nice journey. And come back for more.")
896  self.sequence = [[0,8,0],[9,3,0]]
897  self.speech = ["com_tutorial_oswald/oswald_cancel.ogg", ""]
898  self.talktime = VS.GetGameTime()
899  self.timer = VS.GetGameTime()+12
900  self.stage = 9
901  # play the talk animation
902  if (self.stage==9 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
903  for index in range (len(self.sequence)):
904  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
905  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
906  # play each soundfile once
907  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
908  self.playSoundCockpit(self.speech[index])
909  self.anitime = VS.GetGameTime()+2
910  if (self.stage==9 and VS.GetGameTime()>=self.timer):
911  self.stage = 98
912  # drone was attacked, give him a lesson!
913  if (self.stage==96):
914  self.tutorialIntermezzo()
915  # player run off during tutorial, let's break it off then
916  if (self.stage==97 and VS.GetGameTime()>self.timer):
917  VS.IOmessage (0,"Oswald","player",self.msgColor+"Hey! Where are you heading? Come back for more anytime.")
918  VS.IOmessage (4,"Oswald","player",self.msgColor+"Have a good flight and don't break the hull.")
919  self.speech = ["com_tutorial_oswald/oswald_runoff_01.ogg"]
920  self.playSoundCockpit(self.speech[0])
921  self.player.commAnimation("com_tutorial_oswald.ani")
922  self.player.commAnimation("com_tutorial_oswald.ani")
923  self.player.commAnimation("com_tutorial_oswald.ani")
924  self.timer = VS.GetGameTime()+6
925  self.stage = 98
926  # if the turorial was declined
927  if (self.stage==98 and VS.GetGameTime()>self.timer):
928  self.drone.SetVelocity((2000,0,0))
929  self.timer = VS.GetGameTime()+10
930  self.putSaveValue(self.stage)
931  print "Tutorial quest finished"
932  self.stage = 99
933  # let the drone disappear
934  if (self.stage==99 and VS.GetGameTime()>self.timer):
935  self.drone.PrimeOrders()
936  self.playernum = -1
937  self.name = "quest_tutorial"
938  self.removeQuest()
939  self.stage += 1 # don't enter this loop anymore
940  return 0
941  # keep the script alive for execution
942  return 1
943 
# call this from the adventure file
def getSaveValue (   self,
  key = SAVE_KEY 
)

Definition at line 85 of file quest_tutorial.py.

85 
86  def getSaveValue(self,key=SAVE_KEY):
87  if Director.getSaveDataLength(self.player.isPlayerStarship(),key) > 0:
88  #print "----getSaveValue---", int(Director.getSaveData(self.player.isPlayerStarship(),key,0))
89  return int(Director.getSaveData(self.player.isPlayerStarship(),key,0))
90  return 0
def hasUndockedFromAtlantis (   self)

Definition at line 99 of file quest_tutorial.py.

99 
100  def hasUndockedFromAtlantis(self):
101  # get the planet object
102  self.startobject = unit.getUnitByName('Atlantis')
103  # target the departing planet to see the distance
104  self.player.SetTarget(self.startobject)
105  # verify if player is still docked at the planet
106  if (self.startobject.isDocked(self.player)):
107  self.dockeddistance = self.startobject.getDistance(self.player)
108  # if the player is not docked and at least 5km away then set next stage number
109  if (not self.startobject.isDocked(self.player) and self.startobject.getDistance(self.player)>(self.dockeddistance+5000)):
110  self.stage = STAGE_AWAY
111  return 0
def launchNewDrone (   self)

Definition at line 137 of file quest_tutorial.py.

References Vector.Add(), quest_disappear.drone, quest_drone.drone, quest_tutorial.drone, quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, and quest_tutorial.msgColor.

138  def launchNewDrone (self):
139  if (not self.player.isNull()):
140  # get the player's position
141  vec = self.player.Position()
142  # set drone position 1000m away from the player
143  vec = Vector.Add(vec,(1000,0,0))
144  # launch the tutorial drone.
145  #VS.launch(name,type,faction,unittype,ai,nr,nrwaves,pos,squadlogo):
146  self.drone = VS.launch("Oswald","Robin.tutorial","klkk_citizen","unit","default",1,1,vec,'')
147  # upgrade drone
148  self.drone.upgrade("quadshield15",0,0,1,0)
149  self.drone.upgrade("armor06",0,0,1,0)
150  # when launching give the player some text and ask him to decide if he wants to participate
151  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Hello traveler.")
152  VS.IOmessage (3,"Oswald","Privateer",self.msgColor+"My name is Oswald and I am offering flight assistance.")
153  VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Would you like to refresh your space faring skills?")
154  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.")
155  #VS.playSound("com_tutorial_oswald/oswald_greet.ogg", self.player.Position(), (0,0,0))
156  #VS.musicPlaySong("com_tutorial_oswald/oswald_greet.ogg")
157  # set comm animation parameters
158  # list [start,duration,anilist_entry]
159  self.sequence = [[0,1,0],[3,3,0],[8,2,0],[12,7,0]]
160  # set speech files
161  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"]
162  #set talktime start
163  self.talktime = VS.GetGameTime()
164  # on launching the drone, set its position near the player
165  vec = self.player.Position()
166  vec = Vector.Add (vec,(vsrandom.uniform(-2000,2000),
167  vsrandom.uniform(-2000,2000),
168  vsrandom.uniform(-2000,2000)))
169  self.drone.SetPosition(vec)
170  # get rid of all orders, so that strange maneouvers don't happen
171  self.drone.PrimeOrders()
172  # display the drone on HUD
173  self.player.SetTarget(self.drone)
174  # remember the initial shield strength
176  self.fight = 0
177  self.stage += 1
178  #self.stage = COMPLETE_TUTORIAL3 # debug
179  # duration of this part until end of animation
180  self.timer = VS.GetGameTime() + 20
181  return 0
def LightMinuteToMeter (   self,
  lightminute 
)

Definition at line 132 of file quest_tutorial.py.

133  def LightMinuteToMeter(self,lightminute):
134  meter = 17987547500 * lightminute
135  return meter
def orbitMe (   self)

Definition at line 208 of file quest_tutorial.py.

References quest_shipyardbomb.player, quest_dispute.player, quest_blockade.player, quest_debug.player, quest_tutorial.player, Vector.SafeNorm(), Vector.Scale(), and Vector.Sub().

209  def orbitMe (self):
210  #self.player.SetTarget(self.drone)
211  # if the drone is more than 1000m away it will start instructions
212  if (self.drone.getDistance(self.player)>=1100):
213  # orientate the nose of the drone towards the player ship
214  vec = Vector.Sub(self.player.Position(),self.drone.Position())
215  self.drone.SetOrientation((1,0,0),vec)
216  # set velocity proportional to distance from player
217  vec = Vector.Scale(Vector.SafeNorm(vec),self.drone.getDistance(self.player)/10)
218  self.drone.SetVelocity(vec)
219  #self.stayputtime = VS.GetGameTime()
220  # if drone has approached player until 1000m then stop it
221  if (self.drone.getDistance(self.player)<1100):
222  self.drone.SetVelocity((0,0,0))
223  # this is also needed to stop rotation of the drone
224  self.drone.SetAngularVelocity((0,0,0))
225  return 0
def playerIsUndocked (   self)

Definition at line 113 of file quest_tutorial.py.

114  def playerIsUndocked(self):
115  # dockedobject and dockeddistance must be global, i.e prefixed with self
116  # otherwise the script will advance to next stage just after undocking
117  # get the planet object
119  name = self.dockedobject.getName()
120  # verify if player is still docked and set the reference distance
121  if (not name==""):
122  self.dockeddistance = self.dockedobject.getDistance(self.player)
123  self.startobjectname = name
124  # when starting from Atlantis, target the departing planet to see the distance
125  if (name=="Atlantis"):
126  self.player.SetTarget(self.dockedobject)
127  # if the player was never docked or is not docked and at least 1km away then set next stage number
128  if (name=="" or ((not self.startobjectname=="") and (not self.startobjectname=="Atlantis") and self.dockedobject.getDistance(self.player)>(self.dockeddistance+1000))):
129  self.stage = STAGE_AWAY
130  self.timer = VS.GetGameTime()+5
131  return 0
def playSoundCockpit (   self,
  soundfile 
)

Definition at line 91 of file quest_tutorial.py.

91 
92  def playSoundCockpit(self,soundfile):
93  try:
94  VS.playSoundCockpit(soundfile)
95  except AttributeError:
96  VS.playSound(soundfile, self.player.Position(), (0,0,0))
def practiceNav (   self)

Definition at line 352 of file quest_tutorial.py.

References quest_tutorial.animations, quest_dispute.animations, quest_dispute.anitime, quest_tutorial.anitime, quest_disappear.drone, quest_drone.drone, quest_tutorial.drone, unit.facingAngleToUnit(), unit.getSignedVelocity(), unit.getUnitFullName(), Vector.Mag(), quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, quest_tutorial.msgColor, defend.objective, escort_local.objective, quest_tutorial.objective, patrol.objectives, patrol_ambush.objectives, quest_tutorial.objectives, quest_shipyardbomb.player, quest_dispute.player, quest_blockade.player, quest_debug.player, quest_tutorial.player, quest_tutorial.playSoundCockpit(), quest_tutorial.practice, quest_tutorial.putSaveValue(), quest_dispute.sequence, quest_tutorial.sequence, quest_tutorial.speech, quest_rlaan_spy.stage, quest_drone.stage, quest_racene.stage, quest_rogue_militia.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, quest_debug.stage, quest_dispute.talktime, quest_tutorial.talktime, quest_disappear.timer, ambush.timer, quest_teleport.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, and Profile.timer.

353  def practiceNav (self):
354  # practice intro
355  if (self.practice==0):
356  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"So much for theory. Let's do some practice now.")
357  VS.IOmessage (4,"Oswald","Privateer",self.msgColor+"First we'll do some basic navigation and targetting.")
358  self.sequence = [[0,3,0],[4,3,0]]
359  self.speech = ["com_tutorial_oswald/oswald_target_01.ogg", "com_tutorial_oswald/oswald_target_02.ogg"]
360  self.talktime = VS.GetGameTime()
361  self.timer = VS.GetGameTime()+10
362  self.practice = 1
363  if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
364  for index in range (len(self.sequence)):
365  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
366  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
367  # play each soundfile once
368  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
369  self.playSoundCockpit(self.speech[index])
370  self.anitime = VS.GetGameTime()+2
371  if (self.practice==1 and VS.GetGameTime()>=self.timer):
372  self.practice = 3
373  if (self.practice==3):
374  # explain basic targetting if drone is not already target
375  if (unit.getUnitFullName(self.player.GetTarget()) != unit.getUnitFullName(self.drone)):
376  nam = unit.getUnitFullName(self.drone)
377  self.objective = VS.addObjective("Target %s" % nam)
378  self.objectives+=[int(self.objective)]
379  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.")
380  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.")
381  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.")
382  # set comm animation parameters
383  self.sequence = [[0,7,0],[8,7,0],[16,6,0]]
384  self.speech = ["com_tutorial_oswald/oswald_target_03.ogg", "com_tutorial_oswald/oswald_target_04.ogg", "com_tutorial_oswald/oswald_target_05.ogg"]
385  self.talktime = VS.GetGameTime()
386  self.timer = VS.GetGameTime()+23
387  self.practice = 4
388  else:
389  self.practice = 5
390  if (self.practice==4 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
391  for index in range (len(self.sequence)):
392  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
393  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
394  # play each soundfile once
395  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
396  self.playSoundCockpit(self.speech[index])
397  self.anitime = VS.GetGameTime()+2
398  if (self.practice==4 and VS.GetGameTime()>=self.timer):
399  self.practice = 5
400  # make the drone the players target
401  if (self.practice==5 and unit.getUnitFullName(self.player.GetTarget())==unit.getUnitFullName(self.drone)):
402  nam = unit.getUnitFullName(self.drone)
403  self.objective = VS.addObjective("Face %s" % nam)
404  self.objectives+=[int(self.objective)]
405  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"OK. Now, orient your ship so that your targetting reticule (cross) points directly at me.")
406  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.")
407  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.")
408  VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"Align your targetting reticule with my ship.")
409  # set comm animation parameters
410  self.sequence = [[0,6,0],[7,6,0],[14,5,0],[20,3,0]]
411  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"]
412  self.talktime = VS.GetGameTime()
413  self.timer = VS.GetGameTime()+24
414  self.practice = 6
415  if (self.practice==6 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
416  for index in range (len(self.sequence)):
417  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
418  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
419  # play each soundfile once
420  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
421  self.playSoundCockpit(self.speech[index])
422  self.anitime = VS.GetGameTime()+2
423  if (self.practice==6 and VS.GetGameTime()>=self.timer):
424  self.practice = 7
425  if (self.practice==7):
426  # check if the player is facing the drone
427  angle = unit.facingAngleToUnit(self.player,self.drone)
428  #print "facing: " + str(angle)
429  if (angle<=0.05):
430  VS.setCompleteness(self.objectives[self.objective],1.0)
431  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Well done.")
432  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.")
433  self.player.commAnimation("com_tutorial_oswald.ani")
434  self.objective = VS.addObjective("Set max velocity")
435  self.objectives+=[int(self.objective)]
436  self.sequence = [[0,1,0],[2,6,0]]
437  self.speech = ["com_tutorial_oswald/oswald_nav_21.ogg", "com_tutorial_oswald/oswald_nav_22.ogg"]
438  self.talktime = VS.GetGameTime()
439  self.timer = VS.GetGameTime()+9
440  self.practice = 8
441  if (self.practice==8 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
442  for index in range (len(self.sequence)):
443  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
444  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
445  # play each soundfile once
446  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
447  self.playSoundCockpit(self.speech[index])
448  self.anitime = VS.GetGameTime()+2
449  if (self.practice==8 and VS.GetGameTime()>=self.timer):
450  self.practice = 9
451  if (self.practice==9):
452  # check if the player is facing away
453  angle = unit.facingAngleToUnit(self.player,self.drone)
454  velocity = Vector.Mag(self.player.GetVelocity())
455  #check if angle to drone is at least 22 degrees (0.20 radians)
456  if (angle>=0.20 and velocity>=295):
457  VS.setCompleteness(self.objectives[self.objective],1.0)
458  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.")
459  self.player.commAnimation("com_tutorial_oswald.ani")
460  self.player.commAnimation("com_tutorial_oswald.ani")
461  self.playSoundCockpit("com_tutorial_oswald/oswald_nav_23.ogg")
462  self.objective = VS.addObjective("Set full stop")
463  self.objectives+=[int(self.objective)]
464  self.timer = VS.GetGameTime()+9
465  self.practice = 10
466  if (self.practice==10):
467  # check if the player is stopped
468  velocity = Vector.Mag(self.player.GetVelocity())
469  if (velocity<=2):
470  VS.setCompleteness(self.objectives[self.objective],1.0)
471  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.")
472  self.player.commAnimation("com_tutorial_oswald.ani")
473  self.playSoundCockpit("com_tutorial_oswald/oswald_nav_24.ogg")
474  self.objective = VS.addObjective("Set velocity reference to 100m/s")
475  self.objectives+=[int(self.objective)]
476  self.timer = VS.GetGameTime()+9
477  self.practice = 11
478  if (self.practice==11):
479  # check if the player has velocity >100
480  velocity = Vector.Mag(self.player.GetVelocity())
481  if (velocity>=98 and velocity<=110):
482  VS.setCompleteness(self.objectives[3],1.0)
483  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.")
484  self.player.commAnimation("com_tutorial_oswald.ani")
485  self.playSoundCockpit("com_tutorial_oswald/oswald_nav_25.ogg")
486  self.objective = VS.addObjective("Set velocity reference to 50m/s")
487  self.objectives+=[int(self.objective)]
488  self.timer = VS.GetGameTime()+9
489  self.practice = 12
490  if (self.practice==12):
491  # check if the player has velocity <50
492  velocity = Vector.Mag(self.player.GetVelocity())
493  if (velocity<=55 and velocity>=40):
494  VS.setCompleteness(self.objectives[self.objective],1.0)
495  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.")
496  self.player.commAnimation("com_tutorial_oswald.ani")
497  self.playSoundCockpit("com_tutorial_oswald/oswald_nav_26.ogg")
498  self.objective = VS.addObjective("Set velocity reference to -20m/s")
499  self.objectives+=[int(self.objective)]
500  self.timer = VS.GetGameTime()+12
501  self.practice = 13
502  if (self.practice==13):
503  # check if the player has velocity <=-20m/s
504  velocity = unit.getSignedVelocity(self.player)
505  if (velocity<=-18):
506  VS.setCompleteness(self.objectives[self.objective],1.0)
507  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Excellent.")
508  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.")
509  VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"I'm sure this will come in handy during your future endeavors.")
510  # set comm animation parameters
511  self.sequence = [[0,1,0],[2,7,0],[10,4,0]]
512  self.speech = ["com_tutorial_oswald/oswald_nav_27.ogg", "com_tutorial_oswald/oswald_nav_28.ogg", "com_tutorial_oswald/oswald_nav_29.ogg"]
513  self.talktime = VS.GetGameTime()
514  self.timer = VS.GetGameTime()+15
515  self.practice = 14
516  if (self.practice==14 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
517  for index in range (len(self.sequence)):
518  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
519  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
520  # play each soundfile once
521  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
522  self.playSoundCockpit(self.speech[index])
523  self.anitime = VS.GetGameTime()+2
524  if (self.practice==14 and VS.GetGameTime()>=self.timer):
525  self.practice = 15
526  if (self.practice==15):
527  # make sure to reset the counter for the next practice loops
528  self.practice = 0
529  self.timer = VS.GetGameTime()+10
530  self.stage = COMPLETE_TUTORIAL3
531  self.putSaveValue(self.stage)
532  #print "NAV - save: " + str(self.getSaveValue())
533  return 0
def practiceSpec (   self)

Definition at line 534 of file quest_tutorial.py.

References quest_tutorial.practice.

535  def practiceSpec (self):
536  # practice intro
537  if (self.practice==0):
538  #self.jump = universe.getRandomJumppoint()
539  self.jump = unit.getUnitByName('JumpToOldziey')
540  nam = unit.getUnitFullName(self.jump)
541  self.objective = VS.addObjective("Target %s" % nam)
542  self.objectives+=[int(self.objective)]
543  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Let's practice some faster than light (FTL) travel now.")
544  VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"Target "+unit.getUnitFullName(self.jump)+" navigation point using the #9999FFN"+self.msgColor+" or the #9999FFShift+N"+self.msgColor+" keys.")
545  self.sequence = [[0,4,0],[5,6,0]]
546  self.speech = ["com_tutorial_oswald/oswald_spec_01.ogg", ""]
547  self.talktime = VS.GetGameTime()
548  self.timer = VS.GetGameTime()+12
549  self.practice = 1
550  if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
551  for index in range (len(self.sequence)):
552  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
553  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
554  # play each soundfile once
555  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
556  self.playSoundCockpit(self.speech[index])
557  self.anitime = VS.GetGameTime()+2
558  if (self.practice==1 and VS.GetGameTime()>=self.timer):
559  self.practice = 2
560  if (self.practice==2 and self.player.GetTarget()==self.jump):
561  VS.setCompleteness(self.objectives[self.objective],1.0)
562  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Set your velocity to maximum with the #9999FF\\"+self.msgColor+" key and activate the SPEC auto pilot with the #9999FFA"+self.msgColor+" key to get there. Hang on as this might take a while if you are close to massive objects.")
563  VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"You will notice that your SPEC drive indicator (S) is flashing, which indicates that SPEC is active.")
564  VS.IOmessage (20,"Oswald","Privateer",self.msgColor+"During FTL travel your shields become inactive, as you can see below on your ship VDU.")
565  VS.IOmessage (26,"Oswald","Privateer",self.msgColor+"You will also notice that your steering has no effect on your vessel since the auto pilot has taken over the controls.")
566  VS.IOmessage (32,"Oswald","Privateer",self.msgColor+"You can always interrupt and resume the auto pilot by toggling the #9999FFA"+self.msgColor+" key. You may try that, if you wish.")
567  VS.IOmessage (40,"Oswald","Privateer",self.msgColor+"In the lower left corner, just above your ship staus you will notice two indicators.")
568  VS.IOmessage (45,"Oswald","Privateer",self.msgColor+"SPEC shows you if your SPEC drive is enabled.")
569  VS.IOmessage (47,"Oswald","Privateer",self.msgColor+"AUTO tells you if auto pilot is engaged.")
570  name = unit.getUnitFullName(self.jump)
571  self.objective = VS.addObjective("Approach %s" % name)
572  self.objectives+=[int(self.objective)]
573  # set comm animation parameters
574  self.sequence = [[0,12,0],[12,6,0],[20,6,0],[26,6,0],[32,7,0],[40,4,0],[45,2,0],[47,4,0]]
575  self.speech = ["com_tutorial_oswald/oswald_spec_02.ogg", "", "com_tutorial_oswald/oswald_spec_03.ogg", "", "", "com_tutorial_oswald/oswald_spec_04.ogg", "", ""]
576  self.talktime = VS.GetGameTime()
577  self.timer = VS.GetGameTime()+52
578  self.practice = 3
579  if (self.practice==3 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
580  for index in range (len(self.sequence)):
581  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
582  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
583  # play each soundfile once
584  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
585  self.playSoundCockpit(self.speech[index])
586  self.anitime = VS.GetGameTime()+2
587  if (self.practice==3 and VS.GetGameTime()>=self.timer):
588  self.practice = 4
589  if (self.practice==4 and self.player.getDistance(self.jump)<=10000):
590  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Almost there.")
591  VS.IOmessage (2,"Oswald","Privateer",self.msgColor+"The auto pilot only gives back control some time after the SPEC auto pilot light stopped flashing.")
592  VS.IOmessage (8,"Oswald","Privateer",self.msgColor+"Notice also how your shields start recharing when leaving FTL travel mode.")
593  # set comm animation parameters
594  self.sequence = [[0,1,0],[2,5,0],[8,4,0]]
595  self.speech = ["com_tutorial_oswald/oswald_spec_05.ogg", "", ""]
596  self.talktime = VS.GetGameTime()
597  self.timer = VS.GetGameTime()+14
598  self.practice = 5
599  if (self.practice==5 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
600  for index in range (len(self.sequence)):
601  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
602  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
603  # play each soundfile once
604  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
605  self.playSoundCockpit(self.speech[index])
606  self.anitime = VS.GetGameTime()+2
607  if (self.practice==5 and VS.GetGameTime()>=self.timer):
608  self.practice = 6
609  if (self.practice==6 and self.player.getDistance(self.jump)<=3000):
610  VS.setCompleteness(self.objectives[self.objective],1.0)
611  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Here we are.")
612  VS.IOmessage (1,"Oswald","Privateer",self.msgColor+"You may try out manual FTL travel at this point.")
613  VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"Target the planet Atlantis using your significant objects targetting keys #9999FFN"+self.msgColor+" and #9999FFShift+N"+self.msgColor+".")
614  # set comm animation parameters
615  self.sequence = [[0,1,0],[1,4,0],[5,7,0]]
616  self.speech = ["com_tutorial_oswald/oswald_spec_06.ogg", "", ""]
617  self.talktime = VS.GetGameTime()
618  self.timer = VS.GetGameTime()+12
619  self.practice += 1
620  if (self.practice==7 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
621  for index in range (len(self.sequence)):
622  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
623  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
624  # play each soundfile once
625  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
626  self.playSoundCockpit(self.speech[index])
627  self.anitime = VS.GetGameTime()+2
628  if (self.practice==7 and VS.GetGameTime()>=self.timer):
629  self.practice = 8
630  if (self.practice==8 and VS.GetGameTime()>self.timer):
631  self.destination = unit.getUnitByName('Atlantis')
632  self.distance = self.player.getDistance(self.destination)
633  name = unit.getUnitFullName(self.destination)
634  self.objective = VS.addObjective("Target %s" % name)
635  self.objectives+=[int(self.objective)]
636  self.timer = VS.GetGameTime()
637  self.practice += 1
638  if (self.practice==9 and self.player.GetTarget()==self.destination):
639  VS.setCompleteness(self.objectives[self.objective],1.0)
640  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Roger that. Turn towards the planet, set your velocity to maximum with the #9999FF\\"+self.msgColor+" key, and enable the manual SPEC with the #9999FFShift+A"+self.msgColor+" key to approach the planet.")
641  VS.IOmessage (12,"Oswald","Privateer",self.msgColor+"Make sure that the planet is fairly well centered in your targetting reticule.")
642  VS.IOmessage (17,"Oswald","Privateer",self.msgColor+"Notice how your speed starts increasing gradually after leaving the jump point range.")
643  self.objective = VS.addObjective("Enable manual SPEC")
644  self.objectives+=[int(self.objective)]
645  # set comm animation parameters
646  self.sequence = [[0,12,0],[12,5,0],[17,5,0]]
647  self.speech = ["com_tutorial_oswald/oswald_spec_07.ogg", "", ""]
648  self.talktime = VS.GetGameTime()
649  self.timer = VS.GetGameTime()+22
650  self.practice += 1
651  if (self.practice==10 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
652  for index in range (len(self.sequence)):
653  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
654  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
655  # play each soundfile once
656  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
657  self.playSoundCockpit(self.speech[index])
658  self.anitime = VS.GetGameTime()+2
659  if (self.practice==10 and VS.GetGameTime()>=self.timer):
660  self.practice = 11
661  if (self.practice==11 and self.player.GetTarget()==self.destination):
662  #disabled for now, since max velocity does not return the spec values
663  #velocity = Vector.Mag(self.player.GetVelocity())
664  #print "velocity=" + str(self.player.GetVelocity())
665  #print "magnitude=" + str(velocity)
666  #if (velocity>=5000):
667  if (self.player.getDistance(self.destination)<=(self.distance*0.97)):
668  VS.setCompleteness(self.objectives[self.objective],1.0)
669  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"If your are getting too much off course, stop the SPEC drive toggling the #9999FFShift+A"+self.msgColor+" key, recenter your target, and then re-enable the manual SPEC drive again with the same keys.")
670  VS.IOmessage (13,"Oswald","Privateer",self.msgColor+"When you have approched Atlantis to 10 000km please disble the SPEC drive toggling the #9999FFShift+A"+self.msgColor+" key again and then stop your ship.")
671  name = unit.getUnitFullName(self.destination)
672  self.objective = VS.addObjective("Approach %s" % name)
673  self.objectives+=[int(self.objective)]
674  # set comm animation parameters
675  self.sequence = [[0,12,0],[13,9,0]]
676  self.speech = ["com_tutorial_oswald/oswald_spec_08.ogg", ""]
677  self.talktime = VS.GetGameTime()
678  self.timer = VS.GetGameTime()+22
679  self.practice += 1
680  #else:
681  # self.practice += 2
682  if (self.practice==12 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
683  for index in range (len(self.sequence)):
684  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
685  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
686  # play each soundfile once
687  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
688  self.playSoundCockpit(self.speech[index])
689  self.anitime = VS.GetGameTime()+2
690  if (self.practice==12 and VS.GetGameTime()>=self.timer):
691  self.practice = 13
692  if (self.practice==13 and self.player.getDistance(self.destination)<=10000000):
693  VS.setCompleteness(self.objectives[self.objective],1.0)
694  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"All right.")
695  VS.IOmessage (2,"Oswald","Privateer",self.msgColor+"You have learned how to conveniently travel within the system.")
696  self.speech = ["com_tutorial_oswald/oswald_spec_09.ogg", ""]
697  self.playSoundCockpit(self.speech[0])
698  self.player.commAnimation("com_tutorial_oswald.ani")
699  self.timer = VS.GetGameTime()+7
700  self.practice += 1
701  if (self.practice==14):
702  velocity = Vector.Mag(self.player.GetVelocity())
703  if (velocity>=10 and self.player.getDistance(self.destination)<=2000000):
704  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Bring your ship to full stop before crashing into the planet.")
705  self.speech = ["com_tutorial_oswald/oswald_spec_10.ogg", ""]
706  self.player.commAnimation("com_tutorial_oswald.ani")
707  self.playSoundCockpit(self.speech[0])
708  self.objective = VS.addObjective("Stop your ship")
709  self.objectives+=[int(self.objective)]
710  self.timer = VS.GetGameTime()+10
711  self.practice += 1
712  else:
713  self.practice += 2
714  if (self.practice==15):
715  velocity = Vector.Mag(self.player.GetVelocity())
716  if (velocity<=10):
717  VS.setCompleteness(self.objectives[self.objective],1.0)
718  self.practice += 1
719  if (self.practice==16):
720  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Now dock to the planet, go to the mission computer, and save your game.")
721  VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"Then get yourself a Jump Drive and an Overdrive and come back for more tutoring if you wish.")
722  VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"To dock, turn towards the planet and press the docking clearance request key #9999FFD"+self.msgColor+". A green docking frame will appear.")
723  VS.IOmessage (17,"Oswald","Privateer",self.msgColor+"You may still enable the SPEC drive until you close up on the planet and your velocity matches the set velocity.")
724  VS.IOmessage (24,"Oswald","Privateer",self.msgColor+"When you are within range, press again the #9999FFD"+self.msgColor+" key to dock. The docking distance will depend on the planet or station size that you are docking to.")
725  VS.IOmessage (33,"Oswald","Privateer",self.msgColor+"The larger the object the further away you can dock.")
726  VS.IOmessage (36,"Oswald","Privateer",self.msgColor+"For Atlantis the docking distance is roughly about 990 kilometers.")
727  # set comm animation parameters
728  self.sequence = [[0,5,0],[5,5,0],[10,7,0],[17,6,0],[24,6,0],[33,3,0],[36,5,0]]
729  self.speech = ["com_tutorial_oswald/oswald_spec_11.ogg", "", "", "", "com_tutorial_oswald/oswald_spec_12.ogg", "", ""]
730  self.talktime = VS.GetGameTime()
731  self.timer = VS.GetGameTime()+42
732  self.practice += 1
733  if (self.practice==17 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
734  for index in range (len(self.sequence)):
735  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
736  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
737  # play each soundfile once
738  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
739  self.playSoundCockpit(self.speech[index])
740  self.anitime = VS.GetGameTime()+2
741  if (self.practice==17 and VS.GetGameTime()>=self.timer):
742  self.practice += 1
743  if (self.practice==18 and self.destination.isDocked(self.player)):
744  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"That concludes the navigation part of the tutorial.")
745  self.speech = ["com_tutorial_oswald/oswald_spec_13.ogg"]
746  self.player.commAnimation("com_tutorial_oswald.ani")
747  self.playSoundCockpit(self.speech[0])
748  self.timer = VS.GetGameTime()+3
749  self.practice = 99
750  if (self.practice>=99):
751  # make sure to reset the counter for the next practice loops
752  self.practice = 0
753  self.stage = COMPLETE_TUTORIAL4
754  self.putSaveValue(self.stage)
755  return 0
def putSaveValue (   self,
  value,
  key = SAVE_KEY 
)

Definition at line 80 of file quest_tutorial.py.

80 
81  def putSaveValue(self,value, key=SAVE_KEY):
82  Director.eraseSaveData(self.player.isPlayerStarship(),key,0)
83  Director.pushSaveData(self.player.isPlayerStarship(),key,value)
84  return 1
def tutorialComm (   self)

Definition at line 253 of file quest_tutorial.py.

References quest_tutorial.animations, quest_dispute.animations, quest_dispute.anitime, quest_tutorial.anitime, quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, quest_tutorial.msgColor, quest_tutorial.playSoundCockpit(), quest_tutorial.practice, quest_tutorial.putSaveValue(), quest_dispute.sequence, quest_tutorial.sequence, quest_tutorial.speech, quest_rlaan_spy.stage, quest_drone.stage, quest_rogue_militia.stage, quest_racene.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, quest_debug.stage, quest_dispute.talktime, quest_tutorial.talktime, ambush.timer, quest_teleport.timer, quest_disappear.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, and Profile.timer.

254  def tutorialComm (self):
255  if (self.practice==0):
256  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Glad I can be of help.")
257  VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"In the first place let's have a look at your heads up display (HUD).")
258  VS.IOmessage (10,"Oswald","Privateer",self.msgColor+"Please do not move your ship in order to better focus on my instructions.")
259  VS.IOmessage (15,"Oswald","Privateer",self.msgColor+"In the upper left corner you can see the communication messages.")
260  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.")
261  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.")
262  VS.IOmessage (35,"Oswald","Privateer",self.msgColor+"Good.")
263  VS.IOmessage (37,"Oswald","Privateer",self.msgColor+"Now you can send me a message by pressing the #9999FFF1"+self.msgColor+" key.")
264  # set comm animation parameters
265  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]]
266  # set speech files
267  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"]
268  self.talktime = VS.GetGameTime()
269  self.timer = VS.GetGameTime()+45
270  self.practice = 1
271  if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
272  for index in range (len(self.sequence)):
273  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
274  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
275  # play each soundfile once
276  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
277  self.playSoundCockpit(self.speech[index])
278  self.anitime = VS.GetGameTime()+2
279  if (self.practice==1 and VS.GetGameTime()>=self.timer):
280  self.practice = 2
281  if (self.practice==2 and VS.GetGameTime()>self.timer):
282  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.")
283  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.")
284  VS.IOmessage (26,"Oswald","Privateer",self.msgColor+"That's about it on the messages display.")
285  # set comm animation parameters
286  self.sequence = [[0,12,0],[14,12,0],[26,2,0]]
287  # set speech files
288  self.speech = ["com_tutorial_oswald/oswald_comm_09.ogg", "com_tutorial_oswald/oswald_comm_10.ogg", "com_tutorial_oswald/oswald_comm_11.ogg"]
289  self.talktime = VS.GetGameTime()
290  self.timer = VS.GetGameTime()+30
291  self.practice = 3
292  if (self.practice==3 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
293  for index in range (len(self.sequence)):
294  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
295  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
296  # play each soundfile once
297  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
298  self.playSoundCockpit(self.speech[index])
299  self.anitime = VS.GetGameTime()+2
300  if (self.practice==3 and VS.GetGameTime()>=self.timer):
301  self.practice = 4
302  if (self.practice==4 and VS.GetGameTime()>self.timer):
303  # make sure to reset the counter for the next practice loops
304  self.practice = 0
305  self.timer = VS.GetGameTime()+0
306  self.stage = COMPLETE_TUTORIAL1
307  self.putSaveValue(self.stage)
308  return 0
def tutorialIntermezzo (   self)

Definition at line 757 of file quest_tutorial.py.

References quest_tutorial.animations, quest_dispute.animations, quest_dispute.anitime, quest_tutorial.anitime, quest_disappear.drone, quest_drone.drone, quest_tutorial.drone, quest_tutorial.droneshield, quest_tutorial.fight, unit.getShieldPercent(), quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, quest_tutorial.msgColor, quest_tutorial.playerhull, quest_tutorial.playSoundCockpit(), quest_tutorial.practice, quest_tutorial.savestage, quest_dispute.sequence, quest_tutorial.sequence, quest_tutorial.speech, quest_rlaan_spy.stage, quest_drone.stage, quest_racene.stage, quest_rogue_militia.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, quest_debug.stage, quest_dispute.talktime, quest_tutorial.talktime, ambush.timer, quest_disappear.timer, quest_teleport.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, and Profile.timer.

758  def tutorialIntermezzo (self):
759  # maybe he can have sympathy and make it a lesson if he beats you
760  # like stop before you destroy the player's ship and mouth off about how he hopes you learned
761  # something, 'pirates won't be so forgiving'
762  if (self.practice==0 and self.fight==1):
763  VS.IOmessage (0,"Oswald","Privateer","#FF0000"+"So you want to learn how to dodge lasers, eh?")
764  VS.IOmessage (3,"Oswald","Privateer","#FF0000"+"You aren't the first newbie I've had to put down, and you won't be the last!")
765  # set comm animation parameters
766  self.sequence = [[0,3,0],[3,5,0]]
767  self.speech = ["com_tutorial_oswald/oswald_intermezzo_01.ogg", ""]
768  self.talktime = VS.GetGameTime()
769  self.timer = VS.GetGameTime()+10
770  self.practice = 1
771  if (self.practice==0 and self.fight==2):
772  VS.IOmessage (0,"Oswald","Privateer","#FF0000"+"That's over the border, boy!")
773  VS.IOmessage (2,"Oswald","Privateer","#FF0000"+"May God have mercy upon my enemies, because I won't!")
774  self.speech = ["com_tutorial_oswald/oswald_intermezzo_02.ogg", ""]
775  # set comm animation parameters
776  self.sequence = [[0,2,0],[2,3,0]]
777  self.talktime = VS.GetGameTime()
778  self.timer = VS.GetGameTime()+5
779  self.practice = 1
780  if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
781  for index in range (len(self.sequence)):
782  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
783  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
784  # play each soundfile once
785  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
786  self.playSoundCockpit(self.speech[index])
787  self.anitime = VS.GetGameTime()+2
788  if (self.practice==1 and VS.GetGameTime()>=self.timer):
789  self.practice = 4
790  if (self.practice==4 and self.player.GetHull()<=self.playerhull*0.90 and self.fight<2):
791  self.drone.SetTarget(VS.Unit())
792  VS.AdjustRelation(self.drone.getFactionName(),self.player.getFactionName(),99,10)
793  VS.AdjustRelation(self.player.getFactionName(),self.drone.getFactionName(),99,10)
794  self.drone.LoadAIScript("sitting_duck")
795  self.drone.PrimeOrders()
796  self.practice = 5
797  if (self.practice==5):
798  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Enough of this!")
799  VS.IOmessage (1,"Oswald","Privateer",self.msgColor+"I hope you've learned something.")
800  VS.IOmessage (3,"Oswald","Privateer",self.msgColor+"Pirates won't be so forgiving.")
801  VS.IOmessage (5,"Oswald","Privateer",self.msgColor+"And neither will I if you ever play tricks on me again!")
802  # set comm animation parameters
803  self.sequence = [[0,2,0],[3,5,0]]
804  self.speech = ["com_tutorial_oswald/oswald_intermezzo_03.ogg", "", "", ""]
805  self.talktime = VS.GetGameTime()
806  self.timer = VS.GetGameTime()+8
807  self.practice = 6
808  if (self.practice==6 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
809  for index in range (len(self.sequence)):
810  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
811  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
812  # play each soundfile once
813  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
814  self.playSoundCockpit(self.speech[index])
815  self.anitime = VS.GetGameTime()+2
816  if (self.practice==6 and VS.GetGameTime()>=self.timer):
817  self.practice = 7
818  if (self.practice==7 and VS.GetGameTime()>=self.timer):
819  VS.IOmessage (0,"Oswald","Privateer",self.msgColor+"Now let's get back to business, hotshot.")
820  self.speech = ["com_tutorial_oswald/oswald_intermezzo_04.ogg"]
821  self.player.commAnimation("com_tutorial_oswald.ani")
822  self.playSoundCockpit(self.speech[0])
823  self.timer = VS.GetGameTime()+3
824  self.practice = 8
825  if (self.practice==8 and VS.GetGameTime()>=self.timer):
826  self.practice = 99
827  if (self.practice>=99):
829  # make sure to reset the counter for the next practice loops
830  self.practice = 0
831  self.stage = self.savestage
832  return 0
def tutorialNav (   self)

Definition at line 309 of file quest_tutorial.py.

References quest_tutorial.animations, quest_dispute.animations, quest_dispute.anitime, quest_tutorial.anitime, quest_slaver.msgColor, quest_shipyardbomb.msgColor, quest_blockade.msgColor, quest_debug.msgColor, quest_tutorial.msgColor, quest_tutorial.playSoundCockpit(), quest_tutorial.practice, quest_tutorial.putSaveValue(), quest_dispute.sequence, quest_tutorial.sequence, quest_tutorial.speech, quest_rlaan_spy.stage, quest_drone.stage, quest_rogue_militia.stage, quest_racene.stage, quest_shipyardbomb.stage, quest_dispute.stage, quest_blockade.stage, quest_tutorial.stage, quest_debug.stage, quest_dispute.talktime, quest_tutorial.talktime, ambush.timer, quest_teleport.timer, quest_disappear.timer, waitjump.timer, quest_explore.timer, ai_escortpatrol.timer, quest_shipyardbomb.timer, quest_dispute.timer, quest_blockade.timer, ambush_scan.timer, quest_debug.timer, quest_tutorial.timer, and Profile.timer.

310  def tutorialNav (self):
311  if (self.practice==0):
312  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.")
313  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.")
314  VS.IOmessage (16,"Oswald","Privateer",self.msgColor+"We will come to the text indicators later.")
315  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.")
316  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.")
317  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.")
318  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:")
319  VS.IOmessage (59,"Oswald","Privateer",self.msgColor+" (L) means a hostile has missile lock on you")
320  VS.IOmessage (63,"Oswald","Privateer",self.msgColor+" (J) means you are in range of a jump point and your jump drive is ready")
321  VS.IOmessage (67,"Oswald","Privateer",self.msgColor+" (S) means your SPEC drive, needed for faster-than-light (FTL) travel, is activated")
322  VS.IOmessage (73,"Oswald","Privateer",self.msgColor+" (E) means your electronic counter measures (ECM) are active")
323  VS.IOmessage (77,"Oswald","Privateer",self.msgColor+"Below the round indicators are three colored bars")
324  VS.IOmessage (81,"Oswald","Privateer",self.msgColor+" (CAPACITOR) shows your weapons capacitor charge")
325  VS.IOmessage (86,"Oswald","Privateer",self.msgColor+" (DRIVES) shows your SPEC and jump drives energy charge")
326  VS.IOmessage (91,"Oswald","Privateer",self.msgColor+" (FUEL) shows you capacity for in-system travel and overdrive propulsion")
327  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.")
328  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.")
329  # set comm animation parameters #8 #13
330  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]]
331  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"]
332  self.talktime = VS.GetGameTime()
333  self.timer = VS.GetGameTime()+112
334  self.practice = 1
335  if (self.practice==1 and VS.GetGameTime()<self.timer and VS.GetGameTime()>=self.anitime):
336  for index in range (len(self.sequence)):
337  if (VS.GetGameTime()-self.talktime>=self.sequence[index][0] and VS.GetGameTime()-self.talktime<=self.sequence[index][0]+self.sequence[index][1]):
338  self.player.commAnimation(self.animations[self.sequence[index][2]][0])
339  # play each soundfile once
340  if (VS.GetGameTime()-self.talktime<=self.sequence[index][0]+1):
341  self.playSoundCockpit(self.speech[index])
342  self.anitime = VS.GetGameTime()+2
343  if (self.practice==1 and VS.GetGameTime()>=self.timer):
344  self.practice = 2
345  if (self.practice==2 and VS.GetGameTime()>self.timer):
346  # make sure to reset the counter for the next practice loops
347  self.practice = 0
348  self.timer = VS.GetGameTime()+0
349  self.stage = COMPLETE_TUTORIAL2
350  self.putSaveValue(self.stage)
351  return 0

Field Documentation

animations

Definition at line 76 of file quest_tutorial.py.

anitime

Definition at line 70 of file quest_tutorial.py.

complete

Definition at line 233 of file quest_tutorial.py.

destination

Definition at line 630 of file quest_tutorial.py.

distance

Definition at line 631 of file quest_tutorial.py.

dockeddistance

Definition at line 67 of file quest_tutorial.py.

dockedobject

Definition at line 117 of file quest_tutorial.py.

drone

Definition at line 64 of file quest_tutorial.py.

droneshield

Definition at line 65 of file quest_tutorial.py.

fight

Definition at line 66 of file quest_tutorial.py.

jump

Definition at line 538 of file quest_tutorial.py.

msgColor

Definition at line 72 of file quest_tutorial.py.

name

Definition at line 936 of file quest_tutorial.py.

newsplayed

Definition at line 78 of file quest_tutorial.py.

objective

Definition at line 74 of file quest_tutorial.py.

objectives

Definition at line 73 of file quest_tutorial.py.

player

Definition at line 62 of file quest_tutorial.py.

playerhull

Definition at line 63 of file quest_tutorial.py.

playernum

Definition at line 935 of file quest_tutorial.py.

practice

Definition at line 60 of file quest_tutorial.py.

savestage

Definition at line 190 of file quest_tutorial.py.

sequence

Definition at line 158 of file quest_tutorial.py.

speech

Definition at line 77 of file quest_tutorial.py.

stage

Definition at line 59 of file quest_tutorial.py.

startobject

Definition at line 101 of file quest_tutorial.py.

startobjectname

Definition at line 75 of file quest_tutorial.py.

stayputtime

Definition at line 71 of file quest_tutorial.py.

system

Definition at line 61 of file quest_tutorial.py.

talktime

Definition at line 69 of file quest_tutorial.py.

timer

Definition at line 68 of file quest_tutorial.py.


The documentation for this class was generated from the following file: