Browse Source

action player cleaning2

shuvit 1 year ago
parent
commit
e11dfdecdd
3 changed files with 35 additions and 302 deletions
  1. 31
    300
      scripts/actionPlayer.py
  2. 1
    1
      scripts/birds.py
  3. 3
    1
      scripts/camera.py

+ 31
- 300
scripts/actionPlayer.py View File

@@ -112,7 +112,34 @@ state_a = ['reg_idle',
112 112
 'fak_hardflip',
113 113
 'fak_inward_heelflip',
114 114
 'fak_varial_kickflip',
115
-'fak_varial_heelflip']
115
+'fak_varial_heelflip',
116
+'frontside_grab',
117
+'backside_grab',
118
+'frontside_nose_grab',
119
+'backside_nose_grab',
120
+'frontside_tail_grab',
121
+'backside_tail_grab',
122
+'reg_ollie_north',
123
+'reg_ollie_south',
124
+'reg_judo',
125
+'reg_frigid',
126
+'reg_fsonefoot',
127
+'reg_onefoot',
128
+'reg_airwalk',
129
+'reg_wall_r',
130
+'reg_wall_l',
131
+'fak_frontside_grab',
132
+'fak_backside_grab',
133
+'fak_frontside_nose_grab',
134
+'fak_backside_nose_grab',
135
+'fak_frontside_tail_grab',
136
+'fak_backside_tail_grab',
137
+'fak_ollie_north',
138
+'fak_ollie_south',
139
+'fak_judo',
140
+'fak_frigid',
141
+'fak_fsonefoot',
142
+'fak_onefoot']
116 143
 
117 144
 state_b = ['reg_jump',
118 145
 'reg_walk_air',
@@ -268,16 +295,13 @@ def main(cont):
268 295
 			actionPlayer(action)
269 296
 		newState = check_exit(aState, rA, timer, action)		
270 297
 
271
-	if aState in state_b:
298
+	elif aState in state_b:
272 299
 		action = getattr(actionsFSMlist, aState)
273 300
 		actionPlayer(action)
274 301
 		if own['stateTimer'] > getattr(action, 'fef'):
275 302
 			newState = check_exit(aState, rA, timer, action)
276 303
 
277 304
 
278
-
279
-
280
-
281 305
 ###################################
282 306
 
283 307
 	check_state = 'reg_sit'
@@ -356,171 +380,6 @@ def main(cont):
356 380
 		newState = check_exit(aState, rA, timer, actionsFSMlist.reg_fs_powerslide)				
357 381
 
358 382
 
359
-#-----------
360
-#grinds-----
361
-#-----------
362
-
363
-
364
-
365
-#-----------
366
-#grabs------
367
-#-----------
368
-
369
-
370
-
371
-
372
-
373
-	check_state = 'frontside_grab'
374
-	if aState == check_state:
375
-		action = getattr(actionsFSMlist, check_state)
376
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
377
-			intro = getattr(action, 'intro')
378
-			actionPlayer(getattr(actionsFSMlist, intro))	
379
-		else:
380
-			actionPlayer(action)		
381
-		newState = check_exit(aState, rA, timer, action)
382
-
383
-	check_state = 'backside_grab'
384
-	if aState == check_state:
385
-		action = getattr(actionsFSMlist, check_state)
386
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
387
-			intro = getattr(action, 'intro')
388
-			actionPlayer(getattr(actionsFSMlist, intro))	
389
-		else:
390
-			actionPlayer(action)		
391
-		newState = check_exit(aState, rA, timer, action)		
392
-		
393
-	check_state = 'frontside_nose_grab'
394
-	if aState == check_state:
395
-		action = getattr(actionsFSMlist, check_state)
396
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
397
-			intro = getattr(action, 'intro')
398
-			actionPlayer(getattr(actionsFSMlist, intro))	
399
-		else:
400
-			actionPlayer(action)		
401
-		newState = check_exit(aState, rA, timer, action)
402
-	
403
-	check_state = 'backside_nose_grab'
404
-	if aState == check_state:
405
-		action = getattr(actionsFSMlist, check_state)
406
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
407
-			intro = getattr(action, 'intro')
408
-			actionPlayer(getattr(actionsFSMlist, intro))	
409
-		else:
410
-			actionPlayer(action)		
411
-		newState = check_exit(aState, rA, timer, action)
412
-	
413
-	check_state = 'frontside_tail_grab'
414
-	if aState == check_state:
415
-		action = getattr(actionsFSMlist, check_state)
416
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
417
-			intro = getattr(action, 'intro')
418
-			actionPlayer(getattr(actionsFSMlist, intro))	
419
-		else:
420
-			actionPlayer(action)		
421
-		newState = check_exit(aState, rA, timer, action)
422
-
423
-	check_state = 'backside_tail_grab'
424
-	if aState == check_state:
425
-		action = getattr(actionsFSMlist, check_state)
426
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
427
-			intro = getattr(action, 'intro')
428
-			actionPlayer(getattr(actionsFSMlist, intro))	
429
-		else:
430
-			actionPlayer(action)		
431
-		newState = check_exit(aState, rA, timer, action)
432
-
433
-	check_state = 'reg_ollie_north'
434
-	if aState == check_state:
435
-		action = getattr(actionsFSMlist, check_state)
436
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
437
-			intro = getattr(action, 'intro')
438
-			actionPlayer(getattr(actionsFSMlist, intro))	
439
-		else:
440
-			actionPlayer(action)		
441
-		newState = check_exit(aState, rA, timer, action)		
442
-
443
-	check_state = 'reg_ollie_south'
444
-	if aState == check_state:
445
-		action = getattr(actionsFSMlist, check_state)
446
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
447
-			intro = getattr(action, 'intro')
448
-			actionPlayer(getattr(actionsFSMlist, intro))	
449
-		else:
450
-			actionPlayer(action)		
451
-		newState = check_exit(aState, rA, timer, action)
452
-
453
-	check_state = 'reg_judo'
454
-	if aState == check_state:
455
-		action = getattr(actionsFSMlist, check_state)
456
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
457
-			intro = getattr(action, 'intro')
458
-			actionPlayer(getattr(actionsFSMlist, intro))	
459
-		else:
460
-			actionPlayer(action)		
461
-		newState = check_exit(aState, rA, timer, action)
462
-
463
-	check_state = 'reg_frigid'
464
-	if aState == check_state:
465
-		action = getattr(actionsFSMlist, check_state)
466
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
467
-			intro = getattr(action, 'intro')
468
-			actionPlayer(getattr(actionsFSMlist, intro))	
469
-		else:
470
-			actionPlayer(action)		
471
-		newState = check_exit(aState, rA, timer, action)
472
-
473
-	check_state = 'reg_fsonefoot'
474
-	if aState == check_state:
475
-		action = getattr(actionsFSMlist, check_state)
476
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
477
-			intro = getattr(action, 'intro')
478
-			actionPlayer(getattr(actionsFSMlist, intro))	
479
-		else:
480
-			actionPlayer(action)		
481
-		newState = check_exit(aState, rA, timer, action)
482
-
483
-	check_state = 'reg_onefoot'
484
-	if aState == check_state:
485
-		action = getattr(actionsFSMlist, check_state)
486
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
487
-			intro = getattr(action, 'intro')
488
-			actionPlayer(getattr(actionsFSMlist, intro))	
489
-		else:
490
-			actionPlayer(action)		
491
-		newState = check_exit(aState, rA, timer, action)
492
-
493
-	check_state = 'reg_airwalk'
494
-	if aState == check_state:
495
-		action = getattr(actionsFSMlist, check_state)
496
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
497
-			intro = getattr(action, 'intro')
498
-			actionPlayer(getattr(actionsFSMlist, intro))	
499
-		else:
500
-			actionPlayer(action)		
501
-		newState = check_exit(aState, rA, timer, action)		
502
-
503
-	check_state = 'reg_wall_r'
504
-	if aState == check_state:
505
-		action = getattr(actionsFSMlist, check_state)
506
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
507
-			intro = getattr(action, 'intro')
508
-			actionPlayer(getattr(actionsFSMlist, intro))	
509
-		else:
510
-			actionPlayer(action)		
511
-		newState = check_exit(aState, rA, timer, action)		
512
-
513
-	check_state = 'reg_wall_l'
514
-	if aState == check_state:
515
-		action = getattr(actionsFSMlist, check_state)
516
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
517
-			intro = getattr(action, 'intro')
518
-			actionPlayer(getattr(actionsFSMlist, intro))	
519
-		else:
520
-			actionPlayer(action)		
521
-		newState = check_exit(aState, rA, timer, action)		
522
-
523
-
524 383
 
525 384
 	check_state = 'fak_sit'
526 385
 	if aState == check_state:
@@ -599,137 +458,8 @@ def main(cont):
599 458
 		newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)				
600 459
 
601 460
 
602
-
603
-
604
-#-----------
605
-#grabs------
606
-#-----------
607
-
608
-
609
-
610
-	check_state = 'fak_frontside_grab'
611
-	if aState == check_state:
612
-		action = getattr(actionsFSMlist, check_state)
613
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
614
-			intro = getattr(action, 'intro')
615
-			actionPlayer(getattr(actionsFSMlist, intro))	
616
-		else:
617
-			actionPlayer(action)		
618
-		newState = check_exit(aState, rA, timer, action)
619
-
620
-	check_state = 'fak_backside_grab'
621
-	if aState == check_state:
622
-		action = getattr(actionsFSMlist, check_state)
623
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
624
-			intro = getattr(action, 'intro')
625
-			actionPlayer(getattr(actionsFSMlist, intro))	
626
-		else:
627
-			actionPlayer(action)		
628
-		newState = check_exit(aState, rA, timer, action)		
629
-		
630
-	check_state = 'fak_frontside_nose_grab'
631
-	if aState == check_state:
632
-		action = getattr(actionsFSMlist, check_state)
633
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
634
-			intro = getattr(action, 'intro')
635
-			actionPlayer(getattr(actionsFSMlist, intro))	
636
-		else:
637
-			actionPlayer(action)		
638
-		newState = check_exit(aState, rA, timer, action)
639
-	
640
-	check_state = 'fak_backside_nose_grab'
641
-	if aState == check_state:
642
-		action = getattr(actionsFSMlist, check_state)
643
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
644
-			intro = getattr(action, 'intro')
645
-			actionPlayer(getattr(actionsFSMlist, intro))	
646
-		else:
647
-			actionPlayer(action)		
648
-		newState = check_exit(aState, rA, timer, action)
649
-	
650
-	check_state = 'fak_frontside_tail_grab'
651
-	if aState == check_state:
652
-		action = getattr(actionsFSMlist, check_state)
653
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
654
-			intro = getattr(action, 'intro')
655
-			actionPlayer(getattr(actionsFSMlist, intro))	
656
-		else:
657
-			actionPlayer(action)		
658
-		newState = check_exit(aState, rA, timer, action)
659
-
660
-	check_state = 'fak_backside_tail_grab'
661
-	if aState == check_state:
662
-		action = getattr(actionsFSMlist, check_state)
663
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
664
-			intro = getattr(action, 'intro')
665
-			actionPlayer(getattr(actionsFSMlist, intro))	
666
-		else:
667
-			actionPlayer(action)		
668
-		newState = check_exit(aState, rA, timer, action)
669
-
670
-	check_state = 'fak_ollie_north'
671
-	if aState == check_state:
672
-		action = getattr(actionsFSMlist, check_state)
673
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
674
-			intro = getattr(action, 'intro')
675
-			actionPlayer(getattr(actionsFSMlist, intro))	
676
-		else:
677
-			actionPlayer(action)		
678
-		newState = check_exit(aState, rA, timer, action)		
679
-
680
-	check_state = 'fak_ollie_south'
681
-	if aState == check_state:
682
-		action = getattr(actionsFSMlist, check_state)
683
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
684
-			intro = getattr(action, 'intro')
685
-			actionPlayer(getattr(actionsFSMlist, intro))	
686
-		else:
687
-			actionPlayer(action)		
688
-		newState = check_exit(aState, rA, timer, action)
689
-
690
-	check_state = 'fak_judo'
691
-	if aState == check_state:
692
-		action = getattr(actionsFSMlist, check_state)
693
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
694
-			intro = getattr(action, 'intro')
695
-			actionPlayer(getattr(actionsFSMlist, intro))	
696
-		else:
697
-			actionPlayer(action)		
698
-		newState = check_exit(aState, rA, timer, action)
699
-
700
-	check_state = 'fak_frigid'
701
-	if aState == check_state:
702
-		action = getattr(actionsFSMlist, check_state)
703
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
704
-			intro = getattr(action, 'intro')
705
-			actionPlayer(getattr(actionsFSMlist, intro))	
706
-		else:
707
-			actionPlayer(action)		
708
-		newState = check_exit(aState, rA, timer, action)
709
-
710
-	check_state = 'fak_fsonefoot'
711
-	if aState == check_state:
712
-		action = getattr(actionsFSMlist, check_state)
713
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
714
-			intro = getattr(action, 'intro')
715
-			actionPlayer(getattr(actionsFSMlist, intro))	
716
-		else:
717
-			actionPlayer(action)		
718
-		newState = check_exit(aState, rA, timer, action)
719
-
720
-	check_state = 'fak_onefoot'
721
-	if aState == check_state:
722
-		action = getattr(actionsFSMlist, check_state)
723
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
724
-			intro = getattr(action, 'intro')
725
-			actionPlayer(getattr(actionsFSMlist, intro))	
726
-		else:
727
-			actionPlayer(action)		
728
-		newState = check_exit(aState, rA, timer, action)
729
-
730
-
731
-
732 461
 	#-----------------------
462
+	#print(own['aState'], newState, rA)
733 463
 	if newState != '':
734 464
 		own['aState'] = newState 
735 465
 	own['l_aState'] = og_state
@@ -741,3 +471,4 @@ def main(cont):
741 471
 		frame = int(own['rotz'] * 70) 
742 472
 	else:
743 473
 		skater.stopAction(5)	
474
+

+ 1
- 1
scripts/birds.py View File

@@ -57,4 +57,4 @@ def main(cont, scene):
57 57
 
58 58
     life(own)    
59 59
     do_birds(scene, own, cont)  
60
-    #print('birding')    
60
+    print('birding')    

+ 3
- 1
scripts/camera.py View File

@@ -4,6 +4,7 @@ import mathutils
4 4
 from mathutils import *
5 5
 scene = bge.logic.getCurrentScene()
6 6
 import camFSM
7
+import birds
7 8
 
8 9
 def main(cont):
9 10
     #camFSM.main(cont)
@@ -360,4 +361,5 @@ def main(cont):
360 361
             pass
361 362
     set_lens_dist()        
362 363
     get_cam_state()
363
-    camFSM.main(cont)
364
+    camFSM.main(cont)
365
+    birds.main(cont, scene)

Loading…
Cancel
Save