Browse Source

char loading

shuvit 5 years ago
parent
commit
0e290c3f6b
8 changed files with 167 additions and 41 deletions
  1. 6
    4
      Settings.py
  2. 57
    19
      co_ActionState.py
  3. 24
    4
      grindV2.py
  4. 25
    0
      load_char.py
  5. 26
    4
      menuV3.py
  6. 4
    1
      music_player.py
  7. 18
    4
      scene_init.py
  8. 7
    5
      walk.py

+ 6
- 4
Settings.py View File

24
         #print lines[29]
24
         #print lines[29]
25
         reading.close()
25
         reading.close()
26
 
26
 
27
-    own["val"] = int(data[1])
28
-    own["bright"] = int(data[1])
27
+    #own["val"] = int(data[1])
28
+    #own["bright"] = int(data[1])
29
     own["playerName"] = data[4]
29
     own["playerName"] = data[4]
30
     #own["audio"] = int(data[3])
30
     #own["audio"] = int(data[3])
31
     own["level"] = data[5]
31
     own["level"] = data[5]
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['recorder_on'] = recorder_on  
56
+    dict['recorder_on'] = recorder_on 
57
+    character = data[1]
58
+    dict["character"] = str(character.split(None, 1)[0])
57
     dict["shirt_color_r"] = float(data[16])
59
     dict["shirt_color_r"] = float(data[16])
58
     dict["shirt_color_g"] = float(data[17])
60
     dict["shirt_color_g"] = float(data[17])
59
     dict["shirt_color_b"] = float(data[18])
61
     dict["shirt_color_b"] = float(data[18])
103
     print("writing called")
105
     print("writing called")
104
     with open(fileName, 'w') as writing:
106
     with open(fileName, 'w') as writing:
105
         writing.write(str("//settings.dat")+"\n")
107
         writing.write(str("//settings.dat")+"\n")
106
-        writing.write(str(own["val"])+"\n")
108
+        writing.write(str(dict["character"])+"\n")
107
         writing.write(str(own["bright"])+"\n")
109
         writing.write(str(own["bright"])+"\n")
108
         writing.write(str("-\n"))
110
         writing.write(str("-\n"))
109
         writing.write(str("//level (e.g. spine, city, city2)")+"\n")
111
         writing.write(str("//level (e.g. spine, city, city2)")+"\n")

+ 57
- 19
co_ActionState.py View File

80
         own['requestAction'] = 'empty'              
80
         own['requestAction'] = 'empty'              
81
 #================
81
 #================
82
     #stance change detection
82
     #stance change detection
83
-    if (requestAction == 'reg_roll' and l_actionState in ('fak_roll', 'fak_land', 'fak_pump_out', 'fak_nopos_out', 'fak_opos_out', 'fak_air-roll', 'fak_fs_powerslide_out', 'fak_bs_powerslide_out', 'fak_nmanual_out', 'fak_manual_out')) or l_actionState == 'fak_land' and (requestAction == 'reg_turnLeft' or requestAction == 'reg_turnRight' or requestAction == 'reg_turnLeft_out' or requestAction == 'reg_turnRight_out' or requestAction == 'reg_opos' or requestAction == 'reg_nopos' or requestAction == 'reg_pump' or requestAction == 'reg_push' or requestAction == 'reg_push_goof' or requestAction == 'fak_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('reg_turnLeft', 'reg_turnRight') and l_actionState in ('fak_turnLeft', 'fak_turnRight')):
83
+    if (requestAction == 'reg_roll' and l_actionState in ('fak_roll', 'fak_land', 'fak_pump_out', 'fak_nopos_out', 'fak_opos_out', 'fak_air-roll', 'fak_fs_powerslide_out', 'fak_bs_powerslide_out', 'fak_nmanual_out', 'fak_manual_out', 'fak_tailslide_out', 'fak_noseslide_out', 'fak_5050_out')) or l_actionState == 'fak_land' and (requestAction == 'reg_turnLeft' or requestAction == 'reg_turnRight' or requestAction == 'reg_turnLeft_out' or requestAction == 'reg_turnRight_out' or requestAction == 'reg_opos' or requestAction == 'reg_nopos' or requestAction == 'reg_pump' or requestAction == 'reg_push' or requestAction == 'reg_push_goof' or requestAction == 'fak_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('reg_turnLeft', 'reg_turnRight') and l_actionState in ('fak_turnLeft', 'fak_turnRight')):
84
         #print("fak-reg_roll")
84
         #print("fak-reg_roll")
85
         requestAction = 'fak-reg_roll'
85
         requestAction = 'fak-reg_roll'
86
         own['requestAction'] = 'fak-reg_roll' 
86
         own['requestAction'] = 'fak-reg_roll' 
87
-    if (requestAction == 'fak_roll' and l_actionState in ('reg_roll', 'reg_land', 'reg_pump_out', 'reg_nopos_out', 'reg_opos_out', 'reg_air-roll', 'reg_fs_powerslide_out', 'reg_bs_powerslide_out', 'reg_nmanual_out', 'reg_manual_out')) or l_actionState == 'reg_land' and (requestAction == 'fak_turnLeft' or requestAction == 'fak_turnRight' or requestAction == 'fak_turnLeft_out' or requestAction == 'fak_turnRight_out' or requestAction == 'fak_opos' or requestAction == 'fak_nopos' or requestAction == 'fak_pump' or requestAction == 'fak_push' or requestAction == 'reg_push_goof' or requestAction == 'reg_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('fak_turnLeft', 'fak_turnRight') and l_actionState in ('reg_turnLeft', 'reg_turnRight')):
87
+    if (requestAction == 'fak_roll' and l_actionState in ('reg_roll', 'reg_land', 'reg_pump_out', 'reg_nopos_out', 'reg_opos_out', 'reg_air-roll', 'reg_fs_powerslide_out', 'reg_bs_powerslide_out', 'reg_nmanual_out', 'reg_manual_out', 'reg_tailslide_out', 'reg_noseslide_out', 'reg_5050_out')) or l_actionState == 'reg_land' and (requestAction == 'fak_turnLeft' or requestAction == 'fak_turnRight' or requestAction == 'fak_turnLeft_out' or requestAction == 'fak_turnRight_out' or requestAction == 'fak_opos' or requestAction == 'fak_nopos' or requestAction == 'fak_pump' or requestAction == 'fak_push' or requestAction == 'reg_push_goof' or requestAction == 'reg_5050-roll') and requestAction not in ['reg_push', 'reg_push_goof', 'fak_push', 'fak_push_goof'] or (requestAction in ('fak_turnLeft', 'fak_turnRight') and l_actionState in ('reg_turnLeft', 'reg_turnRight')):
88
         #print("reg-fak_roll")
88
         #print("reg-fak_roll")
89
         requestAction = 'reg-fak_roll'
89
         requestAction = 'reg-fak_roll'
90
         own['requestAction'] = 'reg-fak_roll'
90
         own['requestAction'] = 'reg-fak_roll'
157
     if 'invert' in requestAction:
157
     if 'invert' in requestAction:
158
         actionTimer = 0
158
         actionTimer = 0
159
         own['actionTimer'] = 0    
159
         own['actionTimer'] = 0    
160
-            
160
+    
161
+    
162
+    #dirty stall fix
163
+    fixer = 0
164
+    if requestAction in ['reg_5050', 'reg_tailslide', 'reg_noseslide'] and actionState in ['reg_pump_out', 'fak_nopos_out'] and actionTimer > 10:
165
+        fixer = 1 
166
+    if requestAction in ['fak_5050', 'fak_tailslide', 'fak_noseslide'] and actionState in ['fak_pump_out', 'fak_nopos_out'] and actionTimer > 10:
167
+        fixer = 1             
168
+        
169
+    if fixer == 1:    
170
+        actionTimer = 0
171
+        own['actionTimer'] = 0  
172
+        stopActs()              
173
+    
161
     #grind override
174
     #grind override
162
 #    if requestAction in pump_out_overList and requestAction != l_requestAction and l_actionState not in jump_overrideList:
175
 #    if requestAction in pump_out_overList and requestAction != l_requestAction and l_actionState not in jump_overrideList:
163
 #            skater.stopAction(loop_layer)
176
 #            skater.stopAction(loop_layer)
200
                 requestAction = 'reg_turnRight_out'
213
                 requestAction = 'reg_turnRight_out'
201
                 actionState = 'reg_turnRight_out'
214
                 actionState = 'reg_turnRight_out'
202
             elif requestAction == 'reg_pump_right':
215
             elif requestAction == 'reg_pump_right':
203
-                requestAction = 'reg_right-pump'    
216
+                requestAction = 'reg_right-pump' 
217
+                   
204
         if l_actionState == 'reg_turnLeft':
218
         if l_actionState == 'reg_turnLeft':
205
             if requestAction not in ['reg_turnLeft', 'reg_pump_left', 'reg_pump']:
219
             if requestAction not in ['reg_turnLeft', 'reg_pump_left', 'reg_pump']:
206
                 requestAction = 'reg_turnLeft_out'
220
                 requestAction = 'reg_turnLeft_out'
251
             actionState = 'fak_pump_right-right'                        
265
             actionState = 'fak_pump_right-right'                        
252
             
266
             
253
 #**********************************            
267
 #**********************************            
254
-        if l_actionState == 'reg_pump' and requestAction not in ['reg_pump', 'reg_pump_left', 'reg_pump_right'] and requestAction not in pump_out_overList:
268
+        if l_actionState == 'reg_pump' and requestAction not in ['reg_pump', 'reg_pump_left', 'reg_pump_right', 'reg_5050'] and requestAction not in pump_out_overList:
255
             requestAction = 'reg_pump_out'
269
             requestAction = 'reg_pump_out'
256
             actionState = 'reg_pump_out' 
270
             actionState = 'reg_pump_out' 
257
-            
271
+        if l_actionState == 'reg_pump' and requestAction == 'reg_5050':
272
+            requestAction = 'reg_5050'
273
+            actionState = 'reg_5050'    
258
         if l_actionState == 'fak_pump' and requestAction not in ['fak_pump', 'fak_pump_right', 'fak_pump_left'] and requestAction not in pump_out_overList:
274
         if l_actionState == 'fak_pump' and requestAction not in ['fak_pump', 'fak_pump_right', 'fak_pump_left'] and requestAction not in pump_out_overList:
259
             requestAction = 'fak_pump_out'
275
             requestAction = 'fak_pump_out'
260
             actionState = 'fak_pump_out'            
276
             actionState = 'fak_pump_out'            
577
             actionState = 'reg_pump_right-rightb' 
593
             actionState = 'reg_pump_right-rightb' 
578
             
594
             
579
         if l_actionState == 'reg_pump_right-rightb' and requestAction == 'reg_roll':
595
         if l_actionState == 'reg_pump_right-rightb' and requestAction == 'reg_roll':
580
-            requestAction = 'reg_turnRight_out'
581
-            actionState = 'reg_turnRight_out'
596
+            requestAction = 'reg_turnRight'
597
+            actionState = 'reg_turnRight'
582
             
598
             
583
         if l_actionState == 'reg_right-pump' and requestAction == 'reg_roll':
599
         if l_actionState == 'reg_right-pump' and requestAction == 'reg_roll':
584
             requestAction = 'reg_pump_out'
600
             requestAction = 'reg_pump_out'
717
             requestAction = 'reg_air-roll'              
733
             requestAction = 'reg_air-roll'              
718
             
734
             
719
             
735
             
736
+        if l_actionState == 'reg_land' and requestAction in ['reg_pump_left', 'reg_pump_right']:
737
+            requestAction = 'reg_pump_in'
738
+        if l_actionState == 'fak_land' and requestAction in ['fak_pump_left', 'fak_pump_right']:
739
+            requestAction = 'fak_pump_in'  
740
+        
741
+        if l_actionState in ['reg_pump_right', 'reg_pump_left'] and requestAction == 'reg_roll':
742
+            requestAction = 'reg_pump_out'        
743
+        if l_actionState in ['fak_pump_right', 'fak_pump_left'] and requestAction == 'fak_roll':
744
+            requestAction = 'fak_pump_out'     
745
+        if l_actionState in ['reg_left-pump', 'reg_right-pump'] and requestAction == 'reg_roll':
746
+            requestAction = 'reg_pump_out' 
747
+        if l_actionState in ['fak_left-pump', 'fak_right-pump'] and requestAction == 'reg_roll':
748
+            requestAction = 'fak_pump_out' 
720
             
749
             
750
+        if l_actionState in ['reg_pump_right-rightb'] and requestAction == 'reg_roll':
751
+            requestAction = 'reg_right_out'
752
+            print('asd;fjas;fjas;fkjs;fkjsa;kfjs;afkjs;dkfjs;fkjas;dkfjs;fj')                                
721
             
753
             
722
 #        if (l_actionState == 'fak_air-roll' and requestAction == 'fak_manual'):
754
 #        if (l_actionState == 'fak_air-roll' and requestAction == 'fak_manual'):
723
 #            actionTimer = 0
755
 #            actionTimer = 0
790
                 trucks.playAction("a_fak_dropin", 60,80, layer=trans_layer, play_mode=0, speed=.75)    
822
                 trucks.playAction("a_fak_dropin", 60,80, layer=trans_layer, play_mode=0, speed=.75)    
791
 
823
 
792
             if requestAction == 'reg_turnRight_out':
824
             if requestAction == 'reg_turnRight_out':
793
-                stopActs()
825
+                #stopActs()
794
                 actionState = 'reg_turnRight_out'
826
                 actionState = 'reg_turnRight_out'
795
                 own['actionTimer'] = 19
827
                 own['actionTimer'] = 19
796
                 trans_playing = skater.isPlayingAction(trans_layer)
828
                 trans_playing = skater.isPlayingAction(trans_layer)
797
                 if trans_playing:
829
                 if trans_playing:
798
                     cur_frame = skater.getActionFrame(trans_layer)
830
                     cur_frame = skater.getActionFrame(trans_layer)
799
                                   
831
                                   
800
-                if trans_playing and cur_frame > .5:                
832
+                if trans_playing and cur_frame > .5 and cur_frame < 39:                
801
                     skater.playAction("nreg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
833
                     skater.playAction("nreg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
802
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
834
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
803
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
835
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
804
-                    own['actionTimer'] = (10 - cur_frame) 
805
-                else:                      
836
+                    #own['actionTimer'] = (10 - cur_frame) 
837
+                    own['actionTimer'] = cur_frame
838
+                else:        
839
+                    print('play from start', trans_playing)              
806
                     skater.playAction("nreg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
840
                     skater.playAction("nreg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
807
                     deck.playAction("a_reg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
841
                     deck.playAction("a_reg_right", 10,1, layer=trans_layer, play_mode=0, speed=.5)
808
                     trucks.playAction("a_reg", 10,1, layer=trans_layer, play_mode=0, speed=.5)                   
842
                     trucks.playAction("a_reg", 10,1, layer=trans_layer, play_mode=0, speed=.5)                   
881
                 
915
                 
882
             if requestAction == 'fak_pump_right-right':
916
             if requestAction == 'fak_pump_right-right':
883
                 actionState = 'fak_pump_right-right'
917
                 actionState = 'fak_pump_right-right'
918
+                own['actionState'] = 'fak_pump_right-right'
884
                 own['actionTimer'] = 19
919
                 own['actionTimer'] = 19
885
                     
920
                     
886
                 skater.playAction("nfak_pump_right", 40,30, layer=trans_layer, play_mode=0, speed=.5)
921
                 skater.playAction("nfak_pump_right", 40,30, layer=trans_layer, play_mode=0, speed=.5)
891
      
926
      
892
             if requestAction == 'reg_pump_right-rightb':
927
             if requestAction == 'reg_pump_right-rightb':
893
                 actionState = 'reg_pump_right-rightb'
928
                 actionState = 'reg_pump_right-rightb'
894
-                own['actionTimer'] = 19
929
+                own['actionState'] = 'reg_pump_right-rightb'
930
+                own['actionTimer'] = 20
895
                     
931
                     
896
                 skater.playAction("nreg_pump_right", 30,40, layer=trans_layer, play_mode=0, speed=.5)
932
                 skater.playAction("nreg_pump_right", 30,40, layer=trans_layer, play_mode=0, speed=.5)
897
                 deck.playAction("a_reg_right", 10,10, layer=trans_layer, play_mode=0, speed=.5)
933
                 deck.playAction("a_reg_right", 10,10, layer=trans_layer, play_mode=0, speed=.5)
951
                 trans_playing = skater.isPlayingAction(trans_layer)
987
                 trans_playing = skater.isPlayingAction(trans_layer)
952
                 if trans_playing:
988
                 if trans_playing:
953
                     cur_frame = skater.getActionFrame(trans_layer)
989
                     cur_frame = skater.getActionFrame(trans_layer)
954
-                if trans_playing and cur_frame > .5:                
990
+                if trans_playing and cur_frame > .5 and cur_frame < 38:                
955
                     skater.playAction("nreg_pump_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
991
                     skater.playAction("nreg_pump_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
956
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
992
                     deck.playAction("a_reg_right", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
957
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
993
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=.5)
2679
                 skater.playAction('reg_fak_nosegr', 10,1, layer=trans_layer, play_mode=0, speed=1)
2715
                 skater.playAction('reg_fak_nosegr', 10,1, layer=trans_layer, play_mode=0, speed=1)
2680
                 deck.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)
2716
                 deck.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)
2681
                 trucks.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)                                                
2717
                 trucks.playAction('a_reg_nosegR', 10,10, layer=trans_layer, play_mode=0, speed=1)                                                
2682
-
2718
+        own['actionState'] = actionState
2683
    
2719
    
2684
 #######################################        
2720
 #######################################        
2685
         #loop actions 
2721
         #loop actions 
2860
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2896
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2861
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2897
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2862
                         #print(cur_frame)
2898
                         #print(cur_frame)
2863
-                    else:    
2899
+                    else:   
2900
+                        own['actionTimer'] = 20 
2864
                         skater.playAction("nreg_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
2901
                         skater.playAction("nreg_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
2865
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2902
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2866
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2903
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2967
                         skater.playAction("nfak_pump_in", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
3004
                         skater.playAction("nfak_pump_in", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2968
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
3005
                         deck.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2969
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
3006
                         trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=0, speed=1)
2970
-                    else:    
3007
+                    else:   
3008
+                        own['actionTimer'] = 20 
2971
                         skater.playAction("nfak_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
3009
                         skater.playAction("nfak_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=1)
2972
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
3010
                         deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
2973
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
3011
                         trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=0, speed=1)
4266
     if trans_playing:
4304
     if trans_playing:
4267
         cur_frame = skater.getActionFrame(trans_layer)  
4305
         cur_frame = skater.getActionFrame(trans_layer)  
4268
         cur_frame = round(cur_frame, 2)     
4306
         cur_frame = round(cur_frame, 2)     
4269
-    #print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
4270
-    print("rA:", requestAction, "|aS:", own['actionState'], own['actionTimer'], 'cf', cur_frame)
4307
+    print("oG: ", og_request, "rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'], 'cf', cur_frame)
4308
+    #print("rA:", requestAction, "|aS:", own['actionState'], own['actionTimer'], 'cf', cur_frame)
4271
     cur_frame = skater.getActionFrame(trans_layer)
4309
     cur_frame = skater.getActionFrame(trans_layer)
4272
     #print(cur_frame)
4310
     #print(cur_frame)
4273
     def printplaying():
4311
     def printplaying():

+ 24
- 4
grindV2.py View File

43
     #print(roty)
43
     #print(roty)
44
     roty = abs(roty) 
44
     roty = abs(roty) 
45
     sub = 0
45
     sub = 0
46
-    align_strength = .3
46
+    align_strength = .1#.3
47
     align_strength2 = .2
47
     align_strength2 = .2
48
     touched = grindTouch.triggered
48
     touched = grindTouch.triggered
49
     lgf = own['last_grind_frame']
49
     lgf = own['last_grind_frame']
224
 
224
 
225
         #z align
225
         #z align
226
         #print("zalign") 
226
         #print("zalign") 
227
-        stre = .15
227
+        stre = .15#.075#.15
228
         player.alignAxisToVect(grinder_vectz, 2, stre)                                                  
228
         player.alignAxisToVect(grinder_vectz, 2, stre)                                                  
229
         
229
         
230
         if rot >= 0 and rot < 45:
230
         if rot >= 0 and rot < 45:
652
         except:
652
         except:
653
             pass    
653
             pass    
654
     if ray.triggered == False:
654
     if ray.triggered == False:
655
-        own["nogrindsound"] = 1                               
655
+        own["nogrindsound"] = 1 
656
+    def slow_roty():
657
+      #print(abs(roty - own['last_roty']))
658
+      #print(roty)                
659
+      
660
+      #if roted > 5:
661
+        #pass
662
+        #align slow  
663
+        constraint = cont.actuators['gConstraint']
664
+        if (own['framenum'] - own['grind_start_frame'] < 40) and touched == 1:
665
+          #print('limit rot')              
666
+          #constraint.damp = 80
667
+        #else:
668
+          #constraint.damp = 30
669
+        #constraint.rotDamp = 80
670
+            cont.activate(constraint) 
671
+        else:
672
+            cont.deactivate(constraint)      
656
     timer()    
673
     timer()    
657
     aligntimer()
674
     aligntimer()
658
-    stop_bounce()   
675
+    stop_bounce() 
676
+    slow_roty()
677
+      
659
                    
678
                    
660
     own['grindOld'] = grindold 
679
     own['grindOld'] = grindold 
661
     own['test'] = test
680
     own['test'] = test
665
     own['grindTouch'] = grindTouch.triggered
684
     own['grindTouch'] = grindTouch.triggered
666
     own["grindDar_timer"] = grindDar_timer
685
     own["grindDar_timer"] = grindDar_timer
667
     own["last_grindDar"] = last_grindDar
686
     own["last_grindDar"] = last_grindDar
687
+    own['last_roty'] = roty
668
     linVelocity3 = own.getLinearVelocity(True)
688
     linVelocity3 = own.getLinearVelocity(True)
669
     set_pregrind_vel()
689
     set_pregrind_vel()
670
     own['last_z'] = own.worldPosition.z
690
     own['last_z'] = own.worldPosition.z

+ 25
- 0
load_char.py View File

1
+
2
+import bge
3
+
4
+
5
+
6
+def main(cont):
7
+    own = cont.owner
8
+    scene = bge.logic.getCurrentScene()
9
+    actu = cont.actuators['start_level']
10
+    dict = bge.logic.globalDict
11
+    mainDir = bge.logic.expandPath("//")
12
+    
13
+    fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
14
+    
15
+    path = bge.logic.expandPath(fileName)
16
+    bge.logic.LibLoad(path, 'Scene')  
17
+    
18
+    
19
+#    fileName = mainDir + "characters/sun.blend"    
20
+#    
21
+#    path = bge.logic.expandPath(fileName)
22
+#    bge.logic.LibLoad(path, 'Scene')      
23
+
24
+
25
+    cont.activate(actu)

+ 26
- 4
menuV3.py View File

2
 keyboard = bge.logic.keyboard
2
 keyboard = bge.logic.keyboard
3
 JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
3
 JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED
4
 
4
 
5
+player_list = ['annie', 'billy', 'fred', 'becky', 'kevin', 'ralph']               
5
 
6
 
6
 #exit functions
7
 #exit functions
7
 #=======
8
 #=======
575
             dict['reload_timer'] = 250
576
             dict['reload_timer'] = 250
576
             dict['overlay_fadein'] = 1              
577
             dict['overlay_fadein'] = 1              
577
                                          
578
                                          
578
-                                         
579
+    if funct in player_list:
580
+        if motion == 'inc':
581
+            dict['character'] = funct
582
+            Settings.writeSettings()
583
+            Settings.readSettings()
584
+            dict['load_timer'] = load_timer
585
+            dict['reload_timer'] = 250
586
+            dict['overlay_fadein'] = 1  
587
+            
588
+#    if funct == 'billy':
589
+#        if motion == 'inc':
590
+#            dict['character'] = 'billy'
591
+#            Settings.writeSettings()
592
+#            Settings.readSettings()
593
+#            dict['load_timer'] = load_timer
594
+#            dict['reload_timer'] = 250
595
+#            dict['overlay_fadein'] = 1                                                       
579
 #'1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen'                            
596
 #'1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen'                            
580
     if funct == '1920x1080':
597
     if funct == '1920x1080':
581
         #pass
598
         #pass
661
     if dict['mlevel'] == 2:
678
     if dict['mlevel'] == 2:
662
         if dict['lv1_opt'] == 'player':
679
         if dict['lv1_opt'] == 'player':
663
         #if opt == 'settings':
680
         #if opt == 'settings':
664
-            dict['current_list'] = ['shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo']            
681
+            dict['current_list'] = ['character', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo']            
665
 
682
 
666
     if dict['mlevel'] == 2:
683
     if dict['mlevel'] == 2:
667
         if dict['lv1_opt'] == 'level':
684
         if dict['lv1_opt'] == 'level':
685
         if dict['lv2_opt'] == 'dof':
702
         if dict['lv2_opt'] == 'dof':
686
             dict['current_list'] = ['dof on']  
703
             dict['current_list'] = ['dof on']  
687
         if dict['lv2_opt'] == 'bloom':
704
         if dict['lv2_opt'] == 'bloom':
688
-            dict['current_list'] = ['bloom on']                
705
+            dict['current_list'] = ['bloom on']  
706
+            
707
+        if dict['lv2_opt'] == 'character':
708
+            dict['current_list'] = player_list   
689
 
709
 
690
 def get_inputs(dict, cont):
710
 def get_inputs(dict, cont):
691
     import aud
711
     import aud
812
     dict['mlevel'] = 0
832
     dict['mlevel'] = 0
813
     dict['current_opt'] = ''
833
     dict['current_opt'] = ''
814
     dict['pause_menu_text'] = ''
834
     dict['pause_menu_text'] = ''
815
-    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics']
835
+    dict['menu_end_points'] = ['exit', 'restart', 'shirt color r', 'shirt color g', 'shirt color b', 'shoe color r', 'shoe color g', 'shoe color b','deck color r', 'deck color g', 'deck color b', 'shirt logo', 'brightness / contrast on', 'brightness value', 'contrast value', 'hdr on', 'avgL', 'hdr strength', 'ao on', 'ao radius', 'ao width', 'ao only', 'dof on', 'sun strength', 'sun rot x', 'sun rot y', 'shadow on', 'ambient strength', 'Demo Scene', 'Empty Lot', 'Park A', 'Training', 'Spine', 'Warehouse', 'Shop', '1920x1080', '1280x720', '1024x768', '800x600', 'fullscreen', 'bloom on', 'cam height', 'focal length', 'min dist', 'max dist', 'enter replay', 'recorder on', 'record length', 'enter replay (press back button)', 'recorder on', 'record length (n/a)', 'physics',] + player_list
816
     
836
     
817
 def output(dict):
837
 def output(dict):
818
     try:
838
     try:
918
             outp = outp + '(2.4): ' + str(dict['cam_max'])  
938
             outp = outp + '(2.4): ' + str(dict['cam_max'])  
919
         if dict['current_opt'] ==  'recorder on':
939
         if dict['current_opt'] ==  'recorder on':
920
             outp = outp + ': ' + str(dict['recorder_on']) 
940
             outp = outp + ': ' + str(dict['recorder_on']) 
941
+#        if dict['current_opt'] ==  'character':
942
+#            outp = outp + ': ' + str(dict['character'])             
921
                                 
943
                                 
922
             
944
             
923
     dict['pause_menu_text'] = outp
945
     dict['pause_menu_text'] = outp

+ 4
- 1
music_player.py View File

97
 def initer(cont):
97
 def initer(cont):
98
     #cont = bge.logic.getCurrentController()
98
     #cont = bge.logic.getCurrentController()
99
     own = cont.owner
99
     own = cont.owner
100
+    dict = bge.logic.globalDict
101
+    if 'playback' not in dict:
102
+        dict['playback'] = True
100
     if 'mp_inited' not in own:
103
     if 'mp_inited' not in own:
101
         own['mp_inited'] = True
104
         own['mp_inited'] = True
102
         print('Initializing music player')
105
         print('Initializing music player')
103
-        dict = bge.logic.globalDict
106
+        
104
         file_list = os.listdir(directory) 
107
         file_list = os.listdir(directory) 
105
         dict['mu_lib'] = file_list
108
         dict['mu_lib'] = file_list
106
         dict['mu_playlist'] = file_list
109
         dict['mu_playlist'] = file_list

+ 18
- 4
scene_init.py View File

3
 
3
 
4
 def main():
4
 def main():
5
     import bge
5
     import bge
6
+    #import GameLogic
6
     cont = bge.logic.getCurrentController()
7
     cont = bge.logic.getCurrentController()
7
     own = cont.owner
8
     own = cont.owner
8
     dict = bge.logic.globalDict
9
     dict = bge.logic.globalDict
23
     scenes = bge.logic.getSceneList()
24
     scenes = bge.logic.getSceneList()
24
     own['pre_pause_linvel'] = 0.0
25
     own['pre_pause_linvel'] = 0.0
25
     #own['last_roll_frame'] = 0
26
     #own['last_roll_frame'] = 0
26
-    
27
-    
28
-    
27
+  
28
+
29
+    objList = scene.objects
30
+
31
+    # get object named MainCharacter
32
+    parent = objList["control_cube.002"]
33
+
34
+    # combine child's shape with parent's
35
+    compound = True
36
+    obj = scene.objects['Char4']
37
+    # child is solid
38
+    ghost = False
39
+    # set parent
40
+    obj.setParent( parent, compound, ghost)  
41
+  
29
     
42
     
30
     for i in scenes:
43
     for i in scenes:
31
         if i.name == "main":
44
         if i.name == "main":
159
     own['transition_timer'] = 0
172
     own['transition_timer'] = 0
160
     own['transitioning'] = 0
173
     own['transitioning'] = 0
161
     own['driving'] = False
174
     own['driving'] = False
162
-           
175
+    own['last_roty'] = 0.0
176
+       
163
 main()
177
 main()

+ 7
- 5
walk.py View File

61
 skater = scene.objects["Char4"]
61
 skater = scene.objects["Char4"]
62
 deck = scene.objects["deck"]
62
 deck = scene.objects["deck"]
63
 trucks = scene.objects["trucks"]
63
 trucks = scene.objects["trucks"]
64
-
64
+camobj = scene.objects['camobj']
65
 throw_deck_empty = scene.objects["throw_deck_empty"]
65
 throw_deck_empty = scene.objects["throw_deck_empty"]
66
 wheel1 = scene.objects["rollen.000"]
66
 wheel1 = scene.objects["rollen.000"]
67
 wheel2 = scene.objects["rollen.001"]
67
 wheel2 = scene.objects["rollen.001"]
303
     cont.deactivate(camobj.actuators['camUp'])     
303
     cont.deactivate(camobj.actuators['camUp'])     
304
                 
304
                 
305
 #----------------
305
 #----------------
306
-camera.height = .9 #-.4
307
-camera.min = 1.5
308
-camera.max = 2
306
+camera.height = .01 #.9
307
+camera.min = 1.75
308
+camera.max = 2.25
309
 lasty = own['lasty']     
309
 lasty = own['lasty']     
310
 
310
 
311
 def onboard():
311
 def onboard():
323
         own['grindrail_vol'] = 0
323
         own['grindrail_vol'] = 0
324
         own['grindrail_pitch'] = 0 
324
         own['grindrail_pitch'] = 0 
325
         own['sroll_vol'] = 0
325
         own['sroll_vol'] = 0
326
-        own['sroll_pitch'] = 0                 
326
+        own['sroll_pitch'] = 0   
327
+        
328
+        #camobj.worldPosition.z += 4              
327
         try:
329
         try:
328
             vel = own['offboard_vel']
330
             vel = own['offboard_vel']
329
             vel = [velx, vel.y, vel.z]           
331
             vel = [velx, vel.y, vel.z]           

Loading…
Cancel
Save