shuvit 6 years ago
parent
commit
9d88e0b38f
3 changed files with 95 additions and 38 deletions
  1. 68
    4
      co_ActionState.py
  2. 4
    4
      controller2.py
  3. 23
    30
      walk.py

+ 68
- 4
co_ActionState.py
File diff suppressed because it is too large
View File


+ 4
- 4
controller2.py View File

2174
             own["coping"] = 1
2174
             own["coping"] = 1
2175
         else:
2175
         else:
2176
             own["coping"] = 0    
2176
             own["coping"] = 0    
2177
-
2177
+    #print(own['dropinTimer'], 'dtimer')
2178
     def onboard():
2178
     def onboard():
2179
-        if own['walk'] == 1:
2179
+        if own['walk'] == 1 and own['lasty'] == False:
2180
             cont.deactivate(cam.actuators['replayCam'])
2180
             cont.deactivate(cam.actuators['replayCam'])
2181
             cont.activate(cam.actuators['Camera'])
2181
             cont.activate(cam.actuators['Camera'])
2182
             killall()
2182
             killall()
2190
                 killall() 
2190
                 killall() 
2191
                 if own['dropinCol'] == True:
2191
                 if own['dropinCol'] == True:
2192
                     print("dropinanim")
2192
                     print("dropinanim")
2193
-                    own['requestAction'] = reg_dropin
2193
+                    own['requestAction'] = 'reg_dropin'
2194
                 else:
2194
                 else:
2195
                     own['requestAction'] = 'reg_onboard'    
2195
                     own['requestAction'] = 'reg_onboard'    
2196
                 force = (linVelocity.x -1, linVelocity.y, linVelocity.z)
2196
                 force = (linVelocity.x -1, linVelocity.y, linVelocity.z)
2203
                 killall() 
2203
                 killall() 
2204
                 if own['dropinTimer'] > 30:
2204
                 if own['dropinTimer'] > 30:
2205
                     print("dropinanim2")
2205
                     print("dropinanim2")
2206
-                    own['requestAction'] = fak_dropin
2206
+                    own['requestAction'] = 'fak_dropin'
2207
                 else: 
2207
                 else: 
2208
                     own['requestAction'] = 'fak_onboard'
2208
                     own['requestAction'] = 'fak_onboard'
2209
                 force = (linVelocity.x +1, linVelocity.y, linVelocity.z)
2209
                 force = (linVelocity.x +1, linVelocity.y, linVelocity.z)

+ 23
- 30
walk.py View File

221
     
221
     
222
 
222
 
223
 #idle      
223
 #idle      
224
-if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0:
224
+if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
225
     own['requestAction'] = 'reg_idle'
225
     own['requestAction'] = 'reg_idle'
226
     if own['throw_deck'] == True:
226
     if own['throw_deck'] == True:
227
         own['requestAction'] = 'reg_idle_nb'
227
         own['requestAction'] = 'reg_idle_nb'
231
         skater.playAction("reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
231
         skater.playAction("reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
232
         deck.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
232
         deck.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5)
233
         trucks.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5) 
233
         trucks.playAction("a_reg_idle1", 1,120, layer=3, play_mode=1, speed=.5) 
234
-if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0:
234
+if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
235
     own['requestAction'] = 'fak_idle'
235
     own['requestAction'] = 'fak_idle'
236
     if own['throw_deck'] == True:
236
     if own['throw_deck'] == True:
237
         own['requestAction'] = 'fak_idle_nb'
237
         own['requestAction'] = 'fak_idle_nb'
624
             killact(4)
624
             killact(4)
625
             killact(5)
625
             killact(5)
626
             killact(6)
626
             killact(6)
627
-            killact(7)                        
628
-            skater.playAction("nreg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
629
-            deck.playAction("a_reg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
630
-            trucks.playAction("a_reg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
631
-            if lasty == False:
632
-                skater.playAction("nreg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
633
-                deck.playAction("a_reg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
634
-                trucks.playAction("a_reg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)                
627
+            killact(7) 
628
+            own['requestAction'] ='reg_dropin_pos' 
629
+            own['dropinTimer'] = 60                      
630
+#            skater.playAction("nreg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
631
+#            deck.playAction("a_reg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
632
+#            trucks.playAction("a_reg_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
633
+#            if lasty == False:
634
+#                skater.playAction("nreg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
635
+#                deck.playAction("a_reg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
636
+#                trucks.playAction("a_reg_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)                
635
                 
637
                 
636
         if STANCE == 1 and dropinCol.positive == True: 
638
         if STANCE == 1 and dropinCol.positive == True: 
637
             cont.deactivate(skater.actuators['aRest'])
639
             cont.deactivate(skater.actuators['aRest'])
640
             killact(5)
642
             killact(5)
641
             killact(6)
643
             killact(6)
642
             killact(7)                        
644
             killact(7)                        
643
-            skater.playAction("nfak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
644
-            deck.playAction("a_fak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
645
-            trucks.playAction("a_fak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
646
-            if lasty == False:
647
-                skater.playAction("nfak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
648
-                deck.playAction("a_fak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
649
-                trucks.playAction("a_fak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)                      
645
+            own['requestAction'] ='fak_dropin_pos'  
646
+            own['dropinTimer'] = 60                                 
647
+#            skater.playAction("nfak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
648
+#            deck.playAction("a_fak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
649
+#            trucks.playAction("a_fak_dropin", 50,60, layer=fliplay2, priority=0, play_mode=1, speed=.5)
650
+#            if lasty == False:
651
+#                skater.playAction("nfak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
652
+#                deck.playAction("a_fak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)
653
+#                trucks.playAction("a_fak_dropin", 30,50, layer=fliplay3, priority=0, play_mode=0, speed=.75)                      
650
     if getonboard == 1:
654
     if getonboard == 1:
651
         fliplay3 = 6000 
655
         fliplay3 = 6000 
652
-        onboard_speed = .1   
653
-#        if STANCE == 1:
654
-#            skater.playAction("nfak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)
655
-#            deck.playAction("a_fak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)
656
-#            trucks.playAction("a_fak_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)
657
-#        if STANCE == 0:
658
-#            skater.playAction("nreg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)
659
-#            deck.playAction("a_reg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)
660
-#            trucks.playAction("a_reg_dropin", 60,80, layer=fliplay3, priority=0, play_mode=0, speed=onboard_speed)                                    
656
+        onboard_speed = .1                                      
661
         own['getonboard'] = 0 
657
         own['getonboard'] = 0 
662
     if yBut == False and lasty == True:
658
     if yBut == False and lasty == True:
663
-        own['getonboard'] = 1
664
-        #camera.height = -.5
665
-        #camera.min = .75
666
-        #camera.max = 1.25         
659
+        own['getonboard'] = 1       
667
 
660
 
668
 def nextframe():
661
 def nextframe():
669
     framenumber = own["framenum"]
662
     framenumber = own["framenum"]

Loading…
Cancel
Save