shuvit 10 months ago
parent
commit
aaa45782d6

+ 2
- 2
assets/kits/ramps2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:1979115732848445b1d8584c50a0e6d09e9a861a334a4d16949c3cbe4f80db84
3
-size 143884636
2
+oid sha256:498ef10ab3bc64f9507ee4dc827291a714a86b7c843418df64f2f7972f9bb337
3
+size 24141316

+ 2
- 2
assets/materials/base_m_kit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9a6163026a34d578ea6e4e9dae41d73b7ac32f19075cda30f13910a75bae3714
3
-size 43913880
2
+oid sha256:50bf7c2728d43e6c7994da27dfde723e3d2fd15c3eb2ca614258945e730de00c
3
+size 38682600

+ 3
- 0
assets/materials/textures/plywood_a.jpg View File

@@ -0,0 +1,3 @@
1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:c258df71bdeb611a984c8ffe15abbcdffb10022fe45a81f293677d6a5a458aed
3
+size 213133

+ 3
- 0
assets/materials/textures/plywood_m.jpg View File

@@ -0,0 +1,3 @@
1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:829b20f214242aca3427c0acebf5fed8232af04aa5528a983f05bb6350f1b87e
3
+size 277031

+ 2
- 2
assets/mini_a.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:63eb0b43a268a006c80da22d6bdc55315d1ff3187796d3014d3ac9dd7eb707fe
3
-size 120017560
2
+oid sha256:21614145cf45de91c636413578f31e772d17fbfb64d233bd8d73a7f9706d6cea
3
+size 120024512

+ 2
- 2
assets/mini_b.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:587a7b6373308a5a69a59900ba5909253d9e078761df07de8e969070a82e4345
3
-size 118324384
2
+oid sha256:e1ff0591377ef662b4a9b21d6503029647c9ea8e87392514d9fd625cb18de3a1
3
+size 118444584

+ 1
- 1
assets/stores.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:a2b543b1056b479098718aeab1c0c359db587421558d8abd5f5b58ccb27e1afe
2
+oid sha256:c6052008729156fef96bdf28b34fa1c1c9bf545e56e7dfc1681630b8bbb1e246
3 3
 size 14603012

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:1ed28a307b8912f1cc9c6d10ac9aff2e53b388d67591ce37702adac5c0c19a53
3
-size 13363644
2
+oid sha256:27d91460377601ced66f9e90980afd9b1d21a3da8bf7c4a03357655d10ef28a4
3
+size 584296

+ 3
- 0
assets/user2_tmp.blend View File

@@ -0,0 +1,3 @@
1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:df270cecff9eeb9a88e42ae8626cc50ed8bc1414873a22baeeda45dde42d44ca
3
+size 13384212

+ 2
- 2
assets/utils/building_genV2_1.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:2c51ab0607fe13410b2222badd93fa6aff66376c4b2b5ad34656815a837956b1
3
-size 8193096
2
+oid sha256:37b92f8f1e9bec73b4830c917a6bdd9f81bb76fe7428fc6819c6dcd9e867b1d2
3
+size 8253004

+ 27
- 1
scripts/FSM.py View File

@@ -3,6 +3,7 @@ import bge
3 3
 import StatesWalker
4 4
 import StatesCamera
5 5
 import StatesCar
6
+import StatesEa
6 7
    
7 8
 #====================================
8 9
 class Transition(object):
@@ -161,4 +162,29 @@ class WalkerFSM(Char):
161 162
             self.FSM.SetState('Example')
162 163
     
163 164
     def Execute(self):
164
-        self.FSM.Execute(self.owner)   
165
+        self.FSM.Execute(self.owner)   
166
+
167
+
168
+#=================================== 
169
+
170
+class EaFSM(Char):
171
+    def __init__(self, owner):
172
+        self.FSM = FSM(self, owner)
173
+        self.owner = owner
174
+
175
+        
176
+        state_list = [
177
+        'Example',
178
+        'Land']
179
+
180
+        
181
+        for s in state_list:
182
+            self.FSM.AddState(s, getattr(StatesEa, s)(self.FSM))
183
+            t = 'to' + s
184
+            self.FSM.AddTransition(t, Transition(s))
185
+        
186
+        if self.FSM.curState == None:
187
+            self.FSM.SetState('Example')
188
+    
189
+    def Execute(self):
190
+        self.FSM.Execute(self.owner)           

+ 71
- 0
scripts/StatesEa.py View File

@@ -0,0 +1,71 @@
1
+import bge
2
+import random
3
+#====================================     
4
+
5
+State = type("State", (object,), {})
6
+#====================================     
7
+class State(object):
8
+    def __init__(self, FSM):
9
+        self.FSM = FSM
10
+        self.timer = 0
11
+        self.startTime = 0
12
+    def Enter(self):
13
+        self.timer = 0
14
+        self.startTime = 0
15
+    def Execute(self):
16
+        print('Executing')
17
+    def Exit(self):
18
+        print('Exiting')
19
+#==================================== 
20
+            
21
+class Example(State):
22
+    def __init__(self,FSM):
23
+        super(Example, self).__init__(FSM)    
24
+        
25
+    def Enter(self):
26
+        self.FSM.stateLife = 1
27
+        super(Example, self).Enter()        
28
+        
29
+    def Execute(self):
30
+        self.FSM.stateLife += 1
31
+        print('doing example', self.FSM.owner['EaRequest'])
32
+
33
+        if self.FSM.owner['EaRequest'] == 'land':
34
+            self.FSM.ToTransition('toLand')
35
+        
36
+    def Exit(self):
37
+        pass
38
+
39
+#==================================== 
40
+            
41
+class Land(State):
42
+    def __init__(self,FSM):
43
+        super(Land, self).__init__(FSM)    
44
+        
45
+    def Enter(self):
46
+        self.FSM.stateLife = 1
47
+        self.strength = random.choice([.1, .2, .3, .4, .5, .6, .7, .8, .9, .9, .9, .9])
48
+        #self.strength = random.choice([.1])
49
+        super(Land, self).Enter()        
50
+        
51
+    def Execute(self):
52
+        self.FSM.stateLife += 1
53
+        print('land')
54
+        arm = bge.logic.globalDict['p1']
55
+
56
+        if self.FSM.stateLife > 40:
57
+            if self.strength < 1:
58
+                self.strength += .05
59
+                arm.stopAction(8)
60
+        
61
+        arm.playAction('ea_land1', 0,40, layer=8, play_mode=0, speed=.5, blendin=10, layer_weight=self.strength)
62
+
63
+
64
+        if self.FSM.stateLife > 80:
65
+            self.FSM.owner['EaRequest'] = None
66
+            self.FSM.ToTransition('toExample')    
67
+
68
+
69
+    def Exit(self):
70
+        pass
71
+

+ 6
- 1
scripts/actionPlayer.py View File

@@ -1,6 +1,7 @@
1 1
 import bge
2 2
 import actionsFSMlist
3 3
 import mathutils
4
+import FSM
4 5
 
5 6
 dict = bge.logic.globalDict
6 7
 zero_blend = False
@@ -128,6 +129,8 @@ state_a = ['reg_idle',
128 129
 'reg_airwalk',
129 130
 'reg_wall_r',
130 131
 'reg_wall_l',
132
+'fak_wall_r',
133
+'fak_wall_l',
131 134
 'fak_frontside_grab',
132 135
 'fak_backside_grab',
133 136
 'fak_frontside_nose_grab',
@@ -281,7 +284,8 @@ def main(cont):
281 284
 		own['aState'] = 'reg_idle'
282 285
 		own['l_aState'] = None
283 286
 		own['stateTimer'] = 0
284
-
287
+		own['eaState'] = FSM.EaFSM(own)
288
+		own['EaRequest'] = None
285 289
 	
286 290
 	aState = own['aState']
287 291
 	rA = own['requestAction']
@@ -484,3 +488,4 @@ def main(cont):
484 488
 	else:
485 489
 		skater.stopAction(5)	
486 490
 
491
+	own['eaState'].Execute()

+ 77
- 14
scripts/actionsFSMlist.py View File

@@ -1582,15 +1582,15 @@ reg_wall_r_in = a_class(
1582 1582
 	#player armature action name, start, end frames
1583 1583
 	'reg_wall_r', 1, 10,
1584 1584
 	#deck action name, start, end frames  
1585
-	'b_reg', 1, 10,
1585
+	'b_reg_wall_r', 1, 10,
1586 1586
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1587 1587
 	1, .5, 0, 5,
1588 1588
 	#intro, length
1589 1589
 	None, 0,
1590 1590
 	#exits
1591
-	['reg_airwalk'],
1591
+	['reg_wall_r'],
1592 1592
 	#force exit, frame
1593
-	'reg_airwalk', 20,
1593
+	'reg_wall_r', 20,
1594 1594
 	#opposite
1595 1595
 	None)
1596 1596
 
@@ -1598,9 +1598,9 @@ reg_wall_r = a_class(
1598 1598
 	#player armature action name, start, end frames
1599 1599
 	'reg_wall_r', 10, 10,
1600 1600
 	#deck action name, start, end frames  
1601
-	'b_reg', 10, 10,
1601
+	'b_reg_wall_r', 10, 10,
1602 1602
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1603
-	1, .5, 0, 5,
1603
+	1, .5, 1, 5,
1604 1604
 	#intro, length
1605 1605
 	'reg_wall_r_in', 10,
1606 1606
 	#exits
@@ -1614,13 +1614,13 @@ reg_wall_l_in = a_class(
1614 1614
 	#player armature action name, start, end frames
1615 1615
 	'reg_wall_l', 1, 10,
1616 1616
 	#deck action name, start, end frames  
1617
-	'b_reg', 1, 10,
1617
+	'b_reg_wall_l', 1, 10,
1618 1618
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1619 1619
 	1, .5, 0, 5,
1620 1620
 	#intro, length
1621 1621
 	None, 0,
1622 1622
 	#exits
1623
-	['reg_air'],
1623
+	['reg_wall_l'],
1624 1624
 	#force exit, frame
1625 1625
 	'reg_wall_l', 20,
1626 1626
 	#opposite
@@ -1630,9 +1630,9 @@ reg_wall_l = a_class(
1630 1630
 	#player armature action name, start, end frames
1631 1631
 	'reg_wall_l', 10, 10,
1632 1632
 	#deck action name, start, end frames  
1633
-	'b_reg', 10, 10,
1633
+	'b_reg_wall_l', 10, 10,
1634 1634
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1635
-	1, .5, 0, 5,
1635
+	1, .5, 1, 5,
1636 1636
 	#intro, length
1637 1637
 	'reg_wall_l_in', 10,
1638 1638
 	#exits
@@ -2153,7 +2153,7 @@ reg_dropin_in = a_class(
2153 2153
 	#deck action name, start, end frames  
2154 2154
 	'b_reg_dropin', 30, 50,
2155 2155
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2156
-	1, 1, 0, 15,
2156
+	1, .5, 0, 15,
2157 2157
 	#intro, length
2158 2158
 	None, 0,
2159 2159
 	#exits
@@ -2169,7 +2169,7 @@ reg_dropin = a_class(
2169 2169
 	#deck action name, start, end frames  
2170 2170
 	'b_reg_dropin', 50, 60,
2171 2171
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2172
-	1, 1, 0, 15,
2172
+	1, 1, 1, 15,
2173 2173
 	#intro, length
2174 2174
 	'reg_dropin_in', 20,
2175 2175
 	#exits
@@ -2993,7 +2993,7 @@ fak_air = a_class(
2993 2993
 	#intro, length
2994 2994
 	None, 0,
2995 2995
 	#exits
2996
-	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_air_nose', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_judo', 'fak_frigid', 'fak_onefoot', 'fak_fsonefoot', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
2996
+	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_air_nose', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_judo', 'fak_frigid', 'fak_onefoot', 'fak_fsonefoot', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'fak_wall_l', 'fak_wall_r'],
2997 2997
 	#force exit, frame
2998 2998
 	None, 0,
2999 2999
 	#opposite
@@ -3009,7 +3009,7 @@ fak_air_nb = a_class(
3009 3009
 	#intro, length
3010 3010
 	None, 0,
3011 3011
 	#exits
3012
-	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_air_nose', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_judo', 'fak_frigid', 'fak_onefoot', 'fak_fsonefoot', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
3012
+	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_air_nose', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_judo', 'fak_frigid', 'fak_onefoot', 'fak_fsonefoot', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'fak_wall_l', 'fak_wall_r'],
3013 3013
 	#force exit, frame
3014 3014
 	None, 0,
3015 3015
 	#opposite
@@ -3026,7 +3026,7 @@ fak_air_nose = a_class(
3026 3026
 	#intro, length
3027 3027
 	None, 0,
3028 3028
 	#exits
3029
-	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_manual', 'fak_nmanual', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
3029
+	['fak_offboard', 'fak_land', 'fak_frontside_grab', 'fak_backside_grab', 'fak_frontside_nose_grab', 'fak_backside_nose_grab', 'fak_frontside_tail_grab', 'fak_backside_tail_grab', 'fak_air_nose', 'fak_air_tail', 'fak_ollie_north', 'fak_ollie_south', 'fak_judo', 'fak_frigid', 'fak_onefoot', 'fak_fsonefoot', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'fak_wall_l', 'fak_wall_r'],
3030 3030
 	#force exit, frame
3031 3031
 	None, 0,
3032 3032
 	#opposite
@@ -4125,3 +4125,66 @@ fak_noseslide = a_class(
4125 4125
 
4126 4126
 
4127 4127
 
4128
+fak_wall_r_in = a_class(
4129
+	#player armature action name, start, end frames
4130
+	'fak_wall_r', 1, 10,
4131
+	#deck action name, start, end frames  
4132
+	'b_reg_wall_l', 1, 10,
4133
+	#layer, speed, mode (0 = play, 1 = loop), blendin
4134
+	1, .5, 0, 5,
4135
+	#intro, length
4136
+	None, 0,
4137
+	#exits
4138
+	['fak_wall_r'],
4139
+	#force exit, frame
4140
+	'fak_wall_r', 20,
4141
+	#opposite
4142
+	None)
4143
+
4144
+fak_wall_r = a_class(
4145
+	#player armature action name, start, end frames
4146
+	'fak_wall_r', 10, 10,
4147
+	#deck action name, start, end frames  
4148
+	'b_reg_wall_l', 10, 10,
4149
+	#layer, speed, mode (0 = play, 1 = loop), blendin
4150
+	1, .5, 1, 5,
4151
+	#intro, length
4152
+	'fak_wall_r_in', 10,
4153
+	#exits
4154
+	['fak_air'],
4155
+	#force exit, frame
4156
+	None, 0,
4157
+	#opposite
4158
+	None)
4159
+
4160
+fak_wall_l_in = a_class(
4161
+	#player armature action name, start, end frames
4162
+	'fak_wall_l', 1, 10,
4163
+	#deck action name, start, end frames  
4164
+	'b_reg_wall_r', 1, 10,
4165
+	#layer, speed, mode (0 = play, 1 = loop), blendin
4166
+	1, .5, 0, 5,
4167
+	#intro, length
4168
+	None, 0,
4169
+	#exits
4170
+	['fak_wall_l'],
4171
+	#force exit, frame
4172
+	'fak_wall_l', 20,
4173
+	#opposite
4174
+	None)
4175
+
4176
+fak_wall_l = a_class(
4177
+	#player armature action name, start, end frames
4178
+	'fak_wall_l', 10, 10,
4179
+	#deck action name, start, end frames  
4180
+	'b_reg_wall_r', 10, 10,
4181
+	#layer, speed, mode (0 = play, 1 = loop), blendin
4182
+	1, .5, 1, 5,
4183
+	#intro, length
4184
+	'fak_wall_l_in', 10,
4185
+	#exits
4186
+	['fak_air'],
4187
+	#force exit, frame
4188
+	None, 0,
4189
+	#opposite
4190
+	None)

+ 10
- 4
scripts/controller2.py View File

@@ -4039,9 +4039,12 @@ def main():
4039 4039
 
4040 4040
     def wallride_sound():
4041 4041
         sact = own.actuators["wallSound"]
4042
-        if own["wallride"] != None and (own['actionState'] == 'reg_wall_r' or own['actionState'] == 'reg_wall_l' or own['actionState'] == 'fak_wall_r' or own['actionState'] == 'fak_wall_l'):
4042
+        print('wr as', own['aState'])
4043
+        #if own["wallride"] != None and (own['actionState'] == 'reg_wall_r' or own['actionState'] == 'reg_wall_l' or own['actionState'] == 'fak_wall_r' or own['actionState'] == 'fak_wall_l'):
4044
+        if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
4043 4045
             sact.volume = .2
4044 4046
             cont.activate(own.actuators["wallSound"])
4047
+            print('wall sound act')
4045 4048
         else:
4046 4049
             sact.volume = .001
4047 4050
             sact.stopSound()
@@ -4166,6 +4169,7 @@ def main():
4166 4169
 
4167 4170
     def land_mod():
4168 4171
         if own['requestAction'] == 'reg_land':
4172
+            own['EaRequest'] = 'land'
4169 4173
             if land_overRideL == True:
4170 4174
                 own['requestAction'] = 'reg_landL'
4171 4175
                 print('requesting unbalanced land1')
@@ -4388,12 +4392,14 @@ def main():
4388 4392
                 if localHitDist < 1.5:        
4389 4393
                     #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4390 4394
                     #own.applyMovement((0, 0, (.3 - localHitDist)), True)
4391
-                    own.applyMovement((0, 0, (.4 - localHitDist)), True)
4395
+                    #if localHitDist < 1.0:
4396
+                    own.applyForce((0, 0, (.4 - localHitDist) *1000), True)
4397
+
4392 4398
                     print('moving vert ray')
4393 4399
                     if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4394 4400
                     #if localRay_v[2] != [0,0,-1]:
4395
-                        own.alignAxisToVect(localRay_v[2], 2, .4)
4396
-                        #own.alignAxisToVect(localRay_v[2], 2, .05)
4401
+                        #own.alignAxisToVect(localRay_v[2], 2, .4)
4402
+                        own.alignAxisToVect(localRay_v[2], 2, .05)
4397 4403
                         aligned = True
4398 4404
             else:
4399 4405
                 print('doing nothing')            

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:adba7d5f97d78f60e22b304c00c4c3dfa032ed73bf93f382246fb9efbc422d3d
3
-size 116944168
2
+oid sha256:cb5a8bc22a72afdd6761d32a3fd5a45ab324126e5db7c2253590421cabadefc8
3
+size 117252472

Loading…
Cancel
Save