Browse Source

turn off jumpstance

shuvit 6 years ago
parent
commit
34e44114a8
2 changed files with 27 additions and 71 deletions
  1. 0
    5
      co_ActionState.py
  2. 27
    66
      controller2.py

+ 0
- 5
co_ActionState.py View File

1615
                     trucks.playAction("a_reg", 10,30, layer=loop_layer, play_mode=1, speed=.5)  
1615
                     trucks.playAction("a_reg", 10,30, layer=loop_layer, play_mode=1, speed=.5)  
1616
 
1616
 
1617
 
1617
 
1618
-
1619
-
1620
-
1621
-
1622
-
1623
             if requestAction == 'frontside_tail_grab':
1618
             if requestAction == 'frontside_tail_grab':
1624
                 actionState = 'frontside_tail_grab'
1619
                 actionState = 'frontside_tail_grab'
1625
                 if l_actionState != 'frontside_tail_grab':
1620
                 if l_actionState != 'frontside_tail_grab':

+ 27
- 66
controller2.py View File

185
 fliplay = 470
185
 fliplay = 470
186
 MAX_VEL = 6.7
186
 MAX_VEL = 6.7
187
 SPEEDUP = .055
187
 SPEEDUP = .055
188
-SPEEDPUMP = .13 #.09
189
-SPEEDPUMPFAST = .16 #.13
188
+SPEEDPUMP = .12 #.09
189
+SPEEDPUMPFAST = .14 #.13
190
 PUMP_SPEED_SENS = .4
190
 PUMP_SPEED_SENS = .4
191
 PUMP_SENS = .98
191
 PUMP_SENS = .98
192
 ACCEL = 10
192
 ACCEL = 10
195
 JUMPHEIGHT = 800 #775#750
195
 JUMPHEIGHT = 800 #775#750
196
 JUMPSTRENGTH = 0
196
 JUMPSTRENGTH = 0
197
 own['flip_manual_stance'] = 0
197
 own['flip_manual_stance'] = 0
198
-CAVEMAN_SPEED = .75
198
+#CAVEMAN_SPEED = .75
199
 LAND_LAYER = 100
199
 LAND_LAYER = 100
200
 LAND_END = 20
200
 LAND_END = 20
201
 
201
 
378
         #own["lastPump"] = False
378
         #own["lastPump"] = False
379
         #own["Pump"] = False
379
         #own["Pump"] = False
380
     if lf_ground == False and r_ground.triggered == True:
380
     if lf_ground == False and r_ground.triggered == True:
381
-        #resetjumpstance()
382
-        #print(r_ground.hitObject)
383
         own['jump_from_trans'] = 0
381
         own['jump_from_trans'] = 0
384
         nearestObject = None
382
         nearestObject = None
385
         minDist = None
383
         minDist = None
386
         detectedObjects = grindDar2.hitObjectList
384
         detectedObjects = grindDar2.hitObjectList
387
-        #if grindHit == False and gray.triggered == False and touched == False:
388
 
385
 
389
-#        if grindDar2.positive:
390
-#            for obj in detectedObjects:
391
-#                dist = own.getDistanceTo(obj)
392
-#                if (minDist is None or dist < minDist):
393
-#                    nearestObject = obj
394
-#                    minDist = dist                    
395
-#        if nearestObject != None and 'rail' in scene.objects[nearestObject]:
396
-#            cont.activate(own.actuators["landonrail"])
397
-#            print("landonrail***************")
398
-        #play landing sound
399
         if grindDar == 0:
386
         if grindDar == 0:
400
             #print("you are not grinding", grindHit)
387
             #print("you are not grinding", grindHit)
401
             lastheight = own["air_height"]
388
             lastheight = own["air_height"]
402
             pos = own.worldPosition.z
389
             pos = own.worldPosition.z
403
             dist = lastheight - pos
390
             dist = lastheight - pos
404
             dist = dist * 2
391
             dist = dist * 2
405
-            #print(dist, "-------------dist")
406
-            
392
+
407
             if dist > 1:
393
             if dist > 1:
408
                 dist = 1
394
                 dist = 1
409
             own.actuators["land"].volume = dist 
395
             own.actuators["land"].volume = dist 
410
-            #cont.deactivate(own.actuators["land"])
411
             sact = own.actuators["land"]
396
             sact = own.actuators["land"]
412
             sact.stopSound()   
397
             sact.stopSound()   
413
             cont.activate(own.actuators["land"])
398
             cont.activate(own.actuators["land"])
414
             own['land_sound'] = 1
399
             own['land_sound'] = 1
415
         if grindDar == 1:
400
         if grindDar == 1:
416
             pass
401
             pass
417
-            #cont.activate(own.actuators["landonrail"])    
418
-        #vibrate
419
-        #set_vibration(0, 0.3, 0.3)
420
         own["vib_Countdown"] = 14
402
         own["vib_Countdown"] = 14
421
         cont.activate(own.actuators["Vibration"])
403
         cont.activate(own.actuators["Vibration"])
422
-        #print("vibrate")
423
         if own['manual_v2'] == 0 and grindDar == 0:           
404
         if own['manual_v2'] == 0 and grindDar == 0:           
424
             if STANCE == 0:
405
             if STANCE == 0:
425
                 own['requestAction'] = 'reg_land'
406
                 own['requestAction'] = 'reg_land'
432
     lf_ground = r_ground.triggered
413
     lf_ground = r_ground.triggered
433
     own["lF_ground"] = lf_ground
414
     own["lF_ground"] = lf_ground
434
     vib_countdown = own["vib_Countdown"]
415
     vib_countdown = own["vib_Countdown"]
435
-    if vib_countdown == 0:
436
-        pass
437
-        #set_vibration(0, 0, 0)
438
-    elif vib_countdown > 0:
416
+    if vib_countdown > 0:
439
         vib_countdown = vib_countdown - 1
417
         vib_countdown = vib_countdown - 1
440
         own["vib_Countdown"] = vib_countdown
418
         own["vib_Countdown"] = vib_countdown
441
     if vib_countdown == 1:
419
     if vib_countdown == 1:
470
     own['manual_v2_type'] = None
448
     own['manual_v2_type'] = None
471
 if own['manual_v2'] == 1:    
449
 if own['manual_v2'] == 1:    
472
     if own['last_manual_v2'] == 0:
450
     if own['last_manual_v2'] == 0:
473
-        #print("don't flip")
474
         if STANCE == 0:
451
         if STANCE == 0:
475
             if rUD > .04 and rUD < .07:
452
             if rUD > .04 and rUD < .07:
476
                 #print("reg manual")
453
                 #print("reg manual")
505
                 own['manual_v2_type'] = 'fak nose manual'
482
                 own['manual_v2_type'] = 'fak nose manual'
506
             if own['manual_v2_type'] == 'reg nose manual':
483
             if own['manual_v2_type'] == 'reg nose manual':
507
                 own['manual_v2_type'] = 'fak manual'                                
484
                 own['manual_v2_type'] = 'fak manual'                                
508
-#print(own['manual_v2'], own['manual_v2_type'])    
485
+   
509
 #check manual
486
 #check manual
510
 ####
487
 ####
511
 #reg
488
 #reg
522
     #print("reg_man off2")   
499
     #print("reg_man off2")   
523
 #####
500
 #####
524
 if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0 and own['reg_nmanual'] == 0:
501
 if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0 and own['reg_nmanual'] == 0:
525
-#if own["reg_manual_timer"] > 10 and own["fak_manual"] == 0:
526
-    #if own['fak_nmanual'] == 0:
527
     own["reg_manual"] = 1
502
     own["reg_manual"] = 1
528
 ######
503
 ######
529
 if own["reg_manual_timer"] == 0:
504
 if own["reg_manual_timer"] == 0:
530
     own["reg_manual"] = 0 
505
     own["reg_manual"] = 0 
531
 if own['last_reg_manual'] == 1 and own['reg_manual'] == 0:
506
 if own['last_reg_manual'] == 1 and own['reg_manual'] == 0:
532
-    killall()   
533
-#print(own["reg_manual"])    
507
+    #killall()   
508
+    pass
534
       
509
       
535
 ####   
510
 ####   
536
 #fak
511
 #fak
548
 if own["fak_manual_timer"] == 0:
523
 if own["fak_manual_timer"] == 0:
549
     own["fak_manual"] = 0 
524
     own["fak_manual"] = 0 
550
 if own['last_fak_manual'] == 1 and own['fak_manual'] == 0:
525
 if own['last_fak_manual'] == 1 and own['fak_manual'] == 0:
551
-    killall()   
526
+    #killall() 
527
+    pass  
552
 #print(own["reg_manual"], own["fak_manual"])    
528
 #print(own["reg_manual"], own["fak_manual"])    
553
  
529
  
554
 #####
530
 #####
571
 if own["reg_nmanual_timer"] == 0:
547
 if own["reg_nmanual_timer"] == 0:
572
     own["reg_nmanual"] = 0 
548
     own["reg_nmanual"] = 0 
573
 if own['last_reg_nmanual'] == 1 and own['reg_nmanual'] == 0:
549
 if own['last_reg_nmanual'] == 1 and own['reg_nmanual'] == 0:
574
-    killall()   
550
+    pass
551
+    #killall()   
575
  
552
  
576
 #####
553
 #####
577
 #fak nmanual
554
 #fak nmanual
592
     #if own['flip_manual_stance'] == 0:
569
     #if own['flip_manual_stance'] == 0:
593
     own["fak_nmanual"] = 0 
570
     own["fak_nmanual"] = 0 
594
 if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
571
 if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
595
-    killall()   
572
+    #killall() 
573
+    pass  
596
 
574
 
597
 
575
 
598
 #print("rm ", own["reg_manual"], "rnm ", own["reg_nmanual"], "fm ", own["fak_manual"], "fnm ", own["fak_nmanual"])
576
 #print("rm ", own["reg_manual"], "rnm ", own["reg_nmanual"], "fm ", own["fak_manual"], "fnm ", own["fak_nmanual"])
932
             own["jump_stance"] = 1
910
             own["jump_stance"] = 1
933
         if STANCE == False:
911
         if STANCE == False:
934
             own["jump_stance"] = 0        
912
             own["jump_stance"] = 0        
935
-        #own["jump_stance"] = own["stance"]
913
+        own["jump_stance"] = own["stance"]
936
         if grindHit == True:
914
         if grindHit == True:
937
             own['grind_jump'] = 1
915
             own['grind_jump'] = 1
938
             if lLR > turnsens or lLR < -turnsens or lUD > turnsens or lUD < -turnsens:
916
             if lLR > turnsens or lLR < -turnsens or lUD > turnsens or lUD < -turnsens:
2452
     grindpos = own['grindpos']
2430
     grindpos = own['grindpos']
2453
     GRAB_ON = own["GRAB_ON"]
2431
     GRAB_ON = own["GRAB_ON"]
2454
     wr = own["wallride"]
2432
     wr = own["wallride"]
2455
-    if rUD > .040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 50:
2433
+    if rUD > .040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 40:
2456
         killact(2)
2434
         killact(2)
2457
         killact(4)
2435
         killact(4)
2458
         if STANCE == 0:
2436
         if STANCE == 0:
2459
             own['requestAction'] = 'reg_air_tail'    
2437
             own['requestAction'] = 'reg_air_tail'    
2460
         else:
2438
         else:
2461
             own['requestAction'] = 'fak_air_tail' 
2439
             own['requestAction'] = 'fak_air_tail' 
2462
-    elif rUD < -.040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 50:
2440
+    elif rUD < -.040 and r_ground.triggered == False and GRAB_ON == False and wr == None and jump_timer < 40:
2463
         killact(2)
2441
         killact(2)
2464
         killact(4)
2442
         killact(4)
2465
         if STANCE == 0:
2443
         if STANCE == 0:
2986
                         grindtype("reg_nosegR")
2964
                         grindtype("reg_nosegR")
2987
                     elif rLR < -.02:
2965
                     elif rLR < -.02:
2988
                         grindtype("reg_nosegL")    
2966
                         grindtype("reg_nosegL")    
2989
-                    else:
2990
-                        #print("gtype reg_nosegR")    
2967
+                    else:   
2991
                         grindtype("reg_noseg")
2968
                         grindtype("reg_noseg")
2992
                 if jumpstance == 1:
2969
                 if jumpstance == 1:
2993
                     if rLR > .02:
2970
                     if rLR > .02:
3012
                     else:    
2989
                     else:    
3013
                         grindtype("fak_noseg")        
2990
                         grindtype("fak_noseg")        
3014
         elif grindpos == "reg_board":
2991
         elif grindpos == "reg_board":
3015
-            #print("nose something")
3016
             if jumpstance != 3:
2992
             if jumpstance != 3:
3017
                 if jumpstance == 0:
2993
                 if jumpstance == 0:
3018
                     grindtype("reg_noseslide")    
2994
                     grindtype("reg_noseslide")    
3032
     if own['grindpos'] == 'fak_5050':
3008
     if own['grindpos'] == 'fak_5050':
3033
         grindtype("fak_5050")
3009
         grindtype("fak_5050")
3034
         
3010
         
3035
-    
3036
-   
3037
 if q1oncd > 0:
3011
 if q1oncd > 0:
3038
     q1on = 0
3012
     q1on = 0
3039
     q1oncd = q1oncd - 1
3013
     q1oncd = q1oncd - 1
3294
 # 3 > 4 > 5 >6 > 7
3268
 # 3 > 4 > 5 >6 > 7
3295
 
3269
 
3296
 # fs 360 shovit
3270
 # fs 360 shovit
3297
-# 7 > 6 > 5 > 4 > 3
3298
-
3299
-
3300
-
3301
-     
3271
+# 7 > 6 > 5 > 4 > 3     
3302
 
3272
 
3303
 def hippy_jump():
3273
 def hippy_jump():
3304
     STANCE = own["stance"]
3274
     STANCE = own["stance"]
3506
         if lBump == 1:
3476
         if lBump == 1:
3507
             #print("invert")
3477
             #print("invert")
3508
         #if coping_on ==1 and lBump == 1:
3478
         #if coping_on ==1 and lBump == 1:
3509
-            print("IIIIIINVVERT")   
3479
+            print("invert")   
3510
             own['invert_on'] = 1
3480
             own['invert_on'] = 1
3511
             own.setLinearVelocity([0,0,0],0)
3481
             own.setLinearVelocity([0,0,0],0)
3512
     if own["coping"] == 1 and invert_on == 1:
3482
     if own["coping"] == 1 and invert_on == 1:
3513
-        # killact(25)
3514
-        # killact(24)
3515
         if own['invert_on'] == 1 and own['last_invert'] == False:
3483
         if own['invert_on'] == 1 and own['last_invert'] == False:
3516
             #killall()
3484
             #killall()
3517
             cont.activate(own.actuators['invertOn_sound'])
3485
             cont.activate(own.actuators['invertOn_sound'])
3518
-            
3519
-            # if STANCE == False:
3520
-            #     own['invert_type'] = "reg_back_invert_in"
3486
+            if STANCE == False:
3487
+                own['invert_type'] = "reg_back_invert_in"
3521
             #     skater.playAction("reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3488
             #     skater.playAction("reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3522
             #     deck.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
3489
             #     deck.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1)
3523
             #     trucks.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3490
             #     trucks.playAction("a_reg_back_invert_in", 10,30, layer=303, play_mode=0, speed=1) 
3524
-            # if STANCE == True:
3525
-            #     own['invert_type'] = "fak_fr_invert"
3491
+            if STANCE == True:
3492
+                own['invert_type'] = "fak_fr_invert"
3526
             #     skater.playAction("fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1) 
3493
             #     skater.playAction("fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1) 
3527
             #     deck.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
3494
             #     deck.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)
3528
             #     trucks.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)                           
3495
             #     trucks.playAction("a_fak_fr_invert", 10,30, layer=303, play_mode=0, speed=1)                           
3625
         newy = linVelocity4.y * .8 #.4    
3592
         newy = linVelocity4.y * .8 #.4    
3626
         force = [linVelocity4.x, newy, linVelocity4.z]
3593
         force = [linVelocity4.x, newy, linVelocity4.z]
3627
         own.setLinearVelocity(force, True)   
3594
         own.setLinearVelocity(force, True)   
3628
-        #print("limitting y")       
3629
-#        own["linVely"] = linVelocity.y 
3595
+
3630
 def getoffboard():
3596
 def getoffboard():
3631
     lasty = own['lasty']
3597
     lasty = own['lasty']
3632
     getoffboard = own['getoffboard']
3598
     getoffboard = own['getoffboard']
4119
                 if STANCE == False:
4085
                 if STANCE == False:
4120
                     own.applyForce([-bsforce, 0, 0], True)
4086
                     own.applyForce([-bsforce, 0, 0], True)
4121
                 own.applyMovement([-bs_dloc,0,0], True)                                             
4087
                 own.applyMovement([-bs_dloc,0,0], True)                                             
4122
-                                                       
4123
-    #print("setting linvel", own.linearVelocity, outvel)                     
4088
+                                                                          
4124
     if own['gt_cd2'] > 0:
4089
     if own['gt_cd2'] > 0:
4125
         own['gt_cd2'] -= 1
4090
         own['gt_cd2'] -= 1
4126
     if own['gt_cd2'] == 0:    
4091
     if own['gt_cd2'] == 0:    
4127
         own['grind_out_type'] = None 
4092
         own['grind_out_type'] = None 
4128
-#print(own['grind_out_type'])                       
4129
-             
4130
-#print(own["gt_cd"])
4093
+
4131
 if own["grindoutturn"] > 0:
4094
 if own["grindoutturn"] > 0:
4132
     own["grindoutturn"] = own["grindoutturn"] - 1
4095
     own["grindoutturn"] = own["grindoutturn"] - 1
4133
     
4096
     
4212
 if own['revert_timer'] > 0:
4175
 if own['revert_timer'] > 0:
4213
     own['revert_timer'] = own['revert_timer'] - 1 
4176
     own['revert_timer'] = own['revert_timer'] - 1 
4214
     
4177
     
4215
-              
4216
-    
4217
 def shutoff_timers():
4178
 def shutoff_timers():
4218
     #print(wallride)
4179
     #print(wallride)
4219
     if (LAST_GRIND == False and grindHit == True) or (jump_timer > 10 and own['wallride'] == None):
4180
     if (LAST_GRIND == False and grindHit == True) or (jump_timer > 10 and own['wallride'] == None):

Loading…
Cancel
Save