Browse Source

small ting

shuvit 5 years ago
parent
commit
d975004528
4 changed files with 18 additions and 27 deletions
  1. 3
    0
      Startup.py
  2. 2
    2
      co_ActionState.py
  3. 11
    24
      controller2.py
  4. 2
    1
      load_char.py

+ 3
- 0
Startup.py View File

@@ -140,5 +140,8 @@ def main():
140 140
     dict['spawned_npcs'] = []
141 141
     dict['JUMPHEIGHT'] = 800
142 142
     dict['MAX_VEL'] = 6.7
143
+    dict['char_loaded'] = 0
144
+    dict['man_sens_l'] = .03
145
+    dict['man_sens_r'] = .08
143 146
 
144 147
 main()

+ 2
- 2
co_ActionState.py View File

@@ -714,9 +714,9 @@ def main():
714 714
         if l_actionState == 'reg_pump_left-left' and requestAction not in [ 'reg_pump_left-left', 'reg_pump_left-leftb']:
715 715
             requestAction = 'reg_pump_left'        
716 716
             
717
-        if l_actionState == 'reg_pump_right_out' and requestAction == 'reg_turnRight':
717
+        if l_actionState == 'reg_pump_right_out' and requestAction in ['reg_turnRight', 'reg_turnLeft']:
718 718
             requestAction = 'reg_pump'
719
-        if l_actionState == 'reg_pump_left_out' and requestAction == 'reg_turnLeft':
719
+        if l_actionState == 'reg_pump_left_out' and requestAction in ['reg_turnLeft', 'reg_turnRight']:
720 720
             requestAction = 'reg_pump'    
721 721
                       
722 722
         if l_actionState == 'reg_pump_out' and requestAction == 'reg_pump_right':

+ 11
- 24
controller2.py View File

@@ -350,7 +350,7 @@ def main():
350 350
                 pass
351 351
             own["vib_Countdown"] = 14
352 352
             cont.activate(own.actuators["Vibration"])
353
-            if own['manual_v2'] == 0 and grindDar == 0:           
353
+            if own['manual_v2'] == 0 and grindDar == 0:          
354 354
                 if STANCE == 0:
355 355
                     own['requestAction'] = 'reg_land'
356 356
                 elif STANCE == 1:
@@ -378,7 +378,7 @@ def main():
378 378
             own['requestAction'] = 'fak_roll'
379 379
 
380 380
     #check manual_v2
381
-    if (rUD > .03 and rUD < .08) or (rUD < -.03 and rUD > -.08):
381
+    if (rUD > dict['man_sens_l'] and rUD < dict['man_sens_r']) or (rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r']):
382 382
     #if (rUD > .04 and rUD < .07):
383 383
         #print("zoned")    
384 384
         timer = own['manual_v2_timer']
@@ -454,14 +454,14 @@ def main():
454 454
     #check manual
455 455
     ####
456 456
     #reg
457
-    if rUD > .03 and rUD < .08 and STANCE == 0 and rLR < .035 and rLR > -.035:
457
+    if rUD > dict['man_sens_l'] and rUD < dict['man_sens_r'] and STANCE == 0 and rLR < .035 and rLR > -.035:
458 458
         timer = own["reg_manual_timer"]
459 459
         timer = timer + 1
460 460
         own["reg_manual_timer"] = timer
461 461
         if timer > 20 and rUD < .04:
462 462
             own["reg_manual"] = 0
463 463
             #print("reg_man off")
464
-    if rUD <= .03 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
464
+    if rUD <= dict['man_sens_l'] and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
465 465
         own["reg_manual_timer"] = 0
466 466
         own["reg_manual"] = 0 
467 467
         #print("reg_man off2")   
@@ -471,70 +471,57 @@ def main():
471 471
     ######
472 472
     if own["reg_manual_timer"] == 0:
473 473
         own["reg_manual"] = 0 
474
-    if own['last_reg_manual'] == 1 and own['reg_manual'] == 0:
475
-        #killall()   
476
-        pass
477 474
           
478 475
     ####   
479 476
     #fak
480
-    if rUD > .03 and rUD < .08 and STANCE == 1 and rLR < .035 and rLR > -.035:
477
+    if rUD > dict['man_sens_l'] and rUD < dict['man_sens_r'] and STANCE == 1 and rLR < .035 and rLR > -.035:
481 478
         timer = own["fak_manual_timer"]
482 479
         timer = timer + 1
483 480
         own["fak_manual_timer"] = timer
484 481
         if timer > 20:
485 482
             own["fak_manual"] = 0
486
-    if rUD <= .03 and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
483
+    if rUD <= dict['man_sens_l'] and (STANCE == 1 or STANCE == 0) and rUD >= -.04:
487 484
         own["fak_manual_timer"] = 0
488 485
         own["fak_manual"] = 0
489 486
     if own["fak_manual_timer"] > 10 and own["reg_manual"] == 0:
490 487
         own["fak_manual"] = 1
491 488
     if own["fak_manual_timer"] == 0:
492
-        own["fak_manual"] = 0 
493
-    if own['last_fak_manual'] == 1 and own['fak_manual'] == 0:
494
-        #killall() 
495
-        pass  
496
-    #print(own["reg_manual"], own["fak_manual"])    
489
+        own["fak_manual"] = 0  
497 490
      
498 491
     #####
499 492
     #reg nmanual
500
-    if rUD < -.03 and rUD > -.08 and STANCE == 0 and rLR < .035 and rLR > -.035:
493
+    if rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r'] and STANCE == 0 and rLR < .035 and rLR > -.035:
501 494
         timer = own["reg_nmanual_timer"]
502 495
         timer = timer + 1
503 496
         own["reg_nmanual_timer"] = timer
504 497
         if timer > 20:
505 498
             own["reg_nmanual"] = 0
506
-    if rUD >= -.03 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
499
+    if rUD >= -dict['man_sens_l'] and (STANCE == 1 or STANCE == 0) and rUD <= .04:
507 500
         own["reg_nmanual_timer"] = 0
508 501
         own["reg_nmanual"] = 0
509 502
 
510 503
     if own["reg_nmanual_timer"] > 10 and own["fak_nmanual"] == 0 and own['reg_manual'] == 0 and own['fak_manual'] == 0:  
511 504
         if own['last_fak_manual'] == False and own['last_reg_manual'] == False and own['last_fak_manual'] == False:
512 505
             own["reg_nmanual"] = 1
513
-            #print("baaad", own['reg_manual'], own['last_reg_manual'])
514 506
 
515 507
     if own["reg_nmanual_timer"] == 0:
516 508
         own["reg_nmanual"] = 0 
517
-    if own['last_reg_nmanual'] == 1 and own['reg_nmanual'] == 0:
518
-        pass
519
-        #killall()   
520 509
      
521 510
     #####
522 511
     #fak nmanual
523 512
     #print (rUD)
524
-    if rUD < -.03 and rUD > -.08 and STANCE == 1 and rLR < .035 and rLR > -.035:
513
+    if rUD < -dict['man_sens_l'] and rUD > -dict['man_sens_r'] and STANCE == 1 and rLR < .035 and rLR > -.035:
525 514
         timer = own["fak_nmanual_timer"]
526 515
         timer = timer + 1
527 516
         own["fak_nmanual_timer"] = timer
528 517
         if timer > 20:
529 518
             own["fak_nmanual"] = 0
530
-    if rUD >= -.03 and (STANCE == 1 or STANCE == 0) and rUD <= .04:
519
+    if rUD >= -dict['man_sens_l'] and (STANCE == 1 or STANCE == 0) and rUD <= .04:
531 520
         own["fak_nmanual_timer"] = 0
532 521
         own["fak_nmanual"] = 0
533
-        #print('@@@@@@@@@fak_man_off_1')
534 522
     if own["fak_nmanual_timer"] > 10 and own["reg_nmanual"] == 0 and own['fak_manual'] == 0 and own ['reg_manual'] == 0:
535 523
         own["fak_nmanual"] = 1
536 524
     if own["fak_nmanual_timer"] == 0 and own['reg_manual'] == 0:
537
-        #if own['flip_manual_stance'] == 0:
538 525
         own["fak_nmanual"] = 0 
539 526
     if own['last_fak_nmanual'] == 1 and own['fak_nmanual'] == 0:
540 527
         pass  

+ 2
- 1
load_char.py View File

@@ -36,7 +36,7 @@ def main(cont):
36 36
     actu = cont.actuators['start_level']
37 37
     dict = bge.logic.globalDict
38 38
     mainDir = bge.logic.expandPath("//")
39
-    
39
+ #   if dict['char_loaded'] == 0:
40 40
     fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
41 41
     
42 42
     path = bge.logic.expandPath(fileName)
@@ -50,6 +50,7 @@ def main(cont):
50 50
     
51 51
     path = bge.logic.expandPath(fileName)
52 52
     bge.logic.LibLoad(path, 'Scene') 
53
+#        dict['char_loaded'] = 1
53 54
     
54 55
     
55 56
 #    fileName = mainDir + "characters/sun.blend"    

Loading…
Cancel
Save