Browse Source

more grindouts2

shuvit 6 years ago
parent
commit
456535b418
2 changed files with 32 additions and 50 deletions
  1. 8
    8
      co_ActionState.py
  2. 24
    42
      grindV2.py

+ 8
- 8
co_ActionState.py View File

200
         if l_actionState == 'fak_stop' and requestAction != 'fak_stop':
200
         if l_actionState == 'fak_stop' and requestAction != 'fak_stop':
201
             requestAction = 'fak_stop_out'
201
             requestAction = 'fak_stop_out'
202
             actionState = 'fak_stop_out' 
202
             actionState = 'fak_stop_out' 
203
-        if l_actionState == 'reg_noseslide' and requestAction != 'reg_noseslide':
203
+        if l_actionState == 'reg_noseslide' and requestAction != 'reg_noseslide' and requestAction != 'fak_tailslide':
204
             requestAction = 'reg_noseslide_out'
204
             requestAction = 'reg_noseslide_out'
205
             actionState = 'reg_noseslide_out'
205
             actionState = 'reg_noseslide_out'
206
-        if l_actionState == 'fak_noseslide' and requestAction != 'fak_noseslide':
206
+        if l_actionState == 'fak_noseslide' and requestAction != 'fak_noseslide' and requestAction != 'reg_tailslide':
207
             requestAction = 'fak_noseslide_out'
207
             requestAction = 'fak_noseslide_out'
208
             actionState = 'fak_noseslide_out'
208
             actionState = 'fak_noseslide_out'
209
-        if l_actionState == 'reg_tailslide' and requestAction != 'reg_tailslide':
209
+        if l_actionState == 'reg_tailslide' and requestAction != 'reg_tailslide' and requestAction != 'fak_noseslide':
210
             requestAction = 'reg_tailslide_out'
210
             requestAction = 'reg_tailslide_out'
211
             actionState = 'reg_tailslide_out'     
211
             actionState = 'reg_tailslide_out'     
212
-        if l_actionState == 'fak_tailslide' and requestAction != 'fak_tailslide':
212
+        if l_actionState == 'fak_tailslide' and requestAction != 'fak_tailslide' and requestAction != 'reg_noseslide':
213
             requestAction = 'fak_tailslide_out'
213
             requestAction = 'fak_tailslide_out'
214
             actionState = 'fak_tailslide_out' 
214
             actionState = 'fak_tailslide_out' 
215
         if l_actionState == 'reg_5050' and requestAction != 'reg_5050' and requestAction != 'reg-fak_5050':
215
         if l_actionState == 'reg_5050' and requestAction != 'reg_5050' and requestAction != 'reg-fak_5050':
2357
 
2357
 
2358
             if requestAction == 'reg_tailslide':
2358
             if requestAction == 'reg_tailslide':
2359
                 actionState = 'reg_tailslide'
2359
                 actionState = 'reg_tailslide'
2360
-                if l_actionState != 'reg_tailslide' and l_actionState != 'reg_air_tail' and l_actionState != 'reg_tailslide_out':
2360
+                if l_actionState != 'reg_tailslide' and l_actionState != 'reg_air_tail' and l_actionState != 'reg_tailslide_out' and l_actionState != 'fak_noseslide':
2361
                     skater.stopAction(flip_layer)
2361
                     skater.stopAction(flip_layer)
2362
                     deck.stopAction(flip_layer)
2362
                     deck.stopAction(flip_layer)
2363
                     trucks.stopAction(flip_layer)                    
2363
                     trucks.stopAction(flip_layer)                    
2370
                     trucks.playAction("a_fak_noses", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2370
                     trucks.playAction("a_fak_noses", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2371
             if requestAction == 'fak_tailslide':
2371
             if requestAction == 'fak_tailslide':
2372
                 actionState = 'fak_tailslide'
2372
                 actionState = 'fak_tailslide'
2373
-                if l_actionState != 'fak_tailslide' and l_actionState != 'fak_air_tail' and l_actionState != 'reg_tailslide_out':
2373
+                if l_actionState != 'fak_tailslide' and l_actionState != 'fak_air_tail' and l_actionState != 'reg_tailslide_out' and l_actionState != 'reg_noseslide':
2374
                     skater.stopAction(flip_layer)
2374
                     skater.stopAction(flip_layer)
2375
                     deck.stopAction(flip_layer)
2375
                     deck.stopAction(flip_layer)
2376
                     trucks.stopAction(flip_layer)                    
2376
                     trucks.stopAction(flip_layer)                    
2384
 
2384
 
2385
             if requestAction == 'reg_noseslide':
2385
             if requestAction == 'reg_noseslide':
2386
                 actionState = 'reg_noseslide'
2386
                 actionState = 'reg_noseslide'
2387
-                if l_actionState != 'reg_noseslide' and l_actionState != 'reg_air_nose' and l_actionState != 'reg_tailslide_out':
2387
+                if l_actionState != 'reg_noseslide' and l_actionState != 'reg_air_nose' and l_actionState != 'reg_tailslide_out' and l_actionState != 'fak_tailslide':
2388
                     skater.stopAction(flip_layer)
2388
                     skater.stopAction(flip_layer)
2389
                     deck.stopAction(flip_layer)
2389
                     deck.stopAction(flip_layer)
2390
                     trucks.stopAction(flip_layer)                    
2390
                     trucks.stopAction(flip_layer)                    
2397
                     trucks.playAction("a_fak_tails", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2397
                     trucks.playAction("a_fak_tails", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2398
             if requestAction == 'fak_noseslide':
2398
             if requestAction == 'fak_noseslide':
2399
                 actionState = 'fak_noseslide'
2399
                 actionState = 'fak_noseslide'
2400
-                if l_actionState != 'fak_noseslide' and l_actionState != 'fak_air_nose' and l_actionState != 'reg_tailslide_out':
2400
+                if l_actionState != 'fak_noseslide' and l_actionState != 'fak_air_nose' and l_actionState != 'reg_tailslide_out' and l_actionState != 'reg_tailslide':
2401
                     skater.stopAction(flip_layer)
2401
                     skater.stopAction(flip_layer)
2402
                     deck.stopAction(flip_layer)
2402
                     deck.stopAction(flip_layer)
2403
                     trucks.stopAction(flip_layer)                    
2403
                     trucks.stopAction(flip_layer)                    

+ 24
- 42
grindV2.py View File

52
     last_ground_frame = own['lF_ground_frame']
52
     last_ground_frame = own['lF_ground_frame']
53
     frames_since_ground = framenum - last_ground_frame
53
     frames_since_ground = framenum - last_ground_frame
54
     frames_since_grind = framenum - lgf
54
     frames_since_grind = framenum - lgf
55
+    frames_grinding = framenum - gsf
55
     #if framenum - lgf > 60:
56
     #if framenum - lgf > 60:
56
     minus = framenum - gsf
57
     minus = framenum - gsf
57
     grindspeed_rail = .996 #multiplied by current speed
58
     grindspeed_rail = .996 #multiplied by current speed
178
         rot = round((rot * .01), 1)
179
         rot = round((rot * .01), 1)
179
         rot *= 100
180
         rot *= 100
180
         #print(rot)
181
         #print(rot)
181
-        
182
-        if (rot == 90 or rot == -270) and STANCE == True:
183
-            #print("90 fak stance")
184
-            own['stance'] = 1
185
-            STANCE = 1
186
-        if (rot == 90 or rot == -270) and STANCE == False:
187
-            #print("90 fak stance")
188
-            own['stance'] = 1
189
-            STANCE = 1
190
-        if (rot == -90 or rot == 270) and STANCE == True:
191
-            #print("-90 reg stance")
192
-            own['stance'] = 0
193
-            STANCE = 0
194
-        if (rot == -90 or rot == 270) and STANCE == False:
195
-            #print("-90 reg stance")                        
196
-            own['stance'] = 0
197
-            STANCE = 0
182
+
183
+
184
+        if frames_grinding > 20: 
185
+            print("setting stance")       
186
+            if (rot == 90 or rot == -270) and STANCE == True:
187
+                #print("90 fak stance")
188
+                own['stance'] = 1
189
+                STANCE = 1
190
+            if (rot == 90 or rot == -270) and STANCE == False:
191
+                #print("90 fak stance")
192
+                own['stance'] = 1
193
+                STANCE = 1
194
+            if (rot == -90 or rot == 270) and STANCE == True:
195
+                #print("-90 reg stance")
196
+                own['stance'] = 0
197
+                STANCE = 0
198
+            if (rot == -90 or rot == 270) and STANCE == False:
199
+                #print("-90 reg stance")                        
200
+                own['stance'] = 0
201
+                STANCE = 0
198
         #print("stance: ", STANCE)
202
         #print("stance: ", STANCE)
199
     def grindrotvel(obj):        
203
     def grindrotvel(obj):        
200
         skipconst = 1
204
         skipconst = 1
546
             if grinder_rot < 0:
550
             if grinder_rot < 0:
547
                 grinder_rot = abs(grinder_rot) + 180                   
551
                 grinder_rot = abs(grinder_rot) + 180                   
548
             subtraction = player_rot - grinder_rot
552
             subtraction = player_rot - grinder_rot
549
-
550
-            
551
-    #else:
552
-        #own['grind_rot'] = None 
553
         
553
         
554
     def invertpos(detectedObjects):
554
     def invertpos(detectedObjects):
555
         minDist = None
555
         minDist = None
591
             #print('invertOn')
591
             #print('invertOn')
592
 
592
 
593
         grind_dist = .8#.6
593
         grind_dist = .8#.6
594
-        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 and no_grind_pull == 0:
595
-        #if grindold == 0 and dropin == 0 and grind_jump == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject:    
594
+        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 and no_grind_pull == 0:   
596
             print("new grind trigger")           
595
             print("new grind trigger")           
597
             npos = nearestObject.worldPosition
596
             npos = nearestObject.worldPosition
598
-            #own.worldPosition = [npos.x, npos.y, npos.z + .251]
599
             
597
             
600
-            #own.applyMovement([0,0,.05], False)
601
-
602
-
603
-#        grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287
604
-
605
-#        if grind_height_dif < 0:
606
-#            newz = (own.worldPosition[2] + abs(grind_height_dif) + .05)
607
-#            own.worldPosition = [own.worldPosition[0],own.worldPosition[1], newz]
608
-#            print(newz, "new")
609
-
598
+            
610
         #grind
599
         #grind
611
         #print(dist)
600
         #print(dist)
612
         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'] < 55 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0:
601
         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'] < 55 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0:
620
                         own.alignAxisToVect(hitNormal, 2, .05) 
609
                         own.alignAxisToVect(hitNormal, 2, .05) 
621
                         print("align")                   
610
                         print("align")                   
622
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
611
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
623
-                    #print("setting pos")
624
-            
625
-            #if hitNormal != None:
626
-                #own.alignAxisToVect(hitNormal, 2, .4)
627
-                #print(hitNormal)
628
-
629
-
630
 
612
 
631
-         
632
             grindold = True
613
             grindold = True
633
             own['grindold_timer'] = 0
614
             own['grindold_timer'] = 0
634
             own["grindHit"] = True
615
             own["grindHit"] = True
653
     
634
     
654
     if own['grindold_timer'] > 5:
635
     if own['grindold_timer'] > 5:
655
         grindold = False
636
         grindold = False
637
+        own['grind_start_frame'] = framenum
656
         own["grindSound"] = None
638
         own["grindSound"] = None
657
     
639
     
658
     
640
     

Loading…
Cancel
Save