Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
ai_qct_waitjump.py
Go to the documentation of this file.
1 import VS
2 import sys
3 import quest
4 import Vector
5 import unit
6 import vsrandom
7 import save_util
8 import faction_ships
9 import universe
10 import launch
11 import quest_contraband_truck
12 
13 
14 class waitjump(VS.PythonAI):
15 
16  def init(self,un):
17  self.XMLScript ("++flystraight.xml")
18  self.AddReplaceLastOrder(1)
19  self.timer = 0
20  self.got_target = 0
21  self.autoed = 0
22 
23  def ChooseTarget(self):
24  return
25 
26  def Execute(self):
27  VS.PythonAI.Execute(self);
28  if quest_contraband_truck.truck_exit == 1:
29  if self.got_target == 0:
30  self.GetParent().SetTarget(universe.getRandomJumppoint())
31  self.trucktarget = (self.GetParent()).GetTarget()
32  self.XMLScript ("++afterburn-turntowards.xml")
33  self.AddReplaceLastOrder(1)
34  self.got_target = 1
35 
36 # starts him afterburning to target
37 
38  if self.timer == 0:
39  self.timer = VS.GetGameTime()
40  print "Timer Set"
41  elif self.timer + 30 < VS.GetGameTime() and self.autoed == 0:
42  self.GetParent().ActivateJumpDrive(1)
43  self.GetParent().AutoPilotTo(self.trucktarget,1)
44  self.autoed = 1
45  elif self.timer + 5 < VS.GetGameTime():
46  self.MoveTo(self.trucktarget.Position(),1)
47  self.AddReplaceLastOrder(1)
48 # elif self.timer + 60 < VS.GetGameTime():
49 # gets him to auto to the jump and jump out
50 # self.GetParent().ActivateJumpDrive(1)
51  print self.GetParent().getMinDis(self.trucktarget.Position())
52 
53  return 1
54 hi1 = waitjump()
55 print 'AI creation successful'
56 hi1 = 0