Browse Source

turn tweaks

shuvit 2 months ago
parent
commit
447d50bbf5
4 changed files with 48 additions and 37 deletions
  1. 4
    4
      config.ini
  2. 1
    1
      scripts/actionPlayer.py
  3. 42
    31
      scripts/controller2.py
  4. 1
    1
      scripts/grindV2.py

+ 4
- 4
config.ini View File

@@ -54,9 +54,9 @@ character = annie
54 54
 
55 55
 shirt_logo = 2
56 56
 
57
-shirt_color_r = 0.69
58
-shirt_color_g = 0.05
59
-shirt_color_b = 0
57
+shirt_color_r = 0.29
58
+shirt_color_g = 0.31
59
+shirt_color_b = 0.28
60 60
 
61 61
 shoe_color_r = 0.73
62 62
 shoe_color_g = 0.73
@@ -143,7 +143,7 @@ pump_downforce = -0.0
143 143
 man_sens_l = 0.03
144 144
 man_sens_r = 0.08
145 145
 man_sens_side = 0.035
146
-turn_rotation = 0.02
146
+turn_rotation = 0.0175
147 147
 turn_addx = 0.004
148 148
 turn_air_rotation = 0.07
149 149
 grass_mult = 0.98

+ 1
- 1
scripts/actionPlayer.py View File

@@ -198,7 +198,7 @@ def check_exit(aState, rA, timer, ac):
198 198
 	fe = getattr(ac, 'fef')
199 199
 	rv = ''
200 200
 	
201
-	print('rA, aState', rA, aState, force, fe, timer)
201
+	#print('rA, aState', rA, aState, force, fe, timer)
202 202
 	if rA in exits:
203 203
 		rv = rA
204 204
 	#

+ 42
- 31
scripts/controller2.py View File

@@ -1920,6 +1920,9 @@ def main():
1920 1920
         #speed = .004
1921 1921
         speed = dict['turn_addx']
1922 1922
         manual = 0
1923
+        multer = abs(round(((round(lLR, 2) * 100) / 8), 1))
1924
+        if dict['kb_ra'] == 2 or dict['kb_la'] == 2:
1925
+            multer = 1
1923 1926
         if own['manual_v2'] == 1:
1924 1927
             manual = 1
1925 1928
             if abs(linVelocity.x) < 2:
@@ -1938,55 +1941,63 @@ def main():
1938 1941
         turnVel = .01
1939 1942
     #light
1940 1943
     #if manual and grindhit = true
1941
-        if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1942
-            rotation = [0.0, 0.0, (-rotamt)]
1943
-            local = False # use world axis
1944
-            own.applyRotation( rotation, local)
1945
-
1946
-            if onGround:
1947
-                #print("light turn")
1948
-                if STANCE == 0:
1949
-                    own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1950
-                if STANCE == 1:
1951
-                    own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
1952
-        if lLR < -turnsens and lLR > (turnsens * -1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1953
-            rotation = [0.0, 0.0, rotamt]
1954
-            local = False # use world axis
1955
-            own.applyRotation( rotation, local)
1956
-
1957
-            if onGround:
1958
-                #print("light turn")
1959
-                if STANCE == 0:
1960
-                    own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1961
-                if STANCE == 1:
1962
-                    own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
1944
+        # if lLR > turnsens and lLR < (turnsens * 1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1945
+        #     rotation = [0.0, 0.0, (-rotamt)]
1946
+        #     local = False # use world axis
1947
+        #     #own.applyRotation( rotation, local)
1948
+
1949
+        #     if onGround:
1950
+        #         #print("light turn")
1951
+        #         if STANCE == 0:
1952
+        #             own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1953
+        #         if STANCE == 1:
1954
+        #             own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
1955
+        # if lLR < -turnsens and lLR > (turnsens * -1.3) and (grindHit == False or (manual == 1 and grindHit == True)):
1956
+        #     rotation = [0.0, 0.0, rotamt]
1957
+        #     local = False # use world axis
1958
+        #     #own.applyRotation( rotation, local)
1959
+
1960
+        #     if onGround:
1961
+        #         #print("light turn")
1962
+        #         if STANCE == 0:
1963
+        #             own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y, linVelocity2.z], 1)
1964
+        #         if STANCE == 1:
1965
+        #             own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y, linVelocity2.z], 1)
1963 1966
     #medium
1964
-        if (lLR > (turnsens * 1.3) or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1967
+        max_amt = 3
1968
+        if (lLR > (turnsens * 1) or dict['kb_ra'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1965 1969
             #turn left
1966 1970
             if rot.z < .4:
1967
-                rotation = [0.0, 0.0, (-rotamt * 5)]
1971
+                rotation = [0.0, 0.0, ((-rotamt * 5) * multer)]
1968 1972
             if rot.z < .6 and rot.z > .4:
1969
-                rotation = [0.0, 0.0, (-rotamt * 2)]
1973
+                rotation = [0.0, 0.0, ((-rotamt * 2) * multer)]
1970 1974
             else:
1971
-                rotation = [0.0, 0.0, (-rotamt * 1.6)]
1975
+                rotation = [0.0, 0.0, ((-rotamt * 1.6) * multer)]
1972 1976
             local = True # use world axis
1973 1977
             own.applyRotation( rotation, local)
1978
+            print('rotation = ', rotation)
1974 1979
             if onGround:
1975 1980
                 #print("med turn")
1976 1981
                 if STANCE == 0:
1977 1982
                     own.setLinearVelocity([linVelocity2.x - speed, linVelocity2.y - turnVel, linVelocity2.z], 1)
1978 1983
                 if STANCE == 1:
1979 1984
                     own.setLinearVelocity([linVelocity2.x + speed, linVelocity2.y - turnVel, linVelocity2.z], 1)
1980
-        if (lLR < (-turnsens * 1.3) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1981
-            #turn right
1985
+        elif (lLR < (-turnsens * 1) or dict['kb_la'] == 2) and (grindHit == False or (manual == 1 and grindHit == True)):
1986
+            #turn right                     
1987
+            #vert     
1982 1988
             if rot.z < .4:
1983
-                rotation = [0.0, 0.0, (rotamt * 5)]
1989
+                rotation = [0.0, 0.0, ((rotamt * 5) * multer)]
1990
+            #near vert    
1984 1991
             if rot.z < .6 and rot.z > .4:
1985
-                rotation = [0.0, 0.0, (rotamt * 2)]
1992
+                rotation = [0.0, 0.0, ((rotamt * 2) * multer)]
1993
+                
1994
+            #normal    
1986 1995
             else:
1987
-                rotation = [0.0, 0.0, (rotamt * 1.6)]
1996
+                rotation = [0.0, 0.0, ((rotamt * 1.6) * multer)]
1997
+    
1988 1998
             local = True # use world axis
1989 1999
             own.applyRotation( rotation, local)
2000
+            print('rotation = ', rotation)
1990 2001
             if onGround:
1991 2002
                 #print("med turn")
1992 2003
                 if STANCE == 0:

+ 1
- 1
scripts/grindV2.py View File

@@ -716,7 +716,7 @@ def main():
716 716
                                 stre = .15
717 717
                                 #own.alignAxisToVect(hitNormal, 2, stre)
718 718
                             #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
719
-                            own.worldPosition.lerp(own.worldPosition, nearpos, .1)
719
+                            own.worldPosition.lerp(own.worldPosition, nearpos, .025)
720 720
                             print('new moving world')
721 721
                     
722 722
     else:

Loading…
Cancel
Save