Browse Source

grind corner aligns

shuvit 5 years ago
parent
commit
b12ffe6d35

BIN
scripts/__pycache__/controller2.cpython-36.pyc View File


BIN
scripts/__pycache__/grindV2.cpython-36.pyc View File


+ 12
- 5
scripts/controller2.py View File

@@ -4514,6 +4514,7 @@ def main():
4514 4514
     localRay = groundRay
4515 4515
     own['vert'] = 0
4516 4516
     own['transition'] = False
4517
+    aligned = False
4517 4518
     #if localRay[0] or grindRay[0]:
4518 4519
     if localRay[0]:
4519 4520
 
@@ -4540,6 +4541,7 @@ def main():
4540 4541
             if localRay[2] != [0, 0, -1]:    
4541 4542
                 #own.alignAxisToVect(localRay[2], 2, .25)
4542 4543
                 own.alignAxisToVect(localRay[2], 2, .5)
4544
+                aligned = True
4543 4545
             #print('localRay')
4544 4546
 
4545 4547
 
@@ -4569,6 +4571,7 @@ def main():
4569 4571
                         #print('moving new rayb')
4570 4572
                         if localRay[2] != [0, 0, -1] and grindHit == 0:
4571 4573
                             own.alignAxisToVect(localRay[2], 2, .25)
4574
+                            aligned = True
4572 4575
 
4573 4576
     else:
4574 4577
         #print('vh')
@@ -4583,13 +4586,15 @@ def main():
4583 4586
             localHitDist = Vector.copy(Start - localRay_v[1]).length
4584 4587
             own.linearVelocity.x *= .98
4585 4588
             own.linearVelocity.z = .1
4586
-            if localHitDist < .8 and (dict['lUD'] < .04 or dict['lUD'] > -.04):
4589
+            #if localHitDist < .8 and (dict['lUD'] < .04 or dict['lUD'] > -.04):
4590
+            if localHitDist < .8:    
4587 4591
                 #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4588
-                own.applyMovement((0, 0, (.287 - localHitDist)), True)
4592
+                own.applyMovement((0, 0, (.4 - localHitDist)), True)
4589 4593
                 #print('moving vert ray')
4590 4594
                 if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4591 4595
                 #if localRay_v[2] != [0,0,-1]:
4592
-                    own.alignAxisToVect(localRay_v[2], 2, .3)
4596
+                    own.alignAxisToVect(localRay_v[2], 2, .4)
4597
+                    aligned = True
4593 4598
         #print(own['lGobj'], 'lGobj')                         
4594 4599
 
4595 4600
 
@@ -4610,14 +4615,16 @@ def main():
4610 4615
         if rayf[0]:
4611 4616
             print('rayf hit')
4612 4617
             own.alignAxisToVect(rayf[2], 2, .2)
4618
+            aligned = True
4613 4619
         elif rayb[0]:
4614 4620
             own.alignAxisToVect(rayb[2], 2, .2)
4621
+            aligned = True
4615 4622
             print('rayb hit')
4616 4623
 
4617 4624
     #print(raytof, raytob)
4618 4625
 
4619
-
4620
-
4626
+    if not aligned:
4627
+        own.alignAxisToVect([0.0, 0.0, 1.0], 2, .03)
4621 4628
 
4622 4629
     if own.linearVelocity.x > 12:
4623 4630
         own.linearVelocity.x = 12

+ 8
- 19
scripts/grindV2.py View File

@@ -94,40 +94,29 @@ def main():
94 94
 
95 95
     if grindold == 1:
96 96
         no_grind = 0
97
-    #don't grind unless you were in the air recently or were on a ramp recently or were grinding.
98
-
99
-    #if (own['onramp'] == 0 and frames_since_grind > 30):
100
-        #no_grind = 1
101
-
102
-    #if frames_since_grind > 30:
103
-        #no_grind = 0
104 97
 
105 98
     if frames_since_ground > 30 or since_jumped < 120:
106 99
         no_grind = 0
107 100
     if jump_timer > 50:
108 101
         no_grind = 1
109
-    if grindold == 0 and  (dict['lUD'] < -.04 or dict['lUD'] > .04):
110
-        no_grind = 1
111
-
112
-    #print('no grind timer', no_grind, own['no_grind_timer'])
113
-
114 102
 
115 103
     if (own['fak_nmanual'] == 1 or own['reg_nmanual'] == 1 or own['fak_manual'] == 1 or own['reg_manual'] == 1):
116 104
         manual = 1
117 105
     else:
118 106
         manual = 0
119
-    #manual = own['manual']
107
+
120 108
     own["nogrindsound"] = 0
121 109
     no_grind = 1
122
-    if (dict['rBump'] == 1 or own['vert'] == 0):
123
-    #print(own['last_vert_frame'])
124
-    #if (dict['rBump'] == 1 or (framenum - own['last_vert_frame'] < 10) and own['vert'] == 0):
110
+    
111
+    if (framenum - own['last_vert_frame'] < 40) and own['vert'] == 0:
112
+        no_grind = 1
113
+        print('no_grind = 1 last vert = ', (framenum - own['last_vert_frame']))
114
+    if dict['rBump'] == 1:
125 115
         no_grind = 0
126
-        #print('no_grind = 0')
116
+
127 117
     if own['LAST_GRIND']:
128 118
         no_grind = 0
129
-    # if (dict['lUD'] < -.04 or dict['lUD'] > .04):
130
-    #     no_grind = 0
119
+    
131 120
 #---------###########___###########-----------
132 121
 #start new                     #######
133 122
 ##----------##############----------############

Loading…
Cancel
Save