|
@@ -16,9 +16,6 @@ def printplaying(skater,deck):
|
16
|
16
|
|
17
|
17
|
print(splaying_layers, playing_layers)
|
18
|
18
|
|
19
|
|
-
|
20
|
|
-
|
21
|
|
-
|
22
|
19
|
def main():
|
23
|
20
|
|
24
|
21
|
frame_rate = 60 #Set this to the framerate of your game.
|
|
@@ -35,12 +32,13 @@ def main():
|
35
|
32
|
from mathutils import Vector
|
36
|
33
|
import math
|
37
|
34
|
|
|
35
|
+ debugg = True
|
38
|
36
|
|
39
|
37
|
cont = logic.getCurrentController()
|
40
|
38
|
own = cont.owner
|
41
|
39
|
scene = logic.getCurrentScene()
|
42
|
40
|
dict = logic.globalDict
|
43
|
|
- own['valueIndex'] = own['valueIndex'] + 20
|
|
41
|
+ own['valueIndex'] = own['valueIndex'] + 2
|
44
|
42
|
#dict['recorder_on'] = recorder_on
|
45
|
43
|
npc_index = own['npc_index']
|
46
|
44
|
skater = dict['spawned_npcs'][npc_index]
|
|
@@ -51,9 +49,14 @@ def main():
|
51
|
49
|
recording_cutoff = own['replay_length']
|
52
|
50
|
idle_timer = own['idle_timer']
|
53
|
51
|
npc_playback = own['npc_playback']
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
54
|
55
|
if 'data_loaded' not in own:
|
55
|
|
- own['data_loaded'] = 1
|
|
56
|
+ #own['data_loaded'] = 1
|
56
|
57
|
aiRecord.loadData(cont, own)
|
|
58
|
+ if debugg: print('ai_loadData')
|
|
59
|
+
|
57
|
60
|
if npc_playback == True:
|
58
|
61
|
cube = own
|
59
|
62
|
aiRecord.loadData(cont, own)
|
|
@@ -68,14 +71,7 @@ def main():
|
68
|
71
|
own['objIndex'] = own['objIndex'] + 2
|
69
|
72
|
else:
|
70
|
73
|
own['objIndex'] = 4
|
71
|
|
- print('replay end')
|
72
|
|
-# try:
|
73
|
|
-# tActu = cont.actuators['npcSteering']
|
74
|
|
-# cont.deactivate(tActu)
|
75
|
|
-
|
76
|
|
-#
|
77
|
|
-# except:
|
78
|
|
-# print('no target to delete')
|
|
74
|
+ print('replay end')
|
79
|
75
|
npcChangeAnim.main(cont)
|
80
|
76
|
#own['npc_replay_name'] = '30secA.dat'
|
81
|
77
|
own['inited'] = False
|
|
@@ -89,22 +85,7 @@ def main():
|
89
|
85
|
#print('idling', idle_timer)
|
90
|
86
|
else:
|
91
|
87
|
idle_timer = 0
|
92
|
|
- own['npc_rotate'] = True
|
93
|
|
-# if own['npc_rotate'] == True:
|
94
|
|
-# xyz = own.localOrientation.to_euler()
|
95
|
|
-# rotz = math.degrees(xyz[2])
|
96
|
|
-# print (rotz, own['rpStartZ'], '---rotations')
|
97
|
|
-# num = rotz - own['rpStartZ']
|
98
|
|
-# amt = .05
|
99
|
|
-# amt2 = 2
|
100
|
|
-# if abs(num) < amt2:
|
101
|
|
-# own['npc_playback'] = True
|
102
|
|
-# own['npc_rotate'] = False
|
103
|
|
-# print('----starting replay', num)
|
104
|
|
-# elif rotz > own['rpStartZ']:
|
105
|
|
-# own.applyRotation([0,0,-amt], True)
|
106
|
|
-# elif rotz < own['rpStartZ']:
|
107
|
|
-# own.applyRotation([0,0,amt], True)
|
|
88
|
+ own['npc_rotate'] = True
|
108
|
89
|
|
109
|
90
|
if own['move'] == True:
|
110
|
91
|
speed = .15
|