Browse Source

misc stuff

shuvit 6 years ago
parent
commit
ac673f95ec
4 changed files with 109 additions and 38 deletions
  1. 66
    31
      co_ActionState.py
  2. 38
    4
      controller2.py
  3. 3
    3
      grindV2.py
  4. 2
    0
      pause.py

+ 66
- 31
co_ActionState.py View File

@@ -33,16 +33,17 @@ def main():
33 33
         queueAction = own['queueAction']
34 34
         actionTimer = own['actionTimer']
35 35
     except:
36
-        print("init")
37
-        own['actionState'] = 'empty'
36
+        #print("init")
37
+        own['actionState'] = 'reg_walk'
38 38
         own['l_actionState'] = 'empty'        
39
-        own['requestAction'] = 'empty'    
39
+        own['requestAction'] = 'reg_walk'    
40 40
         own['l_requestAction'] = 'empty'
41 41
         own['queueAction'] = 'empty'
42 42
         own['actionTimer'] = 0
43
+        own['clear_request'] = 0
43 44
         actionTimer = 0
44 45
         queueAction = 'empty'
45
-        requestAction = 'empty'
46
+        requestAction = 'reg_walk'
46 47
         actionState = 'empty'
47 48
         l_actionState = 'empty'
48 49
         l_requestAction = 'empty'
@@ -54,6 +55,10 @@ def main():
54 55
     transPlaying = skater.isPlayingAction(trans_layer)
55 56
     #if isplaying  == False:    
56 57
         #own['actionTimer'] = 0
58
+        
59
+    if own['clear_request'] == 1:
60
+        requestAction = 'empty'
61
+        own['clear_request'] = 0    
57 62
     if own['actionTimer'] != 0 and transPlaying == False and isplaying == False:
58 63
         own['actionTimer'] = 0
59 64
         actionTimer = 0
@@ -133,7 +138,7 @@ def main():
133 138
             
134 139
     #check last actionState to see if an out action is needed
135 140
     
136
-    elif requestAction not in jump_overrideList:
141
+    if requestAction not in jump_overrideList:
137 142
         if l_actionState == 'reg_turnRight' and requestAction != 'reg_turnRight':
138 143
             requestAction = 'reg_turnRight_out'
139 144
             actionState = 'reg_turnRight_out'
@@ -160,12 +165,26 @@ def main():
160 165
             requestAction = 'fak_nopos_out'
161 166
             actionState = 'fak_nopos_out' 
162 167
             
168
+#        if l_actionState == 'reg_pump_out_hold' and requestAction != 'reg_pump' and requestAction not in pump_out_overList:
169
+#            requestAction = 'reg_pump_out'
170
+#            actionState = 'reg_pump_out' 
171
+            
172
+            
163 173
         if l_actionState == 'reg_pump' and requestAction != 'reg_pump' and requestAction not in pump_out_overList:
164 174
             requestAction = 'reg_pump_out'
165 175
             actionState = 'reg_pump_out' 
176
+            
177
+            
178
+                        
179
+#        if l_actionState == 'fak_pump_out_hold' and requestAction != 'fak_pump' and requestAction not in pump_out_overList:
180
+#            requestAction = 'fak_pump_out'
181
+#            actionState = 'fak_pump_out'
182
+            
166 183
         if l_actionState == 'fak_pump' and requestAction != 'fak_pump' and requestAction not in pump_out_overList:
167 184
             requestAction = 'fak_pump_out'
168
-            actionState = 'fak_pump_out'
185
+            actionState = 'fak_pump_out'            
186
+            
187
+            
169 188
         if l_actionState == 'reg_powerslide' and requestAction != 'reg_powerslide':
170 189
             requestAction = 'reg_powerslide_out'
171 190
             actionState = 'reg_powerslide_out' 
@@ -478,9 +497,16 @@ def main():
478 497
                     
479 498
                     own['actionTimer'] = cur_frame
480 499
                 else:                      
481
-                    skater.playAction("nreg_pump_in", 10,1, layer=trans_layer, play_mode=0, speed=.5)
482
-                    deck.playAction("a_reg", 1,40, layer=trans_layer, play_mode=1, speed=.5)
483
-                    trucks.playAction("a_reg", 1,40, layer=trans_layer, play_mode=1, speed=.5)
500
+                    skater.playAction("nreg_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=.5)
501
+                    deck.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
502
+                    trucks.playAction("a_reg", 1,20, layer=trans_layer, play_mode=1, speed=.5)
503
+                    
504
+#            if requestAction == 'reg_pump_out_hold':
505
+#                actionState = 'reg_pump_out_hold'
506
+#                own['actionTimer'] = 19
507
+#                skater.playAction("nreg_pump_in", 10,10, layer=trans_layer, play_mode=0, speed=.5)
508
+#                deck.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)
509
+#                trucks.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)                    
484 510
                     
485 511
             if requestAction == 'fak_pump_out':
486 512
                 actionState = 'fak_pump_out'
@@ -495,9 +521,15 @@ def main():
495 521
                     trucks.playAction("a_reg", cur_frame,1, layer=trans_layer, play_mode=1, speed=.5)
496 522
                     own['actionTimer'] = cur_frame
497 523
                 else:                      
498
-                    skater.playAction("nfak_pump_in", 10,1, layer=trans_layer, play_mode=0, speed=.5)
499
-                    deck.playAction("a_reg", 10,1, layer=trans_layer, play_mode=1, speed=.5)
500
-                    trucks.playAction("a_reg", 10,1, layer=trans_layer, play_mode=1, speed=.5)
524
+                    skater.playAction("nfak_pump_in", 20,1, layer=trans_layer, play_mode=0, speed=.5)
525
+                    deck.playAction("a_reg", 20,1, layer=trans_layer, play_mode=1, speed=.5)
526
+                    trucks.playAction("a_reg", 20,1, layer=trans_layer, play_mode=1, speed=.5)
527
+#            if requestAction == 'fak_pump_out_hold':
528
+#                actionState = 'fak_pump_out_hold'
529
+#                own['actionTimer'] = 19
530
+#                skater.playAction("nfak_pump_in", 10,10, layer=trans_layer, play_mode=0, speed=.5)
531
+#                deck.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)
532
+#                trucks.playAction("a_reg", 10,10, layer=trans_layer, play_mode=1, speed=.5)                          
501 533
 
502 534
             if requestAction == 'reg_stop_out':
503 535
                 actionState = 'reg_stop_out'
@@ -2367,17 +2399,17 @@ def main():
2367 2399
                     # skater.playAction("reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2368 2400
                     # deck.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)
2369 2401
                     # trucks.playAction("a_reg_noseg.002", 1,10, layer=trans_layer, play_mode=0, speed=1)        
2370
-                    skater.playAction("reg_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2371
-                    deck.playAction("a_fak_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2372
-                    trucks.playAction("a_fak_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                        
2402
+                    skater.playAction("reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)                
2403
+                    deck.playAction("a_reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)
2404
+                    trucks.playAction("a_reg_noseg.002", 5,5, layer=trans_layer, play_mode=0, speed=.5)                        
2373 2405
                 else:
2374 2406
                     #pass
2375 2407
                     # skater.playAction("reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2376 2408
                     # deck.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2377 2409
                     # trucks.playAction("a_reg_noseg.002", 11,30, layer=loop_layer, play_mode=1, speed=.5)
2378
-                    skater.playAction("reg_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2379
-                    deck.playAction("a_fak_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2380
-                    trucks.playAction("a_fak_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                     
2410
+                    skater.playAction("reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)                
2411
+                    deck.playAction("a_reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)
2412
+                    trucks.playAction("a_reg_noseg.002", 5,5, layer=loop_layer, play_mode=1, speed=.5)                     
2381 2413
             if requestAction == 'fak_air_nose':
2382 2414
                 actionState = 'fak_air_nose'
2383 2415
                 if l_actionState != 'fak_air_nose':
@@ -2387,20 +2419,20 @@ def main():
2387 2419
                     skater.stopAction(flip_layer)
2388 2420
                     deck.stopAction(flip_layer)
2389 2421
                     trucks.stopAction(flip_layer)                    
2390
-                    # skater.playAction("fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)
2391
-                    # deck.playAction("a_fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)
2392
-                    # trucks.playAction("a_fak_noseg", 40,30, layer=trans_layer, play_mode=0, speed=1)        
2393
-                    skater.playAction("fak_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2394
-                    deck.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2395
-                    trucks.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                    
2422
+                    skater.playAction("fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)
2423
+                    deck.playAction("a_fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)
2424
+                    trucks.playAction("a_fak_noseg", 40,35, layer=trans_layer, play_mode=0, speed=1)        
2425
+                    #skater.playAction("fak_nmanual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                
2426
+                    #deck.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)
2427
+                    #trucks.playAction("a_reg_manual", 1,10, layer=trans_layer, play_mode=0, speed=.5)                    
2396 2428
                 else:
2397 2429
                     #pass
2398
-                    # skater.playAction("fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2399
-                    # deck.playAction("a_fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2400
-                    # trucks.playAction("a_fak_noseg", 30,1, layer=loop_layer, play_mode=1, speed=.5)
2401
-                    skater.playAction("fak_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2402
-                    deck.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2403
-                    trucks.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                    
2430
+                    skater.playAction("fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2431
+                    deck.playAction("a_fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2432
+                    trucks.playAction("a_fak_noseg", 35,35, layer=loop_layer, play_mode=1, speed=.5)
2433
+                    #skater.playAction("fak_nmanual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                
2434
+                    #deck.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)
2435
+                    #trucks.playAction("a_reg_manual", 10,70, layer=loop_layer, play_mode=1, speed=.5)                    
2404 2436
                     
2405 2437
             if requestAction == 'reg_air_tail':
2406 2438
                 actionState = 'reg_air_tail'
@@ -2811,11 +2843,14 @@ def main():
2811 2843
         actionState = updateAction(requestAction, actionState)
2812 2844
         #own['actionState'] = actionState
2813 2845
         
2846
+        
2847
+    if (own['actionState'] == 'reg_land' or own['actionState'] == 'reg_land') and own['actionTimer'] > 0:
2848
+        own['clear_request'] = 1    
2814 2849
   
2815 2850
 ###################  
2816 2851
     
2817 2852
     #debug
2818
-    #print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2853
+    print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2819 2854
     cur_frame = skater.getActionFrame(trans_layer)
2820 2855
     #print(cur_frame)
2821 2856
     def printplaying():

+ 38
- 4
controller2.py View File

@@ -828,7 +828,7 @@ def jump():
828 828
         if grindHit == True:
829 829
             linvelloc = own.getLinearVelocity(True)
830 830
             own.applyForce(force, True)
831
-            force2 = [0.0, 0, 150]
831
+            force2 = [0.0, 0, 150]            
832 832
             own.applyForce(force2, True) 
833 833
             linvelloc2 = own.getLinearVelocity(True)
834 834
             force = (linvelloc.x, linvelloc.y, linvelloc2.z)
@@ -3494,10 +3494,10 @@ if stBut == True:
3494 3494
 if stBut == False and own['last_stBut'] == True:
3495 3495
     if own['pause_on'] == True:
3496 3496
         own['pause_on'] = False
3497
-        own.restoreDynamics()     
3497
+        #own.restoreDynamics()     
3498 3498
     else:
3499 3499
         own['pause_on'] = True
3500
-        own.suspendDynamics()            
3500
+        #own.suspendDynamics()            
3501 3501
     
3502 3502
 own['last_stBut'] = stBut
3503 3503
      
@@ -4139,7 +4139,41 @@ def trans_jump():
4139 4139
         #print(deltamove)
4140 4140
         if abs(deltamove) < 1 and delta[1] < 1:
4141 4141
             own.applyMovement(move, True)               
4142
+
4143
+def air_mover():
4144
+    if r_ground.triggered == False and jump_timer > 53:
4145
+        #print(lUD)
4146
+        if lUD > 0.075:
4147
+            print("air_mover", jump_timer)
4148
+            if STANCE == 0:
4149
+                force2 = [120, 0, 10]
4150
+            if STANCE == 1:
4151
+                force2 = [-120, 0, 10]            
4152
+            
4153
+            own.applyForce(force2, True)
4154
+            #own.applyForce([0,0,5], False)
4155
+    if r_ground.triggered == False and jump_timer > 10 and lUD > 0.075:
4156
+        #print(lUD)
4157
+        print("air_mover", jump_timer)
4158
+        if STANCE == 0:
4159
+            force2 = [7, 0, 10]
4160
+        if STANCE == 1:
4161
+            force2 = [-7, 0, 10]            
4162
+        
4163
+        own.applyForce(force2, True)
4164
+        own.applyForce([0,0,5], False)
4165
+        own['air_mover'] = True
4166
+    else:
4167
+        own['air_mover'] = False        
4142 4168
         
4169
+#if grindHit == 1:
4170
+#    skater.applyRotation([0,0,.05], False)
4171
+#    deck.applyRotation([0,0,.05], False)
4172
+#    trucks.applyRotation([0,0,.05], False)
4173
+#else:
4174
+#    skater.applyRotation([0,0,.0], False)            
4175
+#    deck.applyRotation([0,0,.0], False)            
4176
+#    trucks.applyRotation([0,0,.0], False)            
4143 4177
 #control_calib() #scene must be enabled in main                 
4144 4178
 jump_Timer()
4145 4179
 check_landing()
@@ -4161,7 +4195,7 @@ wallride()
4161 4195
 wallride_sound()
4162 4196
 shutoff_timers()
4163 4197
 grindout_cleanup()
4164
-
4198
+air_mover()
4165 4199
 linvelx = own.getLinearVelocity(True)
4166 4200
 
4167 4201
 own["linvelx"] = linvelx.x

+ 3
- 3
grindV2.py View File

@@ -543,7 +543,7 @@ def main():
543 543
                
544 544
             
545 545
     
546
-    if grindDar.positive == False and grindTouch.positive and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0:
546
+    if grindDar.positive == False and grindTouch.positive and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and own['air_mover'] == False:
547 547
         print("touching, no dar")
548 548
     #print(grindold, "grindold")        
549 549
     if grindDar.positive:
@@ -564,7 +564,7 @@ def main():
564 564
             #print('invertOn')
565 565
 
566 566
         grind_dist = .8#.6
567
-        if dist < grind_dist and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and invert_on == False:
567
+        if dist < grind_dist and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and invert_on == False and own['air_mover'] == False:
568 568
         #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
569 569
             print("new grind trigger")           
570 570
             npos = nearestObject.worldPosition
@@ -582,7 +582,7 @@ def main():
582 582
 
583 583
         #grind
584 584
         #print(dist)
585
-        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False:
585
+        if dist < grind_dist and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and own['airup'] == 0 and own['grindoutturn'] == 0 and own['grindjumpturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 50 and invert_on == False and own['air_mover'] == False:
586 586
             #print("grind")    
587 587
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
588 588
             if grindold == 0:

+ 2
- 0
pause.py View File

@@ -101,9 +101,11 @@ def main():
101 101
     #aBut = cont.sensors["aBut"]
102 102
     pstate = own["pstate"]
103 103
     scene = bge.logic.getCurrentScene()
104
+    dict = bge.logic.globalDict
104 105
     resume = scene.objects["resume"]
105 106
     settings = scene.objects["settings"]
106 107
     level = scene.objects["level"]
108
+    dict['level'] = level
107 109
     levelselect = scene.objects["levelselect"]
108 110
     restart = scene.objects["restart"]
109 111
     exit = scene.objects["exit"]

Loading…
Cancel
Save