Browse Source

stance changes

shuvit 6 years ago
parent
commit
b85f5809b1
3 changed files with 68 additions and 35 deletions
  1. 1
    1
      co_ActionState.py
  2. 35
    25
      controller2.py
  3. 32
    9
      grindV2.py

+ 1
- 1
co_ActionState.py View File

2850
 ###################  
2850
 ###################  
2851
     
2851
     
2852
     #debug
2852
     #debug
2853
-    print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2853
+    #print("rA:", requestAction, "|aS:", own['actionState'], "q", queueAction, own['actionTimer'])
2854
     cur_frame = skater.getActionFrame(trans_layer)
2854
     cur_frame = skater.getActionFrame(trans_layer)
2855
     #print(cur_frame)
2855
     #print(cur_frame)
2856
     def printplaying():
2856
     def printplaying():

+ 35
- 25
controller2.py View File

2082
                 own['requestAction'] = 'fak_tailgl' 
2082
                 own['requestAction'] = 'fak_tailgl' 
2083
             
2083
             
2084
             elif own['grindType'] == "reg_tailslide":
2084
             elif own['grindType'] == "reg_tailslide":
2085
-                own['requestAction'] = 'reg_tailslide'
2085
+                #own['requestAction'] = 'reg_tailslide'
2086
+                own['requestAction'] = 'fak_noseslide'  
2086
                 own['grind_stance'] = 0                
2087
                 own['grind_stance'] = 0                
2087
             elif own['grindType'] == "fak_tailslide":
2088
             elif own['grindType'] == "fak_tailslide":
2088
-                own['requestAction'] = 'fak_tailslide'
2089
+                own['requestAction'] = 'fak_tailslide'                
2089
                 own['grind_stance'] = 1
2090
                 own['grind_stance'] = 1
2090
             elif own['grindType'] == "reg_noseslide":
2091
             elif own['grindType'] == "reg_noseslide":
2091
-                own['requestAction'] = 'reg_noseslide'
2092
+                #own['requestAction'] = 'reg_noseslide'
2093
+                own['requestAction'] = 'fak_tailslide'  
2092
                 own['grind_stance'] = 0
2094
                 own['grind_stance'] = 0
2093
             elif own['grindType'] == "fak_noseslide":
2095
             elif own['grindType'] == "fak_noseslide":
2094
                 own['requestAction'] = 'fak_noseslide'  
2096
                 own['requestAction'] = 'fak_noseslide'  
2095
                 own['grind_stance'] = 1              
2097
                 own['grind_stance'] = 1              
2096
-            elif own['grindType'] == "nose_stall":
2097
-                own['requestAction'] = 'nose_stall'
2098
-                skater.playAction("fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2099
-                deck.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2100
-                trucks.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)  
2101
-            elif own['grindType'] == "tail_stall":
2102
-                own['requestAction'] = 'tail_stall'
2103
-                skater.playAction("fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2104
-                deck.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2105
-                trucks.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2098
+#            elif own['grindType'] == "nose_stall":
2099
+#                own['requestAction'] = 'nose_stall'
2100
+#                skater.playAction("fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2101
+#                deck.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2102
+#                trucks.playAction("a_fak_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)  
2103
+#            elif own['grindType'] == "tail_stall":
2104
+#                own['requestAction'] = 'tail_stall'
2105
+#                skater.playAction("fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2106
+#                deck.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2107
+#                trucks.playAction("a_fak_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2106
             else:
2108
             else:
2107
                 if STANCE == 0:
2109
                 if STANCE == 0:
2108
                     own['requestAction'] = 'reg_5050'
2110
                     own['requestAction'] = 'reg_5050'
2146
                 own['requestAction'] = 'reg_tailslide'
2148
                 own['requestAction'] = 'reg_tailslide'
2147
             elif own['grindType'] == "fak_tailslide":
2149
             elif own['grindType'] == "fak_tailslide":
2148
                 own['grind_stance'] = 1
2150
                 own['grind_stance'] = 1
2149
-                own['requestAction'] = 'fak_tailslide'
2151
+                #own['requestAction'] = 'fak_tailslide'
2152
+                own['requestAction'] = 'reg_noseslide'
2153
+                print('mod slide')
2150
             elif own['grindType'] == "reg_noseslide":
2154
             elif own['grindType'] == "reg_noseslide":
2151
                 own['grind_stance'] = 0
2155
                 own['grind_stance'] = 0
2152
                 own['requestAction'] = 'reg_noseslide'
2156
                 own['requestAction'] = 'reg_noseslide'
2153
             elif own['grindType'] == "fak_noseslide":  
2157
             elif own['grindType'] == "fak_noseslide":  
2154
                 own['grind_stance'] = 1              
2158
                 own['grind_stance'] = 1              
2155
-                own['requestAction'] = 'fak_noseslide'
2156
-            elif own['grindType'] == "nose_stall":
2157
-                skater.playAction("nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2158
-                deck.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2159
-                trucks.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2160
-                #print("nose_stall") 
2161
-            elif own['grindType'] == "tail_stall":
2162
-                skater.playAction("reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2163
-                deck.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2164
-                trucks.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2159
+                #own['requestAction'] = 'fak_noseslide'
2160
+                own['requestAction'] = 'reg_tailslide'
2161
+                
2162
+                
2163
+#            elif own['grindType'] == "nose_stall":
2164
+#                skater.playAction("nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2165
+#                deck.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2166
+#                trucks.playAction("a_nose_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5) 
2167
+#                #print("nose_stall") 
2168
+#            elif own['grindType'] == "tail_stall":
2169
+#                skater.playAction("reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2170
+#                deck.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2171
+#                trucks.playAction("a_reg_tail_stall", 1,30, layer=700, blendin=gblend, play_mode=1, speed=.5)
2165
                 #print("reg_tail_stall")                                 
2172
                 #print("reg_tail_stall")                                 
2166
             else:
2173
             else:
2167
                 if STANCE == 0:
2174
                 if STANCE == 0:
4169
         own['air_mover'] = False 
4176
         own['air_mover'] = False 
4170
         
4177
         
4171
         
4178
         
4179
+
4172
 framenum = own['framenum']
4180
 framenum = own['framenum']
4173
 last_ground_frame = own['lF_ground_frame']
4181
 last_ground_frame = own['lF_ground_frame']
4174
 lF_air_frame = own['lF_air_frame']
4182
 lF_air_frame = own['lF_air_frame']
4175
 frames_since_ground = framenum - lF_air_frame               
4183
 frames_since_ground = framenum - lF_air_frame               
4176
 if framenum - lF_air_frame > 30:
4184
 if framenum - lF_air_frame > 30:
4177
-    own['no_grind_pull'] = 0           
4185
+    own['no_grind_pull'] = 0
4186
+
4187
+                  
4178
 #if grindHit == 1:
4188
 #if grindHit == 1:
4179
 #    skater.applyRotation([0,0,.05], False)
4189
 #    skater.applyRotation([0,0,.05], False)
4180
 #    deck.applyRotation([0,0,.05], False)
4190
 #    deck.applyRotation([0,0,.05], False)

+ 32
- 9
grindV2.py View File

128
     else:
128
     else:
129
         convely = vely  
129
         convely = vely  
130
     def grindvect(obj):
130
     def grindvect(obj):
131
+        STANCE = own['stance']
131
         if obj != None:
132
         if obj != None:
132
             grinder_e = obj.worldOrientation.to_euler()
133
             grinder_e = obj.worldOrientation.to_euler()
133
             grinder_rotz = math.degrees(grinder_e[2])            
134
             grinder_rotz = math.degrees(grinder_e[2])            
171
             grindvect = "pos" 
172
             grindvect = "pos" 
172
             grindyvect = "pos"
173
             grindyvect = "pos"
173
         if rot < -315: 
174
         if rot < -315: 
174
-            grindvect = "pos"         
175
-
175
+            grindvect = "pos"   
176
+        #                     
177
+        #print(grindvect, STANCE)
178
+        rot = round((rot * .01), 1)
179
+        rot *= 100
180
+        #print(rot)
181
+        
182
+        if (rot == 90 or rot == -270) and STANCE == True:
183
+            print("90 fak stance")
184
+            own['stance'] = 1
185
+            STANCE = 1
186
+        if (rot == 90 or rot == -270) and STANCE == False:
187
+            print("90 fak stance")
188
+            own['stance'] = 1
189
+            STANCE = 1
190
+        if (rot == -90 or rot == 270) and STANCE == True:
191
+            print("-90 reg stance")
192
+            own['stance'] = 0
193
+            STANCE = 0
194
+        if (rot == -90 or rot == 270) and STANCE == False:
195
+            print("-90 reg stance")                        
196
+            own['stance'] = 0
197
+            STANCE = 0
198
+        print("stance: ", STANCE)
176
     def grindrotvel(obj):        
199
     def grindrotvel(obj):        
177
         skipconst = 1
200
         skipconst = 1
178
         #print("set jumponinit")              
201
         #print("set jumponinit")              
234
             player.setLinearVelocity([0, convely, zvel], 1)   
257
             player.setLinearVelocity([0, convely, zvel], 1)   
235
             grindpos = "reg_board"     
258
             grindpos = "reg_board"     
236
             grindyvect = "pos"
259
             grindyvect = "pos"
237
-            print("bs1, don't switch")       
260
+            #print("bs1, don't switch")       
238
             #print("boardslide")
261
             #print("boardslide")
239
                            
262
                            
240
         if rot >= 90 and rot < 135:  
263
         if rot >= 90 and rot < 135:  
249
             #player.applyForce([0, 0, 0], True)
272
             #player.applyForce([0, 0, 0], True)
250
             player.setLinearVelocity([0, convely, zvel], 1)
273
             player.setLinearVelocity([0, convely, zvel], 1)
251
             grindpos = "reg_board"  
274
             grindpos = "reg_board"  
252
-            print("-bs2, don't switch?")          
275
+            #print("-bs2, don't switch?")          
253
             #print("boardslide") 
276
             #print("boardslide") 
254
                      
277
                      
255
         if rot >= 135 and rot < 180:
278
         if rot >= 135 and rot < 180:
292
             player.setLinearVelocity([0, convely, zvel], 1)
315
             player.setLinearVelocity([0, convely, zvel], 1)
293
             grindpos = "reg_board"   
316
             grindpos = "reg_board"   
294
             grindyvect = "neg"
317
             grindyvect = "neg"
295
-            print("-bs4")              
318
+            #print("-bs4")              
296
             #print("boardslide")
319
             #print("boardslide")
297
             
320
             
298
         if rot >= 315:
321
         if rot >= 315:
321
             #player.applyForce([0, 0, 0], True)
344
             #player.applyForce([0, 0, 0], True)
322
             player.setLinearVelocity([0, convely, zvel], 1)
345
             player.setLinearVelocity([0, convely, zvel], 1)
323
             grindpos = "reg_board"   
346
             grindpos = "reg_board"   
324
-            print("-bs5")           
347
+            #print("-bs5")           
325
             #print("boardslide")
348
             #print("boardslide")
326
             
349
             
327
             grindyvect = "neg"
350
             grindyvect = "neg"
337
             player.setLinearVelocity([0, convely, zvel], 1)
360
             player.setLinearVelocity([0, convely, zvel], 1)
338
             grindpos = "reg_board"  
361
             grindpos = "reg_board"  
339
             grindyvect = "pos"
362
             grindyvect = "pos"
340
-            print("bs6")           
363
+            #print("bs6")           
341
             #print("boardslide") 
364
             #print("boardslide") 
342
                                            
365
                                            
343
         if rot < -135 and rot >= -180:
366
         if rot < -135 and rot >= -180:
365
             player.setLinearVelocity([0, convely, zvel], 1)
388
             player.setLinearVelocity([0, convely, zvel], 1)
366
             grindpos = "reg_board"   
389
             grindpos = "reg_board"   
367
             grindyvect = "neg"
390
             grindyvect = "neg"
368
-            print("-bs7")          
391
+            #print("-bs7")          
369
             #print("boardslide")            
392
             #print("boardslide")            
370
         if rot < -270 and rot >= -315:
393
         if rot < -270 and rot >= -315:
371
             #print(STANCE, "8")
394
             #print(STANCE, "8")
378
             player.setLinearVelocity([0, convely, zvel], 1)
401
             player.setLinearVelocity([0, convely, zvel], 1)
379
             grindpos = "reg_board"    
402
             grindpos = "reg_board"    
380
             grindyvect = "pos"
403
             grindyvect = "pos"
381
-            print("bs8")        
404
+            #print("bs8")        
382
             #print("boardslide")                                
405
             #print("boardslide")                                
383
         if rot < -315:
406
         if rot < -315:
384
             player.alignAxisToVect(grinder_vect, 0, align_strength) 
407
             player.alignAxisToVect(grinder_vect, 0, align_strength) 

Loading…
Cancel
Save