shuvit 3 years ago
parent
commit
94b7087d06
5 changed files with 580 additions and 134 deletions
  1. 234
    15
      co_ActionState.py
  2. 182
    55
      controller2.py
  3. 9
    4
      grindV2.py
  4. 6
    0
      scene_init.py
  5. 149
    60
      walk.py

+ 234
- 15
co_ActionState.py
File diff suppressed because it is too large
View File


+ 182
- 55
controller2.py View File

@@ -949,6 +949,7 @@ def main():
949 949
         trigger = r_ground.triggered
950 950
         STANCE = own["stance"]
951 951
         wallride = own["wallride"]
952
+        dict['trick_string'] = 'Ollie'
952 953
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
953 954
             own["wallride_off"] = 1
954 955
             own['requestAction'] = 'reg_ollie'
@@ -976,28 +977,32 @@ def main():
976 977
 
977 978
     def kickflip():
978 979
         print("kickflip")
979
-        dict['trick_string'] = 'Kickflip'
980
+        
980 981
         STANCE = own["stance"]
981 982
         print(flip_start_lay)
982 983
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
983 984
             own["wallride_off"] = 1
984 985
             own['requestAction'] = 'reg_kickflip'       
985 986
             jump()
987
+            dict['trick_string'] = 'Kickflip'
986 988
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
987 989
             own["wallride_off"] = 1
988
-            own['requestAction'] = 'fak_kickflip'       
990
+            own['requestAction'] = 'fak_heelflip'       
989 991
             jump()
990 992
             if own["wallride"] !=1: jump()
993
+            dict['trick_string'] = 'Heelflip'
991 994
         if r_ground.triggered == 0 and STANCE == False:
992 995
             own["wallride_off"] = 1
993 996
             own['requestAction'] = 'reg_kickflip'
994 997
             if own["wallride"] != None: 
995 998
                 jump()  
999
+            dict['trick_string'] = 'Kickflip'
996 1000
         elif r_ground.triggered == 0 and STANCE == True:
997 1001
             own["wallride_off"] = 1
998
-            own['requestAction'] = 'fak_kickflip'
1002
+            own['requestAction'] = 'fak_heelflip'
999 1003
             if own["wallride"] != None: 
1000 1004
                 jump()
1005
+            dict['trick_string'] = 'Heelflip'    
1001 1006
 
1002 1007
     def inward_heelflip():
1003 1008
         print("inward heelflip")
@@ -1187,16 +1192,18 @@ def main():
1187 1192
         
1188 1193
     def heelflip():
1189 1194
         print("heelflip")
1190
-        dict['trick_string'] = 'Heelflip'
1195
+        
1191 1196
         STANCE = own["stance"]
1192 1197
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1193 1198
             own["wallride_off"] = 1
1194 1199
             own['requestAction'] = 'reg_heelflip'
1195 1200
             jump()
1201
+            dict['trick_string'] = 'Heelflip'
1196 1202
         elif (r_ground.triggered == 1 and STANCE == True) or ((grindHit == True or wallride != None) and STANCE == True):
1197 1203
             own["wallride_off"] = 1
1198
-            own['requestAction'] = 'fak_heelflip'
1204
+            own['requestAction'] = 'fak_kickflip'
1199 1205
             jump()
1206
+            dict['trick_string'] = 'Kickflip'
1200 1207
         if r_ground.triggered == 0 and STANCE == False:
1201 1208
             own["wallride_off"] = 1
1202 1209
         elif r_ground.triggered == 0 and STANCE == True:
@@ -1225,7 +1232,7 @@ def main():
1225 1232
 
1226 1233
     def shuvit():
1227 1234
         print("shuvit")
1228
-        dict['trick_string'] = 'shuvit'
1235
+        dict['trick_string'] = 'Shuvit'
1229 1236
         STANCE = own["stance"]
1230 1237
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1231 1238
             own["wallride_off"] = 1
@@ -1245,7 +1252,7 @@ def main():
1245 1252
 
1246 1253
     def shuvit360():
1247 1254
         print("360shuvit")
1248
-        dict['trick_string'] = '360 shuvit'
1255
+        dict['trick_string'] = '360 Shuvit'
1249 1256
         STANCE = own["stance"]
1250 1257
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1251 1258
             own["wallride_off"] = 1
@@ -1266,7 +1273,7 @@ def main():
1266 1273
 
1267 1274
     def fsshuvit360():
1268 1275
         print("360shuvit")
1269
-        dict['trick_string'] = '360 shuvit'
1276
+        dict['trick_string'] = 'FS 360 Shuvit'
1270 1277
         STANCE = own["stance"]
1271 1278
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1272 1279
             own["wallride_off"] = 1
@@ -1287,7 +1294,7 @@ def main():
1287 1294
 
1288 1295
     def nollie_shuvit():
1289 1296
         print("shuvit")
1290
-        dict['trick_string'] = 'Nollie shuvit'
1297
+        dict['trick_string'] = 'Nollie Shuvit'
1291 1298
         STANCE = own["stance"]
1292 1299
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1293 1300
             own["wallride_off"] = 1
@@ -1307,7 +1314,7 @@ def main():
1307 1314
                 jump()        
1308 1315
 
1309 1316
     def fsshuvit():
1310
-        dict['trick_string'] = 'Frontside shuvit'
1317
+        dict['trick_string'] = 'FS Shuvit'
1311 1318
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1312 1319
             own["wallride_off"] = 1
1313 1320
             own['requestAction'] = 'reg_fsshuvit'
@@ -1326,7 +1333,7 @@ def main():
1326 1333
                 jump()
1327 1334
             
1328 1335
     def nollie_fsshuvit():
1329
-        dict['trick_string'] = 'Nollie Frontside shuvit'
1336
+        dict['trick_string'] = 'Nollie FS Shuvit'
1330 1337
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1331 1338
             own["wallride_off"] = 1
1332 1339
             own['requestAction'] = 'reg_nollie_fsshuvit'
@@ -1346,7 +1353,7 @@ def main():
1346 1353
      
1347 1354
     #nollie_shuvit360()
1348 1355
     def nollie_shuvit360():
1349
-        dict['trick_string'] = 'Nollie Frontside shuvit 360'
1356
+        dict['trick_string'] = 'Nollie FS Shuvit 360'
1350 1357
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1351 1358
             own["wallride_off"] = 1
1352 1359
             own['requestAction'] = 'reg_nollie_shuvit360'
@@ -1366,7 +1373,7 @@ def main():
1366 1373
 
1367 1374
     #nollie_fsshuvit360()
1368 1375
     def nollie_fsshuvit360():
1369
-        dict['trick_string'] = 'Nollie Frontside shuvit 360'
1376
+        dict['trick_string'] = 'Nollie FS Shuvit 360'
1370 1377
         if (r_ground.triggered == 1 and STANCE == False) or ((grindHit == True or wallride != None) and STANCE == False):
1371 1378
             own["wallride_off"] = 1
1372 1379
             own['requestAction'] = 'reg_nollie_fsshuvit_360'
@@ -1383,11 +1390,68 @@ def main():
1383 1390
             own["wallride_off"] = 1
1384 1391
             if own["wallride"] != None: 
1385 1392
                 jump()             
1386
-        
1393
+#-------
1394
+    def reg_frigid_grab_on():
1395
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1396
+        GRAB_ON = own["GRAB_ON"]
1397
+        dict['trick_string'] = 'Frigid'
1398
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1399
+            own['requestAction'] = 'reg_frigid'
1400
+            grablay2 = grablay + 1
1401
+            GRAB_PLAYED = True
1402
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1403
+    def reg_fsonefoot_grab_on():
1404
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1405
+        GRAB_ON = own["GRAB_ON"]
1406
+        dict['trick_string'] = 'FS One Foot'
1407
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1408
+            own['requestAction'] = 'reg_fsonefoot'
1409
+            grablay2 = grablay + 1
1410
+            GRAB_PLAYED = True
1411
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1412
+    def reg_onefoot_grab_on():
1413
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1414
+        GRAB_ON = own["GRAB_ON"]
1415
+        dict['trick_string'] = 'One Foot'
1416
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1417
+            own['requestAction'] = 'reg_onefoot'
1418
+            grablay2 = grablay + 1
1419
+            GRAB_PLAYED = True
1420
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1421
+
1422
+    def fak_frigid_grab_on():
1423
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1424
+        GRAB_ON = own["GRAB_ON"]
1425
+        dict['trick_string'] = 'Frigid'
1426
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1427
+            own['requestAction'] = 'fak_frigid'
1428
+            grablay2 = grablay + 1
1429
+            GRAB_PLAYED = True
1430
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1431
+    def fak_fsonefoot_grab_on():
1432
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1433
+        GRAB_ON = own["GRAB_ON"]
1434
+        dict['trick_string'] = 'FS One Foot'
1435
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1436
+            own['requestAction'] = 'fak_fsonefoot'
1437
+            grablay2 = grablay + 1
1438
+            GRAB_PLAYED = True
1439
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1440
+    def fak_onefoot_grab_on():
1441
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1442
+        GRAB_ON = own["GRAB_ON"]
1443
+        dict['trick_string'] = 'One Foot'
1444
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1445
+            own['requestAction'] = 'fak_onefoot'
1446
+            grablay2 = grablay + 1
1447
+            GRAB_PLAYED = True
1448
+            own["GRAB_PLAYED)"] = GRAB_PLAYED
1449
+
1450
+#----        
1387 1451
     def reg_judo_grab_on():
1388 1452
         GRAB_PLAYED = own["GRAB_PLAYED"]
1389 1453
         GRAB_ON = own["GRAB_ON"]
1390
-        dict['trick_string'] = 'Judo Grab'
1454
+        dict['trick_string'] = 'Judo'
1391 1455
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1392 1456
             own['requestAction'] = 'reg_judo'
1393 1457
             grablay2 = grablay + 1
@@ -1397,7 +1461,7 @@ def main():
1397 1461
     def fak_judo_grab_on():
1398 1462
         GRAB_PLAYED = own["GRAB_PLAYED"]
1399 1463
         GRAB_ON = own["GRAB_ON"]
1400
-        dict['trick_string'] = 'Fak Judo Grab'
1464
+        dict['trick_string'] = 'Judo'
1401 1465
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1402 1466
             own['requestAction'] = 'fak_judo'
1403 1467
             grablay2 = grablay + 1
@@ -1407,7 +1471,7 @@ def main():
1407 1471
     def frontside_grab_on():
1408 1472
         GRAB_PLAYED = own["GRAB_PLAYED"]
1409 1473
         GRAB_ON = own["GRAB_ON"]
1410
-        dict['trick_string'] = 'Mute Grab'
1474
+        dict['trick_string'] = 'Mute'
1411 1475
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1412 1476
             own['requestAction'] = 'frontside_grab'
1413 1477
             #skater.playAction("reg_fg", 10,30, layer=400, priority=5, play_mode=1, speed=.5)
@@ -1419,6 +1483,7 @@ def main():
1419 1483
     def backside_grab_on():
1420 1484
         GRAB_PLAYED = own["GRAB_PLAYED"]
1421 1485
         GRAB_ON = own["GRAB_ON"]
1486
+        dict['trick_string'] = 'Backside'
1422 1487
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1423 1488
             own['requestAction'] = 'reg_fp_rback'          
1424 1489
         elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
@@ -1429,6 +1494,7 @@ def main():
1429 1494
     def fakfrontside_grab_on():
1430 1495
         GRAB_PLAYED = own["GRAB_PLAYED"]
1431 1496
         GRAB_ON = own["GRAB_ON"]
1497
+        dict['trick_string'] = 'Mute'
1432 1498
         if GRAB_ON == True and r_ground.triggered == 0 and aBut == True:
1433 1499
             own['requestAction'] = 'fak_fp_rback'         
1434 1500
         
@@ -1440,6 +1506,7 @@ def main():
1440 1506
     def fakbackside_grab_on():
1441 1507
         GRAB_PLAYED = own["GRAB_PLAYED"]
1442 1508
         GRAB_ON = own["GRAB_ON"]
1509
+        dict['trick_string'] = 'Backside'
1443 1510
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:         
1444 1511
             own['requestAction'] = 'fak_backside_grab' 
1445 1512
             GRAB_PLAYED = True
@@ -1449,6 +1516,7 @@ def main():
1449 1516
     def frontside_nose_grab_on():
1450 1517
         GRAB_PLAYED = own["GRAB_PLAYED"]
1451 1518
         GRAB_ON = own["GRAB_ON"]
1519
+        dict['trick_string'] = 'FS Nose'
1452 1520
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:
1453 1521
             own['requestAction'] = 'frontside_nose_grab' 
1454 1522
             GRAB_PLAYED = True
@@ -1456,6 +1524,7 @@ def main():
1456 1524
     def frontside_tail_grab_on():
1457 1525
         GRAB_PLAYED = own["GRAB_PLAYED"]
1458 1526
         GRAB_ON = own["GRAB_ON"]
1527
+        dict['trick_string'] = 'FS Tail'
1459 1528
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1460 1529
             own['requestAction'] = 'frontside_tail_grab' 
1461 1530
             GRAB_PLAYED = True
@@ -1463,29 +1532,34 @@ def main():
1463 1532
     def backside_nose_grab_on():
1464 1533
         GRAB_PLAYED = own["GRAB_PLAYED"]
1465 1534
         GRAB_ON = own["GRAB_ON"]
1466
-        #airwalk
1467
-        if GRAB_ON == True and r_ground.triggered == 0 and (aBut == True):    
1468
-            print("airwalk")
1469
-            skater.playAction("reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1470
-            deck.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1471
-            trucks.playAction("a_reg_airwalk", 10,30, layer=405, priority=5, blendin=5, play_mode=1, speed=.5)
1472
-        
1473
-        #norm
1474
-        elif GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:   
1535
+        dict['trick_string'] = 'BS Nose'
1536
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:   
1475 1537
             own['requestAction'] = 'backside_nose_grab' 
1476 1538
             GRAB_PLAYED = True
1477 1539
             own["GRAB_PLAYED)"] = GRAB_PLAYED 
1478 1540
     def backside_tail_grab_on():
1479 1541
         GRAB_PLAYED = own["GRAB_PLAYED"]
1480 1542
         GRAB_ON = own["GRAB_ON"]
1543
+        dict['trick_string'] = 'BS Tail'
1481 1544
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1482 1545
             own['requestAction'] = 'backside_tail_grab' 
1483 1546
             GRAB_PLAYED = True
1484 1547
             own["GRAB_PLAYED)"] = GRAB_PLAYED
1548
+            
1549
+    def reg_airwalk():
1550
+        GRAB_PLAYED = own["GRAB_PLAYED"]
1551
+        GRAB_ON = own["GRAB_ON"]
1552
+        dict['trick_string'] = 'Airwalk'
1553
+        if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0: 
1554
+            own['requestAction'] = 'reg_airwalk' 
1555
+            GRAB_PLAYED = True
1556
+            own["GRAB_PLAYED)"] = GRAB_PLAYED            
1557
+            
1485 1558
     #switch    
1486 1559
     def fak_frontside_nose_grab_on():
1487 1560
         GRAB_PLAYED = own["GRAB_PLAYED"]
1488 1561
         GRAB_ON = own["GRAB_ON"]
1562
+        dict['trick_string'] = 'FS Nose'
1489 1563
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:  
1490 1564
             own['requestAction'] = 'fak_frontside_nose_grab' 
1491 1565
             GRAB_PLAYED = True
@@ -1494,6 +1568,7 @@ def main():
1494 1568
     def fak_frontside_tail_grab_on():
1495 1569
         GRAB_PLAYED = own["GRAB_PLAYED"]
1496 1570
         GRAB_ON = own["GRAB_ON"]
1571
+        dict['trick_string'] = 'FS Tail'
1497 1572
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1498 1573
             own['requestAction'] = 'fak_frontside_tail_grab' 
1499 1574
             GRAB_PLAYED = True
@@ -1502,6 +1577,7 @@ def main():
1502 1577
     def fak_backside_nose_grab_on():
1503 1578
         GRAB_PLAYED = own["GRAB_PLAYED"]
1504 1579
         GRAB_ON = own["GRAB_ON"]
1580
+        dict['trick_string'] = 'BS Nose'
1505 1581
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1506 1582
             own['requestAction'] = 'fak_backside_nose_grab' 
1507 1583
             GRAB_PLAYED = True
@@ -1510,6 +1586,7 @@ def main():
1510 1586
     def fak_backside_tail_grab_on():
1511 1587
         GRAB_PLAYED = own["GRAB_PLAYED"]
1512 1588
         GRAB_ON = own["GRAB_ON"]
1589
+        dict['trick_string'] = 'BS Tail'
1513 1590
         if GRAB_ON == True and GRAB_PLAYED == False and r_ground.triggered == 0:           
1514 1591
             own['requestAction'] = 'fak_backside_tail_grab' 
1515 1592
             GRAB_PLAYED = True
@@ -2101,8 +2178,10 @@ def main():
2101 2178
                 else:
2102 2179
                     if STANCE == 0:
2103 2180
                         own['requestAction'] = 'reg_5050'
2181
+                        dict['trick_string'] = '5050'
2104 2182
                     if STANCE == 1:
2105 2183
                         own['requestAction'] = 'fak_5050'
2184
+                        dict['trick_string'] = '5050'
2106 2185
                 
2107 2186
             elif STANCE == False:
2108 2187
                 if own['grindType'] == "reg_bsboard":
@@ -2420,6 +2499,7 @@ def main():
2420 2499
         own['revert_timer'] = 20 
2421 2500
         cont.activate(own.actuators["revertSound"]) 
2422 2501
         own['revert_sound'] = 1 
2502
+        dict['trick_string'] = 'Revert'
2423 2503
 
2424 2504
     def revert2():
2425 2505
         own["Q3oncdl"] = 0
@@ -2446,6 +2526,7 @@ def main():
2446 2526
         own['revert_timer'] = 20 
2447 2527
         cont.activate(own.actuators["revertSound"])   
2448 2528
         own['revert_sound'] = 1 
2529
+        dict['trick_string'] = 'Revert'
2449 2530
 
2450 2531
     def revert3():
2451 2532
         own["Q7oncdl"] = 0
@@ -2472,6 +2553,7 @@ def main():
2472 2553
         own['revert_timer'] = 20 
2473 2554
         cont.activate(own.actuators["revertSound"]) 
2474 2555
         own['revert_sound'] = 1  
2556
+        dict['trick_string'] = 'Revert'
2475 2557
 
2476 2558
     def revert4():
2477 2559
         own["Q7oncdl"] = 0
@@ -2498,6 +2580,7 @@ def main():
2498 2580
         own['revert_timer'] = 20 
2499 2581
         cont.activate(own.actuators["revertSound"]) 
2500 2582
         own['revert_sound'] = 1      
2583
+        dict['trick_string'] = 'Revert'
2501 2584
 
2502 2585
     def powerslide():
2503 2586
         own['powerslide_counter'] = own['powerslide_counter'] + 1
@@ -3410,23 +3493,39 @@ def main():
3410 3493
         GRAB_ON = True
3411 3494
         own["GRAB_ON"] = GRAB_ON
3412 3495
         #print(rTrig, GRAB_ON)
3413
-
3414
-        if STANCE == False and rUD >= -.07 and rUD <= .07:
3415
-            frontside_grab_on()
3416
-        elif STANCE == True and rUD >= -.07 and rUD <= .07:
3417
-            fakbackside_grab_on()
3418
-        #front_nose    
3419
-        if STANCE == True and rUD < -0.070:
3420
-            fak_backside_nose_grab_on()
3421
-        #front_tail    
3422
-        elif STANCE == True and rUD > 0.07:
3423
-            fak_backside_tail_grab_on() 
3424
-        #    
3425
-        if STANCE == False and rUD < -0.070:
3426
-            frontside_nose_grab_on()
3427
-        #front_tail    
3428
-        elif STANCE == False and rUD > 0.07:
3429
-            frontside_tail_grab_on()                
3496
+        if aBut == False and xBut == False:
3497
+            if STANCE == False and rUD >= -.07 and rUD <= .07:
3498
+                frontside_grab_on()
3499
+            elif STANCE == True and rUD >= -.07 and rUD <= .07:
3500
+                fakbackside_grab_on()
3501
+            #front_nose    
3502
+            if STANCE == True and rUD < -0.070:
3503
+                fak_backside_nose_grab_on()
3504
+            #front_tail    
3505
+            elif STANCE == True and rUD > 0.07:
3506
+                fak_backside_tail_grab_on() 
3507
+            #    
3508
+            if STANCE == False and rUD < -0.070:
3509
+                if bBut == True:
3510
+                    reg_airwalk()
3511
+                else:    
3512
+                    frontside_nose_grab_on()
3513
+            #front_tail    
3514
+            elif STANCE == False and rUD > 0.07:
3515
+                frontside_tail_grab_on()     
3516
+        elif aBut == True and xBut == False:
3517
+            if STANCE == False:
3518
+                reg_fsonefoot_grab_on()        
3519
+            else:
3520
+                fak_onefoot_grab_on()
3521
+        elif aBut == False and xBut == True:
3522
+            if STANCE == False:
3523
+                reg_frigid_grab_on()        
3524
+            else:
3525
+                fak_judo_grab_on()                  
3526
+                
3527
+                
3528
+                           
3430 3529
 
3431 3530
     #backside grab
3432 3531
     if lTrig > 0.02 and r_ground.triggered == 0 and flipping == False:    
@@ -3446,15 +3545,30 @@ def main():
3446 3545
                 fak_frontside_tail_grab_on() 
3447 3546
             #front_nose    
3448 3547
             if STANCE == False and rUD < -0.070:
3449
-                backside_nose_grab_on()
3548
+                if bBut == True:
3549
+                    reg_airwalk()
3550
+                else:                  
3551
+                    backside_nose_grab_on()
3450 3552
             #front_tail    
3451 3553
             elif STANCE == False and rUD > 0.07:
3452
-                backside_tail_grab_on()  
3453
-        else:
3554
+                backside_tail_grab_on() 
3555
+                
3556
+        elif aBut == True and xBut == False:
3454 3557
             if STANCE == False:
3455
-                reg_judo_grab_on()
3456
-            elif STANCE == True:
3457
-                fak_judo_grab_on()            
3558
+                reg_judo_grab_on()        
3559
+            else:
3560
+                fak_frigid_grab_on()
3561
+        elif aBut == False and xBut == True:
3562
+            if STANCE == False:
3563
+                reg_onefoot_grab_on()        
3564
+            else:
3565
+                fak_frigid_grab_on()                    
3566
+                 
3567
+#        else:
3568
+#            if STANCE == False:
3569
+#                reg_judo_grab_on()
3570
+#            elif STANCE == True:
3571
+#                fak_judo_grab_on()            
3458 3572
                                             
3459 3573
             
3460 3574
     #kill grabs        
@@ -3565,19 +3679,32 @@ def main():
3565 3679
         lgf = own['last_grind_frame']
3566 3680
         frame = own['framenum']
3567 3681
         frames_since_grinding = frame - lgf
3568
-        ylimit = .8
3569
-        if ground_since < 15:
3682
+        ylimit = .84
3683
+        #print(ground_since, 'ground_since')
3684
+        if ground_since < 20 and ground_since > 1 and grindHit == 0:
3570 3685
             ylimit = ylimit + ((ground_since - 15) * -.005)
3571
-            if ylimit > .99999:
3572
-                ylimit = .9999
3573
-               
3686
+            
3687
+            yvel = own.linearVelocity.y
3688
+            yvel = yvel *.03
3689
+            if STANCE == 0:
3690
+                yvel *= -1
3691
+            try:    
3692
+                dist = r_ground.hitObject.worldPosition - own.worldPosition
3693
+                #print('ground dist', dist)
3694
+                if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3695
+                    own.applyRotation([0,0,yvel], True)
3696
+                
3697
+                if ylimit > .99999:
3698
+                    ylimit = .9999
3699
+            except:
3700
+                pass       
3574 3701
         else:    
3575 3702
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3576 3703
                 linVelocity4 = own.getLinearVelocity(True)
3577 3704
                 newy = linVelocity4.y * ylimit   
3578 3705
                 force = [linVelocity4.x, newy, linVelocity4.z]
3579 3706
                 own.setLinearVelocity(force, True) 
3580
-        print(ylimit, 'ylimit')       
3707
+        #print(ylimit, 'ylimit')       
3581 3708
 
3582 3709
     def getoffboard():
3583 3710
         lasty = own['lasty']

+ 9
- 4
grindV2.py View File

@@ -403,8 +403,13 @@ def main():
403 403
                 delta = delta.cross(vect)
404 404
                 if delta[2] >= 0:
405 405
                     grindside = "right"
406
+
406 407
                 else:
407 408
                     grindside = "left"
409
+                edge = 0
410
+                if 'edge' in obj:
411
+                    edge = 1    
412
+                #print('grind on', grindside, edge)
408 413
                 if (delta[2] > .00001 or delta[2] < -.00001) and (delta[2] < .8 or delta[2] < -.8):
409 414
                     rotation = own.worldOrientation[2] - obj.worldOrientation[2]
410 415
                     player_e = own.worldOrientation.to_euler()
@@ -513,11 +518,11 @@ def main():
513 518
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
514 519
             #print('grind')      
515 520
             hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
516
-            if grindold == 0:
521
+            if grindold == 0:     
517 522
                 if grindTouch.triggered:
518 523
                     nearpos = nearestObject.worldPosition
519 524
                     if hitNormal != None:
520
-                        stre = .05
525
+                        stre = .45
521 526
                         own.alignAxisToVect(hitNormal, 2, stre) 
522 527
                         #print("align")                   
523 528
                     own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
@@ -538,10 +543,10 @@ def main():
538 543
                     if grindTouch.triggered:
539 544
                         nearpos = nearestObject.worldPosition
540 545
                         if hitNormal != None:
541
-                            stre = .05
546
+                            stre = .15
542 547
                             own.alignAxisToVect(hitNormal, 2, stre) 
543 548
                             #print("align")                   
544
-                        own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
549
+                        #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
545 550
                         print('new moving world')                    
546 551
 
547 552
     else:

+ 6
- 0
scene_init.py View File

@@ -179,5 +179,11 @@ def main():
179 179
     own['driving'] = False
180 180
     dict['last_driving'] = False
181 181
     own['last_roty'] = 0.0
182
+    
183
+    own['walk_targ_speed'] = 2
184
+    own['walk_fast_targ_speed'] = 5
185
+    own['walk_speed'] = 0
186
+    own['walk_inc'] = .05
187
+    own['walk_jump_timer'] = 0
182 188
        
183 189
 main()

+ 149
- 60
walk.py View File

@@ -83,6 +83,9 @@ noidle = 0
83 83
 
84 84
 #if skater.isPlayingAction(460):  
85 85
 #    noidle = 1  
86
+walk_inc = own['walk_inc'] 
87
+if own['stair_counter'] != 0:
88
+    walk_inc = own['walk_inc']  *10
86 89
 
87 90
 if own["stance"] == None:
88 91
     own["stance"] = True
@@ -161,6 +164,64 @@ if lLR > sens:
161 164
     lRight = 1
162 165
 else:
163 166
     lRight = 0        
167
+
168
+
169
+
170
+#turning
171
+turning = False
172
+if r_ground.positive:
173
+    num = .5
174
+    tilt = .015
175
+    if STANCE == 1:
176
+        num *= -1
177
+        tilt *= -1
178
+    if lRight == 1 or dict['kb_ra'] == 2:
179
+        #cont.activate(own.actuators['right'])
180
+        own.linearVelocity.y = num
181
+        if own['stair_counter'] > 0:
182
+            if STANCE == 0:
183
+                own.applyRotation([0,0,.05], True)
184
+            else:
185
+                own.applyRotation([0,0,-.05], True)                
186
+        else:
187
+            own.applyRotation([-tilt, 0, 0], True)
188
+        turning = True
189
+    else:
190
+        #cont.deactivate(own.actuators['right']) 
191
+        pass  
192
+        
193
+    if lLeft == 1 or dict['kb_la'] == 2:
194
+        #cont.activate(own.actuators['left']) 
195
+        own.linearVelocity.y = -num
196
+        if own['stair_counter'] > 0:
197
+            if STANCE == 0:
198
+                own.applyRotation([0,0,.05], True)
199
+            else:
200
+                own.applyRotation([0,0,-.05], True)                                
201
+        else:        
202
+            own.applyRotation([tilt, 0, 0], True)        
203
+        turning = True
204
+    else:
205
+        #cont.deactivate(own.actuators['left'])        
206
+        pass
207
+
208
+#in air        
209
+#if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
210
+if r_ground.positive == False:
211
+    airrot = .05
212
+    if lLeft == 1 or dict['kb_la'] == 2:
213
+        if stance == 0:
214
+            own.applyRotation([0,0,airrot], True)
215
+        if stance == 1:    
216
+            own.applyRotation([0,0,airrot], True)
217
+    if lRight == 1 or dict['kb_ra'] == 2:
218
+        if stance == 0:
219
+            own.applyRotation([0,0,-airrot], True)
220
+        if stance == 1:    
221
+            own.applyRotation([0,0,-airrot], True)            
222
+    own['lF_air_frame'] = own['framenum']  
223
+
224
+
164 225
     
165 226
 #walking
166 227
 
@@ -169,8 +230,10 @@ vel = own.getLinearVelocity(True)
169 230
 if own['walk_timer'] < 50:
170 231
     velx = vel.x * .95             
171 232
     own.setLinearVelocity([velx, 0, vel.z], True)
233
+    #print('y is zero')
172 234
 else:
173
-    own.setLinearVelocity([0, 0, vel.z], True)
235
+    pass
236
+    #own.setLinearVelocity([0, 0, vel.z], True)
174 237
     
175 238
 wf = 1
176 239
 if own['last_walk_frame'] - own['last_roll_frame'] > 55:
@@ -188,33 +251,60 @@ else:
188 251
     walking = None
189 252
    
190 253
 if walking == "regular":
191
-    cont.deactivate(own.actuators['forward2']) 
192
-    cont.deactivate(own.actuators['backward2'])    
193
-    if stance == 0:
194
-        cont.activate(own.actuators['forward'])
254
+    #if linvel.x < own['walk_targ_speed']:
255
+    #cont.deactivate(own.actuators['forward2']) 
256
+    #cont.deactivate(own.actuators['backward2'])    
257
+    if stance == 1:
258
+        if linvel.x < own['walk_targ_speed']:
259
+            own.linearVelocity.x = linvel.x + walk_inc
260
+        else:
261
+            own.linearVelocity.x = own['walk_targ_speed']    
262
+        #cont.activate(own.actuators['forward'])
195 263
     else:
196
-        cont.activate(own.actuators['backward'])
264
+        if linvel.x > -own['walk_targ_speed']:
265
+            own.linearVelocity.x = linvel.x - walk_inc       
266
+        else:
267
+            own.linearVelocity.x = -own['walk_targ_speed']                
268
+        #cont.activate(own.actuators['backward'])
197 269
 if walking == "fast":
198
-    cont.deactivate(own.actuators['forward']) 
199
-    cont.deactivate(own.actuators['backward'])    
200
-    if stance == 0:
201
-        cont.activate(own.actuators['forward2'])
270
+    #cont.deactivate(own.actuators['forward']) 
271
+    #cont.deactivate(own.actuators['backward'])    
272
+    if stance == 1:
273
+        if linvel.x < own['walk_fast_targ_speed']:
274
+            own.linearVelocity.x = linvel.x + walk_inc
275
+        else:
276
+            own.linearVelocity.x = own['walk_fast_targ_speed']  
202 277
     else:
203
-        cont.activate(own.actuators['backward2'])                 
278
+        if linvel.x > -own['walk_fast_targ_speed']:
279
+            own.linearVelocity.x = linvel.x - walk_inc      
280
+        else:
281
+            own.linearVelocity.x = -own['walk_fast_targ_speed'] 
204 282
 
205
-if walking == None:
206
-    cont.deactivate(own.actuators['forward2']) 
207
-    cont.deactivate(own.actuators['backward2'])
208
-    cont.deactivate(own.actuators['forward']) 
209
-    cont.deactivate(own.actuators['backward'])        
210
-    if own['walk_timer'] < 50:
283
+if walking == None and r_ground.positive and own['walk_jump_timer'] == 0:
284
+    #cont.deactivate(own.actuators['forward2']) 
285
+    #cont.deactivate(own.actuators['backward2'])
286
+    #cont.deactivate(own.actuators['forward']) 
287
+    #cont.deactivate(own.actuators['backward'])        
288
+    if own['walk_timer'] < 50 and turning == False:
211 289
         velx = vel.x * .95             
212 290
         own.setLinearVelocity([velx, 0, vel.z], True)
291
+        #print('minusvel', velx)
213 292
     else:
214
-        own.setLinearVelocity([0, 0, vel.z], True) 
293
+        #pass
294
+        print('minusvel')
295
+        if own.linearVelocity.x > .1 or own.linearVelocity.x < -.1:
296
+            own.linearVelocity.x *= .01
297
+        else:
298
+            own.linearVelocity.x = 0
299
+        if turning == False:    
300
+            if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
301
+                own.linearVelocity.y *= .01
302
+            else:
303
+                own.linearVelocity.y = 0                
304
+        #own.setLinearVelocity([0, 0, vel.z], True) 
215 305
     
216 306
 #old walking
217
-if (lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
307
+if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 0):
218 308
     own.actuators["walkondirt"].volume = .2
219 309
     own.actuators["walkondirt"].pitch = 1
220 310
     cont.activate(own.actuators["walkondirt"])
@@ -233,10 +323,11 @@ if (lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and
233 323
         else:
234 324
             own['requestAction'] = 'fak_walk'
235 325
        
236
-elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0:
326
+elif (((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 1):
237 327
     own.actuators["walkondirt"].volume = .2
238 328
     own.actuators["walkondirt"].pitch = 1.3
239 329
     cont.activate(own.actuators["walkondirt"])
330
+    print('fastwalk')
240 331
     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
241 332
         if own['throw_deck'] == True:
242 333
             own['requestAction'] = 'reg_walkFast_nb'
@@ -252,38 +343,7 @@ else:
252 343
     vel = own.getLinearVelocity(True)
253 344
     cont.deactivate(own.actuators["walkondirt"])       
254 345
 
255
-#turning
256
-if lRight == 1 or dict['kb_ra'] == 2:
257
-    cont.activate(own.actuators['right'])
258
-else:
259
-    cont.deactivate(own.actuators['right'])    
260
-    
261
-if lLeft == 1 or dict['kb_la'] == 2:
262
-    cont.activate(own.actuators['left'])    
263
-else:
264
-    cont.deactivate(own.actuators['left'])        
265
-
266
-#in air        
267
-if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
268
-    if stance == 0:
269
-        cont.deactivate(own.actuators['forward'])
270
-        cont.deactivate(own.actuators['forward2'])
271
-        killact(4)
272
-        killact(5)
273
-        killact(6)
274
-        killact(7)        
275
-        velx = linvel.x - 1
276
-        own.setLinearVelocity([-1.5, linvel.y, linvel.z], 1)
277
-    if stance == 1:    
278
-        cont.deactivate(own.actuators['backward'])
279
-        cont.deactivate(own.actuators['backward2'])
280
-        killact(4)
281
-        killact(5)
282
-        killact(6)
283
-        killact(7)        
284
-        velx = linvel.x + 1
285
-        own.setLinearVelocity([1.5, linvel.y, linvel.z], 1)  
286
-    own['lF_air_frame'] = own['framenum']         
346
+       
287 347
 #---------------
288 348
 if rLR > .05:
289 349
     cont.activate(camobj.actuators['camRight'])
@@ -341,11 +401,11 @@ def jump():
341 401
         own.linearVelocity.z = -10
342 402
     if xBut == True or dict['kb_space'] == 1: 
343 403
         if own['lastx'] == 0:
344
-            killact(3)
345
-            killact(4)
346
-            killact(5)
347
-            killact(6)
348
-            killact(7)      
404
+            #killact(3)
405
+            #killact(4)
406
+            #killact(5)
407
+            #killact(6)
408
+            #killact(7)      
349 409
             if STANCE == 0:  
350 410
                 own['requestAction'] ='reg_jump'  
351 411
                 print('jump') 
@@ -358,7 +418,11 @@ def jump():
358 418
             local = False
359 419
             # apply force -- limit jump speed
360 420
             if linvel.z < 10:
361
-                own.applyForce(force, local)
421
+                #own.applyForce(force, local)
422
+                own.linearVelocity.z += 5
423
+                own.linearVelocity.x = linvel.x
424
+                own.linearVelocity.y = linvel.y
425
+                own['walk_jump_timer'] = 20
362 426
         own['lastx'] = 1
363 427
     else:
364 428
         own['lastx'] = 0
@@ -1006,10 +1070,12 @@ if r_ground.triggered:
1006 1070
     try:
1007 1071
         if 'stair' in r_ground.hitObject:
1008 1072
             own['stair_counter'] = 20
1073
+            
1009 1074
     except:
1010 1075
         pass        
1011 1076
     if own['stair_counter'] > 0:
1012
-       own['stair_counter'] -= 1     
1077
+        own.linearVelocity.z += .1
1078
+        own['stair_counter'] -= 1     
1013 1079
 
1014 1080
 if yBut == True:
1015 1081
     own['walk_idling'] = 0
@@ -1038,6 +1104,16 @@ def onground():
1038 1104
             if own['framenum'] - own['last_fall_frame'] < 90:
1039 1105
                 own.applyForce([0,100,0], True)
1040 1106
                 #print('moving away from rail')
1107
+                
1108
+        yvel = own.linearVelocity.y
1109
+        yvel = yvel *.1
1110
+        if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01 and own['stair_counter'] == 0:
1111
+            if STANCE == 0:
1112
+                own.applyRotation([0,0,-yvel], True) 
1113
+            else:
1114
+                own.applyRotation([0,0,yvel], True) 
1115
+        else:
1116
+            own.linearVelocity.y = 0                           
1041 1117
 
1042 1118
     else:
1043 1119
         #print('in air')            
@@ -1050,6 +1126,8 @@ def onground():
1050 1126
     if cb.positive:
1051 1127
         if own['framenum'] - own['last_fall_frame'] < 90:
1052 1128
             own['lF_ground_frame'] = own['framenum']
1129
+            
1130
+            
1053 1131
 
1054 1132
 def get_in_car():
1055 1133
     vehicleNear = cont.sensors["vehicleNear"]
@@ -1124,7 +1202,18 @@ if dict['driving_reset'] == True:
1124 1202
     cont.actuators['Camera'].object = camobj2
1125 1203
     cont.activate(own.actuators['walk'])
1126 1204
     #dict['driving_reset'] = False
1127
-    #print('reseting driving')                
1205
+    #print('reseting driving')   
1206
+if own['walk_jump_timer'] != 0:
1207
+    own['walk_jump_timer'] = own['walk_jump_timer'] - 1    
1208
+wts = own['walk_targ_speed'] +1                 
1209
+if own['requestAction'] == 'reg_walkFast' and own.linearVelocity.x > (wts * -1):
1210
+    own['requestAction'] = 'reg_walk' 
1211
+if own['requestAction'] == 'fak_walkFast' and own.linearVelocity.x < wts:
1212
+    own['requestAction'] = 'fak_walk' 
1213
+if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
1214
+    own['requestAction'] = 'reg_walk_nb' 
1215
+if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1216
+    own['requestAction'] = 'fak_walk_nb'                         
1128 1217
 onboard() 
1129 1218
 jump()
1130 1219
 dropin()

Loading…
Cancel
Save