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,16 +200,16 @@ def main():
200 200
         if l_actionState == 'fak_stop' and requestAction != 'fak_stop':
201 201
             requestAction = 'fak_stop_out'
202 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 204
             requestAction = 'reg_noseslide_out'
205 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 207
             requestAction = 'fak_noseslide_out'
208 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 210
             requestAction = 'reg_tailslide_out'
211 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 213
             requestAction = 'fak_tailslide_out'
214 214
             actionState = 'fak_tailslide_out' 
215 215
         if l_actionState == 'reg_5050' and requestAction != 'reg_5050' and requestAction != 'reg-fak_5050':
@@ -2357,7 +2357,7 @@ def main():
2357 2357
 
2358 2358
             if requestAction == 'reg_tailslide':
2359 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 2361
                     skater.stopAction(flip_layer)
2362 2362
                     deck.stopAction(flip_layer)
2363 2363
                     trucks.stopAction(flip_layer)                    
@@ -2370,7 +2370,7 @@ def main():
2370 2370
                     trucks.playAction("a_fak_noses", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2371 2371
             if requestAction == 'fak_tailslide':
2372 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 2374
                     skater.stopAction(flip_layer)
2375 2375
                     deck.stopAction(flip_layer)
2376 2376
                     trucks.stopAction(flip_layer)                    
@@ -2384,7 +2384,7 @@ def main():
2384 2384
 
2385 2385
             if requestAction == 'reg_noseslide':
2386 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 2388
                     skater.stopAction(flip_layer)
2389 2389
                     deck.stopAction(flip_layer)
2390 2390
                     trucks.stopAction(flip_layer)                    
@@ -2397,7 +2397,7 @@ def main():
2397 2397
                     trucks.playAction("a_fak_tails", 30,1, layer=loop_layer, play_mode=1, speed=.5)                    
2398 2398
             if requestAction == 'fak_noseslide':
2399 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 2401
                     skater.stopAction(flip_layer)
2402 2402
                     deck.stopAction(flip_layer)
2403 2403
                     trucks.stopAction(flip_layer)                    

+ 24
- 42
grindV2.py View File

@@ -52,6 +52,7 @@ def main():
52 52
     last_ground_frame = own['lF_ground_frame']
53 53
     frames_since_ground = framenum - last_ground_frame
54 54
     frames_since_grind = framenum - lgf
55
+    frames_grinding = framenum - gsf
55 56
     #if framenum - lgf > 60:
56 57
     minus = framenum - gsf
57 58
     grindspeed_rail = .996 #multiplied by current speed
@@ -178,23 +179,26 @@ def main():
178 179
         rot = round((rot * .01), 1)
179 180
         rot *= 100
180 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 202
         #print("stance: ", STANCE)
199 203
     def grindrotvel(obj):        
200 204
         skipconst = 1
@@ -546,10 +550,6 @@ def main():
546 550
             if grinder_rot < 0:
547 551
                 grinder_rot = abs(grinder_rot) + 180                   
548 552
             subtraction = player_rot - grinder_rot
549
-
550
-            
551
-    #else:
552
-        #own['grind_rot'] = None 
553 553
         
554 554
     def invertpos(detectedObjects):
555 555
         minDist = None
@@ -591,22 +591,11 @@ def main():
591 591
             #print('invertOn')
592 592
 
593 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 595
             print("new grind trigger")           
597 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 599
         #grind
611 600
         #print(dist)
612 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,15 +609,7 @@ def main():
620 609
                         own.alignAxisToVect(hitNormal, 2, .05) 
621 610
                         print("align")                   
622 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 613
             grindold = True
633 614
             own['grindold_timer'] = 0
634 615
             own["grindHit"] = True
@@ -653,6 +634,7 @@ def main():
653 634
     
654 635
     if own['grindold_timer'] > 5:
655 636
         grindold = False
637
+        own['grind_start_frame'] = framenum
656 638
         own["grindSound"] = None
657 639
     
658 640
     

Loading…
Cancel
Save