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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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:
  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. #up
  326. if lUD < -0.080:
  327. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  328. cont.activate(followcam.actuators["up"])
  329. #print("fastup")
  330. else:
  331. cont.deactivate(followcam.actuators["up"])
  332. # #down
  333. if lUD > .080:
  334. followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  335. cont.activate(followcam.actuators["down"])
  336. else:
  337. cont.deactivate(followcam.actuators["down"])
  338. # #left
  339. if lLR < -0.080:
  340. followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  341. cont.activate(followcam.actuators["left"])
  342. else:
  343. cont.deactivate(followcam.actuators["left"])
  344. # #right
  345. if lLR > 0.080:
  346. followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
  347. cont.activate(followcam.actuators["right"])
  348. else:
  349. cont.deactivate(followcam.actuators["right"])
  350. #up
  351. if rUD < -0.080:
  352. followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
  353. cont.activate(followcam.actuators["rotup"])
  354. #print("uppppppppppppppppppppppppppp")
  355. else:
  356. cont.deactivate(followcam.actuators["rotup"])
  357. # #down
  358. if rUD > .080:
  359. followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
  360. cont.activate(followcam.actuators["rotdown"])
  361. else:
  362. cont.deactivate(followcam.actuators["rotdown"])
  363. # #left
  364. if rLR < -0.080:
  365. followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
  366. cont.activate(followcam.actuators["rotleft"])
  367. else:
  368. cont.deactivate(followcam.actuators["rotleft"])
  369. # #right
  370. if rLR > 0.080:
  371. followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
  372. cont.activate(followcam.actuators["rotright"])
  373. else:
  374. cont.deactivate(followcam.actuators["rotright"])
  375. #*********************************************
  376. if lUD > -0.080 and lUD < -0.030:
  377. followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  378. cont.activate(followcam.actuators["up"])
  379. #print(lUD)
  380. else:
  381. cont.deactivate(followcam.actuators["up"])
  382. # #down
  383. if lUD < .080 and lUD > .03:
  384. followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  385. cont.activate(followcam.actuators["down"])
  386. else:
  387. cont.deactivate(followcam.actuators["down"])
  388. # #left
  389. if lLR > -0.080 and lLR < -0.030:
  390. followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  391. cont.activate(followcam.actuators["left"])
  392. else:
  393. cont.deactivate(followcam.actuators["left"])
  394. # #right
  395. if lLR < .080 and lLR > .03:
  396. followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
  397. cont.activate(followcam.actuators["right"])
  398. else:
  399. cont.deactivate(followcam.actuators["right"])
  400. #up
  401. if rUD > -0.080 and rUD < -0.030:
  402. followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
  403. cont.activate(followcam.actuators["rotup"])
  404. else:
  405. cont.deactivate(followcam.actuators["rotup"])
  406. # #down
  407. if rUD < .080 and rUD > .03:
  408. followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  409. cont.activate(followcam.actuators["rotdown"])
  410. else:
  411. cont.deactivate(followcam.actuators["rotdown"])
  412. # #left
  413. if rLR > -0.080 and rLR < -0.030:
  414. followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
  415. cont.activate(followcam.actuators["rotleft"])
  416. else:
  417. cont.deactivate(followcam.actuators["rotleft"])
  418. # #right
  419. if rLR < .080 and rLR > .03:
  420. followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
  421. cont.activate(followcam.actuators["rotright"])
  422. else:
  423. cont.deactivate(followcam.actuators["rotright"])
  424. #################
  425. if own['camnum'] == 2 and own['playback']:
  426. scene.active_camera = freecam
  427. #act = freecam.actuators[
  428. camspeed1 = .015
  429. camspeed2 = .055
  430. camrot1 = .005
  431. camrot2 = .02
  432. #up
  433. if lUD < -0.080:
  434. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
  435. cont.activate(freecam.actuators["up"])
  436. #print("fastup")
  437. else:
  438. cont.deactivate(freecam.actuators["up"])
  439. # #down
  440. if lUD > .080:
  441. freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
  442. cont.activate(freecam.actuators["down"])
  443. else:
  444. cont.deactivate(freecam.actuators["down"])
  445. # #left
  446. if lLR < -0.080:
  447. freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
  448. cont.activate(freecam.actuators["left"])
  449. else:
  450. cont.deactivate(freecam.actuators["left"])
  451. # #right
  452. if lLR > 0.080:
  453. freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
  454. cont.activate(freecam.actuators["right"])
  455. else:
  456. cont.deactivate(freecam.actuators["right"])
  457. #up
  458. if rUD < -0.080:
  459. freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
  460. cont.activate(freecam.actuators["rotup"])
  461. else:
  462. cont.deactivate(freecam.actuators["rotup"])
  463. # #down
  464. if rUD > .080:
  465. freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
  466. cont.activate(freecam.actuators["rotdown"])
  467. else:
  468. cont.deactivate(freecam.actuators["rotdown"])
  469. # #left
  470. if rLR < -0.080:
  471. freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
  472. cont.activate(freecam.actuators["rotleft"])
  473. else:
  474. cont.deactivate(freecam.actuators["rotleft"])
  475. # #right
  476. if rLR > 0.080:
  477. freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
  478. cont.activate(freecam.actuators["rotright"])
  479. else:
  480. cont.deactivate(freecam.actuators["rotright"])
  481. #*********************************************
  482. if lUD > -0.080 and lUD < -0.030:
  483. freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
  484. cont.activate(freecam.actuators["up"])
  485. #print(lUD)
  486. else:
  487. cont.deactivate(freecam.actuators["up"])
  488. # #down
  489. if lUD < .080 and lUD > .03:
  490. freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
  491. cont.activate(freecam.actuators["down"])
  492. else:
  493. cont.deactivate(freecam.actuators["down"])
  494. # #left
  495. if lLR > -0.080 and lLR < -0.030:
  496. freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
  497. cont.activate(freecam.actuators["left"])
  498. else:
  499. cont.deactivate(freecam.actuators["left"])
  500. # #right
  501. if lLR < .080 and lLR > .03:
  502. freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
  503. cont.activate(freecam.actuators["right"])
  504. else:
  505. cont.deactivate(freecam.actuators["right"])
  506. #up
  507. if rUD > -0.080 and rUD < -0.030:
  508. freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
  509. cont.activate(freecam.actuators["rotup"])
  510. else:
  511. cont.deactivate(freecam.actuators["rotup"])
  512. # #down
  513. if rUD < .080 and rUD > .03:
  514. freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
  515. cont.activate(freecam.actuators["rotdown"])
  516. else:
  517. cont.deactivate(freecam.actuators["rotdown"])
  518. # #left
  519. if rLR > -0.080 and rLR < -0.030:
  520. freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
  521. cont.activate(freecam.actuators["rotleft"])
  522. else:
  523. cont.deactivate(freecam.actuators["rotleft"])
  524. # #right
  525. if rLR < .080 and rLR > .03:
  526. freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
  527. cont.activate(freecam.actuators["rotright"])
  528. else:
  529. cont.deactivate(freecam.actuators["rotright"])
  530. ########################################
  531. if own['camnum'] == 0:
  532. cam = camList["Camera.003"]
  533. scene.active_camera = cam
  534. valueIndex = own['valueIndex']
  535. n = (valueIndex / recording_cutoff) * 1000
  536. n = int(round(n))
  537. #n = 10
  538. #print("n: ", n, "--", valueIndex, recording_cutoff)
  539. #dict = logic.globalDict #Get the global dictionary
  540. dict['playhead'] = n
  541. own['last_back_but'] = own['back_but']
  542. own['back_but'] = back_on
  543. own['last_a_but'] = own['a_but']
  544. own['a_but'] = a_on
  545. own['last_ltsBut'] = ltsBut
  546. own['last_rtsBut'] = rtsBut
  547. own['last_playback'] = own['playback']
  548. dict['playback'] = own['playback']