shuvit 4 years ago
parent
commit
9492b1c072
7 changed files with 25 additions and 177 deletions
  1. 2
    2
      assets/foliage.blend
  2. 2
    2
      assets/rails.blend
  3. 2
    2
      assets/user10_working.blend
  4. 2
    2
      assets/user2.blend
  5. 3
    3
      config.ini
  6. 12
    164
      scripts/controller2.py
  7. 2
    2
      shuvit.blend

+ 2
- 2
assets/foliage.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9c0b45d0c143a38926abe3845054bc8b1686b3723e20836473cc69ecf6fce171
3
-size 3846252
2
+oid sha256:153bf3a6d853ea2d8d6af129f4641da130f1cf26d12d5b0f617ce4be3ce1815e
3
+size 3846380

+ 2
- 2
assets/rails.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:806f4e67b88bd33e31dd08e2c7a275a0330ea80a7965bf1ac5c64d8e4c735ed1
3
-size 482684
2
+oid sha256:295799d06166408def50692e019c6ed17981a525d5cc51d38a544222cdd242a8
3
+size 474180

+ 2
- 2
assets/user10_working.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:279d76c10072619c6259e35800b5c36794d3ff79a2be293dcd28eb9c1731f83e
3
-size 15563332
2
+oid sha256:a3ce21ce415b1a326da389f316a8d366eb53b623d3f5a0f5b0a4e490277fbd7e
3
+size 15590664

+ 2
- 2
assets/user2.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:72706c55ca565b8d11198bab3c08ba1e42c24e6ba7a57696d8fb15b57549d0f0
3
-size 19062000
2
+oid sha256:09078add584edfde6caca8153f880778a58ead3268abc38a90b50b99a0590e43
3
+size 19108548

+ 3
- 3
config.ini View File

58
 shirt_color_g = 0.9
58
 shirt_color_g = 0.9
59
 shirt_color_b = 0.88
59
 shirt_color_b = 0.88
60
 
60
 
61
-shoe_color_r = 0.0
62
-shoe_color_g = 0.35
63
-shoe_color_b = 0.57
61
+shoe_color_r = 0.85
62
+shoe_color_g = 0
63
+shoe_color_b = 0
64
 #-----------------
64
 #-----------------
65
 
65
 
66
 #deck settings
66
 #deck settings

+ 12
- 164
scripts/controller2.py View File

197
             onGround = True    
197
             onGround = True    
198
     if onGround: 
198
     if onGround: 
199
         own['wallride_off'] = 0
199
         own['wallride_off'] = 0
200
-    #print(linVelocity.y / linVelocity.x, 'linvels')
201
-    #print(r_ground.triggered)
202
     try:
200
     try:
203
         balance = linVelocity.y / linVelocity.x
201
         balance = linVelocity.y / linVelocity.x
204
     except:
202
     except:
205
         balance = 0
203
         balance = 0
206
     #print(balance)
204
     #print(balance)
207
-    #if ground_since > 0 and ground_since < 5 and jump_timer < 30:
208
     min_speed = .8
205
     min_speed = .8
209
     if ground_since > -1 and ground_since < 60 and (abs(linVelocity.x) > min_speed or abs(linVelocity.y) > min_speed):
206
     if ground_since > -1 and ground_since < 60 and (abs(linVelocity.x) > min_speed or abs(linVelocity.y) > min_speed):
210
         #print(balance, 'balance')
207
         #print(balance, 'balance')
213
         sens3 = 1.5
210
         sens3 = 1.5
214
         if balance > sens or balance < - sens:
211
         if balance > sens or balance < - sens:
215
             #fall
212
             #fall
216
-            #if ground_since > -1 and ground_since < 10:
217
-            #print(own['l_actionState'], touched)
218
             if own['l_actionState'] != None:
213
             if own['l_actionState'] != None:
219
                 if 'land' in own['l_actionState'] and touched == False:
214
                 if 'land' in own['l_actionState'] and touched == False:
220
                     own['fall'] = 1
215
                     own['fall'] = 1
299
 
294
 
300
     def check_fall():
295
     def check_fall():
301
         playing_frame = 20
296
         playing_frame = 20
302
-        #hitDistance = own.worldPosition.z - r_ground.hitPosition.z
303
         if skater.isPlayingAction(fliplay):
297
         if skater.isPlayingAction(fliplay):
304
             playing_frame = skater.getActionFrame(fliplay)
298
             playing_frame = skater.getActionFrame(fliplay)
305
-        #if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
306
         if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 45 and playing_frame < 16 and playing_frame > 3:    
299
         if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 45 and playing_frame < 16 and playing_frame > 3:    
307
             hitDistance = own.worldPosition[2] - r_ground.hitPosition[2]
300
             hitDistance = own.worldPosition[2] - r_ground.hitPosition[2]
308
             if hitDistance < dict['fall_height']:
301
             if hitDistance < dict['fall_height']:
335
                 dist = dist * 2
328
                 dist = dist * 2
336
                 if dist > 1:
329
                 if dist > 1:
337
                     dist = 1
330
                     dist = 1
338
-                #own.actuators["land"].volume = dist
339
-                #sact = own.actuators["land"]                
340
-                #sact.stopSound()
341
-                #cont.activate(own.actuators["land"])
331
+
342
                 cam['sndmgr'].queue_sound(['land', own, cam])
332
                 cam['sndmgr'].queue_sound(['land', own, cam])
343
                 own['land_sound'] = 1
333
                 own['land_sound'] = 1
344
             if grindDar == 1:
334
             if grindDar == 1:
357
             vib_countdown = vib_countdown - 1
347
             vib_countdown = vib_countdown - 1
358
             own["vib_Countdown"] = vib_countdown
348
             own["vib_Countdown"] = vib_countdown
359
         if vib_countdown == 1:
349
         if vib_countdown == 1:
360
-            #stopAnims()
361
             stance()
350
             stance()
362
 
351
 
363
-        #if lf_ground == False and r_ground.triggered == True and own['jump_timer'] < 40 and grindHit == False and touched == False and LAST_GRIND == False:
364
-        #print(touched, LAST_GRIND)
365
-        #if lf_ground == False and r_ground.triggered == True and own['jump_timer'] < 40  and LAST_GRIND == False and jump_timer != 0:
366
-        #if lf_ground == False and r_ground.triggered == True:
367
         if ground_since == 3 and own['jump_timer'] < 40:
352
         if ground_since == 3 and own['jump_timer'] < 40:
368
             print('---landing-b')
353
             print('---landing-b')
369
             if STANCE == 0:
354
             if STANCE == 0:
390
 
375
 
391
     #check manual_v2
376
     #check manual_v2
392
     if (rUD > dict['man_sens_l'] and rUD < dict['man_sens_r']) or (rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r']):
377
     if (rUD > dict['man_sens_l'] and rUD < dict['man_sens_r']) or (rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r']):
393
-    #if (rUD > .04 and rUD < .07):
394
-        #print("zoned")
395
         timer = own['manual_v2_timer']
378
         timer = own['manual_v2_timer']
396
         timer = timer + 1
379
         timer = timer + 1
397
         if timer > 20:
380
         if timer > 20:
512
 
495
 
513
     #####
496
     #####
514
     #fak nmanual
497
     #fak nmanual
515
-    #print (rUD)
516
     if rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r'] and STANCE == 1 and rLR < dict['man_sens_side'] and rLR > -dict['man_sens_side']:
498
     if rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r'] and STANCE == 1 and rLR < dict['man_sens_side'] and rLR > -dict['man_sens_side']:
517
         timer = own["fak_nmanual_timer"]
499
         timer = own["fak_nmanual_timer"]
518
         timer = timer + 1
500
         timer = timer + 1
558
             own['requestAction'] = 'fak_manual'  
540
             own['requestAction'] = 'fak_manual'  
559
 
541
 
560
     def reg_nmanual_on():
542
     def reg_nmanual_on():
561
-
562
         if lLR > turnsens:
543
         if lLR > turnsens:
563
             own['requestAction'] = 'reg_nmanual_right'
544
             own['requestAction'] = 'reg_nmanual_right'
564
         elif lLR < -turnsens:
545
         elif lLR < -turnsens:
568
 
549
 
569
 
550
 
570
     def fak_nmanual_on():
551
     def fak_nmanual_on():
571
-
572
-    #def fak_manual_on():
573
         if lLR > turnsens:
552
         if lLR > turnsens:
574
             own['requestAction'] = 'fak_nmanual_right'
553
             own['requestAction'] = 'fak_nmanual_right'
575
         elif lLR < -turnsens:
554
         elif lLR < -turnsens:
788
             # apply force
767
             # apply force
789
             try:
768
             try:
790
                 if 'trans' in r_ground.hitObject:
769
                 if 'trans' in r_ground.hitObject:
791
-                    #print('jump from trans')
792
                     own['jump_from_trans'] = 1
770
                     own['jump_from_trans'] = 1
793
                     own['trans_jump_obj'] = r_ground.hitObject
771
                     own['trans_jump_obj'] = r_ground.hitObject
794
             except:
772
             except:
795
-                #print('trans jump broke')
796
                 pass
773
                 pass
797
             if grindHit == False:
774
             if grindHit == False:
798
                 if rot.z < .7:
775
                 if rot.z < .7:
807
                     force2 = [0,0,0]
784
                     force2 = [0,0,0]
808
 
785
 
809
                 own.applyForce(force, local)
786
                 own.applyForce(force, local)
810
-                
811
                 own.applyForce(force2, True)
787
                 own.applyForce(force2, True)
812
-                #print("apply jump force1")
788
+
813
             if grindHit == True:
789
             if grindHit == True:
814
                 linvelloc = own.getLinearVelocity(True)
790
                 linvelloc = own.getLinearVelocity(True)
815
                 own.applyForce(force, True)
791
                 own.applyForce(force, True)
818
                 linvelloc2 = own.getLinearVelocity(True)
794
                 linvelloc2 = own.getLinearVelocity(True)
819
                 force = (linvelloc.x, linvelloc.y, linvelloc2.z)
795
                 force = (linvelloc.x, linvelloc.y, linvelloc2.z)
820
                 own.setLinearVelocity(force, True)
796
                 own.setLinearVelocity(force, True)
821
-                #print("apply jump force2 grindHit")
822
 
797
 
823
             own['jump_stance'] = STANCE
798
             own['jump_stance'] = STANCE
824
             if STANCE == True:
799
             if STANCE == True:
870
         downforce = dict['pump_downforce']
845
         downforce = dict['pump_downforce']
871
         lF_air_frame = own['lF_air_frame']
846
         lF_air_frame = own['lF_air_frame']
872
         frames_since_ground = own['framenum'] - own['lF_air_frame']
847
         frames_since_ground = own['framenum'] - own['lF_air_frame']
873
-        #if linVelocity.x < MAX_VEL and linVelocity.x >= -0 and STANCE == 1 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
874
         if STANCE == 1 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
848
         if STANCE == 1 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
875
             countdown = COUNTDOWN
849
             countdown = COUNTDOWN
876
             yvel = linVelocity.x + SPEEDPUMP
850
             yvel = linVelocity.x + SPEEDPUMP
886
             if own['requestAction'] not in ['fak_pump_left', 'fak_pump_right'] and own['l_actionState'] not in ['fak_turnLeft', 'fak_turnRight']:
860
             if own['requestAction'] not in ['fak_pump_left', 'fak_pump_right'] and own['l_actionState'] not in ['fak_turnLeft', 'fak_turnRight']:
887
                 own['requestAction'] = 'fak_pump'
861
                 own['requestAction'] = 'fak_pump'
888
         #reg
862
         #reg
889
-        #if linVelocity.x > -MAX_VEL and linVelocity.x <= 0 and STANCE == 0 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
890
         if STANCE == 0 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
863
         if STANCE == 0 and grindHit == False and frames_since_ground > 30 and own['last_manual_v2'] == 0:
891
             countdown = COUNTDOWN
864
             countdown = COUNTDOWN
892
             yvel = linVelocity.x - SPEEDPUMP
865
             yvel = linVelocity.x - SPEEDPUMP
930
         if ground_since > 30:
903
         if ground_since > 30:
931
             if (onGround) and STANCE == False and (own['manual'] == 0 or own['requestAction'] == 'fak_roll'):
904
             if (onGround) and STANCE == False and (own['manual'] == 0 or own['requestAction'] == 'fak_roll'):
932
                 if grindold == 0:
905
                 if grindold == 0:
933
-                    #print('opos request', own['requestAction'])
934
-                    
935
                     if own['requestAction'] == 'reg_turnRight':
906
                     if own['requestAction'] == 'reg_turnRight':
936
                         own['requestAction'] = 'reg_pump_right'
907
                         own['requestAction'] = 'reg_pump_right'
937
                     elif own['requestAction'] == 'reg_turnLeft':
908
                     elif own['requestAction'] == 'reg_turnLeft':
941
 
912
 
942
             elif (onGround) and STANCE == True and (own['manual'] == 0 or own['requestAction'] == 'fak_roll'):
913
             elif (onGround) and STANCE == True and (own['manual'] == 0 or own['requestAction'] == 'fak_roll'):
943
                 if grindold == 0:
914
                 if grindold == 0:
944
-                    #print('opos request', own['requestAction'])
945
                     if own['requestAction'] == 'fak_turnRight':
915
                     if own['requestAction'] == 'fak_turnRight':
946
                         own['requestAction'] = 'fak_pump_right'
916
                         own['requestAction'] = 'fak_pump_right'
947
                     elif own['requestAction'] == 'fak_turnLeft':
917
                     elif own['requestAction'] == 'fak_turnLeft':
948
                         own['requestAction'] = 'fak_pump_left'                        
918
                         own['requestAction'] = 'fak_pump_left'                        
949
                     else:                    
919
                     else:                    
950
                         own['requestAction'] = 'fak_opos'
920
                         own['requestAction'] = 'fak_opos'
951
-            #print('result', own['requestAction'])            
952
             own["last_Opos"] = True
921
             own["last_Opos"] = True
953
 
922
 
954
     def noposin():
923
     def noposin():
963
 
932
 
964
     def aollie():
933
     def aollie():
965
         print("ollie")
934
         print("ollie")
966
-        #dict['trick_string'] = 'Ollie'
967
-        
968
         STANCE = own["stance"]
935
         STANCE = own["stance"]
969
         wallride = own["wallride"]
936
         wallride = own["wallride"]
970
         dict['trick_string'] = 'Ollie'
937
         dict['trick_string'] = 'Ollie'
1708
                 elif distance >= 1.75:
1675
                 elif distance >= 1.75:
1709
                     own.alignAxisToVect([0.0, 0.0, 1.0], 2, .03)
1676
                     own.alignAxisToVect([0.0, 0.0, 1.0], 2, .03)
1710
         elif onGround:
1677
         elif onGround:
1711
-            #if d2 > .4:
1712
-               #own.alignAxisToVect([0.0, 0.0, 1.0], 2, .03)
1713
             pass
1678
             pass
1714
     def stopAnims():
1679
     def stopAnims():
1715
         pass
1680
         pass
1733
         local = True
1698
         local = True
1734
         #print("push")
1699
         #print("push")
1735
         linVelocity15 = own.linearVelocity
1700
         linVelocity15 = own.linearVelocity
1736
-        #if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0 and own['last_footplant'] == False:
1737
         if linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0 and own['last_footplant'] == False:    
1701
         if linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0 and own['last_footplant'] == False:    
1738
             if linVelocity15.x < MAX_VEL:
1702
             if linVelocity15.x < MAX_VEL:
1739
                 countdown = COUNTDOWN
1703
                 countdown = COUNTDOWN
1743
                 own.setLinearVelocity(force, local)
1707
                 own.setLinearVelocity(force, local)
1744
             own['requestAction'] = 'fak_push_goof'
1708
             own['requestAction'] = 'fak_push_goof'
1745
         #switch
1709
         #switch
1746
-        #if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:
1747
         if linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1710
         if linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1748
             if linVelocity15.x > -MAX_VEL:
1711
             if linVelocity15.x > -MAX_VEL:
1749
                 countdown = COUNTDOWN
1712
                 countdown = COUNTDOWN
1757
         linVelocity15 = own.linearVelocity
1720
         linVelocity15 = own.linearVelocity
1758
         local = True
1721
         local = True
1759
         #print("push goof")
1722
         #print("push goof")
1760
-        #if linVelocity15.x < MAX_VEL and linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:
1761
         if  linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1723
         if  linVelocity15.x >= -0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1762
             if linVelocity15.x < MAX_VEL:
1724
             if linVelocity15.x < MAX_VEL:
1763
                 countdown = COUNTDOWN
1725
                 countdown = COUNTDOWN
1767
                 own.setLinearVelocity(force, local)
1729
                 own.setLinearVelocity(force, local)
1768
             own['requestAction'] = 'fak_push'
1730
             own['requestAction'] = 'fak_push'
1769
         #switch
1731
         #switch
1770
-        #if linVelocity15.x > -MAX_VEL and linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:
1771
         if  linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1732
         if  linVelocity15.x < 0 and onGround and own['hippy'] == 0 and own['last_hippy'] == 0:    
1772
             if linVelocity15.x > -MAX_VEL:
1733
             if linVelocity15.x > -MAX_VEL:
1773
                 countdown = COUNTDOWN
1734
                 countdown = COUNTDOWN
1984
 
1945
 
1985
         turnVel = .01
1946
         turnVel = .01
1986
     #light
1947
     #light
1987
-    #if manual and grindhit = true
1988
-        # if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1989
-        #     rotation = [0.0, 0.0, (-rotamt)]
1990
-        #     local = False # use world axis
1991
-        #     #own.applyRotation( rotation, local)
1992
-
1993
-        #     if onGround:
1994
-        #         #print("light turn")
1995
-        #         if STANCE == 0:
1996
-        #             own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1997
-        #         if STANCE == 1:
1998
-        #             own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
1999
-        # if lLR < -turnsens and lLR > (turnsens * -1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
2000
-        #     rotation = [0.0, 0.0, rotamt]
2001
-        #     local = False # use world axis
2002
-        #     #own.applyRotation( rotation, local)
2003
-
2004
-        #     if onGround:
2005
-        #         #print("light turn")
2006
-        #         if STANCE == 0:
2007
-        #             own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
2008
-        #         if STANCE == 1:
2009
-        #             own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
2010
     #medium
1948
     #medium
2011
         max_amt = 3
1949
         max_amt = 3
2012
         if (lLR > (turnsens * 1) or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1950
         if (lLR > (turnsens * 1) or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
2019
                 rotation = [0.0, 0.0, ((-rotamt * 1.6) * multer)]
1957
                 rotation = [0.0, 0.0, ((-rotamt * 1.6) * multer)]
2020
             local = True # use world axis
1958
             local = True # use world axis
2021
             own.applyRotation( rotation, local)
1959
             own.applyRotation( rotation, local)
2022
-            #print('rotation = ', rotation)
2023
             if onGround:
1960
             if onGround:
2024
                 #print("med turn")
1961
                 #print("med turn")
2025
                 if STANCE == 0:
1962
                 if STANCE == 0:
2041
     
1978
     
2042
             local = True # use world axis
1979
             local = True # use world axis
2043
             own.applyRotation( rotation, local)
1980
             own.applyRotation( rotation, local)
2044
-            #print('rotation = ', rotation)
2045
             if onGround:
1981
             if onGround:
2046
                 #print("med turn")
1982
                 #print("med turn")
2047
                 if STANCE == 0:
1983
                 if STANCE == 0:
2227
             edge = 0
2163
             edge = 0
2228
             try:
2164
             try:
2229
                 if 'edge' in grindTouch.hitObject:
2165
                 if 'edge' in grindTouch.hitObject:
2230
-                    #print('Edge')
2231
                     edge = 1
2166
                     edge = 1
2232
             except:
2167
             except:
2233
                 pass
2168
                 pass
2240
                 tempstance = jumpstance
2175
                 tempstance = jumpstance
2241
             else:
2176
             else:
2242
                 tempstance = STANCE
2177
                 tempstance = STANCE
2243
-            #print(own['grindpos'], own['grindType'], 'pos n type111')
2178
+
2244
             grindpos = own['grindpos']
2179
             grindpos = own['grindpos']
2245
             if grindpos == "reg_5050" and own['grindType'] == "empty":
2180
             if grindpos == "reg_5050" and own['grindType'] == "empty":
2246
                 own['grindType'] = grindpos
2181
                 own['grindType'] = grindpos
2250
                 else:
2185
                 else:
2251
                     own['grindType'] = "fak_bsboard"
2186
                     own['grindType'] = "fak_bsboard"
2252
 
2187
 
2253
-
2254
-            # if own['grindType'] == '' and grindpos == 'reg_board':
2255
-            #     if STANCE == 0:
2256
-            #         own['grindType'] = "reg_bsboard"
2257
-            #     else:
2258
-            #         own['grindType'] = "fak_bsboard"
2259
-
2260
-            # if own['grindType'] == '' and grindpos == 'reg_board':
2261
-            #     own['grindType'] = 'reg_bsboard'
2262
-
2263
-            #print(own['grindpos'], own['grindType'], 'pos n type')
2264
-
2265
             if STANCE == True:
2188
             if STANCE == True:
2266
                 if own['grindType'] == "reg_bsboard":
2189
                 if own['grindType'] == "reg_bsboard":
2267
                     own['grind_stance'] = 0
2190
                     own['grind_stance'] = 0
3389
         if frame - lif > 3 and own['invert_on'] == 0:
3312
         if frame - lif > 3 and own['invert_on'] == 0:
3390
             own['invert_type'] = None
3313
             own['invert_type'] = None
3391
 
3314
 
3392
-        #print(own['requestAction'])
3393
-
3394
     invert()
3315
     invert()
3395
     footplant()
3316
     footplant()
3396
-    #print(own['invert_on'], 'invert_on')
3397
     def reset_pos():
3317
     def reset_pos():
3398
         #reset
3318
         #reset
3399
         if ddPad == 1:
3319
         if ddPad == 1:
3417
                 own.setLinearVelocity([-.1,0,0], 1)
3337
                 own.setLinearVelocity([-.1,0,0], 1)
3418
 
3338
 
3419
         if udPad == 1:
3339
         if udPad == 1:
3420
-
3421
             own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]]
3340
             own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]]
3422
             own['spawn_rot'] = [[own.worldOrientation[0][0], own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0], own.worldOrientation[1][1], own.worldOrientation[1][2]], own.worldOrientation[2][2]]
3341
             own['spawn_rot'] = [[own.worldOrientation[0][0], own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0], own.worldOrientation[1][1], own.worldOrientation[1][2]], own.worldOrientation[2][2]]
3423
             own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]]
3342
             own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]]
3427
 
3346
 
3428
     #start button
3347
     #start button
3429
     if stBut == True:
3348
     if stBut == True:
3430
-        #own.actuators["sroll"].volume = .0001
3431
-        #cont.deactivate(own.actuators["sroll"])
3432
-        #own.actuators["sroll"].stopSound()
3433
         cam['sndmgr'].stop_sound(['roll'])
3349
         cam['sndmgr'].stop_sound(['roll'])
3350
+
3434
     if (stBut == False and dict['last_stBut'] == True) or dict['kb_en'] == 1:
3351
     if (stBut == False and dict['last_stBut'] == True) or dict['kb_en'] == 1:
3435
         if own['pause_on'] == True:
3352
         if own['pause_on'] == True:
3436
             own['pause_on'] = False
3353
             own['pause_on'] = False
3444
         ylimit = dict['ylimit']
3361
         ylimit = dict['ylimit']
3445
         if ground_since < 20 and ground_since > 1 and grindHit == 0 and own['jump_timer'] < 40:
3362
         if ground_since < 20 and ground_since > 1 and grindHit == 0 and own['jump_timer'] < 40:
3446
             ylimit = ylimit + ((ground_since - 15) * -.005)
3363
             ylimit = ylimit + ((ground_since - 15) * -.005)
3447
-
3448
             yvel = own.linearVelocity.y
3364
             yvel = own.linearVelocity.y
3449
             yvel = yvel *.03
3365
             yvel = yvel *.03
3450
             if STANCE == 0:
3366
             if STANCE == 0:
3452
             try:
3368
             try:
3453
                 if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3369
                 if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3454
                     own.applyRotation([0, 0, yvel], True)
3370
                     own.applyRotation([0, 0, yvel], True)
3455
-
3456
                 if ylimit > .99999:
3371
                 if ylimit > .99999:
3457
                     ylimit = .9999
3372
                     ylimit = .9999
3458
             except:
3373
             except:
3466
                 try:
3381
                 try:
3467
                     if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3382
                     if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3468
                         own.applyRotation([0, 0, yvel], True)
3383
                         own.applyRotation([0, 0, yvel], True)
3469
-
3470
                 except:
3384
                 except:
3471
                     pass
3385
                     pass
3472
 
3386
 
3796
                 STANCE = 0
3710
                 STANCE = 0
3797
             if own['grindpos'] == 'reg_5050':
3711
             if own['grindpos'] == 'reg_5050':
3798
                 if sl.q3 >= countdown or sl.q2 >= countdown or dict['kb_ra'] == 2:
3712
                 if sl.q3 >= countdown or sl.q2 >= countdown or dict['kb_ra'] == 2:
3799
-                #if lq3on == 1 or lq2on or dict['kb_ra'] == 2:
3800
                     if own['gt_cd2'] == 0:
3713
                     if own['gt_cd2'] == 0:
3801
                         own['gt_cd2'] = 60
3714
                         own['gt_cd2'] = 60
3802
 
3715
 
3808
                             own['grind_out_type'] = 'reg right'
3721
                             own['grind_out_type'] = 'reg right'
3809
                     own["grindoutturn"] = gotcd
3722
                     own["grindoutturn"] = gotcd
3810
                 if sl.q7 >= countdown or sl.q8 >= countdown or dict['kb_la'] == 2:
3723
                 if sl.q7 >= countdown or sl.q8 >= countdown or dict['kb_la'] == 2:
3811
-                #if lq7on == 1 or lq8on or dict['kb_la'] == 2:
3812
                     if own['gt_cd2'] == 0:
3724
                     if own['gt_cd2'] == 0:
3813
                         own['gt_cd2'] = 60
3725
                         own['gt_cd2'] = 60
3814
                     if STANCE == True:
3726
                     if STANCE == True:
3845
                 outvel = own.getLinearVelocity(1)
3757
                 outvel = own.getLinearVelocity(1)
3846
                 outact.dLoc = [0, 0, 0]
3758
                 outact.dLoc = [0, 0, 0]
3847
                 outact.dRot = [0, 0, 0]
3759
                 outact.dRot = [0, 0, 0]
3848
-
3849
-
3850
-                #if lq5on == 1 or dict['kb_da'] == 2:
3851
                 if sl.q5 >= countdown or dict['kb_da'] == 2:
3760
                 if sl.q5 >= countdown or dict['kb_da'] == 2:
3852
                     if own['gt_cd2'] == 0:
3761
                     if own['gt_cd2'] == 0:
3853
                         own['gt_cd2'] = 60
3762
                         own['gt_cd2'] = 60
3858
                             cont.activate(own.actuators["grindoutRight"])
3767
                             cont.activate(own.actuators["grindoutRight"])
3859
                         if own['grind_out_type'] == None:
3768
                         if own['grind_out_type'] == None:
3860
                             own['grind_out_type'] = 'bs fak back'
3769
                             own['grind_out_type'] = 'bs fak back'
3861
-                        #own.applyRotation((0, .15, 0), True)
3862
-                        print('board out')
3863
                     if STANCE == False:
3770
                     if STANCE == False:
3864
 
3771
 
3865
                         if own['footplant_on'] == True:
3772
                         if own['footplant_on'] == True:
3867
                             cont.activate(own.actuators["grindoutRight"])
3774
                             cont.activate(own.actuators["grindoutRight"])
3868
                         if own['grind_out_type'] == None:
3775
                         if own['grind_out_type'] == None:
3869
                             own['grind_out_type'] = 'bs reg back'
3776
                             own['grind_out_type'] = 'bs reg back'
3870
-                        #own.applyRotation((0, -.15, 0), True)
3871
-                        print('board out')
3777
+
3872
                     own["grindoutturn"] = gotcd
3778
                     own["grindoutturn"] = gotcd
3873
                     own['invert_on'] = 0
3779
                     own['invert_on'] = 0
3874
                 if sl.q1 >= countdown or dict['kb_ua'] == 2:
3780
                 if sl.q1 >= countdown or dict['kb_ua'] == 2:
3875
-                #if lq1on == 1 or dict['kb_ua'] == 2:
3876
                     if own['gt_cd2'] == 0:
3781
                     if own['gt_cd2'] == 0:
3877
                         own['gt_cd2'] = 60
3782
                         own['gt_cd2'] = 60
3878
                     if STANCE == True:
3783
                     if STANCE == True:
3879
                         if own['footplant_on'] == True:
3784
                         if own['footplant_on'] == True:
3880
                             own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
3785
                             own.setLinearVelocity([(outvel.x + bsoutvel), outvel.y, outvel.z], 1)
3881
-                            #cont.activate(own.actuators["grindoutRight"])
3786
+            
3882
                         if own['grind_out_type'] == None:
3787
                         if own['grind_out_type'] == None:
3883
                             own['grind_out_type'] = 'bs fak forward'
3788
                             own['grind_out_type'] = 'bs fak forward'
3884
-                        #own.applyRotation((0, .15, 0), True)
3789
+            
3885
                     if STANCE == False:
3790
                     if STANCE == False:
3886
                         if own['footplant_on'] == True:
3791
                         if own['footplant_on'] == True:
3887
                             own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
3792
                             own.setLinearVelocity([(outvel.x + -bsoutvel), outvel.y, outvel.z], 1)
3888
-                            #cont.activate(own.actuators["grindoutRight"])
3793
+            
3889
                         if own['grind_out_type'] == None:
3794
                         if own['grind_out_type'] == None:
3890
                             own['grind_out_type'] = 'bs reg forward'
3795
                             own['grind_out_type'] = 'bs reg forward'
3891
-                        #own.applyRotation((0, -.15, 0), True)
3796
+            
3892
                     own["grindoutturn"] = gotcd
3797
                     own["grindoutturn"] = gotcd
3893
                     own['invert_on'] = 0
3798
                     own['invert_on'] = 0
3894
-            #if lq1on or lq2on or lq3on or lq4on or lq5on or lq6on or lq7on or lq8on:
3799
+            
3895
             if sl.q1 >= countdown or sl.q2 >= countdown or sl.q3 >= countdown or sl.q4 >= countdown or sl.q5 >= countdown or sl.q6 >= countdown or sl.q7 >= countdown:
3800
             if sl.q1 >= countdown or sl.q2 >= countdown or sl.q3 >= countdown or sl.q4 >= countdown or sl.q5 >= countdown or sl.q6 >= countdown or sl.q7 >= countdown:
3896
                 gt_cd = own['gt_cd']
3801
                 gt_cd = own['gt_cd']
3897
                 if gt_cd == 0:
3802
                 if gt_cd == 0:
3980
     if own["grindoutturn"] > 0:
3885
     if own["grindoutturn"] > 0:
3981
         own["grindoutturn"] = own["grindoutturn"] - 1
3886
         own["grindoutturn"] = own["grindoutturn"] - 1
3982
 
3887
 
3983
-
3984
     def air_height():
3888
     def air_height():
3985
         height = own["air_height"]
3889
         height = own["air_height"]
3986
         if lf_ground == True and not onGround:
3890
         if lf_ground == True and not onGround:
4041
 
3945
 
4042
     def wallride_sound():
3946
     def wallride_sound():
4043
         sact = own.actuators["wallSound"]
3947
         sact = own.actuators["wallSound"]
4044
-        #print('wr as', own['aState'])
4045
-        #if own["wallride"] != None and (own['actionState'] == 'reg_wall_r' or own['actionState'] == 'reg_wall_l' or own['actionState'] == 'fak_wall_r' or own['actionState'] == 'fak_wall_l'):
4046
         if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
3948
         if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
4047
             sact.volume = .2
3949
             sact.volume = .2
4048
             cont.activate(own.actuators["wallSound"])
3950
             cont.activate(own.actuators["wallSound"])
4167
                 if ('rd_cl' in str(const) or 'rd_cr' in str(const)):
4069
                 if ('rd_cl' in str(const) or 'rd_cr' in str(const)):
4168
                     const.enforce = stre  
4070
                     const.enforce = stre  
4169
 
4071
 
4170
-
4171
-
4172
     def land_mod():
4072
     def land_mod():
4173
         if own['requestAction'] == 'reg_land':
4073
         if own['requestAction'] == 'reg_land':
4174
             own['EaRequest'] = 'land'
4074
             own['EaRequest'] = 'land'
4295
     Distance = -10
4195
     Distance = -10
4296
     End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
4196
     End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
4297
     Start = own.worldPosition
4197
     Start = own.worldPosition
4298
-    #localRay = own.rayCast(End, Start, 0,'ground', 0, 0, 0)
4299
     localRay = groundRay
4198
     localRay = groundRay
4300
     own['vert'] = 0
4199
     own['vert'] = 0
4301
     own['transition'] = False
4200
     own['transition'] = False
4302
     aligned = False
4201
     aligned = False
4303
-    #if localRay[0] or grindRay[0]:
4202
+
4304
     if localRay[0]:
4203
     if localRay[0]:
4305
         if 'transition' in localRay[0]:
4204
         if 'transition' in localRay[0]:
4306
             own['transition'] = True
4205
             own['transition'] = True
4321
            
4220
            
4322
         if localHitDist > .31 and localHitDist < 2:
4221
         if localHitDist > .31 and localHitDist < 2:
4323
             own.alignAxisToVect(localRay[2], 2, .05)
4222
             own.alignAxisToVect(localRay[2], 2, .05)
4324
-    #else:
4325
-        #print('no localRay')
4223
+
4326
         else:
4224
         else:
4327
             if own['jump_timer'] == 0:
4225
             if own['jump_timer'] == 0:
4328
                 y1 = Start
4226
                 y1 = Start
4344
                     localHitDist = (Start - localRay[1]).length
4242
                     localHitDist = (Start - localRay[1]).length
4345
                     if localHitDist < .3:
4243
                     if localHitDist < .3:
4346
                         own.applyMovement((0, 0, (.3 - localHitDist)), True)
4244
                         own.applyMovement((0, 0, (.3 - localHitDist)), True)
4347
-                        #print('moving new rayb')
4348
                         if localRay[2] != [0, 0, -1] and grindHit == 0:
4245
                         if localRay[2] != [0, 0, -1] and grindHit == 0:
4349
                             own.alignAxisToVect(localRay[2], 2, .25)
4246
                             own.alignAxisToVect(localRay[2], 2, .25)
4350
                             aligned = True
4247
                             aligned = True
4351
 
4248
 
4352
     else:
4249
     else:
4353
-        #print('vh')
4354
         Axis = 2
4250
         Axis = 2
4355
         Distance = -2
4251
         Distance = -2
4356
         End = Vector.copy(own.worldPosition + (own.worldOrientation.col[Axis]*Distance))
4252
         End = Vector.copy(own.worldPosition + (own.worldOrientation.col[Axis]*Distance))
4364
             print('vert hit')
4260
             print('vert hit')
4365
             ud_sens = .04      
4261
             ud_sens = .04      
4366
             if 'spine' in localRay_v[0] and lUD < -.04:
4262
             if 'spine' in localRay_v[0] and lUD < -.04:
4367
-                print('spine hit!!!!!', lUD)
4368
-                
4369
-                #print('roting')
4370
                 if STANCE == True:
4263
                 if STANCE == True:
4371
                     own.applyRotation([0,.15,0], True)
4264
                     own.applyRotation([0,.15,0], True)
4372
                 else:    
4265
                 else:    
4379
                 own.linearVelocity.x *= .98
4272
                 own.linearVelocity.x *= .98
4380
                 own.linearVelocity.z = .1
4273
                 own.linearVelocity.z = .1
4381
 
4274
 
4382
-
4383
-
4384
-                #if localHitDist < .8 and (dict['lUD'] < .04 or dict['lUD'] > -.04):
4385
-                #if localHitDist < .8:    
4386
-
4387
-
4388
-
4389
-
4390
-
4391
-
4392
-
4393
-                # if localHitDist < 1.5:        
4394
-                #     #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4395
-                #     #own.applyMovement((0, 0, (.3 - localHitDist)), True)
4396
-                #     #if localHitDist < 1.0:
4397
-                #     own.applyForce((0, 0, (.4 - localHitDist) *1000), True)
4398
-
4399
-                #     print('moving vert ray')
4400
-                #     if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4401
-                #     #if localRay_v[2] != [0,0,-1]:
4402
-                #         #own.alignAxisToVect(localRay_v[2], 2, .4)
4403
-                #         own.alignAxisToVect(localRay_v[2], 2, .05)
4404
-                #         aligned = True
4405
-
4406
-
4407
-
4408
-                #f localHitDist < .295:
4409
                 if localHitDist < .4:    
4275
                 if localHitDist < .4:    
4410
                     if own['jump_timer'] < 30:
4276
                     if own['jump_timer'] < 30:
4411
                         own.localLinearVelocity.z = 0
4277
                         own.localLinearVelocity.z = 0
4412
                     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4278
                     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4413
-                    #own.applyMovement((0, 0, (.35 - (localHitDist))), True)
4414
                     if localRay_v[2] != [0, 0, -1]:    
4279
                     if localRay_v[2] != [0, 0, -1]:    
4415
                         own.alignAxisToVect(localRay_v[2], 2, .5)
4280
                         own.alignAxisToVect(localRay_v[2], 2, .5)
4416
                         aligned = True
4281
                         aligned = True
4417
-
4418
-            #elif lUD >= -ud_sens:
4419
-                
4420
-
4421
-
4422
-
4423
             else:
4282
             else:
4424
                 own.alignAxisToVect([0,0,1], 2, .1)
4283
                 own.alignAxisToVect([0,0,1], 2, .1)
4425
                 print('doing nothing')            
4284
                 print('doing nothing')            
4426
-        #print(own['lGobj'], 'lGobj')                         
4427
-
4428
-
4429
-
4430
 
4285
 
4431
     localHitDist = 1000
4286
     localHitDist = 1000
4432
     raytof = scene.objects['rayTo_f']
4287
     raytof = scene.objects['rayTo_f']
4433
     raytob = scene.objects['rayTo_b']
4288
     raytob = scene.objects['rayTo_b']
4434
 
4289
 
4435
-
4436
     if localRay[0]:
4290
     if localRay[0]:
4437
-        #print('gh')
4438
         localHitDist = (own.worldPosition - localRay[1]).length
4291
         localHitDist = (own.worldPosition - localRay[1]).length
4439
     if localHitDist > .3 and frames_since_grinding < 30 and frames_since_grinding > 0 and own['grindTouch'] == False:
4292
     if localHitDist > .3 and frames_since_grinding < 30 and frames_since_grinding > 0 and own['grindTouch'] == False:
4440
         rayf = own.rayCast(raytof.worldPosition, own.worldPosition, 0, 'transition', 1, 0, 0)
4293
         rayf = own.rayCast(raytof.worldPosition, own.worldPosition, 0, 'transition', 1, 0, 0)
4449
             aligned = True
4302
             aligned = True
4450
             print('rayb hit')
4303
             print('rayb hit')
4451
 
4304
 
4452
-
4453
     if not aligned or (lBump == 1):
4305
     if not aligned or (lBump == 1):
4454
         own.alignAxisToVect([0.0, 0.0, 1.0], 2, .00003)
4306
         own.alignAxisToVect([0.0, 0.0, 1.0], 2, .00003)
4455
 
4307
 
4458
     if (grindDar == False and onGround and own['grindTouch'] == False) or own['jump_timer'] > 40:
4310
     if (grindDar == False and onGround and own['grindTouch'] == False) or own['jump_timer'] > 40:
4459
         own['grindType'] = ''
4311
         own['grindType'] = ''
4460
 
4312
 
4461
-    
4462
     if cont.sensors['npc'].triggered:
4313
     if cont.sensors['npc'].triggered:
4463
         cam['walker_manager'].pub.dispatch('path found', ['hit', own, cont.sensors['npc'].hitObject])
4314
         cam['walker_manager'].pub.dispatch('path found', ['hit', own, cont.sensors['npc'].hitObject])
4464
-        
4465
-        #print('npc hit')
4466
-
4467
 
4315
 
4468
     if own['actionState'] in ['frontside_grab_out', 'backside_grab_out', 'frontside_nose_grab_out', 'frontside_tail_grab_out', 'backside_nose_grab_out', 'backside_tail_grab_out', 'reg_walk_air_out', 'reg_air-walk_air', 'reg_judo_out', 'reg_frigid_out', 'reg_fsonefoot_out', 'reg_onefoot_out', 'reg_airwalk_out'] and own['requestAction'] in ['fak_land', 'reg_land']:
4316
     if own['actionState'] in ['frontside_grab_out', 'backside_grab_out', 'frontside_nose_grab_out', 'frontside_tail_grab_out', 'backside_nose_grab_out', 'backside_tail_grab_out', 'reg_walk_air_out', 'reg_air-walk_air', 'reg_judo_out', 'reg_frigid_out', 'reg_fsonefoot_out', 'reg_onefoot_out', 'reg_airwalk_out'] and own['requestAction'] in ['fak_land', 'reg_land']:
4469
         own['requestAction'] = 'reg_land'
4317
         own['requestAction'] = 'reg_land'

+ 2
- 2
shuvit.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:e72556574622eb6505f8efaca9e42a1f2f722a16f51198ba1c9fdcbaa1a7764c
3
-size 117183140
2
+oid sha256:81e6f6a85fa2051df8668efacb6b1e7c72e7374d2dfb678bb77146b23b12cf90
3
+size 117308004

Loading…
Cancel
Save