Browse Source

new anim code1

shuvit 2 years ago
parent
commit
6cdb83bee7

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

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:8f008b26f7b7134323c616925691067886f5f4d5440047396fdad5f4f5c5fc8c
3
-size 88512652
2
+oid sha256:69486a9653ba9b6ff283d37f7361834aa4e86ca862cd0066d6eff7216528a9a2
3
+size 187177596

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:77db4e46f63bbc9da04ab4df1cfc9005168aee194c61e2ce7df7f569b4319493
3
-size 36844116
2
+oid sha256:3f61eb94898eac143be19fcc213d8eb9c1249a7a6b1e0bd24c6f14afb81e7768
3
+size 36970420

+ 3
- 0
assets/user2pit.blend View File

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

+ 29
- 29
config.ini View File

@@ -49,41 +49,41 @@ walk_focal_length = 14
49 49
 #character settings
50 50
 ###################
51 51
 
52
-character = annie
52
+character = ralph
53 53
 
54
-shirt_logo = 2
54
+shirt_logo = 4
55 55
 
56
-shirt_color_r = 0.44
57
-shirt_color_g = 0.44
58
-shirt_color_b = 0.44
56
+shirt_color_r = 0.23
57
+shirt_color_g = 0.03
58
+shirt_color_b = 0.05
59 59
 
60
-shoe_color_r = 0.08
61
-shoe_color_g = 0.03
62
-shoe_color_b = 0
60
+shoe_color_r = 0.71
61
+shoe_color_g = 0.71
62
+shoe_color_b = 0.71
63 63
 #-----------------
64 64
 
65 65
 #deck settings
66 66
 ##############
67
-deck_index = 5
68
-deck_color_r = 0.8
69
-deck_color_g = 0.8
70
-deck_color_b = 0.8
71
-trucks_r = 0
72
-trucks_g = 0
73
-trucks_b = 0
74
-
75
-wheel1_r = 0.21
76
-wheel1_g = 0.21
77
-wheel1_b = 0.21
78
-wheel2_r = 0.21
79
-wheel2_g = 0.21
80
-wheel2_b = 0.21
81
-wheel3_r = 0.21
82
-wheel3_g = 0.21
83
-wheel3_b = 0.21
84
-wheel4_r = 0.21
85
-wheel4_g = 0.21
86
-wheel4_b = 0.21
67
+deck_index = 6
68
+deck_color_r = 0.1
69
+deck_color_g = 0
70
+deck_color_b = 0
71
+trucks_r = 0.29
72
+trucks_g = 0.28
73
+trucks_b = 0.31
74
+
75
+wheel1_r = 0
76
+wheel1_g = 0.1
77
+wheel1_b = 0
78
+wheel2_r = 0
79
+wheel2_g = 0.1
80
+wheel2_b = 0
81
+wheel3_r = 0
82
+wheel3_g = 0.1
83
+wheel3_b = 0
84
+wheel4_r = 0
85
+wheel4_g = 0.1
86
+wheel4_b = 0
87 87
 #-------------------
88 88
 
89 89
 #2d filter settings
@@ -127,7 +127,7 @@ shadow_on = 0
127 127
 
128 128
 #physics
129 129
 ########
130
-JUMPHEIGHT = 840#800
130
+JUMPHEIGHT = 880#840#800
131 131
 MAX_VEL = 6.7
132 132
 SPEEDUP = 0.055
133 133
 SPEEDPUMP = 0.14#.09

+ 10
- 1
scripts/Record.py View File

@@ -225,7 +225,7 @@ def loadData():
225 225
     skater = scene.objects["Char4"]
226 226
     deck = scene.objects["deck"]
227 227
     trucks = scene.objects["trucks"]
228
-    
228
+    bdeck = scene.objects['deck_arm']
229 229
     num = 1
230 230
     obj = scene.objects['control_cube.002']
231 231
     if num == 1:    
@@ -358,6 +358,15 @@ def loadData():
358 358
         skater.stopAction(6)
359 359
         skater.stopAction(9999)
360 360
 
361
+        bdeck.stopAction(0)
362
+        bdeck.stopAction(1)
363
+        bdeck.stopAction(2)
364
+        bdeck.stopAction(3)
365
+        bdeck.stopAction(4)
366
+        bdeck.stopAction(5)
367
+        bdeck.stopAction(6)
368
+        bdeck.stopAction(9999)        
369
+
361 370
 
362 371
         boneRecord.Playback(valueIndex)
363 372
 

BIN
scripts/__pycache__/Record.cpython-36.pyc View File


BIN
scripts/__pycache__/co_ActionState.cpython-36.pyc View File


BIN
scripts/__pycache__/colors.cpython-36.pyc View File


BIN
scripts/__pycache__/controller2.cpython-36.pyc View File


BIN
scripts/__pycache__/grindV2.cpython-36.pyc View File


BIN
scripts/__pycache__/scene_init.cpython-36.pyc View File


BIN
scripts/__pycache__/walk.cpython-36.pyc View File


+ 240
- 0
scripts/actionPlayer.py View File

@@ -0,0 +1,240 @@
1
+import bge
2
+import actionsFSMlist
3
+
4
+dict = bge.logic.globalDict
5
+
6
+
7
+def actionPlayer(ac):
8
+	scene = bge.logic.getCurrentScene()
9
+	skater = dict['p1']
10
+	deck = dict['p1d']
11
+	a = getattr(actionsFSMlist.reg_walk, 'name')
12
+	name = getattr(ac, 'name')
13
+	dname = getattr(ac, 'dname')
14
+	start = getattr(ac, 'start')
15
+	end = getattr(ac, 'end')
16
+	dstart = getattr(ac, 'dstart')
17
+	dend = getattr(ac, 'dend')
18
+	layer = getattr(ac, 'layer')
19
+	mode = getattr(ac, 'mode')
20
+	speed = getattr(ac, 'speed')
21
+	blendin = getattr(ac, 'blendin')
22
+	#--------------------------------
23
+	skater.playAction(name, start,end, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
24
+	deck.playAction(dname, dstart,dend, layer=layer, play_mode=mode, speed=speed, blendin=blendin)
25
+
26
+
27
+def get_frame(ac):
28
+	skater = dict['p1']
29
+	layer = getattr(ac, 'layer')
30
+	print('getting frame', skater.getActionFrame(layer))
31
+	return skater.getActionFrame(layer)
32
+
33
+def set_frame(ac, frame):
34
+	skater = dict['p1']
35
+	deck = dict['p1d']
36
+	layer = getattr(ac, 'layer')
37
+	skater.setActionFrame(frame, layer)
38
+	deck.setActionFrame(frame, layer)
39
+	print('setting frame', frame)
40
+
41
+def check_exit(aState, rA, ac):
42
+	exits = getattr(ac, 'exits')
43
+	if rA in exits:
44
+		return rA
45
+	else:
46
+		return aState
47
+
48
+
49
+def state_timer(own):
50
+	if own['aState'] == own['l_aState']:
51
+		own['stateTimer'] += 1
52
+	else:
53
+		own['stateTimer'] = 0
54
+
55
+def main(cont):
56
+	own = cont.owner
57
+	dict = bge.logic.globalDict
58
+
59
+	#initial state
60
+	if 'aState' not in own:
61
+		own['aState'] = 'reg_idle'
62
+		own['l_aState'] = None
63
+		own['stateTimer'] = 0
64
+
65
+
66
+	og_state = own['aState']
67
+	aState = own['aState']
68
+	rA = own['requestAction']
69
+	
70
+	#-----------------------
71
+	if aState == 'reg_idle':
72
+		actionPlayer(actionsFSMlist.reg_idle)
73
+		aState = check_exit(aState, rA, actionsFSMlist.reg_idle)
74
+		
75
+	elif aState == 'reg_idle2':
76
+		actionPlayer(actionsFSMlist.reg_idle2)
77
+		aState = check_exit(aState, rA, actionsFSMlist.reg_idle2)
78
+
79
+	elif aState == 'reg_idle3':
80
+		actionPlayer(actionsFSMlist.reg_idle3)
81
+		aState = check_exit(aState, rA, actionsFSMlist.reg_idle3)
82
+	
83
+	elif aState == 'reg_idle4':
84
+		actionPlayer(actionsFSMlist.reg_idle4)
85
+		aState = check_exit(aState, rA, actionsFSMlist.reg_idle4)
86
+
87
+	elif aState == 'reg_idle5':
88
+		actionPlayer(actionsFSMlist.reg_idle5)
89
+		aState = check_exit(aState, rA, actionsFSMlist.reg_idle5)
90
+	
91
+	elif aState == 'reg_jump':
92
+		actionPlayer(actionsFSMlist.reg_jump)
93
+		aState = check_exit(aState, rA, actionsFSMlist.reg_jump)
94
+	
95
+	elif aState == 'reg_walk_air':
96
+		actionPlayer(actionsFSMlist.reg_walk_air)
97
+		if aState != rA:
98
+			aState = 'reg_walk_air_out'
99
+
100
+	elif aState == 'reg_walk_air_out':
101
+		actionPlayer(actionsFSMlist.reg_walk_air_out)
102
+		if own['stateTimer'] > 7:
103
+			aState = check_exit(aState, rA, actionsFSMlist.reg_walk_air_out)		
104
+		
105
+	elif aState == 'reg_sit':
106
+
107
+		if own['stateTimer'] < 19:
108
+			actionPlayer(actionsFSMlist.reg_sit_in)
109
+		else:
110
+			actionPlayer(actionsFSMlist.reg_sit)
111
+		aState = check_exit(aState, rA, actionsFSMlist.reg_sit)
112
+
113
+	#-----------------------
114
+	elif aState == 'reg_walk':
115
+		
116
+		if own['l_aState'] == 'reg_walkFast':
117
+			print('--------------------doing last frame')
118
+			frame = get_frame(actionsFSMlist.reg_walkFast)
119
+			actionPlayer(actionsFSMlist.reg_walk)
120
+			set_frame(actionsFSMlist.reg_walk, frame)
121
+		else:	
122
+			frame = actionPlayer(actionsFSMlist.reg_walk)
123
+		
124
+		aState = check_exit(aState, rA, actionsFSMlist.reg_walk)
125
+
126
+	#-----------------------
127
+	elif aState == 'reg_walkFast':
128
+		
129
+		aState = check_exit(aState, rA, actionsFSMlist.reg_walkFast)
130
+
131
+		if own['l_aState'] == 'reg_walk':
132
+			print('--------------------doing last framebbbb')
133
+			frame = get_frame(actionsFSMlist.reg_walk)
134
+			actionPlayer(actionsFSMlist.reg_walkFast)
135
+			set_frame(actionsFSMlist.reg_walkFast, frame)
136
+
137
+		else:
138
+			actionPlayer(actionsFSMlist.reg_walkFast)
139
+		#print(frame)
140
+
141
+
142
+
143
+	elif aState == 'reg_onboard':
144
+		actionPlayer(actionsFSMlist.reg_onboard)
145
+		if own['stateTimer'] > 10:
146
+			aState = check_exit(aState, rA, actionsFSMlist.reg_onboard)
147
+
148
+	elif aState == 'reg_offboard':
149
+		actionPlayer(actionsFSMlist.reg_offboard)
150
+		if own['stateTimer'] > 20:
151
+			aState = check_exit(aState, rA, actionsFSMlist.reg_offboard)			
152
+
153
+	elif aState == 'reg_roll':
154
+		actionPlayer(actionsFSMlist.reg_roll)
155
+		aState = check_exit(aState, rA, actionsFSMlist.reg_roll)
156
+
157
+	elif aState == 'reg_turnLeft':
158
+		actionPlayer(actionsFSMlist.reg_turnLeft)
159
+		aState = check_exit(aState, rA, actionsFSMlist.reg_turnLeft)
160
+	
161
+	elif aState == 'reg_turnRight':
162
+		actionPlayer(actionsFSMlist.reg_turnRight)
163
+		aState = check_exit(aState, rA, actionsFSMlist.reg_turnRight)
164
+
165
+	elif aState == 'reg_opos':
166
+		actionPlayer(actionsFSMlist.reg_opos)
167
+		aState = check_exit(aState, rA, actionsFSMlist.reg_opos)		
168
+
169
+	elif aState == 'reg_nopos':
170
+		actionPlayer(actionsFSMlist.reg_nopos)
171
+		aState = check_exit(aState, rA, actionsFSMlist.reg_nopos)		
172
+
173
+	elif aState == 'reg_pump':
174
+		actionPlayer(actionsFSMlist.reg_pump)
175
+		aState = check_exit(aState, rA, actionsFSMlist.reg_pump)		
176
+
177
+	elif aState == 'reg_push':
178
+		actionPlayer(actionsFSMlist.reg_push)
179
+		if own['stateTimer'] > 70:
180
+			aState = 'reg_roll'
181
+
182
+	elif aState == 'reg_push_goof':
183
+		actionPlayer(actionsFSMlist.reg_push_goof)
184
+		if own['stateTimer'] > 70:
185
+			aState = 'reg_roll'			
186
+		
187
+	elif aState == 'reg_powerslide':
188
+		if own['stateTimer'] < 20:
189
+			actionPlayer(actionsFSMlist.reg_powerslide_in)
190
+		else:
191
+			actionPlayer(actionsFSMlist.reg_powerslide)
192
+		
193
+
194
+		aState = check_exit(aState, rA, actionsFSMlist.reg_powerslide)
195
+
196
+	elif aState == 'reg_fs_powerslide':
197
+		if own['stateTimer'] < 20:
198
+			actionPlayer(actionsFSMlist.reg_fs_powerslide_in)
199
+		else:
200
+			actionPlayer(actionsFSMlist.reg_fs_powerslide)
201
+		aState = check_exit(aState, rA, actionsFSMlist.reg_fs_powerslide)				
202
+
203
+	elif aState == 'reg_manual':
204
+		actionPlayer(actionsFSMlist.reg_manual)
205
+		aState = check_exit(aState, rA, actionsFSMlist.reg_manual)
206
+
207
+	elif aState == 'reg_nmanual':
208
+		actionPlayer(actionsFSMlist.reg_nmanual)
209
+		aState = check_exit(aState, rA, actionsFSMlist.reg_nmanual)
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+	#-----------------------
236
+	own['aState'] = aState
237
+	print(own['l_aState'], '----l_aState', own['aState'])
238
+	own['l_aState'] = og_state
239
+	
240
+	state_timer(own)

+ 695
- 123
scripts/actionsFSMlist.py View File

@@ -6,126 +6,698 @@ fak_fliplist = ['fak_ollie', 'fak_nollie', 'fak_nollie', 'fak_kickflip', 'fak_va
6 6
 
7 7
 
8 8
 class a_class:
9
-    pass
10
-#------------------------------
11
-reg_roll = a_class()
12
-reg_roll.name = 'reg_roll'
13
-reg_roll.parent = []
14
-#reg_roll.siblings['fak_roll']
15
-reg_roll.s_action = 'nreg'
16
-reg_roll.s_se = [1, 60]
17
-reg_roll.d_action = 'a_reg'
18
-reg_roll.d_se = [0, 10]
19
-reg_roll.t_action = 'a_reg'
20
-reg_roll.t_se = [0, 10]
21
-reg_roll.stateLife = 1
22
-reg_roll.layer = MAIN_LAYER
23
-reg_roll.speed = 1
24
-reg_roll.mode = 0
25
-#------------------------------
26
-reg_opos = a_class()
27
-reg_opos.name = 'reg_opos'
28
-reg_opos.parent = ['reg_roll']
29
-reg_opos.parentTrans = 'toreg_opos_to_roll'
30
-reg_opos.requestAction = 'reg_opos'
31
-#reg_roll.siblings['']
32
-reg_opos.s_action = 'nopos'
33
-reg_opos.s_se = [1, 40]
34
-reg_opos.d_action = 'a_reg'
35
-reg_opos.d_se = [0, 10]
36
-reg_opos.t_action = 'a_reg'
37
-reg_opos.t_se = [0, 10]
38
-reg_opos.stateLife = 1
39
-reg_opos.layer = MAIN_LAYER
40
-reg_opos.speed = 1
41
-reg_opos.mode = 0
42
-#------------------------------
43
-reg_left = a_class()
44
-reg_left.name = 'reg_left'
45
-reg_left.parent = ['reg_roll']
46
-reg_left.parentTrans = 'toreg_left_to_roll'
47
-reg_left.requestAction = 'reg_turnLeft'
48
-reg_left.s_action = 'nreg_left'
49
-reg_left.s_se = [10, 10]
50
-reg_left.d_action = 'a_reg_left'
51
-reg_left.d_se = [0, 10]
52
-reg_left.t_action = 'a_reg'
53
-reg_left.t_se = [0, 10]
54
-reg_left.stateLife = 1
55
-reg_left.layer = MAIN_LAYER
56
-reg_left.speed = 1
57
-reg_left.mode = 0
58
-#------------------------------
59
-reg_roll_to_opos = a_class()
60
-reg_roll_to_opos.name = 'reg_roll_to_opos'
61
-reg_roll_to_opos.parent = ['reg_roll']
62
-reg_roll_to_opos.parentTrans = 'toreg_opos'
63
-reg_roll_to_opos.s_action = 'noposin'
64
-reg_roll_to_opos.s_se = [1, 20]
65
-reg_roll_to_opos.d_action = 'a_reg'
66
-reg_roll_to_opos.d_se = [0, 10]
67
-reg_roll_to_opos.t_action = 'a_reg'
68
-reg_roll_to_opos.t_se = [0, 10]
69
-reg_roll_to_opos.stateLife = 1
70
-reg_roll_to_opos.layer = TRANS_LAYER
71
-reg_roll_to_opos.speed = 1
72
-reg_roll_to_opos.mode = 0
73
-#------------------------------
74
-reg_opos_to_roll = a_class()
75
-reg_opos_to_roll.name = 'reg_opos_to_roll'
76
-reg_opos_to_roll.parent = ['reg_roll']
77
-reg_opos_to_roll.s_action = 'noposin'
78
-reg_opos_to_roll.s_se = [20, 1]
79
-reg_opos_to_roll.d_action = 'a_reg'
80
-reg_opos_to_roll.d_se = [0, 10]
81
-reg_opos_to_roll.t_action = 'a_reg'
82
-reg_opos_to_roll.t_se = [0, 10]
83
-reg_opos_to_roll.stateLife = 1
84
-reg_opos_to_roll.layer = TRANS_LAYER
85
-reg_opos_to_roll.speed = 1
86
-reg_opos_to_roll.mode = 0
87
-#------------------------------
88
-reg_roll_to_left = a_class()
89
-reg_roll_to_left.name = 'reg_roll_to_left'
90
-reg_roll_to_left.parent = ['reg_roll']
91
-reg_roll_to_left.s_action = 'nreg_left'
92
-reg_roll_to_left.s_se = [1, 10]
93
-reg_roll_to_left.d_action = 'a_reg'
94
-reg_roll_to_left.d_se = [0, 10]
95
-reg_roll_to_left.t_action = 'a_reg'
96
-reg_roll_to_left.t_se = [0, 10]
97
-reg_roll_to_left.stateLife = 1
98
-reg_roll_to_left.layer = TRANS_LAYER
99
-reg_roll_to_left.speed = .5
100
-reg_roll_to_left.mode = 0
101
-#------------------------------
102
-reg_left_to_roll = a_class()
103
-reg_left_to_roll.name = 'reg_left_to_roll'
104
-reg_left_to_roll.parent = ['reg_roll']
105
-reg_left_to_roll.s_action = 'nreg_left'
106
-reg_left_to_roll.s_se = [10, 1]
107
-reg_left_to_roll.d_action = 'a_reg'
108
-reg_left_to_roll.d_se = [0, 10]
109
-reg_left_to_roll.t_action = 'a_reg'
110
-reg_left_to_roll.t_se = [0, 10]
111
-reg_left_to_roll.stateLife = 1
112
-reg_left_to_roll.layer = TRANS_LAYER
113
-reg_left_to_roll.speed = .5
114
-reg_left_to_roll.mode = 0
115
-#------------------------------
116
-reg_left_to_roll = a_class()
117
-reg_left_to_roll.name = 'reg_ollie'
118
-reg_left_to_roll.parent = ['reg_roll']
119
-reg_left_to_roll.s_action = 'reg_ollie'
120
-reg_left_to_roll.s_se = [1, 20]
121
-reg_left_to_roll.d_action = 'a_reg_ollie'
122
-reg_left_to_roll.d_se = [1, 20]
123
-reg_left_to_roll.t_action = 't_reg_ollie'
124
-reg_left_to_roll.t_se = [1, 20]
125
-reg_left_to_roll.stateLife = 1
126
-reg_left_to_roll.layer = TRANS_LAYER
127
-reg_left_to_roll.speed = .5
128
-reg_left_to_roll.mode = 0
129
-#------------------------------
130
-
131
-#reg_ollie
9
+	def __init__(self, name, start, end, dname, dstart, dend, layer, speed, mode, blendin, exits):
10
+		self.name = name
11
+		self.start = start
12
+		self.end = end
13
+		self.dname = dname
14
+		self.dstart = dstart
15
+		self.dend = dend
16
+		self.layer = layer
17
+		self.speed = speed
18
+		self.mode = mode
19
+		self.blendin = blendin
20
+		self.exits = exits
21
+
22
+reg_walk = a_class(
23
+	#player armature action name
24
+	'reg_nwalk', 
25
+	#start frame
26
+	0,           
27
+	#end frame
28
+	35,
29
+	#deck action name 
30
+	'b_reg_walk', 
31
+	#deck start frame
32
+	0, 
33
+	#deck end frame
34
+	35,
35
+	#layer
36
+	1,
37
+	#speed
38
+	.5,
39
+	#mode (1 = play, 0 = loop)
40
+	0,
41
+	#blendin
42
+	20,
43
+	#exits
44
+	['reg_walkFast', 'reg_idle', 'reg_jump', 'reg_onboard'])
45
+
46
+reg_walkFast = a_class(
47
+	#player armature action name
48
+	'reg_nwalk', 
49
+	#start frame
50
+	0,           
51
+	#end frame
52
+	35,
53
+	#deck action name 
54
+	'b_reg_walk', 
55
+	#deck start frame
56
+	0, 
57
+	#deck end frame
58
+	35,
59
+	#layer
60
+	1,
61
+	#speed
62
+	1,
63
+	#mode (1 = play, 0 = loop)
64
+	0,
65
+	#blendin
66
+	0, 
67
+	#exits
68
+	['reg_walk', 'reg_idle', 'reg_jump', 'reg_onboard'])
69
+
70
+
71
+
72
+reg_idle = a_class(
73
+	#player armature action name
74
+	'reg_idle1', 
75
+	#start frame
76
+	1,           
77
+	#end frame
78
+	120,
79
+	#deck action name 
80
+	'b_reg_walk', 
81
+	#deck start frame
82
+	1, 
83
+	#deck end frame
84
+	1,
85
+	#layer
86
+	1,
87
+	#speed
88
+	.5,
89
+	#mode (1 = play, 0 = loop)
90
+	0,
91
+	#blendin
92
+	20,
93
+	#exits
94
+	['reg_walk', 'reg_idle2', 'reg_idle3', 'reg_idle4', 'reg_idle5', 'reg_jump', 'reg_sit', 'reg_onboard'])
95
+
96
+reg_idle2 = a_class(
97
+	#player armature action name
98
+	'reg_idle2', 
99
+	#start frame
100
+	1,           
101
+	#end frame
102
+	120,
103
+	#deck action name 
104
+	'b_reg_walk', 
105
+	#deck start frame
106
+	1, 
107
+	#deck end frame
108
+	1,
109
+	#layer
110
+	1,
111
+	#speed
112
+	.5,
113
+	#mode (1 = play, 0 = loop)
114
+	1,
115
+	#blendin
116
+	20,
117
+	#exits
118
+	['reg_walk', 'reg_idle', 'reg_idle3', 'reg_idle4', 'reg_idle5', 'reg_jump', 'reg_onboard'])
119
+
120
+reg_idle3 = a_class(
121
+	#player armature action name
122
+	'reg_idle3', 
123
+	#start frame
124
+	1,           
125
+	#end frame
126
+	120,
127
+	#deck action name 
128
+	'b_reg_walk', 
129
+	#deck start frame
130
+	1, 
131
+	#deck end frame
132
+	1,
133
+	#layer
134
+	1,
135
+	#speed
136
+	.5,
137
+	#mode (1 = play, 0 = loop)
138
+	1,
139
+	#blendin
140
+	20,
141
+	#exits
142
+	['reg_walk', 'reg_idle2', 'reg_idle', 'reg_idle4', 'reg_idle5', 'reg_jump', 'reg_onboard'])
143
+
144
+reg_idle4 = a_class(
145
+	#player armature action name
146
+	'reg_idle4', 
147
+	#start frame
148
+	1,           
149
+	#end frame
150
+	120,
151
+	#deck action name 
152
+	'b_reg_walk', 
153
+	#deck start frame
154
+	1, 
155
+	#deck end frame
156
+	1,
157
+	#layer
158
+	1,
159
+	#speed
160
+	.5,
161
+	#mode (1 = play, 0 = loop)
162
+	1,
163
+	#blendin
164
+	20,
165
+	#exits
166
+	['reg_walk', 'reg_idle2', 'reg_idle3', 'reg_idle', 'reg_idle5', 'reg_jump', 'reg_onboard'])
167
+
168
+reg_idle5 = a_class(
169
+	#player armature action name
170
+	'reg_idle5', 
171
+	#start frame
172
+	1,           
173
+	#end frame
174
+	120,
175
+	#deck action name 
176
+	'b_reg_walk', 
177
+	#deck start frame
178
+	1, 
179
+	#deck end frame
180
+	1,
181
+	#layer
182
+	1,
183
+	#speed
184
+	.5,
185
+	#mode (1 = play, 0 = loop)
186
+	1,
187
+	#blendin
188
+	20,
189
+	#exits
190
+	['reg_walk', 'reg_idle2', 'reg_idle3', 'reg_idle4', 'reg_idle', 'reg_jump', 'reg_onboard'])
191
+
192
+reg_jump = a_class(
193
+	#player armature action name
194
+	'reg_jump', 
195
+	#start frame
196
+	1,           
197
+	#end frame
198
+	10,
199
+	#deck action name 
200
+	'b_reg_jump', 
201
+	#deck start frame
202
+	1, 
203
+	#deck end frame
204
+	10,
205
+	#layer
206
+	1,
207
+	#speed
208
+	.5,
209
+	#mode (1 = play, 0 = loop)
210
+	1,
211
+	#blendin
212
+	10,
213
+	#exits
214
+	['reg_idle', 'reg_walk_air', 'reg_onboard'])
215
+
216
+reg_walk_air = a_class(
217
+	#player armature action name
218
+	'reg_walk_air', 
219
+	#start frame
220
+	10,           
221
+	#end frame
222
+	10,
223
+	#deck action name 
224
+	'b_reg_jump', 
225
+	#deck start frame
226
+	10, 
227
+	#deck end frame
228
+	10,
229
+	#layer
230
+	1,
231
+	#speed
232
+	.5,
233
+	#mode (1 = play, 0 = loop)
234
+	0,
235
+	#blendin
236
+	10,
237
+	#exits
238
+	['reg_walk_air_out'])
239
+
240
+reg_walk_air_out = a_class(
241
+	#player armature action name
242
+	'reg_walk_air', 
243
+	#start frame
244
+	10,           
245
+	#end frame
246
+	40,
247
+	#deck action name 
248
+	'b_reg_jump', 
249
+	#deck start frame
250
+	10, 
251
+	#deck end frame
252
+	10,
253
+	#layer
254
+	1,
255
+	#speed
256
+	1.5,
257
+	#mode (1 = play, 0 = loop)
258
+	1,
259
+	#blendin
260
+	10,
261
+	#exits
262
+	['reg_idle', 'reg_walk', 'reg_walkFast', 'reg_onboard'])
263
+
264
+reg_sit_in = a_class(
265
+	#player armature action name
266
+	'reg_sit', 
267
+	#start frame
268
+	1,           
269
+	#end frame
270
+	65,
271
+	#deck action name 
272
+	'b_reg_jump', 
273
+	#deck start frame
274
+	1, 
275
+	#deck end frame
276
+	65,
277
+	#layer
278
+	1,
279
+	#speed
280
+	1,
281
+	#mode (1 = play, 0 = loop)
282
+	1,
283
+	#blendin
284
+	20,
285
+	#exits
286
+	['reg_idle', 'reg_walk'])
287
+
288
+reg_sit = a_class(
289
+	#player armature action name
290
+	'reg_sit', 
291
+	#start frame
292
+	65,           
293
+	#end frame
294
+	65,
295
+	#deck action name 
296
+	'b_reg_jump', 
297
+	#deck start frame
298
+	65, 
299
+	#deck end frame
300
+	65,
301
+	#layer
302
+	1,
303
+	#speed
304
+	1,
305
+	#mode (1 = play, 0 = loop)
306
+	1,
307
+	#blendin
308
+	20,
309
+	#exits
310
+	['reg_idle', 'reg_walk'])
311
+
312
+#------news
313
+
314
+reg_onboard = a_class(
315
+	#player armature action name
316
+	'reg_noffboard', 
317
+	#start frame
318
+	20,           
319
+	#end frame
320
+	1,
321
+	#deck action name 
322
+	'b_reg_offboard', 
323
+	#deck start frame
324
+	20, 
325
+	#deck end frame
326
+	1,
327
+	#layer
328
+	1,
329
+	#speed
330
+	1,
331
+	#mode (1 = play, 0 = loop)
332
+	1,
333
+	#blendin
334
+	10,
335
+	#exits
336
+	['reg_roll'])
337
+
338
+reg_offboard = a_class(
339
+	#player armature action name
340
+	'reg_noffboard', 
341
+	#start frame
342
+	1,           
343
+	#end frame
344
+	40,
345
+	#deck action name 
346
+	'b_reg_offboard', 
347
+	#deck start frame
348
+	1, 
349
+	#deck end frame
350
+	40,
351
+	#layer
352
+	1,
353
+	#speed
354
+	1,
355
+	#mode (1 = play, 0 = loop)
356
+	1,
357
+	#blendin
358
+	5,
359
+	#exits
360
+	['reg_idle', 'reg_walkFast', 'reg_walk'])
361
+
362
+reg_roll = a_class(
363
+	#player armature action name
364
+	'nreg', 
365
+	#start frame
366
+	1,           
367
+	#end frame
368
+	60,
369
+	#deck action name 
370
+	'b_reg', 
371
+	#deck start frame
372
+	1, 
373
+	#deck end frame
374
+	60,
375
+	#layer
376
+	1,
377
+	#speed
378
+	.5,
379
+	#mode (1 = play, 0 = loop)
380
+	1,
381
+	#blendin
382
+	10,
383
+	#exits
384
+	['reg_idle', 'reg_offboard', 'reg_turnLeft', 'reg_turnRight', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
385
+
386
+reg_turnLeft = a_class(
387
+	#player armature action name
388
+	'nreg_left', 
389
+	#start frame
390
+	10,           
391
+	#end frame
392
+	30,
393
+	#deck action name 
394
+	'b_reg_left', 
395
+	#deck start frame
396
+	10, 
397
+	#deck end frame
398
+	30,
399
+	#layer
400
+	1,
401
+	#speed
402
+	.5,
403
+	#mode (1 = play, 0 = loop)
404
+	1,
405
+	#blendin
406
+	20,
407
+	#exits
408
+	['reg_roll', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
409
+
410
+reg_turnRight = a_class(
411
+	#player armature action name
412
+	'nreg_right', 
413
+	#start frame
414
+	10,           
415
+	#end frame
416
+	30,
417
+	#deck action name 
418
+	'b_reg_right', 
419
+	#deck start frame
420
+	10, 
421
+	#deck end frame
422
+	30,
423
+	#layer
424
+	1,
425
+	#speed
426
+	.5,
427
+	#mode (1 = play, 0 = loop)
428
+	1,
429
+	#blendin
430
+	20,
431
+	#exits
432
+	['reg_roll', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
433
+
434
+
435
+reg_opos = a_class(
436
+	#player armature action name
437
+	'nopos', 
438
+	#start frame
439
+	11,           
440
+	#end frame
441
+	40,
442
+	#deck action name 
443
+	'b_reg', 
444
+	#deck start frame
445
+	1, 
446
+	#deck end frame
447
+	1,
448
+	#layer
449
+	1,
450
+	#speed
451
+	1,
452
+	#mode (1 = play, 0 = loop)
453
+	1,
454
+	#blendin
455
+	15,
456
+	#exits
457
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
458
+
459
+reg_nopos = a_class(
460
+	#player armature action name
461
+	'nnopos', 
462
+	#start frame
463
+	20,           
464
+	#end frame
465
+	20,
466
+	#deck action name 
467
+	'b_reg', 
468
+	#deck start frame
469
+	1, 
470
+	#deck end frame
471
+	1,
472
+	#layer
473
+	1,
474
+	#speed
475
+	1,
476
+	#mode (1 = play, 0 = loop)
477
+	1,
478
+	#blendin
479
+	15,
480
+	#exits
481
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
482
+
483
+reg_pump = a_class(
484
+	#player armature action name
485
+	'nopos', 
486
+	#start frame
487
+	20,           
488
+	#end frame
489
+	20,
490
+	#deck action name 
491
+	'b_reg', 
492
+	#deck start frame
493
+	1, 
494
+	#deck end frame
495
+	1,
496
+	#layer
497
+	1,
498
+	#speed
499
+	1,
500
+	#mode (1 = play, 0 = loop)
501
+	1,
502
+	#blendin
503
+	15,
504
+	#exits
505
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
506
+
507
+reg_push = a_class(
508
+	#player armature action name
509
+	'reg_push', 
510
+	#start frame
511
+	1,           
512
+	#end frame
513
+	35,
514
+	#deck action name 
515
+	'b_reg', 
516
+	#deck start frame
517
+	1, 
518
+	#deck end frame
519
+	1,
520
+	#layer
521
+	1,
522
+	#speed
523
+	.5,
524
+	#mode (1 = play, 0 = loop)
525
+	0,
526
+	#blendin
527
+	10,
528
+	#exits
529
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
530
+
531
+reg_push_goof = a_class(
532
+	#player armature action name
533
+	'reg_push_goof', 
534
+	#start frame
535
+	1,           
536
+	#end frame
537
+	35,
538
+	#deck action name 
539
+	'b_reg', 
540
+	#deck start frame
541
+	1, 
542
+	#deck end frame
543
+	1,
544
+	#layer
545
+	1,
546
+	#speed
547
+	.5,
548
+	#mode (1 = play, 0 = loop)
549
+	0,
550
+	#blendin
551
+	10,
552
+	#exits
553
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual'])
554
+
555
+
556
+reg_powerslide_in = a_class(
557
+	#player armature action name
558
+	'nreg_powerslide2', 
559
+	#start frame
560
+	0,           
561
+	#end frame
562
+	20,
563
+	#deck action name 
564
+	'b_reg_powerslide2', 
565
+	#deck start frame
566
+	0, 
567
+	#deck end frame
568
+	20,
569
+	#layer
570
+	1,
571
+	#speed
572
+	1,
573
+	#mode (1 = play, 0 = loop)
574
+	1,
575
+	#blendin
576
+	10,
577
+	#exits
578
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos', 'reg_manual', 'reg_nmanual'])
579
+
580
+reg_fs_powerslide_in = a_class(
581
+	#player armature action name
582
+	'nreg_powerslide', 
583
+	#start frame
584
+	0,           
585
+	#end frame
586
+	20,
587
+	#deck action name 
588
+	'b_reg_powerslide', 
589
+	#deck start frame
590
+	0, 
591
+	#deck end frame
592
+	20,
593
+	#layer
594
+	1,
595
+	#speed
596
+	1,
597
+	#mode (1 = play, 0 = loop)
598
+	1,
599
+	#blendin
600
+	10,
601
+	#exits
602
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos', 'reg_manual', 'reg_nmanual'])
603
+
604
+reg_powerslide = a_class(
605
+	#player armature action name
606
+	'nreg_powerslide2', 
607
+	#start frame
608
+	20,           
609
+	#end frame
610
+	20,
611
+	#deck action name 
612
+	'b_reg_powerslide2', 
613
+	#deck start frame
614
+	20, 
615
+	#deck end frame
616
+	20,
617
+	#layer
618
+	1,
619
+	#speed
620
+	1,
621
+	#mode (1 = play, 0 = loop)
622
+	1,
623
+	#blendin
624
+	10,
625
+	#exits
626
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos', 'reg_manual', 'reg_nmanual'])
627
+
628
+reg_fs_powerslide = a_class(
629
+	#player armature action name
630
+	'nreg_powerslide', 
631
+	#start frame
632
+	20,           
633
+	#end frame
634
+	20,
635
+	#deck action name 
636
+	'b_reg_powerslide', 
637
+	#deck start frame
638
+	20, 
639
+	#deck end frame
640
+	20,
641
+	#layer
642
+	1,
643
+	#speed
644
+	1,
645
+	#mode (1 = play, 0 = loop)
646
+	1,
647
+	#blendin
648
+	10,
649
+	#exits
650
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos', 'reg_manual', 'reg_nmanual'])
651
+
652
+
653
+reg_manual = a_class(
654
+	#player armature action name
655
+	'reg_manual', 
656
+	#start frame
657
+	20,           
658
+	#end frame
659
+	20,
660
+	#deck action name 
661
+	'b_reg_manual', 
662
+	#deck start frame
663
+	20, 
664
+	#deck end frame
665
+	20,
666
+	#layer
667
+	1,
668
+	#speed
669
+	1,
670
+	#mode (1 = play, 0 = loop)
671
+	1,
672
+	#blendin
673
+	10,
674
+	#exits
675
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos'])
676
+
677
+
678
+reg_nmanual = a_class(
679
+	#player armature action name
680
+	'reg_nmanual', 
681
+	#start frame
682
+	20,           
683
+	#end frame
684
+	20,
685
+	#deck action name 
686
+	'b_fak_manual', 
687
+	#deck start frame
688
+	20, 
689
+	#deck end frame
690
+	20,
691
+	#layer
692
+	1,
693
+	#speed
694
+	1,
695
+	#mode (1 = play, 0 = loop)
696
+	1,
697
+	#blendin
698
+	10,
699
+	#exits
700
+	['reg_roll', 'reg_turnRight', 'reg_turnLeft', 'reg_push', 'reg_push_goof', 'reg_pump', 'reg_nopos', 'reg_opos'])
701
+
702
+
703
+#******************(((((((((((((((((())))))))))))))))))*************

+ 63
- 29
scripts/boneRecord.py View File

@@ -4,7 +4,11 @@ from mathutils import Vector
4 4
 dict = bge.logic.globalDict
5 5
 dict['replay_record_length']
6 6
 
7
-bone_list = ["foot.ik.R", "foot.ik.L", "hips", "root", "spine", "spine-1", "chest", "chest-1", "clavicle.L", "clavicle.R", "deltoid.L", "deltoid.R", "upper_arm.fk.L", "upper_arm.fk.R",  "forearm.fk.L", "forearm.fk.R", "hand.fk.L", "hand.fk.R", "neck", "head", "master"]
7
+bone_list = ["foot.ik.R", "foot.ik.L", "knee.pt.ik.R", "knee.pt.ik.L", "hips", "root", "spine", "spine-1", "chest", "chest-1", "clavicle.L", "clavicle.R", "deltoid.L", "deltoid.R", "upper_arm.fk.L", "upper_arm.fk.R",  "forearm.fk.L", "forearm.fk.R", "hand.fk.L", "hand.fk.R", "neck", "head", "master"]
8
+
9
+deck_list = ['main', 'turn']
10
+
11
+#bone_list = ['root', 'head']
8 12
 
9 13
 def Record():    
10 14
     scene = bge.logic.getCurrentScene()
@@ -12,64 +16,94 @@ def Record():
12 16
     master = scene.objects['control_cube.002']
13 17
     cam = scene.objects['Camera.003']
14 18
     armature = scene.objects['Char4']
19
+    deck = scene.objects['deck_arm']
15 20
 
16 21
     if 'dataList' not in master:
17 22
         for x in bone_list:
18 23
             master['dataList'] = True
19 24
             master[str(x) + '-pos'] = []
20 25
             master[str(x) + '-rot'] = []
26
+        for x in deck_list:
27
+            master['dataList'] = True
28
+            master[str(x) + '-pos'] = []
29
+            master[str(x) + '-rot'] = []            
21 30
 
22 31
     for y in bone_list:
23 32
         x = armature.channels[y]
24
-        #print('bone_name: ', x) 
33
+        pos = x.location
34
+        if x.rotation_mode == 0:
35
+            rot = x.rotation_quaternion
36
+        else:
37
+            rot = Vector(x.channel_matrix.to_euler()) 
38
+
39
+        if len(master[str(y) + '-pos']) > dict['replay_record_length']:
40
+            master[str(y) + '-pos'].pop(0)
41
+            master[str(y) + '-rot'].pop(0)            
42
+
43
+            master[str(y) + '-pos'].pop(0)
44
+            master[str(y) + '-rot'].pop(0)            
45
+
46
+        master[str(y) + '-pos'].append(pos)
47
+        master[str(y) + '-rot'].append(rot)
48
+
49
+        master[str(y) + '-pos'].append(pos)
50
+        master[str(y) + '-rot'].append(rot)   
51
+
25 52
 
26
-        #pos = (x.pose_head)+master.worldPosition
27
-        pos = (x.pose_head)
28
-        rot = Vector(x.channel_matrix.to_euler()) 
29
-        #rot = x.rotation_euler  
53
+    for y in deck_list:
54
+        x = deck.channels[y]
55
+        pos = x.location   
56
+        rot = x.rotation_quaternion
30 57
 
58
+            
31 59
         if len(master[str(y) + '-pos']) > dict['replay_record_length']:
32 60
             master[str(y) + '-pos'].pop(0)
33 61
             master[str(y) + '-rot'].pop(0)            
34 62
 
63
+            master[str(y) + '-pos'].pop(0)
64
+            master[str(y) + '-rot'].pop(0)            
65
+
35 66
         master[str(y) + '-pos'].append(pos)
36 67
         master[str(y) + '-rot'].append(rot)
37 68
 
69
+        master[str(y) + '-pos'].append(pos)
70
+        master[str(y) + '-rot'].append(rot) 
71
+
72
+
38 73
 def Playback(valueIndex):
39 74
     scene = bge.logic.getCurrentScene()
40 75
     #own = cont.owner
41 76
     master = scene.objects['control_cube.002']
42 77
     cam = scene.objects['Camera.003']
43 78
     armature = scene.objects['Char4']
44
-    #armature.removeParent()
45
-
46
-
47
-
48
-    #print(master['foot.ik.R-pos'], 'fooot rot')
49
-
50
-
79
+    deck = scene.objects['deck_arm']
51 80
 
52 81
     for y in bone_list:
53 82
         x = armature.channels[y]
54
-        #x.location = [1,0,1]
55
-        
56
-
57 83
         pl = master[str(y) + '-pos'] 
58 84
         rl = master[str(y) + '-rot'] 
59
-        #print(valueIndex)
60
-        #print(rl)
61
-        #print(pl)
62
-        #x.rotation_euler = rl[20]
63 85
         try:
64
-            x.rotation_mode = 1
65
-            x.location = pl[valueIndex]
66
-            x.rotation_euler = rl[valueIndex]
67
-            
68
-            #x.rotation_euler = [1,1,1]
69
-
70
-            print(x.rotation_mode, 'mode')
86
+            if x.rotation_mode == 0:
87
+                x.rotation_quaternion = rl[valueIndex]
88
+            else:    
89
+                x.rotation_euler = rl[valueIndex]
90
+            x.location = pl[valueIndex]    
91
+            #print(x.rotation_mode, pl[valueIndex],  'mode', valueIndex)
71 92
         except:
72 93
             print('index out of range')
94
+        
95
+
73 96
 
74
-        armature.update()
75
-        #print('trying')
97
+    for z in deck_list:
98
+        x = deck.channels[z]
99
+        pl = master[str(z) + '-pos'] 
100
+        rl = master[str(z) + '-rot'] 
101
+        try:
102
+            x.rotation_quaternion = rl[valueIndex]
103
+            x.location = pl[valueIndex]    
104
+
105
+            #print(x.rotation_mode, pl[valueIndex],  'mode', valueIndex, x.name)
106
+        except:
107
+            print('index out of range')
108
+    armature.update()        
109
+    deck.update()        

+ 8
- 9
scripts/camFSM.py View File

@@ -14,15 +14,14 @@ def get_request_state(cur_state):
14 14
 
15 15
 #camera - (Target Object, Min Distance, Max Distance, Height)
16 16
 def activate_camera(cobj, cmin, cmax, cheight):
17
-    pass
18
-    # cont = bge.logic.getCurrentController()
19
-    # scene = bge.logic.getCurrentScene()
20
-    # camActu = cont.actuators['Camera']
21
-    # camActu.object = scene.objects[cobj]
22
-    # camActu.min = cmin
23
-    # camActu.max = cmax
24
-    # camActu.height = cheight
25
-    # cont.activate(camActu)
17
+    cont = bge.logic.getCurrentController()
18
+    scene = bge.logic.getCurrentScene()
19
+    camActu = cont.actuators['Camera']
20
+    camActu.object = scene.objects[cobj]
21
+    camActu.min = cmin
22
+    camActu.max = cmax
23
+    camActu.height = cheight
24
+    cont.activate(camActu)
26 25
 
27 26
 
28 27
 

+ 4809
- 4802
scripts/co_ActionState.py
File diff suppressed because it is too large
View File


+ 7
- 7
scripts/colors.py View File

@@ -51,7 +51,7 @@ def main():
51 51
     #shirt.color = shirtC
52 52
     #print(dict['shirt_color'])
53 53
     scol = [dict['shirt_color_r'], dict['shirt_color_g'], dict['shirt_color_b'], 1]
54
-    deckC = [dict['deck_color_r'], dict['deck_color_g'], dict['deck_color_b'], 1]
54
+    deckC = [dict['deck_color_r'], dict['deck_color_g'], dict['deck_color_b'], 0]
55 55
     #print(scol)
56 56
     shirt.color = scol
57 57
     deck.color = deckC
@@ -62,14 +62,14 @@ def main():
62 62
     shoeR.color = shoesC
63 63
     shoeL.color = shoesC
64 64
     
65
-    trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 1]
66
-    throw_deck_trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 1]
65
+    trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 0]
66
+    throw_deck_trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 0]
67 67
     focus_deckA_trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 1]
68 68
     focus_deckB_trucks.color = [dict['trucks_r'], dict['trucks_g'], dict['trucks_b'], 1]
69
-    wheel1.color = [dict['wheel1_r'], dict['wheel1_g'], dict['wheel1_b'], 1]
70
-    wheel2.color = [dict['wheel2_r'], dict['wheel2_g'], dict['wheel2_b'], 1]
71
-    wheel3.color = [dict['wheel3_r'], dict['wheel3_g'], dict['wheel3_b'], 1]
72
-    wheel4.color = [dict['wheel4_r'], dict['wheel4_g'], dict['wheel4_b'], 1]
69
+    wheel1.color = [dict['wheel1_r'], dict['wheel1_g'], dict['wheel1_b'], 0]
70
+    wheel2.color = [dict['wheel2_r'], dict['wheel2_g'], dict['wheel2_b'], 0]
71
+    wheel3.color = [dict['wheel3_r'], dict['wheel3_g'], dict['wheel3_b'], 0]
72
+    wheel4.color = [dict['wheel4_r'], dict['wheel4_g'], dict['wheel4_b'], 0]
73 73
     throw_deck_wheel1.color = [dict['wheel1_r'], dict['wheel1_g'], dict['wheel1_b'], 1]
74 74
     throw_deck_wheel2.color = [dict['wheel2_r'], dict['wheel2_g'], dict['wheel2_b'], 1]
75 75
     throw_deck_wheel3.color = [dict['wheel3_r'], dict['wheel3_g'], dict['wheel3_b'], 1]

+ 29
- 17
scripts/controller2.py View File

@@ -361,7 +361,7 @@ def main():
361 361
         if skater.isPlayingAction(fliplay):
362 362
             playing_frame = skater.getActionFrame(fliplay)
363 363
         #if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
364
-        if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 45 and playing_frame < 17 and playing_frame > 3:    
364
+        if onGround and skater.isPlayingAction(fliplay) and own['jump_timer'] < 45 and playing_frame < 16 and playing_frame > 3:    
365 365
             hitDistance = own.worldPosition[2] - r_ground.hitPosition[2]
366 366
             if hitDistance < dict['fall_height']:
367 367
                 own['fall'] = 1
@@ -4547,8 +4547,9 @@ def main():
4547 4547
                 own.alignAxisToVect(localRay[2], 2, .5)
4548 4548
                 aligned = True
4549 4549
             #print('localRay')
4550
-
4551
-
4550
+        if localHitDist > .31 and localHitDist < 2:
4551
+            own.alignAxisToVect(localRay[2], 2, .05)
4552
+            print('new align')
4552 4553
     #else:
4553 4554
         #print('no localRay')
4554 4555
         else:
@@ -4590,20 +4591,31 @@ def main():
4590 4591
         if localRay_v[0] and own['LAST_GRIND'] == False and rBump == 0 and lBump == 0 and ((own['framenum'] - own['last_transition_frame'] < 10) or (own['framenum'] - own['last_vert_frame'] < 10)):
4591 4592
             own['vert'] = 1
4592 4593
             #print('vert hit')
4593
-            own['last_vert_frame'] = own['framenum']
4594
-            localHitDist = Vector.copy(Start - localRay_v[1]).length
4595
-            own.linearVelocity.x *= .98
4596
-            own.linearVelocity.z = .1
4597
-            #if localHitDist < .8 and (dict['lUD'] < .04 or dict['lUD'] > -.04):
4598
-            #if localHitDist < .8:    
4599
-            if localHitDist < 1.5:        
4600
-                #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4601
-                own.applyMovement((0, 0, (.3 - localHitDist)), True)
4602
-                #print('moving vert ray')
4603
-                if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4604
-                #if localRay_v[2] != [0,0,-1]:
4605
-                    own.alignAxisToVect(localRay_v[2], 2, .4)
4606
-                    aligned = True
4594
+
4595
+            if 'spine' in localRay_v[0] and lUD < -.04:
4596
+                print('spine hit!!!!!', lUD)
4597
+                
4598
+                #print('roting')
4599
+                if STANCE == True:
4600
+                    own.applyRotation([0,.15,0], True)
4601
+                else:    
4602
+                    own.applyRotation([0,-.15,0], True)
4603
+                own.linearVelocity.x *= .97    
4604
+            elif lUD > -.04: 
4605
+                own['last_vert_frame'] = own['framenum']
4606
+                localHitDist = Vector.copy(Start - localRay_v[1]).length
4607
+                own.linearVelocity.x *= .98
4608
+                own.linearVelocity.z = .1
4609
+                #if localHitDist < .8 and (dict['lUD'] < .04 or dict['lUD'] > -.04):
4610
+                #if localHitDist < .8:    
4611
+                if localHitDist < 1.5:        
4612
+                    #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4613
+                    own.applyMovement((0, 0, (.3 - localHitDist)), True)
4614
+                    #print('moving vert ray')
4615
+                    if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4616
+                    #if localRay_v[2] != [0,0,-1]:
4617
+                        own.alignAxisToVect(localRay_v[2], 2, .4)
4618
+                        aligned = True
4607 4619
         #print(own['lGobj'], 'lGobj')                         
4608 4620
 
4609 4621
 

+ 2
- 2
scripts/ragdoll.py View File

@@ -81,8 +81,8 @@ def main():
81 81
     sens = cont.sensors['rd_key']
82 82
     dict = bge.logic.globalDict
83 83
     
84
-    if 'inited' not in own:
85
-        own['inited'] = True
84
+    if 'rdinited' not in own:
85
+        own['rdinited'] = True
86 86
         own['ragdoll_active'] = False
87 87
         pB = scene.objectsInactive["npc_ed_arm_physBody"]  
88 88
         own['rd_rb'] = scene.addObject(pB)

+ 3
- 0
scripts/scene_init.py View File

@@ -29,6 +29,9 @@ def main():
29 29
         # combine child's shape with parent's
30 30
         compound = True
31 31
         obj = scene.objects['Char4']
32
+        deck_obj = scene.objects['deck_arm']
33
+        dict['p1'] = obj
34
+        dict['p1d'] = deck_obj
32 35
         # child is solid
33 36
         ghost = False
34 37
         # set parent

+ 7
- 7
scripts/walk.py View File

@@ -504,18 +504,18 @@ def main(cont):
504 504
             wheel2act = wheel2.actuators["Visibility"]
505 505
             wheel3act = wheel3.actuators["Visibility"]
506 506
             wheel4act = wheel4.actuators["Visibility"]        
507
-            deckact.visibility = True
507
+            #deckact.visibility = True
508 508
             trucksact.visibility = True
509 509
             wheel1act.visibility = True
510 510
             wheel2act.visibility = True
511 511
             wheel3act.visibility = True
512 512
             wheel4act.visibility = True  
513
-            cont.activate(deck.actuators['Visibility'])
514
-            cont.activate(trucks.actuators['Visibility'])
515
-            cont.activate(wheel1.actuators['Visibility'])
516
-            cont.activate(wheel2.actuators['Visibility'])
517
-            cont.activate(wheel3.actuators['Visibility'])
518
-            cont.activate(wheel4.actuators['Visibility']) 
513
+            #cont.activate(deck.actuators['Visibility'])
514
+            #cont.activate(trucks.actuators['Visibility'])
515
+            #cont.activate(wheel1.actuators['Visibility'])
516
+            #cont.activate(wheel2.actuators['Visibility'])
517
+            #cont.activate(wheel3.actuators['Visibility'])
518
+            #cont.activate(wheel4.actuators['Visibility']) 
519 519
             own['throw_deck'] = False 
520 520
             throw_deck_empty = scene.objects["throw_deck_empty"]
521 521
             throw_deck_empty['kill_deck'] = 1 

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9382a5e4ed4156584de823b3e48974f6ffd0be28c07c3ae9d57bb04c1ca8f896
3
-size 141395864
2
+oid sha256:9a38a3c66688c3eacb95254792badf529b3590acaad52269bd3353d2c9dbdd36
3
+size 146559260

Loading…
Cancel
Save