Browse Source

bunch o crap

shuvit 6 years ago
parent
commit
d69b69ce4b
10 changed files with 887 additions and 464 deletions
  1. 38
    6
      Manager.py
  2. 142
    43
      Record.py
  3. 76
    2
      Settings.py
  4. 90
    14
      SortData.py
  5. 6
    0
      Startup.py
  6. 144
    91
      co_ActionState.py
  7. 14
    5
      controller2.py
  8. 68
    28
      npause.py
  9. 248
    271
      pause.py
  10. 61
    4
      scene_init.py

+ 38
- 6
Manager.py View File

106
         udPad = dict['udPad']
106
         udPad = dict['udPad']
107
         ddPad = dict['ddPad']    
107
         ddPad = dict['ddPad']    
108
             
108
             
109
-        
109
+        try:
110
+            pause_state = dict['npause']
111
+            last_pause = dict['last_npause']
112
+        except:
113
+            dict['npause'] = 0
114
+            dict['last_npause'] = 0
115
+            pause_state = 0
116
+            last_pause = 0          
110
            
117
            
111
         #trigs results range 0 - .08
118
         #trigs results range 0 - .08
112
         #print(lTrig, rTrig)
119
         #print(lTrig, rTrig)
169
                 else:    
176
                 else:    
170
                     own["objIndex"] -= 2
177
                     own["objIndex"] -= 2
171
                     logic.setLogicTicRate(frame_rate*1.5)
178
                     logic.setLogicTicRate(frame_rate*1.5)
172
-            if b_on == True:
179
+            if b_on == True and pause_state == 0:
173
                 print("bbut_on")
180
                 print("bbut_on")
174
                 own['objIndex'] = 0
181
                 own['objIndex'] = 0
175
                 own['valueIndex'] = 0 
182
                 own['valueIndex'] = 0 
240
                 cont.activate(own.actuators['remove_stance'])
247
                 cont.activate(own.actuators['remove_stance'])
241
                 own['objIndex'] = 0
248
                 own['objIndex'] = 0
242
                 own['valueIndex'] = 3
249
                 own['valueIndex'] = 3
243
-                logic.setLogicTicRate(frame_rate*1)               
244
-                 
250
+                logic.setLogicTicRate(frame_rate*1)  
251
+                
252
+                
253
+              
254
+                
255
+        if dict['rtsBut'] == False and dict['last_rtsBut'] == True:
256
+            
257
+            if 'pause' in scene_list:    
258
+                #cont.activate(own.actuators['remove_overlay']) 
259
+                cont.activate(own.actuators['add_hud'])
260
+            else:
261
+                #cont.activate(own.actuators['add_overlay']) #pause
262
+                cont.activate(own.actuators['remove_hud']) #replay 
263
+                cont.activate(own.actuators['pause_replay_remove']) 
264
+                                            
265
+        if pause_state == 1 and last_pause == 1 and own["playback"]:
266
+            #print('pause_on')
267
+            if 'pause_replay' not in scene_list:
268
+                cont.activate(own.actuators['pause_replay_add'])
269
+                print('pause_on')
270
+                
271
+        if pause_state != 1 and own["playback"]:
272
+            if 'pause_replay' in scene_list:
273
+                cont.activate(own.actuators['pause_replay_remove'])                    
274
+        if own['playback'] and 'pause' in scene_list:
275
+            cont.activate(cube.actuators['remove_overlay'])                         
245
                              
276
                              
246
     ####
277
     ####
247
-        if a_on == 1 and own['a_but'] == False:
278
+        if a_on == 1 and own['a_but'] == False and pause_state == 0:
248
             if own['loop_play'] == 1:
279
             if own['loop_play'] == 1:
249
                 own['loop_play'] = 0
280
                 own['loop_play'] = 0
250
             else:
281
             else:
553
         own['a_but'] = a_on
584
         own['a_but'] = a_on
554
         own['last_ltsBut'] = ltsBut
585
         own['last_ltsBut'] = ltsBut
555
         own['last_rtsBut'] = rtsBut
586
         own['last_rtsBut'] = rtsBut
556
-        own['last_playback'] = own['playback']
587
+        own['last_playback'] = own['playback']
588
+        dict['playback'] = own['playback']

+ 142
- 43
Record.py View File

23
 wheel3 = scene.objects["rollen.002"]
23
 wheel3 = scene.objects["rollen.002"]
24
 wheel4 = scene.objects["rollen.003"]
24
 wheel4 = scene.objects["rollen.003"]
25
 
25
 
26
+try:
27
+    throw_deck = scene.objects['throw_deck']
28
+except:
29
+    throw_deck = None    
26
 
30
 
27
 deckact = deck.actuators["Visibility"]
31
 deckact = deck.actuators["Visibility"]
28
 trucksact = trucks.actuators["Visibility"]
32
 trucksact = trucks.actuators["Visibility"]
36
 
40
 
37
 
41
 
38
     def savePosition(obj, cut):
42
     def savePosition(obj, cut):
39
-        
40
         position = [Vector(obj.worldPosition)[0],
43
         position = [Vector(obj.worldPosition)[0],
41
             Vector(obj.worldPosition)[1],
44
             Vector(obj.worldPosition)[1],
42
             Vector(obj.worldPosition)[2]]
45
             Vector(obj.worldPosition)[2]]
43
         position = str(position).strip("[]")
46
         position = str(position).strip("[]")
44
         position = position.replace(", ",",")
47
         position = position.replace(", ",",")
45
-       
46
         writeData.addPosition(obj, position, cut)
48
         writeData.addPosition(obj, position, cut)
47
      
49
      
48
-    def saveOrientation(obj, cut):
49
-            
50
+    def saveOrientation(obj, cut): 
50
         orientation = [Vector(obj.localOrientation.to_euler())[0],
51
         orientation = [Vector(obj.localOrientation.to_euler())[0],
51
             Vector(obj.localOrientation.to_euler())[1],
52
             Vector(obj.localOrientation.to_euler())[1],
52
             Vector(obj.localOrientation.to_euler())[2]]
53
             Vector(obj.localOrientation.to_euler())[2]]
53
         orientation = str(orientation).strip("[]")
54
         orientation = str(orientation).strip("[]")
54
-        orientation = orientation.replace(", ",",")
55
-                
55
+        orientation = orientation.replace(", ",",")     
56
         writeData.addOrientation(obj, orientation, cut)
56
         writeData.addOrientation(obj, orientation, cut)
57
                     
57
                     
58
-    def saveScale(obj, cut):
59
-        
58
+    def saveScale(obj, cut):  
60
         scale = [Vector(obj.localScale)[0],
59
         scale = [Vector(obj.localScale)[0],
61
             Vector(obj.localScale)[1],
60
             Vector(obj.localScale)[1],
62
             Vector(obj.localScale)[2]]
61
             Vector(obj.localScale)[2]]
63
         scale = str(scale).strip("[]")
62
         scale = str(scale).strip("[]")
64
         scale = scale.replace(", ",",")
63
         scale = scale.replace(", ",",")
65
-         
66
         writeData.addScale(obj, scale, cut)
64
         writeData.addScale(obj, scale, cut)
67
-        
68
     def saveColor(obj, cut):
65
     def saveColor(obj, cut):
69
-        
70
         color = [Vector(obj.color)[0],
66
         color = [Vector(obj.color)[0],
71
             Vector(obj.color)[1],
67
             Vector(obj.color)[1],
72
             Vector(obj.color)[2],
68
             Vector(obj.color)[2],
73
             Vector(obj.color)[3]]
69
             Vector(obj.color)[3]]
74
         color = str(color).strip("[]")
70
         color = str(color).strip("[]")
75
         color = color.replace(", ",",")
71
         color = color.replace(", ",",")
76
-        
77
         writeData.addColor(obj, color, cut)
72
         writeData.addColor(obj, color, cut)
78
-        
79
     def saveState(obj, cut):
73
     def saveState(obj, cut):
80
         
74
         
81
         state = str(obj.state)
75
         state = str(obj.state)
82
         writeData.addState(obj, state, cut)
76
         writeData.addState(obj, state, cut)
83
         
77
         
84
     def saveVisibility(obj, cut):
78
     def saveVisibility(obj, cut):
85
-        
86
         visible = obj.visible
79
         visible = obj.visible
87
-        
88
         if visible:
80
         if visible:
89
             visible = 1
81
             visible = 1
90
         else:
82
         else:
91
-            visible = 0
92
-            
83
+            visible = 0   
93
         writeData.addVisibility(obj, str(visible), cut)
84
         writeData.addVisibility(obj, str(visible), cut)
94
     
85
     
95
     def saveSkaterAnim(obj, cut):
86
     def saveSkaterAnim(obj, cut):
169
         writeData.addSlandsound(obj, str(num), cut) 
160
         writeData.addSlandsound(obj, str(num), cut) 
170
     def saveSdeckvis(obj, cut):
161
     def saveSdeckvis(obj, cut):
171
         num = cube['deckvis']
162
         num = cube['deckvis']
172
-        writeData.addSdeckvis(obj, str(num), cut)                                                                
163
+        writeData.addSdeckvis(obj, str(num), cut)  
164
+        
165
+    def savetdPosition(obj, cut):
166
+        try:
167
+            obj = scene.objects['throw_deck']
168
+        except:
169
+            pass    
170
+        position = [Vector(obj.worldPosition)[0],
171
+            Vector(obj.worldPosition)[1],
172
+            Vector(obj.worldPosition)[2]]
173
+        position = str(position).strip("[]")
174
+        position = position.replace(", ",",")
175
+        writeData.addtdPosition(obj, position, cut)
176
+     
177
+    def savetdOrientation(obj, cut): 
178
+        try:
179
+            obj = scene.objects['throw_deck']
180
+        except:
181
+            pass
182
+        orientation = [Vector(obj.localOrientation.to_euler())[0],
183
+            Vector(obj.localOrientation.to_euler())[1],
184
+            Vector(obj.localOrientation.to_euler())[2]]
185
+        orientation = str(orientation).strip("[]")
186
+        orientation = orientation.replace(", ",",")     
187
+        writeData.addtdOrientation(obj, orientation, cut)
188
+    def saveSrevertsound(obj, cut):
189
+        num = cube['revert_sound']
190
+        writeData.addSrevertsound(obj, str(num), cut)                                                                               
173
               
191
               
174
 def loadData():
192
 def loadData():
175
     
193
     
197
     loadedSgrind_railPitch = own["loadedSgrind_railPitch"] 
215
     loadedSgrind_railPitch = own["loadedSgrind_railPitch"] 
198
     loadedSpopsound = own["loadedSpopsound"]            
216
     loadedSpopsound = own["loadedSpopsound"]            
199
     loadedSlandsound = own["loadedSlandsound"] 
217
     loadedSlandsound = own["loadedSlandsound"] 
200
-    loadedSdeckvis = own["loadedSdeckvis"]    
218
+    loadedSdeckvis = own["loadedSdeckvis"]  
219
+    loadedtdPosition = own["loadedtdPosition"]
220
+    loadedtdOrientation = own["loadedtdOrientation"]      
221
+    loadedSrevertsound = own["loadedSrevertsound"] 
201
     
222
     
202
     skater = scene.objects["Char4"]
223
     skater = scene.objects["Char4"]
203
     deck = scene.objects["deck"]
224
     deck = scene.objects["deck"]
237
     own["lengthOri"] = readData.getLengthOri()   
258
     own["lengthOri"] = readData.getLengthOri()   
238
     lengthOri = own["lengthOri"]
259
     lengthOri = own["lengthOri"]
239
     
260
     
240
-    if lengthPos:
261
+    #if lengthPos:
262
+    if lengthOri:
241
   
263
   
242
         if valueIndex > lengthOri-1:
264
         if valueIndex > lengthOri-1:
243
             own["valueIndex"] = 0
265
             own["valueIndex"] = 0
456
             own["objIndex"] = lengthSpopsound-2
478
             own["objIndex"] = lengthSpopsound-2
457
         name, spopsound = readData.returnSpopsound(objIndex, valueIndex)   
479
         name, spopsound = readData.returnSpopsound(objIndex, valueIndex)   
458
         if name in scene.objects:
480
         if name in scene.objects:
481
+            #act = sound_empty.actuators["pop"]
459
             try:
482
             try:
460
                 #cube = scene.objects[sound_empty]
483
                 #cube = scene.objects[sound_empty]
461
                 spopsound = round(spopsound, 2)
484
                 spopsound = round(spopsound, 2)
462
                 act = cube.actuators["pop"]
485
                 act = cube.actuators["pop"]
486
+                #act = sound_empty.actuators["pop"]
463
                 if spopsound == 1:
487
                 if spopsound == 1:
488
+                    #act.volume_maximum = .7
489
+                    #act.is3D = True
490
+                    #act.distance_reference = 10.0
491
+                    #act.distance_maximum = 50.0
492
+                    act.volume = .6
464
                     act.startSound()
493
                     act.startSound()
465
                 #print("grindsound = ", spopsound, sgrind_railPitch)
494
                 #print("grindsound = ", spopsound, sgrind_railPitch)
466
             except:
495
             except:
483
                 slandsound = round(slandsound, 2)
512
                 slandsound = round(slandsound, 2)
484
                 act = cube.actuators["land"]
513
                 act = cube.actuators["land"]
485
                 if slandsound == 1:
514
                 if slandsound == 1:
515
+                    act.volume = .6
486
                     act.startSound()
516
                     act.startSound()
487
                 #print("grindsound = ", slandsound, sgrind_railPitch)
517
                 #print("grindsound = ", slandsound, sgrind_railPitch)
488
             except:
518
             except:
504
         if name in scene.objects:
534
         if name in scene.objects:
505
             try:
535
             try:
506
                 cube = scene.objects["control_cube.002"]
536
                 cube = scene.objects["control_cube.002"]
507
-                #slandsound = round(slandsound, 2)
508
                 if sdeckvis == 1:
537
                 if sdeckvis == 1:
509
-                    print('setting deck visible')
510
-                    #wheel1.visible = True
511
-                    #wheel2.visible = True
512
-                    #wheel3.visible = True
513
-                    #wheel4.visible = True 
514
-                    #deck.visible = True
515
-                    #trucks.setVisible(True, True)
516
-                    
517
-                    
538
+                    #print('setting deck visible')
518
                     deckact.visibility = True
539
                     deckact.visibility = True
519
                     trucksact.visibility = True
540
                     trucksact.visibility = True
520
                     wheel1act.visibility = True
541
                     wheel1act.visibility = True
526
                     cont.activate(wheel1.actuators['Visibility'])
547
                     cont.activate(wheel1.actuators['Visibility'])
527
                     cont.activate(wheel2.actuators['Visibility'])
548
                     cont.activate(wheel2.actuators['Visibility'])
528
                     cont.activate(wheel3.actuators['Visibility'])
549
                     cont.activate(wheel3.actuators['Visibility'])
529
-                    cont.activate(wheel4.actuators['Visibility'])                     
530
-                               
550
+                    cont.activate(wheel4.actuators['Visibility'])  
551
+                    for n in scene.objects:
552
+                        if 'throw_deck' in n.name and 'empty' not in n.name:
553
+                            n.endObject() 
554
+#                    if 'throw_deck' in scene.objects:
555
+                            #print('ending td', n)
556
+                            cont.activate(throw_deck.actuators['end_throw_deck'])                   
557
+                     
558
+                    #throwdeck.visibility = False                               
531
                 else:
559
                 else:
532
-                    print('setting deck invisible')
533
-                    #wheel1.visible = False
534
-                    #wheel2.visible = False
535
-                    #wheel3.visible = False
536
-                    #wheel4.visible = False
537
-                    #deck.visible = False
538
-                    #trucks.setVisible(False, False)
539
-
560
+                    #print('setting deck invisible')
540
                     deckact.visibility = False
561
                     deckact.visibility = False
541
                     trucksact.visibility = False
562
                     trucksact.visibility = False
542
                     wheel1act.visibility = False
563
                     wheel1act.visibility = False
548
                     cont.activate(wheel1.actuators['Visibility'])
569
                     cont.activate(wheel1.actuators['Visibility'])
549
                     cont.activate(wheel2.actuators['Visibility'])
570
                     cont.activate(wheel2.actuators['Visibility'])
550
                     cont.activate(wheel3.actuators['Visibility'])
571
                     cont.activate(wheel3.actuators['Visibility'])
551
-                    cont.activate(wheel4.actuators['Visibility'])                     
572
+                    cont.activate(wheel4.actuators['Visibility'])  
573
+                    #if throw_deck == None:
574
+                    if 'throw_deck' not in scene.objects:
575
+                        #print('no throwdeck')
576
+                        #cont.deactivate(throw_deck.actuators['end_throw_deck']) 
577
+                        #throw_deck_empty.wordPosition.z = throw_deck_empty.wordPosition.z + 1
578
+                        cont.activate(throw_deck_empty.actuators['throw_dec_act']) 
579
+                        #scene.addObject('throw_deck')
580
+                    #throwdeck.visibility = True
581
+                    throw_deck.suspendDynamics()
552
 
582
 
583
+            except:
584
+                pass
585
+##    
586
+    #-----Position-----#
587
+    own["lengthtdPos"] = readData.getLengthtdPos()
588
+    lengthPos = own["lengthtdPos"] 
589
+    
590
+    if lengthPos:
591
+        
592
+        if objIndex > lengthPos-1:
593
+            own["objIndex"] = 0
594
+        if objIndex < 0:
595
+            own["objIndex"] = lengthPos-2
596
+
597
+        name, position = readData.returntdPosition(objIndex, valueIndex)
598
+        name = 'throw_deck'
599
+        if name in scene.objects:
600
+            try:
601
+                scene.objects[name].worldPosition = position
602
+                #print('recording tdPos', position)
603
+            except:
604
+                pass
605
+    #-----Orientation-----#
606
+    own["lengthtdOri"] = readData.getLengthtdOri()   
607
+    lengthOri = own["lengthtdOri"]
608
+    
609
+    #if lengthPos:
610
+    if lengthOri:
611
+  
612
+        if valueIndex > lengthOri-1:
613
+            own["valueIndex"] = 0
614
+        if objIndex < 0:
615
+            own["objIndex"] = lengthOri-2
553
 
616
 
617
+        name, orientation = readData.returntdOrientation(objIndex, valueIndex)
618
+        name = 'throw_deck'
619
+        if name in scene.objects:
620
+            
621
+            oXYZ = scene.objects[name].localOrientation.to_euler()
554
 
622
 
623
+            oXYZ[0] = float(orientation[0])
624
+            oXYZ[1] = float(orientation[1])
625
+            oXYZ[2] = float(orientation[2])
626
+            
627
+            try:
628
+                #print('recording tdOri')
629
+                scene.objects[name].localOrientation = oXYZ.to_matrix()
555
             except:
630
             except:
556
                 pass
631
                 pass
557
-##    
632
+
633
+#
634
+    #-----revert sound-----#
635
+    own["lengthSrevertsound"] = readData.getLengthSrevertsound()
636
+    lengthSrevertsound = own["lengthSrevertsound"]
637
+    if lengthSrevertsound:
638
+        if valueIndex > lengthSrevertsound-1:
639
+            own["valueIndex"] = 0
640
+        if objIndex < 0:
641
+            own["objIndex"] = lengthSrevertsound-2
642
+        name, srevertsound = readData.returnSrevertsound(objIndex, valueIndex)   
643
+        if name in scene.objects:
644
+            try:
645
+                #cube = scene.objects[sound_empty]
646
+                srevertsound = round(srevertsound, 2)
647
+                act = cube.actuators["revertSound"]
648
+                if srevertsound == 1:
649
+                    act.startSound()
650
+                #print("grindsound = ", spopsound, sgrind_railPitch)
651
+            except:
652
+                print("sound passed")
653
+                pass
558
 
654
 
559
                                             
655
                                             
560
                        
656
                        
594
         getData.saveSgrind_railPitch(obj, recording_cutoff)
690
         getData.saveSgrind_railPitch(obj, recording_cutoff)
595
         getData.saveSpopsound(obj, recording_cutoff)            
691
         getData.saveSpopsound(obj, recording_cutoff)            
596
         getData.saveSlandsound(obj, recording_cutoff) 
692
         getData.saveSlandsound(obj, recording_cutoff) 
597
-        getData.saveSdeckvis(obj, recording_cutoff)                               
693
+        getData.saveSdeckvis(obj, recording_cutoff) 
694
+        getData.savetdPosition(obj, recording_cutoff)
695
+        getData.savetdOrientation(obj, recording_cutoff)
696
+        getData.saveSrevertsound(obj, recording_cutoff)                                       
598
             
697
             
599
          
698
          
600
 def breakOut():
699
 def breakOut():

+ 76
- 2
Settings.py View File

52
     print("Game play recorder on: ", recorder_on) 
52
     print("Game play recorder on: ", recorder_on) 
53
     #dict = bge.logic.globalDict
53
     #dict = bge.logic.globalDict
54
     dict['recorder_on'] = recorder_on
54
     dict['recorder_on'] = recorder_on
55
-    own['recorder_on'] = recorder_on    
55
+    own['recorder_on'] = recorder_on  
56
+    dict["shirt_color_r"] = float(data[16])
57
+    dict["shirt_color_g"] = float(data[17])
58
+    dict["shirt_color_b"] = float(data[18])
59
+    dict["shoe_color_r"] = float(data[20])
60
+    dict["shoe_color_g"] = float(data[21])
61
+    dict["shoe_color_b"] = float(data[22]) 
62
+    dict["deck_color_r"] = float(data[24])
63
+    dict["deck_color_g"] = float(data[25])
64
+    dict["deck_color_b"] = float(data[26]) 
65
+    dict["shirt_logo"] = int(data[28])  
66
+    dict["bc"] = int(data[30])
67
+    dict["BC_BRIGHTNESS"] = float(data[31])
68
+    dict["BC_CONTRAST"] = float(data[32])  
69
+    dict['hdr'] = int(data[34])
70
+    dict['avgL'] = float(data[35])
71
+    dict['HDRamount'] = float(data[36])
72
+    dict['ao'] = int(data[38])
73
+    dict['onlyAO'] = int(data[39])
74
+    dict['aowidth'] = float(data[40])
75
+    dict['aoradius'] = float(data[41])
76
+    dict['dof_on'] = float(data[43])
77
+    dict['sun_strength'] = float(data[45])
78
+    dict['sun_rot_x'] = float(data[46])
79
+    dict['sun_rot_y'] = float(data[47])            
80
+    dict['shadow_on'] = float(data[48])
81
+    dict['ambient_strength'] = float(data[49])        
82
+    
83
+    
84
+    
85
+    
86
+    #print('bc = ', dict['bc'])        
87
+    #dict['music_player_on'] = int(data[16])  
56
 def writeSettings():
88
 def writeSettings():
57
     import GameLogic
89
     import GameLogic
58
     import bge
90
     import bge
59
     cont = GameLogic.getCurrentController()
91
     cont = GameLogic.getCurrentController()
60
     own = cont.owner
92
     own = cont.owner
61
     scenes = bge.logic.getSceneList()
93
     scenes = bge.logic.getSceneList()
94
+    dict = bge.logic.globalDict
62
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
95
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
63
     own = main_scene.objects['Empty']
96
     own = main_scene.objects['Empty']
64
     print("writing called")
97
     print("writing called")
77
         writing.write(str("//show profile")+"\n")
110
         writing.write(str("//show profile")+"\n")
78
         writing.write(str(own["profile"])+"\n")
111
         writing.write(str(own["profile"])+"\n")
79
         writing.write(str("//Game play recorder off/on (0,1)")+"\n")
112
         writing.write(str("//Game play recorder off/on (0,1)")+"\n")
80
-        writing.write(str(own["recorder_on"])+"\n")        
113
+        writing.write(str(own["recorder_on"])+"\n") 
114
+        writing.write(str("//Shirt color [r,g,b]")+"\n")
115
+        writing.write(str(dict["shirt_color_r"])+"\n") #16
116
+        writing.write(str(dict["shirt_color_g"])+"\n")
117
+        writing.write(str(dict["shirt_color_b"])+"\n")    # 
118
+        writing.write(str("//Shoe color [r,g,b]")+"\n")
119
+        writing.write(str(dict["shoe_color_r"])+"\n") #16
120
+        writing.write(str(dict["shoe_color_g"])+"\n")
121
+        writing.write(str(dict["shoe_color_b"])+"\n")    # 
122
+        writing.write(str("//Deck color [r,g,b]")+"\n")
123
+        writing.write(str(dict["deck_color_r"])+"\n") #24
124
+        writing.write(str(dict["deck_color_g"])+"\n")
125
+        writing.write(str(dict["deck_color_b"])+"\n")    #                           
126
+        writing.write(str("//Shirt Logo")+"\n")
127
+        writing.write(str(dict["shirt_logo"])+"\n") #24
128
+        writing.write(str("//Brightness/Contrast: On, brightness, contrast")+"\n")
129
+        writing.write(str(dict["bc"])+"\n")
130
+        writing.write(str(dict["BC_BRIGHTNESS"])+"\n")
131
+        writing.write(str(dict["BC_CONTRAST"])+"\n")
132
+        writing.write(str("//HDR: On, avgL, amount")+"\n")
133
+        writing.write(str(dict["hdr"])+"\n")
134
+        writing.write(str(dict["avgL"])+"\n")
135
+        writing.write(str(dict["HDRamount"])+"\n") 
136
+        writing.write(str("//AO: On, only, width, radius")+"\n")
137
+        writing.write(str(dict["ao"])+"\n")
138
+        writing.write(str(dict["onlyAO"])+"\n")
139
+        writing.write(str(dict["aowidth"])+"\n")                
140
+        writing.write(str(dict["aoradius"])+"\n") 
141
+        writing.write(str("//dof on")+"\n")
142
+        writing.write(str(dict["dof_on"])+"\n") 
143
+        writing.write(str("//sun settings: strength, rotx, roty, shadow on, ambient strength")+"\n")
144
+        writing.write(str(dict["sun_strength"])+"\n")                           
145
+        writing.write(str(dict["sun_rot_x"])+"\n")                           
146
+        writing.write(str(dict["sun_rot_y"])+"\n")                           
147
+        writing.write(str(dict["shadow_on"])+"\n")                                     
148
+        writing.write(str(dict["ambient_strength"])+"\n")                             
149
+        
150
+        
151
+        
152
+        
153
+        
154
+        
81
         #writing.write(str(own["framerate"])+"\n")
155
         #writing.write(str(own["framerate"])+"\n")
82
         print("writing settings")
156
         print("writing settings")
83
         writing.close()
157
         writing.close()

+ 90
- 14
SortData.py View File

30
 spopsoundList = []
30
 spopsoundList = []
31
 slandsoundList = []
31
 slandsoundList = []
32
 sdeckvisList = []
32
 sdeckvisList = []
33
+positiontdList = []
34
+orientationtdList = []
35
+srevertsoundList = []
33
 
36
 
34
 allDataList = []
37
 allDataList = []
35
 allDataPath = path+gameName+" replay.dat"
38
 allDataPath = path+gameName+" replay.dat"
188
         sdeckvisList.append(sdeckvis)
191
         sdeckvisList.append(sdeckvis)
189
         if len(sdeckvisList) >= cut and cut > 0:
192
         if len(sdeckvisList) >= cut and cut > 0:
190
             del sdeckvisList[0]
193
             del sdeckvisList[0]
191
-            del sdeckvisList[0]                                                                                       
194
+            del sdeckvisList[0]     
195
+            
196
+    def addtdPosition(obj, pos, cut):
197
+        global positiontdList
198
+        positiontdList.append(" "+str(obj))
199
+        positiontdList.append(pos)
200
+        
201
+        if len(positiontdList) >= cut and cut > 0:
202
+            del positiontdList[0]
203
+            del positiontdList[0]
204
+        
205
+    def addtdOrientation(obj, ori, cut):
206
+        global orientationtdData
207
+        orientationtdList.append(" "+str(obj))
208
+        orientationtdList.append(ori)
209
+        
210
+        if len(orientationtdList) >= cut and cut > 0:
211
+            del orientationtdList[0]
212
+            del orientationtdList[0]  
213
+##
214
+    def addSrevertsound(obj, srevertsound, cut):
215
+        global srevertsoundData
216
+        srevertsoundList.append(" "+str(obj))
217
+        srevertsoundList.append(srevertsound)
218
+        if len(srevertsoundList) >= cut and cut > 0:
219
+            del srevertsoundList[0]
220
+            del srevertsoundList[0]                       
221
+                                                                                              
192
             
222
             
193
     def saveAll():
223
     def saveAll():
194
 
224
 
211
             " ".join(sgrind_railPitchList),
241
             " ".join(sgrind_railPitchList),
212
             " ".join(spopsoundList),
242
             " ".join(spopsoundList),
213
             " ".join(slandsoundList),
243
             " ".join(slandsoundList),
214
-            " ".join(sdeckvisList)]    
244
+            " ".join(sdeckvisList),
245
+            " ".join(positiontdList),
246
+            " ".join(orientationtdList),
247
+            " ".join(spopsoundList)]    
215
         try:
248
         try:
216
             with open(allDataPath,'w') as all:
249
             with open(allDataPath,'w') as all:
217
                 all.write("|".join(allDataList))
250
                 all.write("|".join(allDataList))
245
         global sgrind_railPitchList
278
         global sgrind_railPitchList
246
         global spopsoundList
279
         global spopsoundList
247
         global slandsoundList 
280
         global slandsoundList 
248
-        global sdeckvisList                                        
281
+        global sdeckvisList     
282
+        global positiontdList
283
+        global orientationtdList 
284
+        global srevertsoundList                                          
249
             
285
             
250
         if not allDataList:
286
         if not allDataList:
251
             try:
287
             try:
278
                             spopsoundList = allDataList[17].split()
314
                             spopsoundList = allDataList[17].split()
279
                             slandsoundList = allDataList[18].split()
315
                             slandsoundList = allDataList[18].split()
280
                             sdeckvisList = allDataList[19].split()
316
                             sdeckvisList = allDataList[19].split()
317
+                            positiontdList = allDataList[20].split()
318
+                            orientationtdList = allDataList[21].split()                            
319
+                            srevertsoundList = allDataList[22].split()
281
                             
320
                             
282
                             if printDebug:
321
                             if printDebug:
283
                                 print("Read file "+allDataPath)
322
                                 print("Read file "+allDataPath)
292
         if positionList:
331
         if positionList:
293
             name = positionList[objIndex-2]   #That -2 is a little workaround to a list index out of range error.
332
             name = positionList[objIndex-2]   #That -2 is a little workaround to a list index out of range error.
294
             position = positionList[valueIndex-2]
333
             position = positionList[valueIndex-2]
295
-
296
             name = name.replace(" ","")
334
             name = name.replace(" ","")
297
-
298
             position = str(position)
335
             position = str(position)
299
             position = position.replace(","," ")
336
             position = position.replace(","," ")
300
-
301
             pX = float(position.split()[0])
337
             pX = float(position.split()[0])
302
             pY = float(position.split()[1])
338
             pY = float(position.split()[1])
303
             pZ = float(position.split()[2])
339
             pZ = float(position.split()[2])
304
-
305
             position = [pX,pY,pZ]
340
             position = [pX,pY,pZ]
306
-
307
             return(name, position)
341
             return(name, position)
308
 
342
 
309
     def returnOrientation(objIndex, valueIndex):
343
     def returnOrientation(objIndex, valueIndex):
310
-        
311
         if orientationList:
344
         if orientationList:
312
             name = orientationList[objIndex-2]
345
             name = orientationList[objIndex-2]
313
             orientation = orientationList[valueIndex-2]
346
             orientation = orientationList[valueIndex-2]
314
-            
315
             name = name.replace(" ","")
347
             name = name.replace(" ","")
316
-            
317
             orientation = str(orientation)
348
             orientation = str(orientation)
318
             orientation = orientation.replace(","," ")
349
             orientation = orientation.replace(","," ")
319
             orientation = orientation.split()
350
             orientation = orientation.split()
320
-
321
             return(name, orientation)
351
             return(name, orientation)
322
 
352
 
323
     def returnScale(objIndex, valueIndex):
353
     def returnScale(objIndex, valueIndex):
507
             sdeckvis = str(sdeckvis)
537
             sdeckvis = str(sdeckvis)
508
             sdeckvis = sdeckvis.replace(","," ")
538
             sdeckvis = sdeckvis.replace(","," ")
509
             sdeckvis = int(sdeckvis)
539
             sdeckvis = int(sdeckvis)
510
-            return(name, sdeckvis)                
540
+            return(name, sdeckvis) 
541
+        
542
+    def returntdPosition(objIndex, valueIndex):
543
+        
544
+        if positiontdList:
545
+            name = positiontdList[objIndex-2]   #That -2 is a little workaround to a list index out of range error.
546
+            position = positiontdList[valueIndex-2]
547
+            name = name.replace(" ","")
548
+            position = str(position)
549
+            position = position.replace(","," ")
550
+            pX = float(position.split()[0])
551
+            pY = float(position.split()[1])
552
+            pZ = float(position.split()[2])
553
+            position = [pX,pY,pZ]
554
+            return(name, position)
555
+
556
+    def returntdOrientation(objIndex, valueIndex):
557
+        if orientationtdList:
558
+            name = orientationtdList[objIndex-2]
559
+            orientation = orientationtdList[valueIndex-2]
560
+            name = name.replace(" ","")
561
+            orientation = str(orientation)
562
+            orientation = orientation.replace(","," ")
563
+            orientation = orientation.split()
564
+            return(name, orientation)     
565
+        
566
+    def returnSrevertsound(objIndex, valueIndex):
567
+        if srevertsoundList:
568
+            name = srevertsoundList[objIndex-2]
569
+            srevertsound = srevertsoundList[valueIndex-2]
570
+            name = name.replace(" ","")
571
+            srevertsound = str(srevertsound)
572
+            srevertsound = srevertsound.replace(","," ")
573
+            srevertsound = int(srevertsound)
574
+            return(name, srevertsound)           
575
+                       
511
 ####                
576
 ####                
512
 
577
 
513
     def getLengthPos():
578
     def getLengthPos():
571
             return(len(slandsoundList)) 
636
             return(len(slandsoundList)) 
572
     def getLengthSdeckvis():
637
     def getLengthSdeckvis():
573
         if sdeckvisList:
638
         if sdeckvisList:
574
-            return(len(sdeckvisList))                                                                                               
639
+            return(len(sdeckvisList))   
640
+    def getLengthtdPos():
641
+        if positiontdList:
642
+            return(len(positiontdList))
643
+    def getLengthtdOri():
644
+        if orientationtdList:
645
+            return(len(orientationtdList))
646
+    def getLengthSrevertsound():
647
+        if srevertsoundList:
648
+            return(len(srevertsoundList))    
649
+             
650
+                                                                                                    

+ 6
- 0
Startup.py View File

72
     dict['overlay_fadeout'] = 0
72
     dict['overlay_fadeout'] = 0
73
     dict['load_timer'] = 0
73
     dict['load_timer'] = 0
74
     dict['reload_timer'] = 0
74
     dict['reload_timer'] = 0
75
+    dict['menu_idle_timer'] = 0
75
     if not any(logic.joysticks):
76
     if not any(logic.joysticks):
76
         print("joystick not connnected")
77
         print("joystick not connnected")
77
         dict['joy_con'] = 0
78
         dict['joy_con'] = 0
117
     dict['mTrig'] = 0.0 
118
     dict['mTrig'] = 0.0 
118
     dict['lTrig'] = 0.0
119
     dict['lTrig'] = 0.0
119
     dict['rTrig'] = 0.0 
120
     dict['rTrig'] = 0.0 
121
+    #dict['shirt_color'] = [.5,1,1,1]
122
+    
123
+    dict['mu_last_track'] = ''
124
+    dict['mu_artist'] = ''
125
+    dict['mu_title'] = ''    
120
 
126
 
121
 main()
127
 main()

+ 144
- 91
co_ActionState.py View File

113
             own['actionTimer'] = 0
113
             own['actionTimer'] = 0
114
             actionTimer = 0 
114
             actionTimer = 0 
115
     #print(own['manual_v2_timer'], 'man_timer###@!')                   
115
     #print(own['manual_v2_timer'], 'man_timer###@!')                   
116
-    if (own['l_requestAction'] == 'reg_air_nose' or own['l_requestAction'] == 'reg_air_tail' or own['l_requestAction'] == 'fak_air_nose' or own['l_requestAction'] == 'fak_air_tail') and (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
117
-    #if (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
118
-        requestAction = own['l_requestAction']
119
-        print("changing land")
120
-        #pass
116
+#    if (own['l_requestAction'] == 'reg_air_nose' or own['l_requestAction'] == 'reg_air_tail' or own['l_requestAction'] == 'fak_air_nose' or own['l_requestAction'] == 'fak_air_tail') and (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
117
+#    #if (requestAction == 'reg_land' or requestAction == 'fak_land') and own['manual_v2_timer'] > 2:
118
+#        requestAction = own['l_requestAction']
119
+#        own['actionTimer'] = 5
120
+#        print("changing land")
121
+#        #pass
121
         
122
         
122
-    #dirty manual fix
123
-    if l_actionState == 'reg_air_tail' and requestAction == 'reg_roll':
124
-        requestAction = 'reg_air_tail'
125
-    if l_actionState == 'reg_air_nose' and requestAction == 'reg_roll':
126
-        requestAction = 'reg_air_nose'
127
-    if l_actionState == 'fak_air_tail' and requestAction == 'fak_roll':
128
-        requestAction = 'fak_air_tail'
129
-    if l_actionState == 'fak_air_nose' and requestAction == 'fak_roll':
130
-        requestAction = 'fak_air_nose'                
123
+        
124
+    
125
+        
126
+        
127
+#    #dirty manual fix
128
+#    if l_actionState == 'reg_air_tail' and requestAction == 'reg_roll':
129
+#        requestAction = 'reg_air_tail'
130
+#    if l_actionState == 'reg_air_nose' and requestAction == 'reg_roll':
131
+#        requestAction = 'reg_air_nose'
132
+#    if l_actionState == 'fak_air_tail' and requestAction == 'fak_roll':
133
+#        requestAction = 'fak_air_tail'
134
+#    if l_actionState == 'fak_air_nose' and requestAction == 'fak_roll':
135
+#        requestAction = 'fak_air_nose'                
131
         
136
         
132
     #dirt invert fix
137
     #dirt invert fix
133
     if 'invert' in requestAction:
138
     if 'invert' in requestAction:
379
         if (l_actionState == 'fak_5050_out' and requestAction == 'fak_roll') or (l_actionState in {'fak_noseg_out', 'fak_nosegr_out', 'fak_nosegl_out', 'fak_tailg_out', 'fak_tailgr_out', 'fak_tailgl_out'} and actionTimer < 10): 
384
         if (l_actionState == 'fak_5050_out' and requestAction == 'fak_roll') or (l_actionState in {'fak_noseg_out', 'fak_nosegr_out', 'fak_nosegl_out', 'fak_tailg_out', 'fak_tailgr_out', 'fak_tailgl_out'} and actionTimer < 10): 
380
             requestAction = 'fak_5050-roll'
385
             requestAction = 'fak_5050-roll'
381
             actionState = 'fak_5050-roll' 
386
             actionState = 'fak_5050-roll' 
387
+
388
+
389
+
390
+
391
+
392
+#####
393
+
394
+
382
             
395
             
383
-        if l_actionState == 'fak_air_tail' and requestAction in ('reg_roll', 'reg_manual'):
384
-            requestAction = 'fak_manual'
385
-        if l_actionState == 'reg_air_tail' and requestAction in ('fak_roll', 'fak_manual'):
386
-            requestAction = 'reg_manual'
387
-        
388
-        if l_actionState == 'reg_air_tail' and requestAction in ('fak_manual', 'fak_roll'):
389
-            requestAction == 'reg_air_tail to manual'   
390
-        if l_actionState == 'reg_air_tail' and requestAction in ('fak_manual', 'fak_roll'):
391
-            requestAction = 'fak_nmanual'
396
+        if l_actionState == 'fak_air_tail' and requestAction in ('reg_roll', 'reg_manual', 'fak_land'):
397
+            requestAction = 'fak_air_tail to manual'
398
+            print('fucking manuals')
392
             
399
             
393
-        if l_actionState == 'fak_air_nose' and requestAction in ('reg_roll', 'reg_nmanual'):
394
-            requestAction = 'fak_nmanual'
395
-        if l_actionState == 'reg_air_nose' and requestAction in ('fak_roll', 'fak_nmanual'):
396
-            requestAction = 'reg_nmanual'
400
+#        if l_actionState == 'reg_air_tail' and requestAction in ('fak_roll', 'fak_manual'):
401
+#            requestAction = 'reg_manual'
397
         
402
         
398
-        if l_actionState == 'reg_air_nose' and requestAction in ('fak_nmanual', 'fak_roll', 'reg_nmanual', 'reg_roll', 'reg_manual'):
399
-            requestAction == 'reg_air_nose to nmanual'   
400
-        if l_actionState == 'reg_air_nose' and requestAction in ('fak_nmanual', 'fak_roll'):
401
-            requestAction = 'fak_manual' 
403
+        if l_actionState == 'reg_air_tail' and requestAction in ('fak_manual', 'fak_roll', 'reg_land'):
404
+            requestAction = 'reg_air_tail to manual'
405
+            print('fucking manuals')
406
+               
407
+#        if l_actionState == 'reg_air_tail' and requestAction in ('fak_manual', 'fak_roll'):
408
+#            requestAction = 'fak_nmanual'
409
+            
410
+        if l_actionState == 'fak_air_nose' and requestAction in ('reg_roll', 'reg_nmanual', 'fak_land'):
411
+            requestAction = 'fak_air_nose to nmanual'
412
+            print('fucking manuals')
413
+            
414
+        if l_actionState == 'reg_air_nose' and requestAction in ('fak_roll', 'fak_nmanual', 'reg_land'):
415
+            requestAction = 'reg_air_nose to nmanual'
416
+            print('fucking manuals') 
417
+        #own['requestAction'] = requestAction
418
+#        if l_actionState == 'reg_air_nose' and requestAction in ('fak_nmanual', 'fak_roll', 'reg_nmanual', 'reg_roll', 'reg_manual'):
419
+#            requestAction == 'reg_air_nose to nmanual' 
420
+              
421
+#        if l_actionState == 'reg_air_nose' and requestAction in ('fak_nmanual', 'fak_roll'):
422
+#            requestAction = 'fak_manual' 
423
+
424
+
425
+
426
+#        if requestAction == 'reg_nmanual' and l_requestAction in ['fak-reg_manual', 'reg_nmanual']:
427
+#            requestAction == 'reg_manual'
402
 
428
 
429
+
430
+
431
+####
432
+
433
+
434
+        #print(requestAction)
403
         if l_actionState == 'reg_air_tail to manual' and requestAction == 'fak_nmanual':
435
         if l_actionState == 'reg_air_tail to manual' and requestAction == 'fak_nmanual':
404
             requestAction = 'reg-fak_nmanual'
436
             requestAction = 'reg-fak_nmanual'
405
         if l_actionState == 'fak_air_tail to manual' and requestAction == 'reg_nmanual':
437
         if l_actionState == 'fak_air_tail to manual' and requestAction == 'reg_nmanual':
406
             requestAction = 'fak-reg_nmanual' 
438
             requestAction = 'fak-reg_nmanual' 
439
+        if l_actionState == 'fak_air_tail to nmanual' and requestAction == 'reg_nmanual':
440
+            requestAction = 'fak-reg_manual'   
407
             
441
             
408
         if l_actionState == 'reg_air_nose to nmanual' and requestAction == 'fak_manual':
442
         if l_actionState == 'reg_air_nose to nmanual' and requestAction == 'fak_manual':
409
             requestAction = 'reg-fak_manual'
443
             requestAction = 'reg-fak_manual'
410
         if l_actionState == 'fak_air_nose to nmanual' and requestAction == 'reg_manual':
444
         if l_actionState == 'fak_air_nose to nmanual' and requestAction == 'reg_manual':
411
-            requestAction = 'fak-reg_manual'  
445
+            requestAction = 'fak-reg_manual' 
446
+            
447
+            
448
+#        if l_actionState == 'fak_air_nose to nmanual' and requestAction == 'reg_nmanual':
449
+#            requestAction = 'fak-reg_manual'  
450
+#            print('this???')
451
+#        if l_actionState == 'fak-reg_manual' and requestAction == 'reg_nmanual':
452
+#            requestAction = 'reg_manual'                
412
             
453
             
413
             
454
             
414
         if l_actionState == 'reg_ollie_north' and requestAction != 'reg_ollie_north':
455
         if l_actionState == 'reg_ollie_north' and requestAction != 'reg_ollie_north':
429
         if l_actionState == 'fak_air_nose to nmanual' and requestAction == 'reg_roll':
470
         if l_actionState == 'fak_air_nose to nmanual' and requestAction == 'reg_roll':
430
             requestAction = 'fak_nmanual_out'            
471
             requestAction = 'fak_nmanual_out'            
431
         if l_actionState == 'reg_air_tail to manual' and requestAction == 'fak_roll':
472
         if l_actionState == 'reg_air_tail to manual' and requestAction == 'fak_roll':
432
-            requestAction = 'reg_nmanual_out'
473
+            requestAction = 'reg_manual_out'
433
         if l_actionState == 'fak_air_tail to manual' and requestAction == 'reg_roll':
474
         if l_actionState == 'fak_air_tail to manual' and requestAction == 'reg_roll':
434
-            requestAction = 'fak_nmanual_out'            
475
+            requestAction = 'fak_manual_out'            
435
 
476
 
436
         if l_actionState == 'frontside_grab' and requestAction != 'frontside_grab':
477
         if l_actionState == 'frontside_grab' and requestAction != 'frontside_grab':
437
             requestAction = 'frontside_grab_out'
478
             requestAction = 'frontside_grab_out'
494
         if requestAction in ('fak_roll', 'reg_roll') and l_actionState in ('fak_ollie_north_out', 'fak_ollie_north', 'fak_ollie_south_out', 'fak_ollie_south', 'fak_backside_grab', 'fak_frontside_grab', 'fak_frontside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_nose_grab', 'fak_backside_tail_grab', 'fak_backside_grab_out', 'fak_frontside_grab_out', 'fak_frontside_nose_grab_out', 'fak_frontside_tail_grab_out', 'fak_backside_nose_grab_out', 'fak_backside_tail_grab_out', 'fak_judo_out') and actionTimer < 2:
535
         if requestAction in ('fak_roll', 'reg_roll') and l_actionState in ('fak_ollie_north_out', 'fak_ollie_north', 'fak_ollie_south_out', 'fak_ollie_south', 'fak_backside_grab', 'fak_frontside_grab', 'fak_frontside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_nose_grab', 'fak_backside_tail_grab', 'fak_backside_grab_out', 'fak_frontside_grab_out', 'fak_frontside_nose_grab_out', 'fak_frontside_tail_grab_out', 'fak_backside_nose_grab_out', 'fak_backside_tail_grab_out', 'fak_judo_out') and actionTimer < 2:
495
             requestAction = 'fak_land'  
536
             requestAction = 'fak_land'  
496
 
537
 
497
-        if l_actionState in ('reg_air_tail', 'reg_air_nose') and requestAction in ('fak_opos', 'fak_nopos'):
498
-            requestAction = 'reg_land'
499
-        if l_actionState in ('fak_air_tail', 'fak_air_nose') and requestAction in ('reg_opos', 'reg_nopos'):
500
-            requestAction = 'fak_land'    
538
+#        if l_actionState in ('reg_air_tail', 'reg_air_nose') and requestAction in ('fak_opos', 'fak_nopos'):
539
+#            requestAction = 'reg_land'
540
+#        if l_actionState in ('fak_air_tail', 'fak_air_nose') and requestAction in ('reg_opos', 'reg_nopos'):
541
+#            requestAction = 'fak_land'    
501
             
542
             
502
             
543
             
503
         if l_actionState == 'reg_air' and requestAction == 'fak_air':
544
         if l_actionState == 'reg_air' and requestAction == 'fak_air':
525
         if l_actionState in ('reg_noseslide_out', 'regtailslide_out') and requestAction == ' fak_roll':
566
         if l_actionState in ('reg_noseslide_out', 'regtailslide_out') and requestAction == ' fak_roll':
526
             requestAction = 'reg-fak_roll'
567
             requestAction = 'reg-fak_roll'
527
         if l_actionState in ('fak_noseslide_out', 'faktailslide_out') and requestAction == ' reg_roll':
568
         if l_actionState in ('fak_noseslide_out', 'faktailslide_out') and requestAction == ' reg_roll':
528
-            requestAction = 'fak-reg_roll'            
569
+            requestAction = 'fak-reg_roll'     
570
+            
571
+            
572
+#        if (l_actionState == 'fak_air-roll' and requestAction == 'fak_manual'):
573
+#            actionTimer = 0
574
+#            own['actionTimer'] = 0  
575
+#            l_actionState = 'fak_manual'
576
+#            own['l_actionState'] = 'fak_manual' 
577
+#        if (l_actionState == 'reg_air-roll' and requestAction == 'reg_manual'):
578
+#            actionTimer = 0
579
+#            own['actionTimer'] = 0                      
580
+#            l_actionState = 'reg_manual'
581
+#            own['l_actionState'] = 'reg_manual'             
529
                                                                                                                                                         
582
                                                                                                                                                         
530
     else:
583
     else:
531
         print("action over written")               
584
         print("action over written")               
1078
                 actionState = 'reg_manual_out'
1131
                 actionState = 'reg_manual_out'
1079
                 own['actionTimer'] = 9
1132
                 own['actionTimer'] = 9
1080
                 trans_playing = skater.isPlayingAction(trans_layer)
1133
                 trans_playing = skater.isPlayingAction(trans_layer)
1081
-                if trans_playing:
1082
-                    cur_frame = skater.getActionFrame(trans_layer)                   
1083
-                if trans_playing and cur_frame > 1:                
1084
-                    skater.playAction("reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1085
-                    deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1086
-                    trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1087
-                    #own['actionTimer'] = cur_frame
1088
-                else:                      
1089
-                    skater.playAction("reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1090
-                    deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1091
-                    trucks.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1092
-                    
1134
+#                if trans_playing:
1135
+#                    cur_frame = skater.getActionFrame(trans_layer)                   
1136
+#                if trans_playing and cur_frame > 1:                
1137
+#                    skater.playAction("reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1138
+#                    deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1139
+#                    trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1140
+#                    #own['actionTimer'] = cur_frame
1141
+#                else:                      
1142
+                skater.playAction("reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1143
+                deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1144
+                trucks.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1145
+                
1093
                     
1146
                     
1094
             if requestAction == 'fak_manual_out':
1147
             if requestAction == 'fak_manual_out':
1095
                 actionState = 'fak_manual_out'
1148
                 actionState = 'fak_manual_out'
1096
                 own['actionTimer'] = 9
1149
                 own['actionTimer'] = 9
1097
                 trans_playing = skater.isPlayingAction(trans_layer)
1150
                 trans_playing = skater.isPlayingAction(trans_layer)
1098
-                if trans_playing:
1099
-                    cur_frame = skater.getActionFrame(trans_layer)                   
1100
-                if trans_playing and cur_frame > 1:                
1101
-                    skater.playAction("fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1102
-                    deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1103
-                    trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1104
-                    #own['actionTimer'] = cur_frame
1105
-                else:                      
1106
-                    skater.playAction("fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1107
-                    deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1108
-                    trucks.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1109
-                    
1151
+#                if trans_playing:
1152
+#                    cur_frame = skater.getActionFrame(trans_layer)                   
1153
+#                if trans_playing and cur_frame > 1:                
1154
+#                    skater.playAction("fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1155
+#                    deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1156
+#                    trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1157
+#                    #own['actionTimer'] = cur_frame
1158
+                #else:                      
1159
+                skater.playAction("fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1160
+                deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1161
+                trucks.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1162
+                
1110
             if requestAction == 'reg_nmanual_out':
1163
             if requestAction == 'reg_nmanual_out':
1111
                 actionState = 'reg_nmanual_out'
1164
                 actionState = 'reg_nmanual_out'
1112
                 own['actionTimer'] = 9
1165
                 own['actionTimer'] = 9
1113
                 trans_playing = skater.isPlayingAction(trans_layer)
1166
                 trans_playing = skater.isPlayingAction(trans_layer)
1114
-                if trans_playing:
1115
-                    cur_frame = skater.getActionFrame(trans_layer)                   
1116
-                if trans_playing and cur_frame > 1:                
1117
-                    skater.playAction("reg_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1118
-                    deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1119
-                    trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1120
-                    #own['actionTimer'] = cur_frame
1121
-                else:                      
1122
-                    skater.playAction("reg_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1123
-                    deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1124
-                    trucks.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1167
+#                if trans_playing:
1168
+#                    cur_frame = skater.getActionFrame(trans_layer)                   
1169
+#                if trans_playing and cur_frame > 1:                
1170
+#                    skater.playAction("reg_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1171
+#                    deck.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1172
+#                    trucks.playAction("a_fak_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1173
+#                    #own['actionTimer'] = cur_frame
1174
+                #else:                      
1175
+                skater.playAction("reg_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1176
+                deck.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1177
+                trucks.playAction("a_fak_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)                     
1125
                     
1178
                     
1126
                     
1179
                     
1127
             if requestAction == 'fak_nmanual_out':
1180
             if requestAction == 'fak_nmanual_out':
1128
                 actionState = 'fak_nmanual_out'
1181
                 actionState = 'fak_nmanual_out'
1129
                 own['actionTimer'] = 9
1182
                 own['actionTimer'] = 9
1130
                 trans_playing = skater.isPlayingAction(trans_layer)
1183
                 trans_playing = skater.isPlayingAction(trans_layer)
1131
-                if trans_playing:
1132
-                    cur_frame = skater.getActionFrame(trans_layer)                   
1133
-                if trans_playing and cur_frame > 1:                
1134
-                    skater.playAction("fak_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1135
-                    deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1136
-                    trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1137
-                    #own['actionTimer'] = cur_frame
1138
-                else:                      
1139
-                    skater.playAction("fak_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1140
-                    deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1141
-                    trucks.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1184
+#                if trans_playing:
1185
+#                    cur_frame = skater.getActionFrame(trans_layer)                   
1186
+#                if trans_playing and cur_frame > 1:                
1187
+#                    skater.playAction("fak_nmanual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1188
+#                    deck.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1189
+#                    trucks.playAction("a_reg_manual", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
1190
+#                    #own['actionTimer'] = cur_frame
1191
+                #else:                      
1192
+                skater.playAction("fak_nmanual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1193
+                deck.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1194
+                trucks.playAction("a_reg_manual", 10,1, layer=trans_layer, play_mode=0, speed=1)
1142
             
1195
             
1143
             if requestAction == 'reg-fak_nmanual':
1196
             if requestAction == 'reg-fak_nmanual':
1144
                 own['actionTimer'] = 9
1197
                 own['actionTimer'] = 9
1800
                 
1853
                 
1801
             if l_requestAction == 'fak_air_nose to nmanual':
1854
             if l_requestAction == 'fak_air_nose to nmanual':
1802
                 own['actionTimer'] = 20
1855
                 own['actionTimer'] = 20
1803
-                actionState = 'fak_air_tail to nmanual'                    
1856
+                actionState = 'fak_air_nose to nmanual'                    
1804
                 skater.playAction("fak_nmanual", 90,110, layer=trans_layer, play_mode=0, speed=1)                
1857
                 skater.playAction("fak_nmanual", 90,110, layer=trans_layer, play_mode=0, speed=1)                
1805
                 deck.playAction("a_reg_manual", 90,110, layer=trans_layer, play_mode=0, speed=1)
1858
                 deck.playAction("a_reg_manual", 90,110, layer=trans_layer, play_mode=0, speed=1)
1806
                 trucks.playAction("a_reg_manual", 90,110, layer=trans_layer, play_mode=0, speed=1)                                                                 
1859
                 trucks.playAction("a_reg_manual", 90,110, layer=trans_layer, play_mode=0, speed=1)                                                                 
3687
     
3740
     
3688
 ##############
3741
 ##############
3689
     #turn off land for manuals
3742
     #turn off land for manuals
3690
-    if (requestAction == 'reg_manual' or requestAction == 'fak_manual' or requestAction == 'reg_nmanual' or requestAction == 'fak_nmanual') and (actionState == 'reg_land' or actionState == 'fak_land'):
3691
-        own['actionTimer'] = 0
3743
+#    if (requestAction == 'reg_manual' or requestAction == 'fak_manual' or requestAction == 'reg_nmanual' or requestAction == 'fak_nmanual') and (actionState == 'reg_land' or actionState == 'fak_land'):
3744
+#        own['actionTimer'] = 0
3692
                   
3745
                   
3693
     if (own['actionTimer'] == 0 or requestAction == 'reg_land' or requestAction == 'fak_land') or requestAction in jump_overrideList:
3746
     if (own['actionTimer'] == 0 or requestAction == 'reg_land' or requestAction == 'fak_land') or requestAction in jump_overrideList:
3694
         actionState = updateAction(requestAction, actionState)
3747
         actionState = updateAction(requestAction, actionState)
3695
         
3748
         
3696
-    if (own['actionState'] == 'reg_land' or own['actionState'] == 'reg_land') and own['actionTimer'] > 0:
3697
-        own['clear_request'] = 1    
3749
+#    if (own['actionState'] == 'reg_land' or own['actionState'] == 'reg_land') and own['actionTimer'] > 0:
3750
+#        own['clear_request'] = 1    
3698
   
3751
   
3699
 ###################  
3752
 ###################  
3700
     
3753
     
3705
     if trans_playing:
3758
     if trans_playing:
3706
         cur_frame = skater.getActionFrame(trans_layer)  
3759
         cur_frame = skater.getActionFrame(trans_layer)  
3707
         cur_frame = round(cur_frame, 2)     
3760
         cur_frame = round(cur_frame, 2)     
3708
-    print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
3761
+    #print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
3709
     cur_frame = skater.getActionFrame(trans_layer)
3762
     cur_frame = skater.getActionFrame(trans_layer)
3710
     #print(cur_frame)
3763
     #print(cur_frame)
3711
     def printplaying():
3764
     def printplaying():

+ 14
- 5
controller2.py View File

189
     fliplay = 470
189
     fliplay = 470
190
     MAX_VEL = 6.7
190
     MAX_VEL = 6.7
191
     SPEEDUP = .055
191
     SPEEDUP = .055
192
-    SPEEDPUMP = .12 #.09
193
-    SPEEDPUMPFAST = .14 #.13
192
+    SPEEDPUMP = .14 #.09
193
+    SPEEDPUMPFAST = .16 #.13
194
     PUMP_SPEED_SENS = .4
194
     PUMP_SPEED_SENS = .4
195
     PUMP_SENS = .98
195
     PUMP_SENS = .98
196
     ACCEL = 10
196
     ACCEL = 10
424
                     print('---requesting reg nose manual')
424
                     print('---requesting reg nose manual')
425
                     own['manual_v2_type'] = 'reg manual'                                          
425
                     own['manual_v2_type'] = 'reg manual'                                          
426
             if own['jump_stance'] == 1:
426
             if own['jump_stance'] == 1:
427
-                #print('flipstance 1')
427
+                print('flipstance 1')
428
                 if own['manual_v2_type'] == 'reg manual':
428
                 if own['manual_v2_type'] == 'reg manual':
429
                     own['manual_v2_type'] = 'fak nose manual'
429
                     own['manual_v2_type'] = 'fak nose manual'
430
                 if own['manual_v2_type'] == 'reg nose manual':
430
                 if own['manual_v2_type'] == 'reg nose manual':
4126
             print('::::::wallhit')
4126
             print('::::::wallhit')
4127
             force = (linVelocity.x * -.7, linVelocity.y, linVelocity.z )                    
4127
             force = (linVelocity.x * -.7, linVelocity.y, linVelocity.z )                    
4128
             own.setLinearVelocity(force, True)        
4128
             own.setLinearVelocity(force, True)        
4129
-
4129
+    
4130
+    def land_boost():
4131
+        linvelx = linVelocity.x
4132
+        lastx = own["linvelx"]
4133
+        if frames_since_ground < 2 and (abs(lastx) - abs(linvelx)) > .5:
4134
+            print('**_____________land boost')
4135
+            force = (lastx, linVelocity.y, linVelocity.z )                    
4136
+            own.setLinearVelocity(force, True)             
4137
+        
4138
+    
4130
     jump_Timer()
4139
     jump_Timer()
4131
     check_landing()
4140
     check_landing()
4132
     nextframe()
4141
     nextframe()
4149
     onboard()   
4158
     onboard()   
4150
     #wallhit() 
4159
     #wallhit() 
4151
     linvelx = own.getLinearVelocity(True)
4160
     linvelx = own.getLinearVelocity(True)
4152
-
4161
+    land_boost()
4153
     own["linvelx"] = linvelx.x
4162
     own["linvelx"] = linvelx.x
4154
     LAST_STANCE = STANCE
4163
     LAST_STANCE = STANCE
4155
     LAST_STANCE = own["stance"]
4164
     LAST_STANCE = own["stance"]

+ 68
- 28
npause.py View File

1
 import bge
1
 import bge
2
+import menuV3
3
+import Settings
2
 
4
 
3
 
5
 
6
+#replay huds:
7
+#add_hud
8
+#remove_hud (on control_cube)
9
+
4
 def main():
10
 def main():
5
 
11
 
6
     cont = bge.logic.getCurrentController()
12
     cont = bge.logic.getCurrentController()
7
     scene = bge.logic.getCurrentScene()
13
     scene = bge.logic.getCurrentScene()
8
-    own = cont.owner
14
+    #own = cont.owner
9
     dict = bge.logic.globalDict 
15
     dict = bge.logic.globalDict 
10
     
16
     
11
     skater = scene.objects["Char4"]
17
     skater = scene.objects["Char4"]
12
     deck = scene.objects["deck"]
18
     deck = scene.objects["deck"]
13
     trucks = scene.objects["trucks"]
19
     trucks = scene.objects["trucks"]
20
+    own = scene.objects["control_cube.002"]
21
+    
22
+    camList = scene.cameras
23
+    freecam = camList["freecam"] 
24
+    mcam = camList['Camera.003']   
25
+    
26
+    #freecam = scene.objects['freecam']
27
+    cube = scene.objects['control_cube.002']
14
     
28
     
15
     try:
29
     try:
16
         pause_state = dict['npause']
30
         pause_state = dict['npause']
59
         own['pre_pause_linvel'] = [own['linvelx'], own['linVely'], 0]
73
         own['pre_pause_linvel'] = [own['linvelx'], own['linVely'], 0]
60
         own.setLinearVelocity([0,0,0],1)  
74
         own.setLinearVelocity([0,0,0],1)  
61
         cont.activate(cont.actuators['empty'])
75
         cont.activate(cont.actuators['empty'])
62
-        cont.activate(cont.actuators['add_overlay']) 
63
-        printplaying()
76
+        if mcam['playback'] == False:
77
+            cont.activate(cont.actuators['add_overlay']) 
78
+            #pass
79
+        #printplaying()
80
+        cont.activate(cont.actuators['remove_stance'])  
81
+        cube['camera'] = 2
82
+        cube['camnum'] = 2 
83
+        scene.active_camera = freecam 
84
+        #print('set freecam', scene.active_camera)
85
+        freecam.lens = mcam['focal_length'] 
86
+        freecam.worldPosition = mcam.worldPosition
87
+        freecam.worldOrientation = mcam.worldOrientation                      
64
 
88
 
65
-    if pause_state == 1:        
66
-        layer = 450
67
-        if skater.isPlayingAction(layer):
68
-            skater.stopAction(layer)
69
-        if deck.isPlayingAction(layer):    
70
-            deck.stopAction(layer)
71
-        if trucks.isPlayingAction(layer):    
72
-            trucks.stopAction(layer)
73
-        layer = 460
74
-        if skater.isPlayingAction(layer):
75
-            skater.stopAction(layer)
76
-        if deck.isPlayingAction(layer):    
77
-            deck.stopAction(layer)
78
-        if trucks.isPlayingAction(layer):    
79
-            trucks.stopAction(layer)
80
-        layer = 470
81
-        if skater.isPlayingAction(layer):
82
-            skater.stopAction(layer)
83
-        if deck.isPlayingAction(layer):    
84
-            deck.stopAction(layer)
85
-        if trucks.isPlayingAction(layer):    
86
-            trucks.stopAction(layer)
87
-                                                            
89
+    if pause_state == 1: 
90
+        if mcam['playback'] == False:       
91
+            layer = 450
92
+            if skater.isPlayingAction(layer):
93
+                skater.stopAction(layer)
94
+            if deck.isPlayingAction(layer):    
95
+                deck.stopAction(layer)
96
+            if trucks.isPlayingAction(layer):    
97
+                trucks.stopAction(layer)
98
+            layer = 460
99
+            if skater.isPlayingAction(layer):
100
+                skater.stopAction(layer)
101
+            if deck.isPlayingAction(layer):    
102
+                deck.stopAction(layer)
103
+            if trucks.isPlayingAction(layer):    
104
+                trucks.stopAction(layer)
105
+            layer = 470
106
+            if skater.isPlayingAction(layer):
107
+                skater.stopAction(layer)
108
+            if deck.isPlayingAction(layer):    
109
+                deck.stopAction(layer)
110
+            if trucks.isPlayingAction(layer):    
111
+                trucks.stopAction(layer)
112
+        menuV3.main(cont)                                                    
88
         
113
         
89
         
114
         
90
         
115
         
91
     #exit pause     
116
     #exit pause     
92
     if pause_state == 0 and last_pause == 1:
117
     if pause_state == 0 and last_pause == 1:
93
         #print("unpause")
118
         #print("unpause")
119
+        Settings.writeSettings()
94
         own.restoreDynamics()
120
         own.restoreDynamics()
121
+        #own['camera'] = 0
95
         #own.setlinearVelocity([0,0,0],1] 
122
         #own.setlinearVelocity([0,0,0],1] 
96
-        cont.activate(cont.actuators['roll'])
123
+        
124
+        if own['walk'] == False:
125
+            cont.activate(cont.actuators['roll'])
126
+        else:
127
+            cont.activate(cont.actuators['walk'])    
97
         #print("pre_pause_linvel = ", own['pre_pause_linvel'])
128
         #print("pre_pause_linvel = ", own['pre_pause_linvel'])
98
         try:
129
         try:
99
             own.setLinearVelocity(own['pre_pause_linvel'], 1) 
130
             own.setLinearVelocity(own['pre_pause_linvel'], 1) 
100
         except:
131
         except:
101
             pass    
132
             pass    
102
-        cont.activate(cont.actuators['remove_overlay'])           
133
+        cont.activate(cont.actuators['remove_overlay'])  
134
+        cont.activate(cont.actuators['add_stance']) 
135
+        
136
+    if pause_state == 1 and dict['rtsBut'] == False and dict['last_rtsBut'] == True:
137
+        scenes = bge.logic.getSceneList()
138
+        if 'pause' in scenes:    
139
+            cont.activate(cont.actuators['remove_overlay']) 
140
+        else:
141
+            cont.activate(cont.actuators['add_overlay'])                                   
103
     #print(pause_state)
142
     #print(pause_state)
104
     dict['last_npause'] = pause_state
143
     dict['last_npause'] = pause_state
144
+    #print(scene.active_camera, cube['camera'])
105
     
145
     
106
 main()
146
 main()

+ 248
- 271
pause.py View File

59
     pstate = own["pstate"]
59
     pstate = own["pstate"]
60
     scene = bge.logic.getCurrentScene()
60
     scene = bge.logic.getCurrentScene()
61
     dict = bge.logic.globalDict
61
     dict = bge.logic.globalDict
62
-    resume = scene.objects["resume"]
63
-    settings = scene.objects["settings"]
62
+#    resume = scene.objects["resume"]
63
+#    settings = scene.objects["settings"]
64
     level = scene.objects["level"]
64
     level = scene.objects["level"]
65
     dict['level'] = level
65
     dict['level'] = level
66
-    levelselect = scene.objects["levelselect"]
67
-    restart = scene.objects["restart"]
68
-    exit = scene.objects["exit"]
69
-    submenu_on = own["submenu_on"]
70
-    level_text = scene.objects["level_text"]
71
-    level_text.resolution = 8
66
+#    levelselect = scene.objects["levelselect"]
67
+#    restart = scene.objects["restart"]
68
+#    exit = scene.objects["exit"]
69
+#    submenu_on = own["submenu_on"]
70
+#    level_text = scene.objects["level_text"]
71
+#    level_text.resolution = 8
72
     lastup = own["lastup"]
72
     lastup = own["lastup"]
73
     lastdown = own["lastdown"]
73
     lastdown = own["lastdown"]
74
     lastleft = own["lastleft"]
74
     lastleft = own["lastleft"]
78
     #sSelect = cont.actuators["sSelect"]
78
     #sSelect = cont.actuators["sSelect"]
79
     cont.deactivate(own.actuators['restart'])                                        
79
     cont.deactivate(own.actuators['restart'])                                        
80
     #joy down
80
     #joy down
81
-    if down == 1 and lastdown != 1:
82
-        #own.stopAction(0)
83
-        pstate = own["pstate"]
84
-                    
85
-        if pstate == 0 and submenu_on == 0:
86
-            resume.playAction("p_resume", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
87
-        if pstate == 1 and submenu_on == 0:
88
-            settings.playAction("p_settings", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
89
-        if pstate == 2 and submenu_on == 0:
90
-            level.playAction("p_level", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
91
-            #level.playAction("p_level_select", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
92
-        if pstate == 3 and submenu_on == 0:
93
-            restart.playAction("p_restart", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
94
-        if pstate == 4 and submenu_on == 0:
95
-            exit.playAction("p_exit", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)           
96
-            
97
-        if pstate < 4 and submenu_on == 0:
98
-            own["pstate"] = own["pstate"] + 1
99
-        if pstate == 4 and submenu_on == 0:
100
-            own["pstate"] = 0    
101
-        pstate = own["pstate"]
102
-        #print(pstate)   
103
-        cont.activate(own.actuators['sSelect']) 
104
-    #joy up    
105
-    if up == 1 and lastup != 1:
106
-        pstate = own["pstate"]
107
-                    
108
-        if pstate == 0 and submenu_on == 0:
109
-            resume.playAction("p_resume", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
110
-        if pstate == 1 and submenu_on == 0:
111
-            settings.playAction("p_settings", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
112
-        if pstate == 2 and submenu_on == 0:
113
-            level.playAction("p_level", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
114
-        if pstate == 3 and submenu_on == 0:
115
-            restart.playAction("p_restart", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
116
-        if pstate == 4 and submenu_on == 0:
117
-            exit.playAction("p_exit", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
118
-            
119
-            
120
-        if pstate > 0 and submenu_on == 0:
121
-            own["pstate"] = own["pstate"] - 1
122
-        if pstate == 0 and submenu_on == 0:
123
-            own["pstate"] = 4    
124
-        pstate = own["pstate"]
125
-        #print(pstate)    
126
-        cont.activate(own.actuators['sSelect'])  
127
-    if right == 1 and lastright !=1:
128
-        cont.activate(own.actuators['sSelect']) 
129
-    if left == 1 and lastleft != 1:    
130
-        cont.activate(own.actuators['sSelect'])
81
+#    if down == 1 and lastdown != 1:
82
+#        #own.stopAction(0)
83
+#        pstate = own["pstate"]
84
+#                    
85
+#        if pstate == 0 and submenu_on == 0:
86
+#            resume.playAction("p_resume", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
87
+#        if pstate == 1 and submenu_on == 0:
88
+#            settings.playAction("p_settings", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
89
+#        if pstate == 2 and submenu_on == 0:
90
+#            level.playAction("p_level", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
91
+#            #level.playAction("p_level_select", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
92
+#        if pstate == 3 and submenu_on == 0:
93
+#            restart.playAction("p_restart", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)
94
+#        if pstate == 4 and submenu_on == 0:
95
+#            exit.playAction("p_exit", 10,0, layer=1, priority=0, play_mode=0, speed=playspeed)           
96
+#            
97
+#        if pstate < 4 and submenu_on == 0:
98
+#            own["pstate"] = own["pstate"] + 1
99
+#        if pstate == 4 and submenu_on == 0:
100
+#            own["pstate"] = 0    
101
+#        pstate = own["pstate"]
102
+#        #print(pstate)   
103
+#        cont.activate(own.actuators['sSelect']) 
104
+#    #joy up    
105
+#    if up == 1 and lastup != 1:
106
+#        pstate = own["pstate"]
107
+#                    
108
+#        if pstate == 0 and submenu_on == 0:
109
+#            resume.playAction("p_resume", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
110
+#        if pstate == 1 and submenu_on == 0:
111
+#            settings.playAction("p_settings", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
112
+#        if pstate == 2 and submenu_on == 0:
113
+#            level.playAction("p_level", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
114
+#        if pstate == 3 and submenu_on == 0:
115
+#            restart.playAction("p_restart", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
116
+#        if pstate == 4 and submenu_on == 0:
117
+#            exit.playAction("p_exit", 10,0, layer=0, priority=0, play_mode=0, speed=playspeed)
118
+#            
119
+#            
120
+#        if pstate > 0 and submenu_on == 0:
121
+#            own["pstate"] = own["pstate"] - 1
122
+#        if pstate == 0 and submenu_on == 0:
123
+#            own["pstate"] = 4    
124
+#        pstate = own["pstate"]
125
+#        #print(pstate)    
126
+#        cont.activate(own.actuators['sSelect'])  
127
+#    if right == 1 and lastright !=1:
128
+#        cont.activate(own.actuators['sSelect']) 
129
+#    if left == 1 and lastleft != 1:    
130
+#        cont.activate(own.actuators['sSelect'])
131
         
131
         
132
 #level*****************************************************
132
 #level*****************************************************
133
 
133
 
134
-    if own["submenu"] == "level":
135
-        #print("submenu is level")
136
-        active_level_select = own["active_level_select"]
137
-        
138
-        import Settings
139
-        if left == 1 and lastleft != 1:
140
-            if active_level_select >= 0:
141
-               active_level_select -= 1
142
-            if active_level_select < 0:
143
-                active_level_select = 8    
144
-            #if active_level_select == -1:    
145
-                #active_level_select = 0
146
-        #print(active_level_select)        
147
-            #move up
148
-            #play up            
149
-        if right == 1 and lastright != 1:    
150
-            if active_level_select < 9:
151
-               active_level_select += 1               
152
-            if active_level_select == 9:
153
-                active_level_select = 0
154
-            if active_level_select == -1:    
155
-                active_level_select = 0
156
-        #print(active_level_select)                        
157
-            #move down
158
-            #play down
159
-        if active_level_select == 0:
160
-            level_text.text = "Empty Lot"
161
-        if active_level_select == 1:
162
-            level_text.text = "Waterfall"
163
-        if active_level_select == 2:
164
-            level_text.text = "Warehouse" 
165
-        if active_level_select == 3:
166
-            level_text.text = "City"          
167
-        if active_level_select == 4:
168
-            level_text.text = "Training"          
169
-        if active_level_select == 5:
170
-            level_text.text = "Spine" 
171
-        if active_level_select == 6:
172
-            level_text.text = "Apricot Park" 
173
-        if active_level_select == 7:
174
-            level_text.text = "Newday Bowl"                           
175
-        if active_level_select == 8:
176
-            level_text.text = "Garage 18"                                                                      
177
-        own["active_level_select"] = active_level_select 
178
-        load_timer = 100
179
-#indoor
180
-        if aBut == False and active_level_select == 0 and lasta == 1:
181
-            level_text.text = ""
182
-            cont.activate(own.actuators['loading']) 
183
-            level = "lot"
184
-            main_empty["level"] = "lot"
185
-            own["level"] = level
186
-            Settings.writeSettings()
187
-            #print("not")
188
-            Settings.readSettings()
189
-            #cont.activate(own.actuators['restart'])
190
-            dict['reload_timer'] = 250
191
-            dict['overlay_fadein'] = 1
192
-            #Settings.loadlevel() 
193
-            dict['load_timer'] = load_timer
194
-        else: 
195
-            
196
-            cont.deactivate(own.actuators['restart']) 
197
-#woodbowl               
198
-        if aBut == False and active_level_select == 1 and lasta == 1:
199
-            level_text.text = ""
200
-            #cont.activate(own.actuators['loading']) 
201
-            level = "mini_scene"
202
-            main_empty["level"] = "mini_scene"
203
-            own["level"] = level
204
-            Settings.writeSettings()
205
-            Settings.readSettings()
206
-            #cont.activate(own.actuators['restart']) 
207
-            dict['reload_timer'] = 250
208
-            dict['overlay_fadein'] = 1
209
-            #Settings.loadlevel()
210
-            dict['load_timer'] = load_timer
211
-        else: cont.deactivate(own.actuators['restart']) 
212
-#mini        
213
-        if aBut == False and active_level_select == 2 and lasta == 1:
214
-            level_text.text = ""
215
-            #cont.activate(own.actuators['loading']) 
216
-            level = "warehouse"
217
-            main_empty["level"] = "warehouse"
218
-            own["level"] = level
219
-            Settings.writeSettings()
220
-            Settings.readSettings()
221
-            #cont.activate(own.actuators['restart']) 
222
-            dict['reload_timer'] = 250
223
-            dict['overlay_fadein'] = 1
224
-            #Settings.loadlevel()
225
-            dict['load_timer'] = load_timer
226
-        else: cont.deactivate(own.actuators['restart'])
227
-#level3        
228
-        if aBut == False and active_level_select == 3 and lasta == 1:
229
-            level_text.text = ""
230
-            level = "city2"
231
-            main_empty["level"] = "city2"
232
-            own["level"] = level
233
-            Settings.writeSettings()
234
-            Settings.readSettings()
235
-            #cont.activate(own.actuators['restart']) 
236
-            dict['reload_timer'] = 250
237
-            dict['overlay_fadein'] = 1
238
-            #Settings.loadlevel()
239
-            dict['load_timer'] = load_timer
240
-        else: cont.deactivate(own.actuators['restart']) 
241
-#hubbas rail        
242
-        if aBut == False and active_level_select == 4 and lasta == 1:
243
-            level_text.text = ""
244
-            level = "train"
245
-            main_empty["level"] = "train"
246
-            own["level"] = level
247
-            Settings.writeSettings()
248
-            Settings.readSettings()
249
-            #cont.activate(own.actuators['restart']) 
250
-            dict['reload_timer'] = 250
251
-            dict['overlay_fadein'] = 1
252
-            #Settings.loadlevel()
253
-            dict['load_timer'] = load_timer
254
-        else: cont.deactivate(own.actuators['restart']) 
255
-#training        
256
-        if aBut == False and active_level_select == 5 and lasta == 1:
257
-            level_text.text = ""
258
-            level = "spine"
259
-            main_empty["level"] = "spine"
260
-            own["level"] = level
261
-            Settings.writeSettings()
262
-            Settings.readSettings()
263
-            #cont.activate(own.actuators['restart']) 
264
-            dict['reload_timer'] = 250
265
-            dict['overlay_fadein'] = 1
266
-            #Settings.loadlevel()
267
-            dict['load_timer'] = load_timer
268
-        else: cont.deactivate(own.actuators['restart'])  
269
-        if aBut == False and active_level_select == 6 and lasta == 1:
270
-            level_text.text = ""
271
-            level = "gt"
272
-            main_empty["level"] = "gt"
273
-            own["level"] = level
274
-            Settings.writeSettings()
275
-            Settings.readSettings()
276
-            #cont.activate(own.actuators['restart']) 
277
-            dict['reload_timer'] = 250
278
-            dict['overlay_fadein'] = 1
279
-            #Settings.loadlevel()
280
-            dict['load_timer'] = load_timer
281
-        else: cont.deactivate(own.actuators['restart']) 
282
-        if aBut == False and active_level_select == 7 and lasta == 1:
283
-            level_text.text = ""
284
-            level = "newday"
285
-            main_empty["level"] = "newday"
286
-            own["level"] = level
287
-            Settings.writeSettings()
288
-            Settings.readSettings()
289
-            #cont.activate(own.actuators['restart']) 
290
-            dict['reload_timer'] = 250
291
-            dict['overlay_fadein'] = 1
292
-            #Settings.loadlevel()
293
-            dict['load_timer'] = load_timer
294
-        else: cont.deactivate(own.actuators['restart']) 
295
-        if aBut == False and active_level_select == 8 and lasta == 1:
296
-            level_text.text = ""
297
-            level = "garage18"
298
-            main_empty["level"] = "garage18"
299
-            own["level"] = level
300
-            Settings.writeSettings()
301
-            Settings.readSettings()
302
-            #cont.activate(own.actuators['restart']) 
303
-            #Settings.loadlevel()
304
-            dict['load_timer'] = load_timer
305
-            dict['reload_timer'] = 250
306
-            dict['overlay_fadein'] = 1
307
-        else: cont.deactivate(own.actuators['restart'])                                               
308
-    else:
309
-        own["active_level_select"] = -1 
310
-    if bBut == True:    
311
-        levelselect.playAction("p_level_select", 10,0, layer=3, priority=0, play_mode=0, speed=playspeed)                                         
134
+#    if own["submenu"] == "level":
135
+#        #print("submenu is level")
136
+#        active_level_select = own["active_level_select"]
137
+#        
138
+#        import Settings
139
+#        if left == 1 and lastleft != 1:
140
+#            if active_level_select >= 0:
141
+#               active_level_select -= 1
142
+#            if active_level_select < 0:
143
+#                active_level_select = 8    
144
+#            #if active_level_select == -1:    
145
+#                #active_level_select = 0
146
+#        #print(active_level_select)        
147
+#            #move up
148
+#            #play up            
149
+#        if right == 1 and lastright != 1:    
150
+#            if active_level_select < 9:
151
+#               active_level_select += 1               
152
+#            if active_level_select == 9:
153
+#                active_level_select = 0
154
+#            if active_level_select == -1:    
155
+#                active_level_select = 0
156
+#        #print(active_level_select)                        
157
+#            #move down
158
+#            #play down
159
+#        if active_level_select == 0:
160
+#            level_text.text = "Empty Lot"
161
+#        if active_level_select == 1:
162
+#            level_text.text = "Waterfall"
163
+#        if active_level_select == 2:
164
+#            level_text.text = "Warehouse" 
165
+#        if active_level_select == 3:
166
+#            level_text.text = "City"          
167
+#        if active_level_select == 4:
168
+#            level_text.text = "Training"          
169
+#        if active_level_select == 5:
170
+#            level_text.text = "Spine" 
171
+#        if active_level_select == 6:
172
+#            level_text.text = "Apricot Park" 
173
+#        if active_level_select == 7:
174
+#            level_text.text = "Newday Bowl"                           
175
+#        if active_level_select == 8:
176
+#            level_text.text = "Garage 18"                                                                      
177
+#        own["active_level_select"] = active_level_select 
178
+#        load_timer = 100
179
+##indoor
180
+#        if aBut == False and active_level_select == 0 and lasta == 1:
181
+#            level_text.text = ""
182
+#            cont.activate(own.actuators['loading']) 
183
+#            level = "lot"
184
+#            main_empty["level"] = "lot"
185
+#            own["level"] = level
186
+#            Settings.writeSettings()
187
+#            #print("not")
188
+#            Settings.readSettings()
189
+#            #cont.activate(own.actuators['restart'])
190
+#            dict['reload_timer'] = 250
191
+#            dict['overlay_fadein'] = 1
192
+#            #Settings.loadlevel() 
193
+#            dict['load_timer'] = load_timer
194
+#        else: 
195
+#            
196
+#            cont.deactivate(own.actuators['restart']) 
197
+##woodbowl               
198
+#        if aBut == False and active_level_select == 1 and lasta == 1:
199
+#            level_text.text = ""
200
+#            #cont.activate(own.actuators['loading']) 
201
+#            level = "mini_scene"
202
+#            main_empty["level"] = "mini_scene"
203
+#            own["level"] = level
204
+#            Settings.writeSettings()
205
+#            Settings.readSettings()
206
+#            #cont.activate(own.actuators['restart']) 
207
+#            dict['reload_timer'] = 250
208
+#            dict['overlay_fadein'] = 1
209
+#            #Settings.loadlevel()
210
+#            dict['load_timer'] = load_timer
211
+#        else: cont.deactivate(own.actuators['restart']) 
212
+##mini        
213
+#        if aBut == False and active_level_select == 2 and lasta == 1:
214
+#            level_text.text = ""
215
+#            #cont.activate(own.actuators['loading']) 
216
+#            level = "warehouse"
217
+#            main_empty["level"] = "warehouse"
218
+#            own["level"] = level
219
+#            Settings.writeSettings()
220
+#            Settings.readSettings()
221
+#            #cont.activate(own.actuators['restart']) 
222
+#            dict['reload_timer'] = 250
223
+#            dict['overlay_fadein'] = 1
224
+#            #Settings.loadlevel()
225
+#            dict['load_timer'] = load_timer
226
+#        else: cont.deactivate(own.actuators['restart'])
227
+##level3        
228
+#        if aBut == False and active_level_select == 3 and lasta == 1:
229
+#            level_text.text = ""
230
+#            level = "city2"
231
+#            main_empty["level"] = "city2"
232
+#            own["level"] = level
233
+#            Settings.writeSettings()
234
+#            Settings.readSettings()
235
+#            #cont.activate(own.actuators['restart']) 
236
+#            dict['reload_timer'] = 250
237
+#            dict['overlay_fadein'] = 1
238
+#            #Settings.loadlevel()
239
+#            dict['load_timer'] = load_timer
240
+#        else: cont.deactivate(own.actuators['restart']) 
241
+##hubbas rail        
242
+#        if aBut == False and active_level_select == 4 and lasta == 1:
243
+#            level_text.text = ""
244
+#            level = "train"
245
+#            main_empty["level"] = "train"
246
+#            own["level"] = level
247
+#            Settings.writeSettings()
248
+#            Settings.readSettings()
249
+#            #cont.activate(own.actuators['restart']) 
250
+#            dict['reload_timer'] = 250
251
+#            dict['overlay_fadein'] = 1
252
+#            #Settings.loadlevel()
253
+#            dict['load_timer'] = load_timer
254
+#        else: cont.deactivate(own.actuators['restart']) 
255
+##training        
256
+#        if aBut == False and active_level_select == 5 and lasta == 1:
257
+#            level_text.text = ""
258
+#            level = "spine"
259
+#            main_empty["level"] = "spine"
260
+#            own["level"] = level
261
+#            Settings.writeSettings()
262
+#            Settings.readSettings()
263
+#            #cont.activate(own.actuators['restart']) 
264
+#            dict['reload_timer'] = 250
265
+#            dict['overlay_fadein'] = 1
266
+#            #Settings.loadlevel()
267
+#            dict['load_timer'] = load_timer
268
+#        else: cont.deactivate(own.actuators['restart'])  
269
+#        if aBut == False and active_level_select == 6 and lasta == 1:
270
+#            level_text.text = ""
271
+#            level = "gt"
272
+#            main_empty["level"] = "gt"
273
+#            own["level"] = level
274
+#            Settings.writeSettings()
275
+#            Settings.readSettings()
276
+#            #cont.activate(own.actuators['restart']) 
277
+#            dict['reload_timer'] = 250
278
+#            dict['overlay_fadein'] = 1
279
+#            #Settings.loadlevel()
280
+#            dict['load_timer'] = load_timer
281
+#        else: cont.deactivate(own.actuators['restart']) 
282
+#        if aBut == False and active_level_select == 7 and lasta == 1:
283
+#            level_text.text = ""
284
+#            level = "newday"
285
+#            main_empty["level"] = "newday"
286
+#            own["level"] = level
287
+#            Settings.writeSettings()
288
+#            Settings.readSettings()
289
+#            #cont.activate(own.actuators['restart']) 
290
+#            dict['reload_timer'] = 250
291
+#            dict['overlay_fadein'] = 1
292
+#            #Settings.loadlevel()
293
+#            dict['load_timer'] = load_timer
294
+#        else: cont.deactivate(own.actuators['restart']) 
295
+#        if aBut == False and active_level_select == 8 and lasta == 1:
296
+#            level_text.text = ""
297
+#            level = "garage18"
298
+#            main_empty["level"] = "garage18"
299
+#            own["level"] = level
300
+#            Settings.writeSettings()
301
+#            Settings.readSettings()
302
+#            #cont.activate(own.actuators['restart']) 
303
+#            #Settings.loadlevel()
304
+#            dict['load_timer'] = load_timer
305
+#            dict['reload_timer'] = 250
306
+#            dict['overlay_fadein'] = 1
307
+#        else: cont.deactivate(own.actuators['restart'])                                               
308
+#    else:
309
+#        own["active_level_select"] = -1 
310
+#    if bBut == True:    
311
+#        levelselect.playAction("p_level_select", 10,0, layer=3, priority=0, play_mode=0, speed=playspeed)                                         
312
 #**********************************************************   
312
 #**********************************************************   
313
 
313
 
314
 
314
 
315
 
315
 
316
-    if bBut == 1:
317
-        cont.activate(own.actuators['sBack']) 
318
-        #cont.activate(own.actuators['exit']) 
319
-        #print("bbut")
320
-    #go to level submenu        
321
-    if aBut == True and pstate == 2:
322
-        cont.activate(own.actuators['sEnter']) 
323
-        #cont.activate(own.actuators['quit']) 
324
-        #print("level")       
325
-        own["submenu_on"] = 1
326
-        own["submenu"] = "level"
327
-        level_text.text = "<choose>"
328
-        levelselect.playAction("p_level_select", -10,10, layer=3, priority=0, play_mode=0, speed=playspeed)
329
-    #exit submenu
330
-    if bBut and submenu_on == 1:
331
-        own["submenu_on"] = 0  
332
-        own["submenu"] = None  
333
-        level_text.text = "" 
334
-    
335
-    #exit    
336
-    if aBut == 1 and pstate == 4:
337
-        cont.activate(own.actuators['sEnter']) 
338
-        cont.activate(own.actuators['quit']) 
339
-        print("bbut")  
316
+ 
340
 
317
 
341
-    if pstate == 0 and submenu_on == 0 and lastpstate != 0:
342
-        resume.playAction("p_resume", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
343
-    if pstate == 1 and submenu_on == 0 and lastpstate != 1:
344
-        settings.playAction("p_settings", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
345
-    if pstate == 2 and submenu_on == 0 and lastpstate != 2:
346
-        level.playAction("p_level", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
347
-        #level.playAction("p_level_select", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
348
-    if pstate == 3 and submenu_on == 0 and lastpstate != 3:
349
-        restart.playAction("p_restart", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
350
-    if pstate == 4 and submenu_on == 0 and lastpstate != 4:
351
-        exit.playAction("p_exit", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)                
318
+#    if pstate == 0 and submenu_on == 0 and lastpstate != 0:
319
+#        resume.playAction("p_resume", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
320
+#    if pstate == 1 and submenu_on == 0 and lastpstate != 1:
321
+#        settings.playAction("p_settings", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
322
+#    if pstate == 2 and submenu_on == 0 and lastpstate != 2:
323
+#        level.playAction("p_level", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
324
+#        #level.playAction("p_level_select", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
325
+#    if pstate == 3 and submenu_on == 0 and lastpstate != 3:
326
+#        restart.playAction("p_restart", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)
327
+#    if pstate == 4 and submenu_on == 0 and lastpstate != 4:
328
+#        exit.playAction("p_exit", -10,10, layer=0, priority=0, play_mode=0, speed=playspeed)                
352
 
329
 
353
 
330
 
354
     #find the scene and object
331
     #find the scene and object

+ 61
- 4
scene_init.py View File

11
     level = dict['level']
11
     level = dict['level']
12
     scene = bge.logic.getCurrentScene()
12
     scene = bge.logic.getCurrentScene()
13
     cam = scene.objects['Camera.003']
13
     cam = scene.objects['Camera.003']
14
-    print("scene innnnnnnnnnnnnit1")
15
     curscene = bge.logic.getCurrentScene()
14
     curscene = bge.logic.getCurrentScene()
16
     
15
     
17
 #    scenes = bge.logic.getSceneList()
16
 #    scenes = bge.logic.getSceneList()
24
     scenes = bge.logic.getSceneList()
23
     scenes = bge.logic.getSceneList()
25
     own['pre_pause_linvel'] = 0.0
24
     own['pre_pause_linvel'] = 0.0
26
     #own['last_roll_frame'] = 0
25
     #own['last_roll_frame'] = 0
26
+    
27
+    
28
+    
29
+    
27
     for i in scenes:
30
     for i in scenes:
28
         if i.name == "main":
31
         if i.name == "main":
29
             main = i
32
             main = i
62
         #main.mistStart = 1
65
         #main.mistStart = 1
63
         #main.mistDistance = 5
66
         #main.mistDistance = 5
64
     elif level == 'pats':
67
     elif level == 'pats':
68
+        print('setting color of', curscene)
69
+        #main.world.zenithColor = [1.0, .9, .975, 0]
70
+        #main.world.horizonColor = [.42, .555, .823, 0]  
71
+        #cam['BC_BRIGHTNESS'] = 1.35
72
+        #cam['BC_CONTRAST'] = 1.3 
73
+       
74
+        #cam['avgL'] = .6
75
+        #cam['HDRamount'] = .45                 
76
+        #main.mistEnable = True
77
+        #main.mistIntensity = .9
78
+        #main.mistStart = 1
79
+        #main.mistDistance = 5 
80
+        
81
+    elif level == 'j_scene':
65
         print('setting color of', curscene)
82
         print('setting color of', curscene)
66
         main.world.zenithColor = [1.0, .9, .975, 0]
83
         main.world.zenithColor = [1.0, .9, .975, 0]
67
         main.world.horizonColor = [.42, .555, .823, 0]  
84
         main.world.horizonColor = [.42, .555, .823, 0]  
72
         #main.mistEnable = True
89
         #main.mistEnable = True
73
         #main.mistIntensity = .9
90
         #main.mistIntensity = .9
74
         #main.mistStart = 1
91
         #main.mistStart = 1
75
-        #main.mistDistance = 5        
92
+        #main.mistDistance = 5                
76
     else:
93
     else:
77
-        cam['BC_BRIGHTNESS'] = 1.0   
78
-        cam['BC_CONTRAST'] = 1.0
94
+        cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
95
+        cam['BC_CONTRAST'] = dict['BC_CONTRAST']
96
+        cam['bc'] = dict['bc']         
79
         main.world.zenithColor = [1.0, .9, .975, 0]
97
         main.world.zenithColor = [1.0, .9, .975, 0]
80
         main.world.horizonColor = [.42, .555, .823, 0] 
98
         main.world.horizonColor = [.42, .555, .823, 0] 
81
         #main.mistEnable = False        
99
         #main.mistEnable = False        
100
+    if dict['bc'] == 1:
101
+        cont.activate(cam.actuators["bc"])
82
 
102
 
103
+    else:
104
+        cont.activate(cam.actuators["bc_off"])  
105
+    if dict['hdr'] == 1:
106
+        cont.activate(cam.actuators["hdr"])
107
+
108
+    else:
109
+        cont.activate(cam.actuators["hdr_off"])
110
+                            
111
+    if dict['ao'] == 1:
112
+        cont.activate(cam.actuators["ao"])
113
+
114
+    else:
115
+        cont.activate(cam.actuators["ao_off"])                    
116
+
117
+    if dict['dof_on'] == 1:
118
+        cont.activate(cam.actuators["DOF"])
119
+
120
+    else:
121
+        cont.activate(cam.actuators["DOF_off"])
122
+    scene.world.envLightEnergy = dict['ambient_strength']   
123
+    
124
+    cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
125
+    cam['BC_CONTRAST'] = dict['BC_CONTRAST']
126
+    cam['bc'] = dict['bc']  
127
+    cam['hdr'] = dict['hdr']
128
+    cam['avgL'] = dict['avgL']
129
+    cam['HDRamount'] = dict['HDRamount']
130
+    cam['ao'] = dict['ao']  
131
+    cam['onlyAO'] = dict['onlyAO']
132
+    cam['aowidth'] = dict['aowidth']
133
+    cam['aoradius'] = dict['aoradius']  
134
+    cam['ambient_strength'] = dict['ambient_strength']
135
+    cam['sun_strength'] = dict['sun_strength']
136
+    cam['sun_pos_x'] = dict['sun_rot_x']
137
+    cam['sun_pos_y'] = dict['sun_rot_y']
138
+    cam['shadow_on'] = dict['shadow_on']    
139
+           
83
 main()
140
 main()

Loading…
Cancel
Save