Shuvit game master repo. http://shuvit.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Manager.py 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. def main():
  2. #"""
  3. #Modified BGE Gameplay Recorder Version 2
  4. #originally written by Nicholas Anderson, aka Red Frost Games.
  5. #"""
  6. #####Tweakables###############
  7. #Watch out! These numbers might bite!
  8. frame_rate = 60 #Set this to the framerate of your game.
  9. optimization = 1 #An integer, must be at least 1! Higher value will make a smaller saved file size. I do not reccomend setting it to anything other than 1 though.
  10. recording_cutoff = 7300 #3600 #Frames at which the oldest recorded frame will be deleted. 0 is no cutoff.
  11. recorder_state = 1 #This is the main state of the recorder object. State will be reverted to this value when the user breaks out of the playback.
  12. allow_playback_break = True #Allow the player to resume playing from the position in the recording.
  13. #####Sensor names#############
  14. record_sensor = "Record"
  15. save_recording_sensor = "Save"
  16. load_recording_sensor = "Load"
  17. track_left_sensor = "Left"
  18. track_right_sensor = "Right"
  19. break_sensor = "Break"
  20. ##############################
  21. from bge import logic
  22. import Record
  23. import SortData
  24. cont = logic.getCurrentController()
  25. own = cont.owner
  26. cont.sensors[record_sensor].skippedTicks = optimization
  27. dict = logic.globalDict
  28. #dict['recorder_on'] = recorder_on
  29. recorder_on = dict.get('recorder_on')
  30. own['recorder_on'] = recorder_on
  31. #print("recorder on: ", recorder_on)
  32. if recorder_on == 1:
  33. #----
  34. scene = logic.getCurrentScene()
  35. scene_list = logic.getSceneList()
  36. camList = scene.cameras
  37. followcam = camList["followcam"]
  38. freecam = camList["freecam"]
  39. skater = scene.objects["Char4"]
  40. cube = scene.objects["control_cube.002"]
  41. deck = scene.objects["deck"]
  42. trucks = scene.objects["trucks"]
  43. replay_cam_axis = own['replay_cam_axis']
  44. cam = own.actuators['Camera']
  45. #----
  46. joybutsens = "joyBut"
  47. #butt = cont.sensors[joybutsens]
  48. #aXis = cont.sensors["joysticksens"]
  49. #bk_but = 4
  50. back_on = dict['bkBut']
  51. #a_but = 0
  52. a_on = dict['aBut']
  53. #b_but = 1
  54. b_on = dict['bBut']
  55. #print(a on)
  56. last_back = own['last_back_but']
  57. #last_back = own['last_a_but']
  58. # reduction = 400000
  59. # axisTh = 0.03
  60. # lt = 4
  61. # rt = 5
  62. # lts_pr = 7
  63. # rts_pr = 8
  64. # lar_lts = 0
  65. # uad_lts = 1
  66. # lar_rts = 2
  67. # uad_rts = 3
  68. #lts_pr = 7
  69. #rts_pr = 8
  70. # lTrig = aXis.axisValues[lt] / reduction
  71. # rTrig = aXis.axisValues[rt] / reduction
  72. # lLR = aXis.axisValues[lar_lts] / reduction
  73. # lUD = aXis.axisValues[uad_lts] / reduction
  74. # rLR = aXis.axisValues[lar_rts] / reduction
  75. # rUD = aXis.axisValues[uad_rts] / reduction
  76. # ltsBut = butt.getButtonStatus(lts_pr)
  77. # rtsBut = butt.getButtonStatus(rts_pr)
  78. #
  79. lLR = dict['lLR']
  80. lUD = dict['lUD']
  81. rLR = dict['rLR']
  82. rUD = dict['rUD']
  83. lTrig = dict['lTrig']
  84. rTrig = dict['rTrig']
  85. aBut = dict['aBut']
  86. bBut = dict['bBut']
  87. xBut = dict['xBut']
  88. yBut = dict['yBut']
  89. lBump = dict['lBump']
  90. rBump = dict['rBump']
  91. bkBut = dict['bkBut']
  92. stBut = dict['stBut']
  93. xbBut = dict['xbBut']
  94. ltsBut = dict['ltsBut']
  95. rtsBut = dict['rtsBut']
  96. ldPad = dict['ldPad']
  97. rdPad = dict['rdPad']
  98. udPad = dict['udPad']
  99. ddPad = dict['ddPad']
  100. try:
  101. pause_state = dict['npause']
  102. last_pause = dict['last_npause']
  103. except:
  104. dict['npause'] = 0
  105. dict['last_npause'] = 0
  106. pause_state = 0
  107. last_pause = 0
  108. #trigs results range 0 - .08
  109. #print(lTrig, rTrig)
  110. #if cont.sensors[record_sensor].positive:
  111. if own["playback"] != True:
  112. Record.main(recording_cutoff, cube)
  113. if cont.sensors[save_recording_sensor].positive:
  114. SortData.writeData.saveAll()
  115. #if cont.sensors[load_recording_sensor].positive or (cube["sel"] == 1 and cube["last_sel"] == 0):
  116. if own['back_state'] == 1 and back_on == 1 and last_back == 0:
  117. cube["last_sel"] == 1
  118. SortData.writeData.saveAll()
  119. own["playback"] = True
  120. own["playbackBroken"] = False
  121. freecam.worldPosition = own.worldPosition
  122. followcam.worldPosition = own.worldPosition
  123. cube['grindcement_vol'] = 0
  124. cube['grindcement_pitch'] = 0
  125. cube['grindrail_vol'] = 0
  126. cube['grindrail_pitch'] = 0
  127. cube['sroll_vol'] = 0
  128. cube['sroll_pitch'] = 0
  129. if own["playback"]:
  130. Record.loadData()
  131. #..................
  132. if cont.sensors[track_left_sensor].positive:
  133. own["objIndex"] -= 2
  134. logic.setLogicTicRate(frame_rate*own["playbackSpeed"])
  135. if cont.sensors[track_right_sensor].positive:
  136. own["objIndex"] += 2
  137. logic.setLogicTicRate(frame_rate*own["playbackSpeed"])
  138. if own["playback"] == True:
  139. if rTrig > .01 and rTrig < .02:
  140. own["objIndex"] += 2
  141. logic.setLogicTicRate(frame_rate*.5)
  142. if (rTrig >= .02 and rTrig < .06) or own['loop_play'] == 1:
  143. own["objIndex"] += 2
  144. logic.setLogicTicRate(frame_rate*1)
  145. #print(own['objIndex'])
  146. if rTrig >= .06 and rTrig < .09:
  147. own["objIndex"] += 2
  148. logic.setLogicTicRate(frame_rate*1.5)
  149. if lTrig > .01 and lTrig < .02:
  150. own["objIndex"] -= 2
  151. logic.setLogicTicRate(frame_rate*.5)
  152. if lTrig >= .02 and lTrig < .06:
  153. own["objIndex"] -= 2
  154. logic.setLogicTicRate(frame_rate*1)
  155. if lTrig >= .06 and lTrig < .09:
  156. if own['loop_play'] == 1:
  157. own["objIndex"] -= 6
  158. #logic.setLogicTicRate(frame_rate*1.5)
  159. else:
  160. own["objIndex"] -= 2
  161. logic.setLogicTicRate(frame_rate*1.5)
  162. if b_on == True and pause_state == 0:
  163. #print("bbut_on")
  164. own['objIndex'] = 0
  165. own['valueIndex'] = 0
  166. logic.setLogicTicRate(frame_rate*1)
  167. #....................
  168. if allow_playback_break:
  169. if own['back_state'] == 0 and back_on == 1 and last_back == 0:
  170. own["playbackBroken"] = True
  171. own["playback"] = False
  172. #print("break - add hud, remove stance (back_state == False)")
  173. #cont.activate(own.actuators['add_hud'])
  174. #cont.activate(own.actuators['remove_stance'])
  175. #removescene = cont.actuators["remove_hud"]
  176. #removescene.scene = "replay_HUD"
  177. #addscene = cont.actuators["add_hud"]
  178. #addscene.scene = "stance"
  179. #cont.activate(addscene)
  180. #cont.activate(removescene)
  181. elif own["playbackBroken"] and back_on == 0:
  182. Record.breakOut()
  183. #cont.activate(own.actuators['remove_hud'])
  184. #cont.activate(own.actuators['add_stance'])
  185. #addscene = cont.actuators["add_hud"]
  186. #addscene.scene = "replay_HUD"
  187. #removescene = cont.actuators["remove_hud"]
  188. #removescene.scene = "stance"
  189. #cont.activate(addscene)
  190. #cont.activate(removescene)
  191. logic.setLogicTicRate(frame_rate)
  192. #set value index
  193. own.state = recorder_state
  194. own["playbackBroken"] = False
  195. skater.stopAction(9999)
  196. deck.stopAction(9999)
  197. trucks.stopAction(9999)
  198. cont.activate(own.actuators['replayCam'])
  199. #print("unbreak")
  200. own['loop_play'] = 0
  201. #own['valueIndex'] = 0
  202. #own["objIndex"] += 2
  203. #logic.setLogicTicRate(frame_rate*1)
  204. #own['objectIndex'] = 0
  205. #print("valueIndex = ", own['valueIndex'])
  206. if back_on == 1 and own['back_but'] == 0:
  207. #print("change back state")
  208. if own['back_state'] == True:
  209. own['back_state'] = False
  210. #elif own['back_state'] == False:
  211. else:
  212. own['back_state'] = True
  213. ###
  214. if own['last_playback'] != own['playback']:
  215. if own['last_playback'] == True:
  216. cont.activate(own.actuators['remove_hud'])
  217. cont.activate(own.actuators['add_stance'])
  218. own['camnum'] = 0
  219. cam = camList["Camera.003"]
  220. scene.active_camera = cam
  221. #print("turning replay off", own['playback'])
  222. if own['last_playback'] == False:
  223. #print("turning replay on", own['playback'])
  224. cont.activate(own.actuators['add_hud'])
  225. cont.activate(own.actuators['remove_stance'])
  226. own['objIndex'] = 0
  227. own['valueIndex'] = 3
  228. logic.setLogicTicRate(frame_rate*1)
  229. if dict['rtsBut'] == False and dict['last_rtsBut'] == True and own['playback'] == True:
  230. if 'pause' in scene_list:
  231. #cont.activate(own.actuators['remove_overlay'])
  232. cont.activate(own.actuators['add_hud'])
  233. else:
  234. #cont.activate(own.actuators['add_overlay']) #pause
  235. cont.activate(own.actuators['remove_hud']) #replay
  236. cont.activate(own.actuators['pause_replay_remove'])
  237. if pause_state == 1 and last_pause == 1 and own["playback"]:
  238. #print('pause_on')
  239. if 'pause_replay' not in scene_list:
  240. cont.activate(own.actuators['pause_replay_add'])
  241. #print('pause_on')
  242. if pause_state != 1 and own["playback"]:
  243. if 'pause_replay' in scene_list:
  244. cont.activate(own.actuators['pause_replay_remove'])
  245. if own['playback'] and 'pause' in scene_list:
  246. cont.activate(cube.actuators['remove_overlay'])
  247. ####
  248. if a_on == 1 and own['a_but'] == False and pause_state == 0:
  249. if own['loop_play'] == 1:
  250. own['loop_play'] = 0
  251. else:
  252. own['loop_play'] = 1
  253. if rLR > .05 and own["playback"]:
  254. act = cont.actuators["replayCam"]
  255. if rLR > .07:
  256. act.dLoc = [ .06, 0.0, 0.0]
  257. else:
  258. act.dLoc = [ .03, 0.0, 0.0]
  259. #cont.deactivate(own.actuators['Camera'])
  260. cont.activate(own.actuators['replayCam'])
  261. #print("move")
  262. elif rLR < -.05 and own["playback"]:
  263. act = cont.actuators["replayCam"]
  264. if rLR < -.07:
  265. act.dLoc = [ -.06, 0.0, 0.0]
  266. else:
  267. act.dLoc = [ -.03, 0.0, 0.0]
  268. #cont.deactivate(own.actuators['Camera'])
  269. #act.damping = 6
  270. cont.activate(own.actuators['replayCam'])
  271. #print("move")
  272. else:
  273. #pass
  274. cont.deactivate(own.actuators['replayCam'])
  275. #cont.activate(own.actuators['Camera'])
  276. #print("back state: ", own['back_state'], "last_back_but: ", own['last_back_but'], "back_but :", own['back_but'])
  277. #integer
  278. #
  279. #0 = +X axis
  280. #
  281. #1 = +Y axis
  282. #
  283. #2 = +Z axis
  284. #
  285. #3 = -X axis
  286. #
  287. #4 = -Y axis
  288. #
  289. #5 = -Z axis
  290. # if rLR > .05 and own["playback"]:
  291. # if own['last_rtsBut'] == True and rtsBut == False:
  292. # if replay_cam_axis == 0:
  293. # replay_cam_axis = 1
  294. # elif replay_cam_axis == 1:
  295. # replay_cam_axis = 3
  296. # elif replay_cam_axis == 3 :
  297. # replay_cam_axis = 4
  298. # elif replay_cam_axis == 4:
  299. # replay_cam_axis = 0
  300. # cam.axis = replay_cam_axis
  301. # cont.activate(cam)
  302. # print("set replay_cam_axis: ", replay_cam_axis)
  303. # own['replay_cam_axis'] = replay_cam_axis
  304. if own['last_ltsBut'] == True and ltsBut == False and own['playback']:
  305. # get camera named SecurityCam
  306. if own['camnum'] == 1:
  307. own['camnum'] = 2
  308. elif own['camnum'] == 0:
  309. own['camnum'] = 1
  310. elif own['camnum'] == 2:
  311. own['camnum'] = 0
  312. if own['last_rtsBut'] == True and rtsBut == False and own['playback']:
  313. # get camera named SecurityCam
  314. if "replay_HUD" in scene_list:
  315. cont.activate(own.actuators['remove_hud'])
  316. else:
  317. cont.activate(own.actuators['add_hud'])
  318. if own['camnum'] == 1 and own['playback']:
  319. scene.active_camera = followcam
  320. #################
  321. camspeed1 = .04 #.015
  322. camspeed2 = .1 #.055
  323. camrot1 = .02 #.005
  324. camrot2 = .04 #.02
  325. # perc = (lUD * 100 * (10 / 80)) *2
  326. # perc = round(perc,2)
  327. # print(perc)
  328. # perc = .025 * perc
  329. # newUD = (lUD * .1) * 5
  330. # if lUD > .0005 or lUD < -.0005:
  331. # camspeed1 = abs(perc)
  332. # camspeed2 = abs(perc)
  333. #up
  334. if lUD < -0.080:
  335. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  336. cont.activate(followcam.actuators["up"])
  337. print("fastup")
  338. else:
  339. cont.deactivate(followcam.actuators["up"])
  340. # #down
  341. if lUD > .080:
  342. followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  343. cont.activate(followcam.actuators["down"])
  344. else:
  345. cont.deactivate(followcam.actuators["down"])
  346. # #left
  347. if lLR < -0.080:
  348. followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  349. cont.activate(followcam.actuators["left"])
  350. else:
  351. cont.deactivate(followcam.actuators["left"])
  352. # #right
  353. if lLR > 0.080:
  354. followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
  355. cont.activate(followcam.actuators["right"])
  356. else:
  357. cont.deactivate(followcam.actuators["right"])
  358. #up
  359. if rUD < -0.080:
  360. followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
  361. cont.activate(followcam.actuators["rotup"])
  362. #print("uppppppppppppppppppppppppppp")
  363. else:
  364. cont.deactivate(followcam.actuators["rotup"])
  365. # #down
  366. if rUD > .080:
  367. followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
  368. cont.activate(followcam.actuators["rotdown"])
  369. else:
  370. cont.deactivate(followcam.actuators["rotdown"])
  371. # #left
  372. if rLR < -0.080:
  373. followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
  374. cont.activate(followcam.actuators["rotleft"])
  375. else:
  376. cont.deactivate(followcam.actuators["rotleft"])
  377. # #right
  378. if rLR > 0.080:
  379. followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
  380. cont.activate(followcam.actuators["rotright"])
  381. else:
  382. cont.deactivate(followcam.actuators["rotright"])
  383. #*********************************************
  384. if lUD > -0.080 and lUD < -0.030:
  385. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  386. cont.activate(followcam.actuators["up"])
  387. #print(lUD)
  388. else:
  389. cont.deactivate(followcam.actuators["up"])
  390. # #down
  391. if lUD < .080 and lUD > .03:
  392. followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  393. cont.activate(followcam.actuators["down"])
  394. else:
  395. cont.deactivate(followcam.actuators["down"])
  396. # #left
  397. if lLR > -0.080 and lLR < -0.030:
  398. followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  399. cont.activate(followcam.actuators["left"])
  400. else:
  401. cont.deactivate(followcam.actuators["left"])
  402. # #right
  403. if lLR < .080 and lLR > .03:
  404. followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
  405. cont.activate(followcam.actuators["right"])
  406. else:
  407. cont.deactivate(followcam.actuators["right"])
  408. #up
  409. if rUD > -0.080 and rUD < -0.030:
  410. followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
  411. cont.activate(followcam.actuators["rotup"])
  412. else:
  413. cont.deactivate(followcam.actuators["rotup"])
  414. # #down
  415. if rUD < .080 and rUD > .03:
  416. followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  417. cont.activate(followcam.actuators["rotdown"])
  418. else:
  419. cont.deactivate(followcam.actuators["rotdown"])
  420. # #left
  421. if rLR > -0.080 and rLR < -0.030:
  422. followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
  423. cont.activate(followcam.actuators["rotleft"])
  424. else:
  425. cont.deactivate(followcam.actuators["rotleft"])
  426. # #right
  427. if rLR < .080 and rLR > .03:
  428. followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
  429. cont.activate(followcam.actuators["rotright"])
  430. else:
  431. cont.deactivate(followcam.actuators["rotright"])
  432. #################
  433. if own['camnum'] == 2 and own['playback']:
  434. scene.active_camera = freecam
  435. #act = freecam.actuators[
  436. camspeed1 = .015
  437. camspeed2 = .055
  438. camrot1 = .005
  439. camrot2 = .02
  440. #up
  441. if lUD < -0.080:
  442. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  443. cont.activate(freecam.actuators["up"])
  444. #print("fastup")
  445. else:
  446. cont.deactivate(freecam.actuators["up"])
  447. # #down
  448. if lUD > .080:
  449. freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  450. cont.activate(freecam.actuators["down"])
  451. else:
  452. cont.deactivate(freecam.actuators["down"])
  453. # #left
  454. if lLR < -0.080:
  455. freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  456. cont.activate(freecam.actuators["left"])
  457. else:
  458. cont.deactivate(freecam.actuators["left"])
  459. # #right
  460. if lLR > 0.080:
  461. freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
  462. cont.activate(freecam.actuators["right"])
  463. else:
  464. cont.deactivate(freecam.actuators["right"])
  465. #up
  466. if rUD < -0.080:
  467. freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
  468. cont.activate(freecam.actuators["rotup"])
  469. else:
  470. cont.deactivate(freecam.actuators["rotup"])
  471. # #down
  472. if rUD > .080:
  473. freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
  474. cont.activate(freecam.actuators["rotdown"])
  475. else:
  476. cont.deactivate(freecam.actuators["rotdown"])
  477. # #left
  478. if rLR < -0.080:
  479. freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
  480. cont.activate(freecam.actuators["rotleft"])
  481. else:
  482. cont.deactivate(freecam.actuators["rotleft"])
  483. # #right
  484. if rLR > 0.080:
  485. freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
  486. cont.activate(freecam.actuators["rotright"])
  487. else:
  488. cont.deactivate(freecam.actuators["rotright"])
  489. #*********************************************
  490. if lUD > -0.080 and lUD < -0.030:
  491. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  492. cont.activate(freecam.actuators["up"])
  493. #print(lUD)
  494. else:
  495. cont.deactivate(freecam.actuators["up"])
  496. # #down
  497. if lUD < .080 and lUD > .03:
  498. freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  499. cont.activate(freecam.actuators["down"])
  500. else:
  501. cont.deactivate(freecam.actuators["down"])
  502. # #left
  503. if lLR > -0.080 and lLR < -0.030:
  504. freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  505. cont.activate(freecam.actuators["left"])
  506. else:
  507. cont.deactivate(freecam.actuators["left"])
  508. # #right
  509. if lLR < .080 and lLR > .03:
  510. freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
  511. cont.activate(freecam.actuators["right"])
  512. else:
  513. cont.deactivate(freecam.actuators["right"])
  514. #up
  515. if rUD > -0.080 and rUD < -0.030:
  516. freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
  517. cont.activate(freecam.actuators["rotup"])
  518. else:
  519. cont.deactivate(freecam.actuators["rotup"])
  520. # #down
  521. if rUD < .080 and rUD > .03:
  522. freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  523. cont.activate(freecam.actuators["rotdown"])
  524. else:
  525. cont.deactivate(freecam.actuators["rotdown"])
  526. # #left
  527. if rLR > -0.080 and rLR < -0.030:
  528. freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
  529. cont.activate(freecam.actuators["rotleft"])
  530. else:
  531. cont.deactivate(freecam.actuators["rotleft"])
  532. # #right
  533. if rLR < .080 and rLR > .03:
  534. freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
  535. cont.activate(freecam.actuators["rotright"])
  536. else:
  537. cont.deactivate(freecam.actuators["rotright"])
  538. ########################################
  539. if own['camnum'] == 0:
  540. cam = camList["Camera.003"]
  541. scene.active_camera = cam
  542. valueIndex = own['valueIndex']
  543. n = (valueIndex / recording_cutoff) * 1000
  544. n = int(round(n))
  545. #n = 10
  546. #print("n: ", n, "--", valueIndex, recording_cutoff)
  547. #dict = logic.globalDict #Get the global dictionary
  548. dict['playhead'] = n
  549. own['last_back_but'] = own['back_but']
  550. own['back_but'] = back_on
  551. own['last_a_but'] = own['a_but']
  552. own['a_but'] = a_on
  553. own['last_ltsBut'] = ltsBut
  554. own['last_rtsBut'] = rtsBut
  555. own['last_playback'] = own['playback']
  556. dict['playback'] = own['playback']