Browse Source

replay sound fix

shuvit 3 years ago
parent
commit
3dd05750d4
54 changed files with 1350 additions and 948 deletions
  1. 0
    3
      assets/levels/user2.blend
  2. 3
    0
      assets/maps/Demo/map.blend
  3. 7
    0
      assets/maps/Demo/map_settings.ini
  4. 3
    0
      assets/maps/Frank's Garage/map.blend
  5. 7
    0
      assets/maps/Frank's Garage/map_settings.ini
  6. 3
    0
      assets/maps/Harry's Garage/map.blend
  7. 7
    0
      assets/maps/Harry's Garage/map_settings.ini
  8. 0
    0
      assets/maps/John's Mini/map.blend
  9. 7
    0
      assets/maps/John's Mini/map_settings.ini
  10. 0
    0
      assets/maps/Scratch/map.blend
  11. 7
    0
      assets/maps/Scratch/map_settings.ini
  12. 2
    2
      assets/materials/base_m_kit.blend
  13. 3
    0
      assets/materials/textures/Ceiling_A.png
  14. 3
    0
      assets/materials/textures/Ceiling_N.png
  15. 3
    0
      assets/materials/textures/Grunge_Masks_A.png
  16. 3
    0
      assets/materials/textures/bricks.png
  17. 3
    0
      assets/materials/textures/bricks_h.png
  18. 3
    0
      assets/materials/textures/bricks_hnb.png
  19. 3
    0
      assets/materials/textures/color_grid.png
  20. 3
    0
      assets/materials/textures/greyscale-pxb.png
  21. 3
    0
      assets/materials/textures/plywood_m_a.jpg
  22. 3
    0
      assets/materials/textures/plywood_m_d.jpg
  23. 3
    0
      assets/materials/textures/plywood_m_h.jpg
  24. 3
    0
      assets/materials/textures/plywood_m_hb.jpg
  25. 3
    0
      assets/materials/textures/plywood_m_hn.jpg
  26. 3
    0
      assets/materials/textures/plywood_m_ln.jpg
  27. 3
    0
      assets/materials/textures/plywood_m_mn.jpg
  28. 3
    0
      assets/materials/textures/plywood_m_n.jpg
  29. 3
    0
      assets/materials/textures/plywood_m_s.jpg
  30. 3
    0
      assets/materials/textures/plywood_m_sn.jpg
  31. 2
    2
      assets/ramps.blend
  32. 2
    2
      assets/user2.blend
  33. 3
    0
      assets/walls.blend
  34. 17
    16
      config.ini
  35. 4
    2
      scripts/FSM.py
  36. 11
    11
      scripts/Record.py
  37. 58
    5
      scripts/Settings.py
  38. 3
    1
      scripts/Startup.py
  39. 22
    0
      scripts/StatesGame.py
  40. 741
    708
      scripts/StatesPlayer.py
  41. 3
    3
      scripts/actionsFSMlist.py
  42. 12
    1
      scripts/boneRecord.py
  43. 6
    4
      scripts/controller2.py
  44. 12
    2
      scripts/game.py
  45. 25
    18
      scripts/grindV2.py
  46. 12
    0
      scripts/levelLibload.py
  47. 37
    16
      scripts/menuV3.py
  48. 2
    1
      scripts/npause.py
  49. 29
    27
      scripts/pause_menu2.py
  50. 214
    111
      scripts/player.py
  51. 11
    3
      scripts/ragdoll.py
  52. 8
    2
      scripts/scene_init.py
  53. 14
    6
      scripts/sound_man.py
  54. 2
    2
      shuvit.blend

+ 0
- 3
assets/levels/user2.blend View File

1
-version https://git-lfs.github.com/spec/v1
2
-oid sha256:0536309cdac72fe106d4ca3b9a6f268d02831c90346df3de24d98991dc01339d
3
-size 1211092

+ 3
- 0
assets/maps/Demo/map.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:e1d0e6eb4384dfac57c52a9c44ea29ae1eace79c57576ea0184171fa5d834c78
3
+size 531092

+ 7
- 0
assets/maps/Demo/map_settings.ini View File

1
+#shuvit map settings configuration file
2
+
3
+#lighting template
4
+map_template = outdoor_ns
5
+
6
+map_npcs = 0
7
+map_cars = 15

+ 3
- 0
assets/maps/Frank's Garage/map.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:773add811d95e272e288d1dfa8b2c60f33b0515fd9aac7bfbc823123b9b59706
3
+size 722880

+ 7
- 0
assets/maps/Frank's Garage/map_settings.ini View File

1
+#shuvit map settings configuration file
2
+
3
+#lighting template
4
+map_template = indoor
5
+
6
+map_npcs = 0
7
+map_cars = 15

+ 3
- 0
assets/maps/Harry's Garage/map.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:d5ab8c6a47a00cb392f712d07430dad963d1af3e6fb6bd1d3ea4dd0fa554a0f3
3
+size 1212232

+ 7
- 0
assets/maps/Harry's Garage/map_settings.ini View File

1
+#shuvit map settings configuration file
2
+
3
+#lighting template
4
+map_template = indoor
5
+
6
+map_npcs = 0
7
+map_cars = 15

assets/levels/mini/user2.blend → assets/maps/John's Mini/map.blend View File


+ 7
- 0
assets/maps/John's Mini/map_settings.ini View File

1
+#shuvit map settings configuration file
2
+
3
+#lighting template
4
+map_template = outdoor
5
+
6
+map_npcs = 0
7
+map_cars = 15

assets/levels/scratch/level.blend → assets/maps/Scratch/map.blend View File


+ 7
- 0
assets/maps/Scratch/map_settings.ini View File

1
+#shuvit map settings configuration file
2
+
3
+#lighting template
4
+map_template = outdoor
5
+
6
+map_npcs = 0
7
+map_cars = 15

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

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:c182c5eb0c2bd584a523fab0cd26dd30cb10a2b852eec3513da70bac981703df
3
-size 35791236
2
+oid sha256:a2e299b71b355f6f71238d6d39eb243687732cda57a536db004b593a042f5977
3
+size 35932972

+ 3
- 0
assets/materials/textures/Ceiling_A.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:633fa590e8f749a9c058a9553bf512bf1f9899e4f2ce1bafcc85b30c4ed93e2a
3
+size 1944896

+ 3
- 0
assets/materials/textures/Ceiling_N.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:ca9829ea155ba80572be65ffc23492ac4244140105897ea3c4d6bfbd618f7b0a
3
+size 1750847

+ 3
- 0
assets/materials/textures/Grunge_Masks_A.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:5618ce49202765378f412e556850a36a7ae1e0eb18c69d82868050818f67dccc
3
+size 1657326

+ 3
- 0
assets/materials/textures/bricks.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:f43e3e11c767afc56b9f250f2b93dd6068ec5f087af7242aed90a779c790b0b4
3
+size 528249

+ 3
- 0
assets/materials/textures/bricks_h.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:3eaaee418f491c0c8b911a970f8a31167a17b941fe80df4b9e1b95768b7927a2
3
+size 231818

+ 3
- 0
assets/materials/textures/bricks_hnb.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:51b7237418626912ca3fae3bf6510ca839296a30620bdab7c30fb3e0e11ca089
3
+size 754969

+ 3
- 0
assets/materials/textures/color_grid.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:5fc4b73b2fdda62dc09e25a8614072d5b5021738b51e93e157931d23c07f8275
3
+size 4624

+ 3
- 0
assets/materials/textures/greyscale-pxb.png View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:1d933843b33401c385dfa8201381f4eef4da35a589916c40a981e299551901bb
3
+size 637110

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:51aa200ddd45fef473de251882048149d8dc8e1f65f96b8e299c76b5551c3921
3
+size 496720

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:25dcf970b3fceda59dfc9ac22871994a2b6f6a4577e9479d98a7bb4a31f6a57a
3
+size 446995

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:0daf050a331bab951d2da760704bffd6be67a1d607744175a844e176ce6feaaf
3
+size 196285

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:6334aad32ad862c62ec1fcd4b75ec4d1dec330754c0d9d10d840a98271b9b07d
3
+size 240274

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:3da31787d46ef5794691f56027f903567ebec19983a92cfe68c77d677d0b1684
3
+size 1424429

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:0b55fbf2d677bfd0832f7b51b3af69f375962a3e70092a3aaa3fe437000f578e
3
+size 592079

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:f372bc45c7495145f882066e049c0a5551d4604a370c1e56bc26fe66eb23b0d6
3
+size 652208

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:ad6679ca69850c1005a42d1e8772bbb451796ca5bf43ea8b204f1bc140a0312d
3
+size 774878

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:88bd5b070da8edf56529f901d9b7576bc3bd4a209741277d1a6cbdf3638fb672
3
+size 617364

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:c9207662a798c9286a828c8b6528fe92fb1f6edc71c268c3e1826a5325085e22
3
+size 341161

+ 2
- 2
assets/ramps.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:7f0ca585c24b56ca66641f6ebeec9b3525f19f757b6857a8c1ac9fb957421066
3
-size 80413544
2
+oid sha256:5f79f92570790b1dce9967d31066953686e966be6e24f8cea739475130b5dcb6
3
+size 84686084

+ 2
- 2
assets/user2.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:591f877f598327200b89c9518b9ba7e8aaefe0f5b69957836fbf0044cb26b5e5
3
-size 3442504
2
+oid sha256:290945cb39568c3ecffdfe59a94d188c0e20dd7eac5b7c33c4b4393a396d6fac
3
+size 3403128

+ 3
- 0
assets/walls.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:50275c1ba939f8e547bf590f50357cfd10bd80d8adf9a241443ccf39df76ae82
3
+size 7128536

+ 17
- 16
config.ini View File

21
 
21
 
22
 #level
22
 #level
23
 ######
23
 ######
24
-level = user2
25
-levelBlend = user2
24
+level = indoor
25
+levelBlend = indoor
26
+map = Harry's Garage
26
 #------------
27
 #------------
27
 
28
 
28
 #replay recorder
29
 #replay recorder
34
 #camera 
35
 #camera 
35
 #######
36
 #######
36
 cam_height = -0.3
37
 cam_height = -0.3
37
-focal_length = 12
38
+focal_length = 10
38
 cam_min = 2.0
39
 cam_min = 2.0
39
 cam_max = 4.4
40
 cam_max = 4.4
40
 cch_targetHeight = 0.3
41
 cch_targetHeight = 0.3
54
 
55
 
55
 shirt_logo = 2
56
 shirt_logo = 2
56
 
57
 
57
-shirt_color_r = 0
58
-shirt_color_g = 0
59
-shirt_color_b = 0
58
+shirt_color_r = 1
59
+shirt_color_g = 0.03
60
+shirt_color_b = 0.03
60
 
61
 
61
-shoe_color_r = 0.69
62
-shoe_color_g = 0.69
63
-shoe_color_b = 0.67
62
+shoe_color_r = 1
63
+shoe_color_g = 0.38
64
+shoe_color_b = 0
64
 #-----------------
65
 #-----------------
65
 
66
 
66
 #deck settings
67
 #deck settings
96
 BC_CONTRAST = 1.09
97
 BC_CONTRAST = 1.09
97
 
98
 
98
 #HDR
99
 #HDR
99
-hdr = 0
100
-avgL = 0.8
100
+hdr = 1
101
+avgL = 0.69
101
 HDRamount = 0.05
102
 HDRamount = 0.05
102
 
103
 
103
 #Ambient Occlusion
104
 #Ambient Occlusion
104
-ao = 0
105
+ao = 1
105
 onlyAO = 0
106
 onlyAO = 0
106
 aowidth = 0.2
107
 aowidth = 0.2
107
 aoradius = 2.4
108
 aoradius = 2.4
119
 
120
 
120
 #sun settings
121
 #sun settings
121
 #############
122
 #############
122
-sun_strength = 1.05
123
-ambient_strength = 0.15
124
-sun_rot_x = 0.05
125
-sun_rot_y = 0.05
123
+sun_strength = 1.1
124
+ambient_strength = 0.18
125
+sun_rot_x = -0.05
126
+sun_rot_y = -0.05
126
 shadow_on = 0
127
 shadow_on = 0
127
 #------------
128
 #------------
128
 
129
 

+ 4
- 2
scripts/FSM.py View File

74
         'Startup',
74
         'Startup',
75
         'Initer',
75
         'Initer',
76
         'LoadLevel',
76
         'LoadLevel',
77
-        'GameOn']
77
+        'GameOn',
78
+        'Reload']
78
         
79
         
79
         for s in state_list:
80
         for s in state_list:
80
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
81
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
109
         'Offboard', 
110
         'Offboard', 
110
         'Dropin',
111
         'Dropin',
111
         'Roll',
112
         'Roll',
112
-        'Ragdoll']
113
+        'Ragdoll',
114
+        'Pause']
113
         
115
         
114
         for s in state_list:
116
         for s in state_list:
115
             self.FSM.AddState(s, getattr(StatesPlayer, s)(self.FSM))
117
             self.FSM.AddState(s, getattr(StatesPlayer, s)(self.FSM))

+ 11
- 11
scripts/Record.py View File

325
     lengthVis = own["lengthVis"]
325
     lengthVis = own["lengthVis"]
326
     
326
     
327
     if lengthVis:
327
     if lengthVis:
328
+        pass
329
+        # if valueIndex > lengthVis-1:
330
+        #     own["valueIndex"] = 0
331
+        # if objIndex < 0:
332
+        #     own["objIndex"] = lengthVis-2
328
 
333
 
329
-        if valueIndex > lengthVis-1:
330
-            own["valueIndex"] = 0
331
-        if objIndex < 0:
332
-            own["objIndex"] = lengthVis-2
333
-
334
-        name, visible = readData.returnVisibility(objIndex, valueIndex)
334
+        # name, visible = readData.returnVisibility(objIndex, valueIndex)
335
         
335
         
336
-        if name in scene.objects:
337
-            try:
338
-                scene.objects[name].visible = int(visible)
339
-            except:
340
-                pass
336
+        # if name in scene.objects:
337
+        #     try:
338
+        #         scene.objects[name].visible = int(visible)
339
+        #     except:
340
+        #         pass
341
     #-----Skater Animation Name-----#
341
     #-----Skater Animation Name-----#
342
     own["lengthSkaterAnim"] = readData.getLengthSkaterAnim()
342
     own["lengthSkaterAnim"] = readData.getLengthSkaterAnim()
343
     lengthSkaterAnim = own["lengthSkaterAnim"]
343
     lengthSkaterAnim = own["lengthSkaterAnim"]

+ 58
- 5
scripts/Settings.py View File

8
 
8
 
9
 config = ConfigObj(fileName, interpolation=True)
9
 config = ConfigObj(fileName, interpolation=True)
10
 dict = bge.logic.globalDict
10
 dict = bge.logic.globalDict
11
+#map_config = {}
12
+
11
 
13
 
12
 print('###############start game##########')
14
 print('###############start game##########')
13
 dict['music_player'] = 1
15
 dict['music_player'] = 1
14
 
16
 
17
+def to_dict3(section, key):
18
+    #dict = bge.logic.globalDict
19
+    print(section, key)
20
+    #d = dict['map']
21
+    fileName2 = GameLogic.expandPath("//assets/maps/" + dict['map'] + '/map_settings.ini')    
22
+    map_config = ConfigObj(fileName2, interpolation=True)   
23
+    value = map_config[key]
24
+    if isinstance(value, str):
25
+        if value.isdigit():
26
+            value = int(value)
27
+        else:
28
+            try:
29
+                value = float(value)
30
+            except:
31
+                pass
32
+    #print(dict['mapDict'])
33
+    dict[key] = value    
34
+
35
+
15
 def to_dict(section, key):
36
 def to_dict(section, key):
16
     dict = bge.logic.globalDict
37
     dict = bge.logic.globalDict
17
     value = config[key]
38
     value = config[key]
24
             except:
45
             except:
25
                 pass
46
                 pass
26
     dict[key] = value  
47
     dict[key] = value  
27
-    #print(key, value)
48
+
28
     
49
     
50
+def readMap():
51
+    fileName = GameLogic.expandPath("//assets/maps/" + dict['map'] + '/map_settings.ini')    
52
+    #fileName = mainDir + dict['character'] + ".ini"
53
+    #print('loading character settings', fileName)
54
+    map_config = ConfigObj(fileName, interpolation=True)
55
+    print('map_config', map_config)
56
+    dict['mapDict'] = map_config
57
+    # def to_dict2(section, key):
58
+    #     #dict = bge.logic.globalDict
59
+    #     value = map_config[key]
60
+    #     if isinstance(value, str):
61
+    #         if value.isdigit():
62
+    #             value = int(value)
63
+    #         else:
64
+    #             try:
65
+    #                 value = float(value)
66
+    #             except:
67
+    #                 pass
68
+    #     dict[key] = value 
69
+
29
 def readChar():
70
 def readChar():
30
     mainDir = GameLogic.expandPath("//characters/")    
71
     mainDir = GameLogic.expandPath("//characters/")    
31
     fileName = mainDir + dict['character'] + ".ini"
72
     fileName = mainDir + dict['character'] + ".ini"
66
     
107
     
67
 
108
 
68
 def readSettings():
109
 def readSettings():
69
-    config.walk(to_dict)         
110
+    config.walk(to_dict)    
111
+    dict['mapDict'] = {}  
112
+    fileName2 = GameLogic.expandPath("//assets/maps/" + dict['map'] + '/map_settings.ini')    
113
+    map_config = ConfigObj(fileName2, interpolation=True)   
114
+    map_config.walk(to_dict3)         
115
+    #readMap()
70
     readChar()
116
     readChar()
71
 
117
 
72
 def from_dict(section, key):
118
 def from_dict(section, key):
117
     if own["profile"] ==1:    
163
     if own["profile"] ==1:    
118
         bge.render.showProfile(1)   
164
         bge.render.showProfile(1)   
119
     act = own2.actuators["level"]
165
     act = own2.actuators["level"]
120
-    dict = bge.logic.globalDict
121
-    level = dict['level']
122
-    print('loading level', level)
166
+    #dict = bge.logic.globalDict
167
+    
168
+    fileName2 = GameLogic.expandPath("//assets/maps/" + dict['map'] + '/map_settings.ini')    
169
+    map_config = ConfigObj(fileName2, interpolation=True)   
170
+    map_config.walk(to_dict3)  
171
+    
172
+    level = dict['map_template']
173
+    dict['level'] = level
174
+    #level = dict['level']
175
+    print('loading template level', level)
123
     act.scene = level 
176
     act.scene = level 
124
     cont.activate(own2.actuators["level"]) 
177
     cont.activate(own2.actuators["level"]) 
125
     dict['npause'] = False 
178
     dict['npause'] = False 

+ 3
- 1
scripts/Startup.py View File

103
     dict['sunz'] = 1.0 
103
     dict['sunz'] = 1.0 
104
     dict['replay_loop_start'] = 0
104
     dict['replay_loop_start'] = 0
105
     dict['replay_loop_end'] = 0
105
     dict['replay_loop_end'] = 0
106
-    dict['replay_record_length'] = 7300#240 #1200 #7300
106
+    dict['replay_record_length'] = 2600#240 #1200 #7300
107
     dict['rp_keyframes'] = []
107
     dict['rp_keyframes'] = []
108
     dict['rp_positions'] = []
108
     dict['rp_positions'] = []
109
     dict['temp_list'] = []
109
     dict['temp_list'] = []
110
     dict['scene_inited'] = True
110
     dict['scene_inited'] = True
111
     dict['p1c'] = None
111
     dict['p1c'] = None
112
+    dict['sun_lights'] = []
113
+    dict['ambient_lights'] = []
112
 
114
 
113
     dict['joy_con'] = False
115
     dict['joy_con'] = False
114
     
116
     

+ 22
- 0
scripts/StatesGame.py View File

5
 import Settings
5
 import Settings
6
 import inputs
6
 import inputs
7
 import logo_fades
7
 import logo_fades
8
+
9
+dict = bge.logic.globalDict
8
 #====================================     
10
 #====================================     
9
 
11
 
10
 State = type("State", (object,), {})
12
 State = type("State", (object,), {})
130
     def Exit(self):
132
     def Exit(self):
131
         pass
133
         pass
132
 
134
 
135
+#==================================== 
136
+
137
+class Reload(State):
138
+    def __init__(self,FSM):
139
+        super(Reload, self).__init__(FSM)    
140
+        
141
+    def Enter(self):
142
+        self.FSM.stateLife = 1
143
+        super(Reload, self).Enter()        
144
+        
145
+    def Execute(self):
146
+        self.FSM.stateLife += 1
147
+        dict.clear()
148
+        self.FSM.owner['cont'].activate(self.FSM.owner['cont'].actuators['restart'])
149
+        #cont.activate(own.actuators['add_fade'])  
150
+        #own['cont'] = cont
151
+
152
+    def Exit(self):
153
+        pass
154
+
133
 #==================================== 
155
 #==================================== 

+ 741
- 708
scripts/StatesPlayer.py View File

6
 State = type("State", (object,), {})
6
 State = type("State", (object,), {})
7
 #====================================     
7
 #====================================     
8
 class State(object):
8
 class State(object):
9
-    def __init__(self, FSM):
10
-        self.FSM = FSM
11
-        self.timer = 0
12
-        self.startTime = 0
13
-    def Enter(self):
14
-        self.timer = 0
15
-        self.startTime = 0
16
-    def Execute(self):
17
-        print('Executing')
18
-    def Exit(self):
19
-        print('Exiting')
9
+	def __init__(self, FSM):
10
+		self.FSM = FSM
11
+		self.timer = 0
12
+		self.startTime = 0
13
+	def Enter(self):
14
+		self.timer = 0
15
+		self.startTime = 0
16
+	def Execute(self):
17
+		print('Executing')
18
+	def Exit(self):
19
+		print('Exiting')
20
 
20
 
21
 #==================================== 
21
 #==================================== 
22
-            
22
+			
23
 class Example(State):
23
 class Example(State):
24
-    def __init__(self,FSM):
25
-        super(Example, self).__init__(FSM)    
26
-        
27
-    def Enter(self):
28
-        self.FSM.stateLife = 1
29
-        super(Example, self).Enter()        
30
-        
31
-    def Execute(self):
32
-        self.FSM.stateLife += 1
33
-        #self.FSM.ToTransition('toExample')
34
-        
35
-    def Exit(self):
36
-        pass
24
+	def __init__(self,FSM):
25
+		super(Example, self).__init__(FSM)    
26
+		
27
+	def Enter(self):
28
+		self.FSM.stateLife = 1
29
+		super(Example, self).Enter()        
30
+		
31
+	def Execute(self):
32
+		self.FSM.stateLife += 1
33
+		#self.FSM.ToTransition('toExample')
34
+		
35
+	def Exit(self):
36
+		pass
37
 
37
 
38
 #==================================== 
38
 #==================================== 
39
 
39
 
40
 class Startup(State):
40
 class Startup(State):
41
-    def __init__(self,FSM):
42
-        super(Startup, self).__init__(FSM)    
43
-        
44
-    def Enter(self):
45
-        self.FSM.stateLife = 1
46
-        super(Startup, self).Enter()        
47
-        
48
-    def Execute(self):
49
-        self.FSM.stateLife += 1
50
-
51
-        if self.FSM.stateLife == 5:
52
-            self.FSM.ToTransition('toWalk')
53
-        print('player FSM')
54
-        
55
-    def Exit(self):
56
-        pass
41
+	def __init__(self,FSM):
42
+		super(Startup, self).__init__(FSM)    
43
+		
44
+	def Enter(self):
45
+		self.FSM.stateLife = 1
46
+		super(Startup, self).Enter()        
47
+		
48
+	def Execute(self):
49
+		self.FSM.stateLife += 1
50
+
51
+		if self.FSM.stateLife == 5:
52
+			self.FSM.ToTransition('toWalk')
53
+		print('player FSM')
54
+		
55
+	def Exit(self):
56
+		pass
57
 
57
 
58
 #==================================== 
58
 #==================================== 
59
-            
59
+			
60
 class Walk(State):
60
 class Walk(State):
61
-    def __init__(self,FSM):
62
-        super(Walk, self).__init__(FSM)    
63
-        
64
-    def Enter(self):
65
-        self.FSM.stateLife = 1
66
-        o = self.FSM.owner.obj
67
-        c = self.FSM.owner
68
-        o['getoffboard'] = False
69
-        o['getonboard'] = False
70
-
71
-        if c.arm == None:
72
-            
73
-            c.arm = o.childrenRecursive['Char4']
74
-            c.deck_arm = o.childrenRecursive['deck_arm']
75
-        self.walk_weight = 1
76
-        self.run_weight = 1
77
-        self.run_speed = 0.0
78
-        self.turn_weight = 0
79
-        self.FSM.owner.walking = True
80
-        dict['walking'] = True
81
-        dict['walk'] = 1
82
-        print('fsm enter walk')
83
-
84
-        super(Walk, self).Enter()        
85
-        
86
-    def Execute(self):
87
-        self.FSM.stateLife += 1
88
-        o = self.FSM.owner.obj
89
-        c = self.FSM.owner
90
-        #print(o.worldPosition.z)
91
-        #print(o['getonboard'], 'dict onboard')
92
-        #print(dict['walk'], 'fsm walk walk')
93
-        # if self.FSM.stateLife == 2:
94
-        #     if o['stance']:
95
-        #         o.applyRotation([0,0,3.14], True)
96
-        #         o['stance'] = False
97
-        #         o['requestAction'] = 'fak_offboard' 
98
-        #         print('request fak offboard')            
99
-        #     else:
100
-        #         o['requestAction'] = 'reg_offboard'                 
101
-        #         print('request reg offboard') 
102
-        # if self.FSM.stateLife > 5:
103
-        #     o['requestAction'] = 'reg_idle'                 
104
-        c.align_walk_z()
105
-        ground_rays = c.get_ground_ray()
106
-        #77777777777777777777777777777777777777777777777777777777777777777777777777777777777
107
-        c.get_hang_align_ray()
108
-        c.move_walk_cam()
109
-        c.check_reset_point()       
110
-        c.check_throw()
111
-
112
-        if ground_rays[0][0] != None:
113
-            dist = c.get_ground_dist(ground_rays)
114
-            if dist > .7:
115
-                self.FSM.ToTransition('toWalkAir')
116
-                #print('---falling')
117
-            else:
118
-                c.set_walk_z(dist)
119
-            #print(dist, 'setting height')
120
-
121
-        if self.FSM.stateLife > 4:
122
-            self.check_onboard()
123
-            self.check_jump()
124
-
125
-            moving = c.walk_movement()
126
-            
127
-            self.get_walk_weight()
128
-            self.idle_blend()
129
-        else:
130
-            dict['walk'] = 1
131
-
132
-
133
-    def check_onboard(self):
134
-
135
-        o = self.FSM.owner.obj
136
-        #print(o['getonboard'], 'getonboard')
137
-
138
-        
139
-        if dict['walk'] == 0:
140
-            o['getonboard'] = True
141
-            #self.FSM.ToTransition('toRoll')
142
-            self.FSM.ToTransition('toWalkOnboard')
143
-            #print('onboard', dict['walk'], o['getonboard'])
144
-        if dict['yBut'] == 1 and dict['last_yBut'] == 0:
145
-        
146
-            
147
-            dropin = self.check_dropin()
148
-            print('-----dropin', dropin)
149
-            if dropin == None:
150
-                o['getonboard'] = True
151
-
152
-                self.FSM.ToTransition('toWalkOnboard')
153
-            else:
154
-                self.FSM.owner.dropin_obj = dropin
155
-                self.FSM.ToTransition('toDropin')
156
-
157
-
158
-
159
-    def check_dropin(self):
160
-        dr = None
161
-        ground_rays = self.FSM.owner.get_dropin_rays()
162
-        for x in ground_rays:
163
-            if x[0] != None:
164
-                #print(x[0], '---checked')
165
-                if 'coping' in x[0]:
166
-                    print('dropin collided')
167
-                    dr = x
168
-        return dr
169
-
170
-    def check_jump(self):
171
-        if dict['xBut'] == True or dict['kb_space'] == 1: 
172
-            if dict['last_xBut'] == 0:
173
-                self.FSM.ToTransition('toWalkJump')
174
-                
175
-
176
-    def idle_blend(self):
177
-        arm = self.FSM.owner.arm
178
-        deck = self.FSM.owner.deck_arm
179
-        arm.playAction('reg_idle1', 1,120, layer=1, play_mode=1, speed=1, blendin=10)
180
-        deck.playAction('b_reg_idle1', 1,120, layer=1, play_mode=1, speed=1, blendin=10)
181
-        if self.FSM.stateLife > 20:
182
-            frame = arm.getActionFrame(2) + .5 * self.run_speed
183
-            if frame > 30:
184
-                frame = 0
185
-            arm.stopAction(2)
186
-            deck.stopAction(2)
187
-            arm.playAction('reg_nwalk3', 0,30, layer=2, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.walk_weight)
188
-            deck.playAction('b_reg_walk', 0,30, layer=2, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.walk_weight)
189
-            #b_reg_walk
190
-            arm.setActionFrame(frame, 2)
191
-            deck.setActionFrame(frame, 2)
192
-            #print(self.walk_weight, frame)
193
-
194
-            
195
-
196
-            frame = arm.getActionFrame(3) + .5 * self.run_speed
197
-            if frame > 30:
198
-                frame = 0
199
-            arm.stopAction(3)
200
-            deck.stopAction(3)
201
-            arm.playAction('reg_run.003', 0,30, layer=3, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.run_weight)
202
-            deck.playAction('b_reg_run', 0,30, layer=3, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.run_weight)
203
-            
204
-            arm.setActionFrame(frame, 3)
205
-            deck.setActionFrame(frame, 3)
206
-            #print(frame, 'frame')
207
-            #print(self.run_weight, frame)
208
-            
209
-        # if self.turn_weight > 0:
210
-        #     tw = abs(self.turn_weight - 1)
211
-        #     #tw = self.turn_weight
212
-        #     arm.stopAction(4)
213
-        #     arm.playAction('bwalk_right', 1,60, layer=4, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=tw)
214
-        # elif self.turn_weight < 0:
215
-        #     tw = abs(abs(self.turn_weight) - 1)
216
-        #     #tw = self.turn_weight
217
-        #     arm.stopAction(4)
218
-        #     arm.playAction('bwalk_left', 1,60, layer=4, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=tw)
219
-            #print('walk_weight', self.walk_weight)
220
-            if self.walk_weight < .8:
221
-                if frame > 15:
222
-                    if self.FSM.owner.step == False:
223
-                        self.FSM.owner.step = True
224
-                        
225
-                        if frame < 23:
226
-                            print('step left')
227
-                            dict['camera']['sndmgr'].queue_sound(['s_l_1', self.FSM.owner.obj, dict['camera']])
228
-                else:
229
-                    if self.FSM.owner.step == True:
230
-                        self.FSM.owner.step = False
231
-                        if frame < 8:
232
-                            dict['camera']['sndmgr'].queue_sound(['s_r_1', self.FSM.owner.obj, dict['camera']])
233
-                            print('step right')
234
-                    
235
-            # if frame > 15 and self.FSM.owner.step:
236
-            #     self.FSM.owner.step = True
237
-            #     print('step left')
238
-            # if frame < 15 and not self.FSM.owner.step:
239
-            #     self.FSM.owner.step = False
240
-            #     print('step right')
241
-            #print('frame', frame)
242
-
243
-    def get_walk_weight(self):
244
-        #print(self.FSM.owner.linearVelocity.y) 
245
-
246
-
247
-        o = self.FSM.owner.obj
248
-        w = abs(o.linearVelocity.x)
249
-        #wt = 3.5
250
-        #yt = 8
251
-        wt = 1.7
252
-        yt = 3
253
-        out2 = 0
254
-        if w < wt:
255
-            out = w / wt
256
-        else:
257
-            out = 1
258
-            #print('running', w)
259
-            out2 = w / yt
260
-        out = abs(1 - out)
261
-        out2 = abs(1 - out2)
262
-        tgww = round(out, 3)
263
-        tgrw = round(out2, 3)
264
-        incer = .05
265
-        if self.walk_weight < tgww:
266
-            self.walk_weight += incer
267
-        if self.walk_weight > tgww:
268
-            self.walk_weight -= incer
269
-        if self.run_weight <= tgrw:
270
-            self.run_weight += incer
271
-        if self.run_weight > tgrw:
272
-            self.run_weight -= incer
273
-        if self.walk_weight <= 0:
274
-            self.walk_weight = 0
275
-        if self.walk_weight > .95:            
276
-            self.walk_weight = 1        
277
-        if self.run_weight <= 0:
278
-            self.run_weight = 0
279
-        if self.run_weight > .95:
280
-            self.run_weight = 1
281
-
282
-
283
-        if dict['kb_lsh'] == 2 or dict['aBut'] == 1:
284
-            self.run_speed = 1.3
285
-        else:
286
-            self.run_speed = .8
287
-        #print(self.run_speed, '---', self.walk_weight, 'walk weight', self.run_weight, 'run weight')
288
-
289
-    def Exit(self):
290
-        self.FSM.owner.arm.stopAction(0)
291
-        self.FSM.owner.arm.stopAction(1)
292
-        self.FSM.owner.arm.stopAction(2)
293
-        self.FSM.owner.arm.stopAction(3)
294
-        self.FSM.owner.deck_arm.stopAction(0)
295
-        self.FSM.owner.deck_arm.stopAction(1)
296
-        self.FSM.owner.deck_arm.stopAction(2)
297
-        self.FSM.owner.deck_arm.stopAction(3)
298
-        dict['walk'] = 0
61
+	def __init__(self,FSM):
62
+		super(Walk, self).__init__(FSM)    
63
+		
64
+	def Enter(self):
65
+		self.FSM.stateLife = 1
66
+		o = self.FSM.owner.obj
67
+		c = self.FSM.owner
68
+		o['getoffboard'] = False
69
+		o['getonboard'] = False
70
+
71
+		if c.arm == None:
72
+			
73
+			c.arm = o.childrenRecursive['Char4']
74
+			c.deck_arm = o.childrenRecursive['deck_arm']
75
+		self.walk_weight = 1
76
+		self.run_weight = 1
77
+		self.run_speed = 0.0
78
+		self.turn_weight = 0
79
+		self.FSM.owner.walking = True
80
+		dict['walking'] = True
81
+		dict['walk'] = 1
82
+		print('fsm enter walk')
83
+
84
+		super(Walk, self).Enter()        
85
+		
86
+	def Execute(self):
87
+		self.FSM.stateLife += 1
88
+		o = self.FSM.owner.obj
89
+		c = self.FSM.owner
90
+		#print(o.worldPosition.z)
91
+		#print(o['getonboard'], 'dict onboard')
92
+		#print(dict['walk'], 'fsm walk walk')
93
+		# if self.FSM.stateLife == 2:
94
+		#     if o['stance']:
95
+		#         o.applyRotation([0,0,3.14], True)
96
+		#         o['stance'] = False
97
+		#         o['requestAction'] = 'fak_offboard' 
98
+		#         print('request fak offboard')            
99
+		#     else:
100
+		#         o['requestAction'] = 'reg_offboard'                 
101
+		#         print('request reg offboard') 
102
+		# if self.FSM.stateLife > 5:
103
+		#     o['requestAction'] = 'reg_idle'                 
104
+		c.align_walk_z()
105
+		ground_rays = c.get_ground_ray()
106
+		#77777777777777777777777777777777777777777777777777777777777777777777777777777777777
107
+		c.get_hang_align_ray()
108
+		c.move_walk_cam()
109
+		c.check_reset_point()       
110
+		c.check_throw()
111
+		c.check_pause()
112
+		c.check_idle(False)
113
+		c.idle_anim()
114
+
115
+		if ground_rays[0][0] != None:
116
+			dist = c.get_ground_dist(ground_rays)
117
+			if dist > .7:
118
+				self.FSM.ToTransition('toWalkAir')
119
+				#print('---falling')
120
+			else:
121
+				c.set_walk_z(dist)
122
+			#print(dist, 'setting height')
123
+
124
+		if self.FSM.stateLife > 4:
125
+			self.check_onboard()
126
+			self.check_jump()
127
+
128
+			moving = c.walk_movement()
129
+			
130
+			self.get_walk_weight()
131
+			self.idle_blend()
132
+		else:
133
+			dict['walk'] = 1
134
+
135
+
136
+	def check_onboard(self):
137
+
138
+		o = self.FSM.owner.obj
139
+		#print(o['getonboard'], 'getonboard')
140
+
141
+		
142
+		if dict['walk'] == 0:
143
+			o['getonboard'] = True
144
+			#self.FSM.ToTransition('toRoll')
145
+			self.FSM.ToTransition('toWalkOnboard')
146
+			#print('onboard', dict['walk'], o['getonboard'])
147
+		if dict['yBut'] == 1 and dict['last_yBut'] == 0:
148
+		
149
+			
150
+			dropin = self.check_dropin()
151
+			print('-----dropin', dropin)
152
+			if dropin == None:
153
+				o['getonboard'] = True
154
+
155
+				self.FSM.ToTransition('toWalkOnboard')
156
+			else:
157
+				self.FSM.owner.dropin_obj = dropin
158
+				self.FSM.ToTransition('toDropin')
159
+
160
+
161
+
162
+	def check_dropin(self):
163
+		dr = None
164
+		ground_rays = self.FSM.owner.get_dropin_rays()
165
+		for x in ground_rays:
166
+			if x[0] != None:
167
+				#print(x[0], '---checked')
168
+				if 'coping' in x[0]:
169
+					print('dropin collided')
170
+					dr = x
171
+		return dr
172
+
173
+	def check_jump(self):
174
+		if dict['xBut'] == True or dict['kb_space'] == 1: 
175
+			if dict['last_xBut'] == 0:
176
+				self.FSM.ToTransition('toWalkJump')
177
+				
178
+
179
+	def idle_blend(self):
180
+		arm = self.FSM.owner.arm
181
+		deck = self.FSM.owner.deck_arm
182
+		arm.playAction('reg_idle1', 1,120, layer=1, play_mode=1, speed=.5, blendin=10)
183
+		deck.playAction('b_reg_idle1', 1,120, layer=1, play_mode=1, speed=1, blendin=10)
184
+		if self.FSM.stateLife > 20:
185
+			frame = arm.getActionFrame(2) + .5 * self.run_speed
186
+			if frame > 30:
187
+				frame = 0
188
+			arm.stopAction(2)
189
+			deck.stopAction(2)
190
+			arm.playAction('reg_nwalk3', 0,30, layer=2, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.walk_weight)
191
+			deck.playAction('b_reg_walk', 0,30, layer=2, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.walk_weight)
192
+			#b_reg_walk
193
+			arm.setActionFrame(frame, 2)
194
+			deck.setActionFrame(frame, 2)
195
+			#print(self.walk_weight, frame)
196
+
197
+			
198
+
199
+			frame = arm.getActionFrame(3) + .5 * self.run_speed
200
+			if frame > 30:
201
+				frame = 0
202
+			arm.stopAction(3)
203
+			deck.stopAction(3)
204
+			arm.playAction('reg_run.003', 0,30, layer=3, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.run_weight)
205
+			deck.playAction('b_reg_run', 0,30, layer=3, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=self.run_weight)
206
+			
207
+			arm.setActionFrame(frame, 3)
208
+			deck.setActionFrame(frame, 3)
209
+			#print(frame, 'frame')
210
+			#print(self.run_weight, frame)
211
+			
212
+		# if self.turn_weight > 0:
213
+		#     tw = abs(self.turn_weight - 1)
214
+		#     #tw = self.turn_weight
215
+		#     arm.stopAction(4)
216
+		#     arm.playAction('bwalk_right', 1,60, layer=4, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=tw)
217
+		# elif self.turn_weight < 0:
218
+		#     tw = abs(abs(self.turn_weight) - 1)
219
+		#     #tw = self.turn_weight
220
+		#     arm.stopAction(4)
221
+		#     arm.playAction('bwalk_left', 1,60, layer=4, play_mode=1, speed=self.run_speed, blendin=0, layer_weight=tw)
222
+			#print('walk_weight', self.walk_weight)
223
+			if self.walk_weight < .8:
224
+				if frame > 15:
225
+					if self.FSM.owner.step == False:
226
+						self.FSM.owner.step = True
227
+						
228
+						if frame < 23:
229
+							#print('step left')
230
+							dict['camera']['sndmgr'].queue_sound(['s_l_1', self.FSM.owner.obj, dict['camera']])
231
+				else:
232
+					if self.FSM.owner.step == True:
233
+						self.FSM.owner.step = False
234
+						if frame < 8:
235
+							dict['camera']['sndmgr'].queue_sound(['s_r_1', self.FSM.owner.obj, dict['camera']])
236
+							#print('step right')
237
+					
238
+			# if frame > 15 and self.FSM.owner.step:
239
+			#     self.FSM.owner.step = True
240
+			#     print('step left')
241
+			# if frame < 15 and not self.FSM.owner.step:
242
+			#     self.FSM.owner.step = False
243
+			#     print('step right')
244
+			#print('frame', frame)
245
+
246
+	def get_walk_weight(self):
247
+		#print(self.FSM.owner.linearVelocity.y) 
248
+
249
+
250
+		o = self.FSM.owner.obj
251
+		w = abs(o.linearVelocity.x)
252
+		#wt = 3.5
253
+		#yt = 8
254
+		wt = 1.7
255
+		yt = 3
256
+		out2 = 0
257
+		if w < wt:
258
+			out = w / wt
259
+		else:
260
+			out = 1
261
+			#print('running', w)
262
+			out2 = w / yt
263
+		out = abs(1 - out)
264
+		out2 = abs(1 - out2)
265
+		tgww = round(out, 3)
266
+		tgrw = round(out2, 3)
267
+		incer = .05
268
+		if self.walk_weight < tgww:
269
+			self.walk_weight += incer
270
+		if self.walk_weight > tgww:
271
+			self.walk_weight -= incer
272
+		if self.run_weight <= tgrw:
273
+			self.run_weight += incer
274
+		if self.run_weight > tgrw:
275
+			self.run_weight -= incer
276
+		if self.walk_weight <= 0:
277
+			self.walk_weight = 0
278
+		if self.walk_weight > .95:            
279
+			self.walk_weight = 1        
280
+		if self.run_weight <= 0:
281
+			self.run_weight = 0
282
+		if self.run_weight > .95:
283
+			self.run_weight = 1
284
+
285
+
286
+		if dict['kb_lsh'] == 2 or dict['aBut'] == 1:
287
+			self.run_speed = 1.3
288
+		else:
289
+			self.run_speed = .8
290
+		#print(self.run_speed, '---', self.walk_weight, 'walk weight', self.run_weight, 'run weight')
291
+
292
+	def Exit(self):
293
+		self.FSM.owner.arm.stopAction(0)
294
+		self.FSM.owner.arm.stopAction(1)
295
+		self.FSM.owner.arm.stopAction(2)
296
+		self.FSM.owner.arm.stopAction(3)
297
+		self.FSM.owner.deck_arm.stopAction(0)
298
+		self.FSM.owner.deck_arm.stopAction(1)
299
+		self.FSM.owner.deck_arm.stopAction(2)
300
+		self.FSM.owner.deck_arm.stopAction(3)
301
+		dict['walk'] = 0
299
 
302
 
300
 
303
 
301
 #==================================== 
304
 #==================================== 
302
-            
305
+			
303
 class WalkAir(State):
306
 class WalkAir(State):
304
-    def __init__(self,FSM):
305
-        super(WalkAir, self).__init__(FSM)    
306
-        
307
-    def Enter(self):
308
-        self.FSM.stateLife = 1
309
-        super(WalkAir, self).Enter()        
310
-        
311
-    def Execute(self):
312
-        self.FSM.stateLife += 1
313
-        self.FSM.owner.check_reset_point()  
314
-        arm = self.FSM.owner.arm
315
-        deck_arm = self.FSM.owner.deck_arm
316
-        #arm.playAction('a_jump_t', 23, 23, layer=3, play_mode=1, speed=1, blendin=5)
317
-        arm.playAction('c_jump_up', 23, 23, layer=3, play_mode=1, speed=1, blendin=15)
318
-        deck_arm.playAction('b_walk_jump', 23, 23, layer=3, play_mode=1, speed=1, blendin=15)
319
-
320
-        if self.FSM.owner.obj.linearVelocity.z < -10:
321
-            self.FSM.owner.obj.linearVelocity.z = -10
322
-        moving = self.FSM.owner.walk_movement() 
323
-        ground_rays = self.FSM.owner.get_ground_ray() 
324
-
325
-        self.FSM.owner.check_throw()
326
-        self.check_onboard()
327
-        self.FSM.owner.align_walk_z()
328
-        if ground_rays[0][0] != None:
329
-            dist = self.FSM.owner.get_ground_dist(ground_rays)
330
-            if dist < .4:
331
-                    self.FSM.ToTransition('toWalkLand')  
332
-
333
-
334
-
335
-            if dist > .5 and self.FSM.owner.obj.worldPosition.z < self.FSM.owner.last_pos.z: 
336
-                hang_ray = self.FSM.owner.get_hang_ray()           
337
-                hang_align_ray = self.FSM.owner.get_hang_align_ray()
338
-
339
-                if hang_ray[0] != None and hang_align_ray[0] != None and self.FSM.prevState != 'WalkHang' and dict['lUD'] < .04:
340
-                    hr_dist = self.FSM.owner.get_hang_dist(hang_ray)
341
-                    if hr_dist < .1:
342
-                        self.FSM.owner.obj.linearVelocity = [0,0,0]
343
-                        self.FSM.owner.obj.worldPosition.z = hang_ray[1].z - 1
344
-                        self.FSM.ToTransition('toWalkHang')
345
-        
346
-    def check_onboard(self):
347
-        o = self.FSM.owner.obj
348
-        # if dict['walk'] == 0:
349
-        #     o['getonboard'] = True
350
-        #     self.FSM.ToTransition('toWalkOnboard')
351
-        if dict['yBut'] == 1 and dict['last_yBut'] == 0:
352
-            o['getonboard'] = True
353
-            #self.FSM.ToTransition('toWalkOnboard')
354
-            self.FSM.ToTransition('toAirOnboard')
355
-
356
-    def Exit(self):
357
-        self.FSM.owner.arm.stopAction(0)
358
-        self.FSM.owner.arm.stopAction(1)
359
-        self.FSM.owner.arm.stopAction(2)
360
-        self.FSM.owner.arm.stopAction(3)
361
-        self.FSM.owner.deck_arm.stopAction(0)
362
-        self.FSM.owner.deck_arm.stopAction(1)
363
-        self.FSM.owner.deck_arm.stopAction(2)
364
-        self.FSM.owner.deck_arm.stopAction(3)
307
+	def __init__(self,FSM):
308
+		super(WalkAir, self).__init__(FSM)    
309
+		
310
+	def Enter(self):
311
+		self.FSM.stateLife = 1
312
+		super(WalkAir, self).Enter()        
313
+		
314
+	def Execute(self):
315
+		self.FSM.stateLife += 1
316
+		self.FSM.owner.check_reset_point()  
317
+		arm = self.FSM.owner.arm
318
+		deck_arm = self.FSM.owner.deck_arm
319
+		#arm.playAction('a_jump_t', 23, 23, layer=3, play_mode=1, speed=1, blendin=5)
320
+		arm.playAction('c_jump_up', 23, 23, layer=3, play_mode=1, speed=1, blendin=15)
321
+		deck_arm.playAction('b_walk_jump', 23, 23, layer=3, play_mode=1, speed=1, blendin=15)
322
+
323
+		if self.FSM.owner.obj.linearVelocity.z < -10:
324
+			self.FSM.owner.obj.linearVelocity.z = -10
325
+		moving = self.FSM.owner.walk_movement() 
326
+		ground_rays = self.FSM.owner.get_ground_ray() 
327
+
328
+		self.FSM.owner.check_throw()
329
+		self.check_onboard()
330
+		self.FSM.owner.align_walk_z()
331
+		self.FSM.owner.check_pause()
332
+		if ground_rays[0][0] != None:
333
+			dist = self.FSM.owner.get_ground_dist(ground_rays)
334
+			if dist < .4:
335
+					self.FSM.ToTransition('toWalkLand')  
336
+
337
+
338
+
339
+			if dist > .5 and self.FSM.owner.obj.worldPosition.z < self.FSM.owner.last_pos.z: 
340
+				hang_ray = self.FSM.owner.get_hang_ray()           
341
+				hang_align_ray = self.FSM.owner.get_hang_align_ray()
342
+
343
+				if hang_ray[0] != None and hang_align_ray[0] != None and self.FSM.prevState != 'WalkHang' and dict['lUD'] < .04:
344
+					hr_dist = self.FSM.owner.get_hang_dist(hang_ray)
345
+					if hr_dist < .1:
346
+						self.FSM.owner.obj.linearVelocity = [0,0,0]
347
+						self.FSM.owner.obj.worldPosition.z = hang_ray[1].z - 1
348
+						self.FSM.ToTransition('toWalkHang')
349
+		
350
+	def check_onboard(self):
351
+		o = self.FSM.owner.obj
352
+		# if dict['walk'] == 0:
353
+		#     o['getonboard'] = True
354
+		#     self.FSM.ToTransition('toWalkOnboard')
355
+		if dict['yBut'] == 1 and dict['last_yBut'] == 0:
356
+			o['getonboard'] = True
357
+			#self.FSM.ToTransition('toWalkOnboard')
358
+			self.FSM.ToTransition('toAirOnboard')
359
+
360
+	def Exit(self):
361
+		self.FSM.owner.arm.stopAction(0)
362
+		self.FSM.owner.arm.stopAction(1)
363
+		self.FSM.owner.arm.stopAction(2)
364
+		self.FSM.owner.arm.stopAction(3)
365
+		self.FSM.owner.deck_arm.stopAction(0)
366
+		self.FSM.owner.deck_arm.stopAction(1)
367
+		self.FSM.owner.deck_arm.stopAction(2)
368
+		self.FSM.owner.deck_arm.stopAction(3)
365
 
369
 
366
 #==================================== 
370
 #==================================== 
367
-            
371
+			
368
 class WalkJump(State):
372
 class WalkJump(State):
369
-    def __init__(self,FSM):
370
-        super(WalkJump, self).__init__(FSM)    
371
-        
372
-    def Enter(self):
373
-        self.FSM.stateLife = 1
374
-        dict['camera']['sndmgr'].queue_sound(['walk_grunt', self.FSM.owner.obj, dict['camera']])
375
-        arm = self.FSM.owner.arm
376
-        deck = self.FSM.owner.deck_arm
377
-        #arm.playAction('a_jump_t', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
378
-        arm.playAction('c_jump_up', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
379
-        deck.playAction('b_walk_jump', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
380
-            
381
-
382
-        super(WalkJump, self).Enter()        
383
-        
384
-    def Execute(self):
385
-        self.FSM.stateLife += 1
386
-        arm = self.FSM.owner.arm
387
-        o = self.FSM.owner.obj
388
-
389
-        moving = self.FSM.owner.walk_movement()              
390
-        self.check_onboard()
391
-        if self.FSM.stateLife == 10:
392
-                force = [ 0.0, 0.0, dict['walk_jump_force']]
393
-                if o.linearVelocity.z < 10:
394
-                     o.applyForce(force, True)
395
-
396
-        if self.FSM.stateLife > 27:
397
-            self.FSM.ToTransition('toWalkAir')
398
-
399
-    def check_onboard(self):
400
-        o = self.FSM.owner.obj
401
-        # if dict['walk'] == 0:
402
-        #     o['getonboard'] = True
403
-        #     self.FSM.ToTransition('toWalkOnboard')
404
-        if dict['yBut'] == 1 and dict['last_yBut'] == 0:
405
-            o['getonboard'] = True
406
-            self.FSM.ToTransition('toAirOnboard')            
407
-        
408
-    def Exit(self):
409
-        pass
373
+	def __init__(self,FSM):
374
+		super(WalkJump, self).__init__(FSM)    
375
+		
376
+	def Enter(self):
377
+		self.FSM.stateLife = 1
378
+		dict['camera']['sndmgr'].queue_sound(['walk_grunt', self.FSM.owner.obj, dict['camera']])
379
+		arm = self.FSM.owner.arm
380
+		deck = self.FSM.owner.deck_arm
381
+		#arm.playAction('a_jump_t', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
382
+		arm.playAction('c_jump_up', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
383
+		deck.playAction('b_walk_jump', 1, 23, layer=3, play_mode=0, speed=1, blendin=5)
384
+			
385
+
386
+		super(WalkJump, self).Enter()        
387
+		
388
+	def Execute(self):
389
+		self.FSM.stateLife += 1
390
+		arm = self.FSM.owner.arm
391
+		o = self.FSM.owner.obj
392
+
393
+		moving = self.FSM.owner.walk_movement()              
394
+		self.check_onboard()
395
+		self.FSM.owner.check_pause()
396
+		if self.FSM.stateLife == 10:
397
+				force = [ 0.0, 0.0, dict['walk_jump_force']]
398
+				if o.linearVelocity.z < 10:
399
+					 o.applyForce(force, True)
400
+
401
+		if self.FSM.stateLife > 27:
402
+			self.FSM.ToTransition('toWalkAir')
403
+
404
+	def check_onboard(self):
405
+		o = self.FSM.owner.obj
406
+		# if dict['walk'] == 0:
407
+		#     o['getonboard'] = True
408
+		#     self.FSM.ToTransition('toWalkOnboard')
409
+		if dict['yBut'] == 1 and dict['last_yBut'] == 0:
410
+			o['getonboard'] = True
411
+			self.FSM.ToTransition('toAirOnboard')            
412
+		
413
+	def Exit(self):
414
+		pass
410
 
415
 
411
 #==================================== 
416
 #==================================== 
412
-            
417
+			
413
 class WalkLand(State):
418
 class WalkLand(State):
414
-    def __init__(self,FSM):
415
-        super(WalkLand, self).__init__(FSM)    
416
-        
417
-    def Enter(self):
418
-        self.FSM.stateLife = 1
419
-        #self.FSM.owner.arm.playAction('a_jump_t', 23, 50, layer=5, play_mode=0, speed=1, blendin=5)
420
-        self.FSM.owner.arm.playAction('c_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
421
-        self.FSM.owner.deck_arm.playAction('b_walk_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
422
-        dict['camera']['sndmgr'].queue_sound(['walk_land', self.FSM.owner.obj, dict['camera']])
423
-        #c_land
424
-        super(WalkLand, self).Enter()        
425
-        
426
-    def Execute(self):
427
-        self.FSM.stateLife += 1
428
-        self.FSM.owner.obj.linearVelocity.x *= .8
429
-        self.FSM.owner.obj.linearVelocity.y *= .8
430
-        # arm = self.FSM.owner.arm
431
-        
432
-        # print('af', arm.getActionFrame(5))
433
-        # if arm.getActionFrame(5) > 30:
434
-        #     print('stopping land')
435
-        #     arm.stopAction(5)
436
-        #     arm.playAction('reg_idle1', 1,120, layer=1, play_mode=1, speed=1, blendin=2)
437
-        if self.FSM.stateLife > 30:
438
-            self.FSM.ToTransition('toWalk')
439
-
440
-        ground_rays = self.FSM.owner.get_ground_ray() 
441
-        if ground_rays[0][0] != None:
442
-            dist = self.FSM.owner.get_ground_dist(ground_rays)
443
-            self.FSM.owner.set_walk_z(dist)
444
-
445
-    def Exit(self):
446
-        pass
419
+	def __init__(self,FSM):
420
+		super(WalkLand, self).__init__(FSM)    
421
+		
422
+	def Enter(self):
423
+		self.FSM.stateLife = 1
424
+		#self.FSM.owner.arm.playAction('a_jump_t', 23, 50, layer=5, play_mode=0, speed=1, blendin=5)
425
+		self.FSM.owner.arm.playAction('c_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
426
+		self.FSM.owner.deck_arm.playAction('b_walk_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
427
+		dict['camera']['sndmgr'].queue_sound(['walk_land', self.FSM.owner.obj, dict['camera']])
428
+		#c_land
429
+		super(WalkLand, self).Enter()        
430
+		
431
+	def Execute(self):
432
+		self.FSM.stateLife += 1
433
+		self.FSM.owner.obj.linearVelocity.x *= .8
434
+		self.FSM.owner.obj.linearVelocity.y *= .8
435
+		# arm = self.FSM.owner.arm
436
+		
437
+		# print('af', arm.getActionFrame(5))
438
+		# if arm.getActionFrame(5) > 30:
439
+		#     print('stopping land')
440
+		#     arm.stopAction(5)
441
+		#     arm.playAction('reg_idle1', 1,120, layer=1, play_mode=1, speed=1, blendin=2)
442
+		if self.FSM.stateLife > 30:
443
+			self.FSM.ToTransition('toWalk')
444
+
445
+		self.FSM.owner.check_pause()
446
+		ground_rays = self.FSM.owner.get_ground_ray() 
447
+		if ground_rays[0][0] != None:
448
+			dist = self.FSM.owner.get_ground_dist(ground_rays)
449
+			self.FSM.owner.set_walk_z(dist)
450
+
451
+	def Exit(self):
452
+		pass
447
 
453
 
448
 #==================================== 
454
 #==================================== 
449
-            
455
+			
450
 class WalkHang(State):
456
 class WalkHang(State):
451
-    def __init__(self,FSM):
452
-        super(WalkHang, self).__init__(FSM)    
453
-        
454
-    def Enter(self):
455
-        self.FSM.stateLife = 1
456
-        self.FSM.owner.arm.playAction('c_braced_hang', 0, 36, layer=2, play_mode=0, speed=1, blendin=10)
457
-        self.moveable = False
458
-        dict['camera']['sndmgr'].queue_sound(['walk_hang', self.FSM.owner.obj, dict['camera']])
459
-        self.FSM.owner.drop_deck()
460
-        #self.FSM.owner.arm.playAction('c_braced_hang', 36, 50, layer=1, play_mode=1, speed=1, blendin=10)
461
-        super(WalkHang, self).Enter()        
462
-        
463
-    def Execute(self):
464
-        self.FSM.stateLife += 1
465
-        self.FSM.owner.obj.linearVelocity = [0,0,0]
466
-        #self.FSM.owner.arm.playAction('c_braced_hang', 0, 36, layer=2, play_mode=0, speed=1, blendin=10)
467
-        self.FSM.owner.arm.playAction('c_braced_hang', 36, 50, layer=1, play_mode=1, speed=1, blendin=10)
468
-        if dict['lUD'] > .04:
469
-            self.FSM.ToTransition('toWalkAir')
470
-           
471
-        
472
-        self.FSM.owner.move_walk_cam()
473
-        if self.FSM.stateLife > 25:
474
-            self.moveable = True
475
-        if self.moveable:
476
-            if dict['lUD'] < -.04:
477
-                self.FSM.ToTransition('toWalkClimb') 
478
-            self.FSM.owner.hang_move()
479
-        ground_rays = self.FSM.owner.get_ground_ray() 
480
-        if ground_rays[0][0] != None:
481
-            dist = self.FSM.owner.get_ground_dist(ground_rays)
482
-            if dist < .4:
483
-                self.FSM.ToTransition('toWalkLand') 
484
-
485
-        hang_ray = self.FSM.owner.get_hang_ray()           
486
-        hang_align_ray = self.FSM.owner.get_hang_align_ray()
487
-        #print(hang_align_ray, 'hang_align_ray')
488
-        #self.FSM.owner.hang_move()
489
-
490
-
491
-
492
-        if hang_ray[0] != None:
493
-            hr_dist = self.FSM.owner.get_hang_dist(hang_ray)
494
-            #print(hr_dist, 'hang dist')
495
-            if hr_dist < .5:
496
-                self.FSM.owner.obj.linearVelocity = [0,0,0]
497
-                self.FSM.owner.obj.worldPosition.z = hang_ray[1].z  - 1
498
-            if hang_align_ray[0] != None:
499
-                #print(hang_align_ray[0])
500
-                v = hang_align_ray[2]
501
-                self.FSM.owner.obj.alignAxisToVect(v, 0, .5)    
502
-        else:
503
-            self.FSM.ToTransition('toWalkAir')
504
-        if hang_align_ray[0] == None:
505
-            self.FSM.ToTransition('toWalkAir')
506
-
507
-        self.FSM.owner.align_walk_z()
508
-    def Exit(self):
509
-        pass
457
+	def __init__(self,FSM):
458
+		super(WalkHang, self).__init__(FSM)    
459
+		
460
+	def Enter(self):
461
+		self.FSM.stateLife = 1
462
+		self.FSM.owner.arm.playAction('c_braced_hang', 0, 36, layer=2, play_mode=0, speed=1, blendin=10)
463
+		self.moveable = False
464
+		dict['camera']['sndmgr'].queue_sound(['walk_hang', self.FSM.owner.obj, dict['camera']])
465
+		self.FSM.owner.drop_deck()
466
+		#self.FSM.owner.arm.playAction('c_braced_hang', 36, 50, layer=1, play_mode=1, speed=1, blendin=10)
467
+		super(WalkHang, self).Enter()        
468
+		
469
+	def Execute(self):
470
+		self.FSM.stateLife += 1
471
+		self.FSM.owner.obj.linearVelocity = [0,0,0]
472
+		#self.FSM.owner.arm.playAction('c_braced_hang', 0, 36, layer=2, play_mode=0, speed=1, blendin=10)
473
+		self.FSM.owner.arm.playAction('c_braced_hang', 36, 50, layer=1, play_mode=1, speed=1, blendin=10)
474
+		if dict['lUD'] > .04:
475
+			self.FSM.ToTransition('toWalkAir')
476
+		   
477
+		
478
+		self.FSM.owner.move_walk_cam()
479
+		self.FSM.owner.check_pause()
480
+		if self.FSM.stateLife > 25:
481
+			self.moveable = True
482
+		if self.moveable:
483
+			if dict['lUD'] < -.04:
484
+				self.FSM.ToTransition('toWalkClimb') 
485
+			self.FSM.owner.hang_move()
486
+		ground_rays = self.FSM.owner.get_ground_ray() 
487
+		if ground_rays[0][0] != None:
488
+			dist = self.FSM.owner.get_ground_dist(ground_rays)
489
+			if dist < .4:
490
+				self.FSM.ToTransition('toWalkLand') 
491
+
492
+		hang_ray = self.FSM.owner.get_hang_ray()           
493
+		hang_align_ray = self.FSM.owner.get_hang_align_ray()
494
+		#print(hang_align_ray, 'hang_align_ray')
495
+		#self.FSM.owner.hang_move()
496
+
497
+
498
+
499
+		if hang_ray[0] != None:
500
+			hr_dist = self.FSM.owner.get_hang_dist(hang_ray)
501
+			#print(hr_dist, 'hang dist')
502
+			if hr_dist < .5:
503
+				self.FSM.owner.obj.linearVelocity = [0,0,0]
504
+				self.FSM.owner.obj.worldPosition.z = hang_ray[1].z  - 1
505
+			if hang_align_ray[0] != None:
506
+				#print(hang_align_ray[0])
507
+				v = hang_align_ray[2]
508
+				self.FSM.owner.obj.alignAxisToVect(v, 0, .5)    
509
+		else:
510
+			self.FSM.ToTransition('toWalkAir')
511
+		if hang_align_ray[0] == None:
512
+			self.FSM.ToTransition('toWalkAir')
513
+
514
+		self.FSM.owner.align_walk_z()
515
+	def Exit(self):
516
+		pass
510
 
517
 
511
 #==================================== 
518
 #==================================== 
512
-            
519
+			
513
 class WalkClimb(State):
520
 class WalkClimb(State):
514
-    def __init__(self,FSM):
515
-        super(WalkClimb, self).__init__(FSM)    
516
-        
517
-    def Enter(self):
518
-        self.FSM.stateLife = 1
519
-        self.FSM.owner.arm.playAction('c_wallclimb', 1, 50, layer=3, play_mode=0, speed=1, blendin=10)
520
-        dict['camera']['sndmgr'].queue_sound(['walk_climb', self.FSM.owner.obj, dict['camera']])
521
-        super(WalkClimb, self).Enter()        
522
-        
523
-    def Execute(self):
524
-        self.FSM.stateLife += 1
525
-        #self.FSM.ToTransition('toLand')
526
-        
527
-        if self.FSM.stateLife > 25:
528
-            self.FSM.owner.obj.applyForce([-300, 0, 80], True)
529
-        else:
530
-            self.FSM.owner.obj.applyForce([-20, 0, 80], True)    
531
-        if self.FSM.stateLife > 35:
532
-            self.FSM.ToTransition('toWalkLand')
533
-        
534
-    def Exit(self):
535
-        pass                                
521
+	def __init__(self,FSM):
522
+		super(WalkClimb, self).__init__(FSM)    
523
+		
524
+	def Enter(self):
525
+		self.FSM.stateLife = 1
526
+		self.FSM.owner.arm.playAction('c_wallclimb', 1, 50, layer=3, play_mode=0, speed=1, blendin=10)
527
+		dict['camera']['sndmgr'].queue_sound(['walk_climb', self.FSM.owner.obj, dict['camera']])
528
+		super(WalkClimb, self).Enter()        
529
+		
530
+	def Execute(self):
531
+		self.FSM.stateLife += 1
532
+		#self.FSM.ToTransition('toLand')
533
+		self.FSM.owner.check_pause()
534
+		if self.FSM.stateLife > 25:
535
+			self.FSM.owner.obj.applyForce([-300, 0, 80], True)
536
+		else:
537
+			self.FSM.owner.obj.applyForce([-20, 0, 80], True)    
538
+		if self.FSM.stateLife > 35:
539
+			self.FSM.ToTransition('toWalkLand')
540
+		
541
+	def Exit(self):
542
+		pass                                
536
 
543
 
537
 #==================================== 
544
 #==================================== 
538
-            
545
+			
539
 class WalkHurdle(State):
546
 class WalkHurdle(State):
540
-    def __init__(self,FSM):
541
-        super(WalkHurdle, self).__init__(FSM)    
542
-        
543
-    def Enter(self):
544
-        self.FSM.stateLife = 1
545
-        super(WalkHurdle, self).Enter()        
546
-        
547
-    def Execute(self):
548
-        self.FSM.stateLife += 1
549
-        #self.FSM.ToTransition('toLand')
550
-        
551
-    def Exit(self):
552
-        pass                                
547
+	def __init__(self,FSM):
548
+		super(WalkHurdle, self).__init__(FSM)    
549
+		
550
+	def Enter(self):
551
+		self.FSM.stateLife = 1
552
+		super(WalkHurdle, self).Enter()        
553
+		
554
+	def Execute(self):
555
+		self.FSM.stateLife += 1
556
+		#self.FSM.ToTransition('toLand')
557
+		
558
+	def Exit(self):
559
+		pass                                
553
 
560
 
554
 
561
 
555
 #==================================== 
562
 #==================================== 
556
 
563
 
557
-            
564
+			
558
 class WalkOnboard(State):
565
 class WalkOnboard(State):
559
-    def __init__(self,FSM):
560
-        super(WalkOnboard, self).__init__(FSM)    
561
-        
562
-    def Enter(self):
563
-        self.FSM.stateLife = 1
564
-        self.FSM.owner.walking = False
565
-        self.FSM.owner.obj['getonboard'] = False
566
-        if self.FSM.owner.throw_deck != None:
567
-            self.FSM.owner.throw_deck.endObject()
568
-            self.FSM.owner.throw_deck = None
569
-            self.FSM.owner.show_deck()
570
-        dict['walking'] = False
571
-        self.FSM.owner.obj['walking'] = False
572
-        self.FSM.owner.obj['requestAction'] = 'reg_onboard'
573
-        self.FSM.owner.obj['getoffboard'] == False
574
-        self.FSM.owner.obj.applyForce([-300, 0, 0], True)
575
-        print('walkonboard entered')
576
-        super(WalkOnboard, self).Enter()        
577
-        
578
-    def Execute(self):
579
-        self.FSM.stateLife += 1
580
-        self.FSM.ToTransition('toRoll')
581
-        
582
-    def Exit(self):
583
-        pass
566
+	def __init__(self,FSM):
567
+		super(WalkOnboard, self).__init__(FSM)    
568
+		
569
+	def Enter(self):
570
+		self.FSM.stateLife = 1
571
+		self.FSM.owner.walking = False
572
+		self.FSM.owner.obj['getonboard'] = False
573
+		if self.FSM.owner.throw_deck != None:
574
+			self.FSM.owner.throw_deck.endObject()
575
+			self.FSM.owner.throw_deck = None
576
+			self.FSM.owner.show_deck()
577
+		dict['walking'] = False
578
+		self.FSM.owner.obj['walking'] = False
579
+		self.FSM.owner.obj['requestAction'] = 'reg_onboard'
580
+		self.FSM.owner.obj['getoffboard'] == False
581
+		self.FSM.owner.obj.applyForce([-300, 0, 0], True)
582
+		print('walkonboard entered')
583
+		super(WalkOnboard, self).Enter()        
584
+		
585
+	def Execute(self):
586
+		self.FSM.stateLife += 1
587
+		self.FSM.ToTransition('toRoll')
588
+		
589
+	def Exit(self):
590
+		pass
584
 
591
 
585
 #==================================== 
592
 #==================================== 
586
 
593
 
587
 
594
 
588
-            
595
+			
589
 class AirOnboard(State):
596
 class AirOnboard(State):
590
-    def __init__(self,FSM):
591
-        super(AirOnboard, self).__init__(FSM)    
592
-        
593
-    def Enter(self):
594
-        self.FSM.stateLife = 1
595
-        self.FSM.owner.walking = False
596
-        self.FSM.owner.obj['getonboard'] = False
597
-        if self.FSM.owner.throw_deck != None:
598
-            self.FSM.owner.throw_deck.endObject()
599
-            self.FSM.owner.throw_deck = None
600
-            self.FSM.owner.show_deck()
601
-        dict['walking'] = False
602
-        self.FSM.owner.obj['walking'] = False
603
-        #self.FSM.owner.obj['requestAction'] = 'reg_onboard'
604
-
605
-        self.FSM.owner.arm.playAction('c_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
606
-        self.FSM.owner.deck_arm.playAction('b_walk_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
607
-
608
-        self.FSM.owner.obj['getoffboard'] == False
609
-        self.FSM.owner.obj.applyForce([-300, 0, 0], True)
610
-        print('air entered')
611
-        super(AirOnboard, self).Enter()        
612
-        
613
-    def Execute(self):
614
-        self.FSM.stateLife += 1
615
-        print('@@@@@@@@@@@@@@@@@@@@@@@@@@@air ob')
616
-        self.FSM.ToTransition('toRoll')
617
-        
618
-    def Exit(self):
619
-        pass
597
+	def __init__(self,FSM):
598
+		super(AirOnboard, self).__init__(FSM)    
599
+		
600
+	def Enter(self):
601
+		self.FSM.stateLife = 1
602
+		self.FSM.owner.walking = False
603
+		self.FSM.owner.obj['getonboard'] = False
604
+		if self.FSM.owner.throw_deck != None:
605
+			self.FSM.owner.throw_deck.endObject()
606
+			self.FSM.owner.throw_deck = None
607
+			self.FSM.owner.show_deck()
608
+		dict['walking'] = False
609
+		self.FSM.owner.obj['walking'] = False
610
+		#self.FSM.owner.obj['requestAction'] = 'reg_onboard'
611
+
612
+		self.FSM.owner.arm.playAction('c_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
613
+		self.FSM.owner.deck_arm.playAction('b_walk_land', 0, 50, layer=1, play_mode=0, speed=1, blendin=5)
614
+
615
+		self.FSM.owner.obj['getoffboard'] == False
616
+		self.FSM.owner.obj.applyForce([-300, 0, 0], True)
617
+		print('air entered')
618
+		super(AirOnboard, self).Enter()        
619
+		
620
+	def Execute(self):
621
+		self.FSM.stateLife += 1
622
+		self.FSM.ToTransition('toRoll')
623
+		
624
+	def Exit(self):
625
+		pass
620
 
626
 
621
 #==================================== 
627
 #==================================== 
622
-            
628
+			
623
 class Roll(State):
629
 class Roll(State):
624
-    def __init__(self,FSM):
625
-        super(Roll, self).__init__(FSM)    
626
-        
627
-    def Enter(self):
628
-        self.FSM.stateLife = 1
629
-        # self.FSM.owner.obj['getoffboard'] == False
630
-        # dict['walk'] = 0
631
-        print('roll entered')
632
-        super(Roll, self).Enter()        
633
-        
634
-    def Execute(self):
635
-        self.FSM.stateLife += 1
636
-        if dict['walk'] == 1 or self.FSM.owner.obj['getoffboard'] == True:
637
-            dict['walk'] = 1
638
-            self.FSM.owner.obj['getoffboard'] = True
639
-            #self.FSM.ToTransition('toWalk')
640
-            self.FSM.ToTransition('toOffboard')
641
-            print('fsm to walk', dict['walk'], self.FSM.owner.obj['getoffboard'])
642
-        if self.FSM.owner.obj['fall'] == True:
643
-            self.FSM.ToTransition('toRagdoll')    
644
-        #print('rolling')
645
-        #self.FSM.ToTransition('toLand')
646
-        
647
-    def Exit(self):
648
-        pass
630
+	def __init__(self,FSM):
631
+		super(Roll, self).__init__(FSM)    
632
+		
633
+	def Enter(self):
634
+		self.FSM.stateLife = 1
635
+		# self.FSM.owner.obj['getoffboard'] == False
636
+		# dict['walk'] = 0
637
+		print('roll entered')
638
+		super(Roll, self).Enter()        
639
+		
640
+	def Execute(self):
641
+		self.FSM.stateLife += 1
642
+		if dict['walk'] == 1 or self.FSM.owner.obj['getoffboard'] == True:
643
+			dict['walk'] = 1
644
+			self.FSM.owner.obj['getoffboard'] = True
645
+			#self.FSM.ToTransition('toWalk')
646
+			self.FSM.ToTransition('toOffboard')
647
+			#print('fsm to walk', dict['walk'], self.FSM.owner.obj['getoffboard'])
648
+		if self.FSM.owner.obj['fall'] == True:
649
+			self.FSM.ToTransition('toRagdoll')    
650
+		#print('rolling')
651
+		#self.FSM.ToTransition('toLand')
652
+		
653
+	def Exit(self):
654
+		pass
649
 
655
 
650
 #==================================== 
656
 #==================================== 
651
 
657
 
652
 class Offboard(State):
658
 class Offboard(State):
653
-    def __init__(self,FSM):
654
-        super(Offboard, self).__init__(FSM)    
655
-        
656
-    def Enter(self):
657
-        self.FSM.stateLife = 1
658
-        
659
-        o = self.FSM.owner.obj
660
-        if o['stance']:
661
-            o.applyRotation([0,0,3.14], True)
662
-            o['stance'] = False
663
-            self.FSM.owner.arm.playAction('fak_noffboard', 0,24, layer=2, play_mode=0, speed=1, blendin=0)
664
-            self.FSM.owner.deck_arm.playAction('b_reg_offboard', 0,30, layer=2, play_mode=0, speed=1, blendin=0)
665
-        else:
666
-            self.FSM.owner.arm.playAction('reg_noffboard', 0,40, layer=2, play_mode=0, speed=1, blendin=0)
667
-            self.FSM.owner.deck_arm.playAction('b_reg_offboard', 0,40, layer=2, play_mode=0, speed=1, blendin=0)
668
-        print('fsm getting off board')
669
-        super(Offboard, self).Enter()        
670
-        
671
-    def Execute(self):
672
-        self.FSM.stateLife += 1
673
-        
674
-        self.FSM.ToTransition('toWalk')
675
-        
676
-    def Exit(self):
677
-        pass
659
+	def __init__(self,FSM):
660
+		super(Offboard, self).__init__(FSM)    
661
+		
662
+	def Enter(self):
663
+		self.FSM.stateLife = 1
664
+		
665
+		o = self.FSM.owner.obj
666
+		if o['stance']:
667
+			o.applyRotation([0,0,3.14], True)
668
+			o['stance'] = False
669
+			self.FSM.owner.arm.playAction('fak_noffboard', 0,24, layer=2, play_mode=0, speed=1, blendin=0)
670
+			self.FSM.owner.deck_arm.playAction('b_reg_offboard', 0,30, layer=2, play_mode=0, speed=1, blendin=0)
671
+		else:
672
+			self.FSM.owner.arm.playAction('reg_noffboard', 0,40, layer=2, play_mode=0, speed=1, blendin=0)
673
+			self.FSM.owner.deck_arm.playAction('b_reg_offboard', 0,40, layer=2, play_mode=0, speed=1, blendin=0)
674
+		print('fsm getting off board')
675
+		super(Offboard, self).Enter()        
676
+		
677
+	def Execute(self):
678
+		self.FSM.stateLife += 1
679
+		
680
+		self.FSM.ToTransition('toWalk')
681
+		
682
+	def Exit(self):
683
+		pass
678
 #==================================== 
684
 #==================================== 
679
 
685
 
680
 class Ragdoll(State):
686
 class Ragdoll(State):
681
-    def __init__(self,FSM):
682
-        super(Ragdoll, self).__init__(FSM)    
683
-        
684
-    def Enter(self):
685
-        self.FSM.stateLife = 1
686
-        self.FSM.owner.obj['ragdoll_active'] = True
687
-        self.FSM.owner.drop_deck()
688
-        print('ragdoll_player_fsm entered')
689
-        super(Ragdoll, self).Enter()        
690
-        
691
-    def Execute(self):
692
-        self.FSM.stateLife += 1
693
-        print('ragdolling')
694
-        if dict['yBut'] == 1:
695
-            self.FSM.owner.obj['fall'] = False
696
-            self.FSM.owner.cont.activate(self.FSM.owner.cont.actuators['walk'])
697
-            #self.FSM.ToTransition('toWalk')
698
-            self.FSM.ToTransition('toOffboard')
699
-        self.FSM.owner.move_walk_cam()
700
-    def Exit(self):
701
-        print('ragdoll_player_fsm exited')
702
-        self.FSM.owner.obj['ragdoll_active'] = False
703
-        #pass                                
687
+	def __init__(self,FSM):
688
+		super(Ragdoll, self).__init__(FSM)    
689
+		
690
+	def Enter(self):
691
+		self.FSM.stateLife = 1
692
+		self.FSM.owner.obj['ragdoll_active'] = True
693
+		self.FSM.owner.drop_deck()
694
+		print('ragdoll_player_fsm entered')
695
+		super(Ragdoll, self).Enter()        
696
+		
697
+	def Execute(self):
698
+		self.FSM.stateLife += 1
699
+		#print('ragdolling')
700
+		if dict['yBut'] == 1:
701
+			self.FSM.owner.obj['fall'] = False
702
+			self.FSM.owner.cont.activate(self.FSM.owner.cont.actuators['walk'])
703
+			#self.FSM.ToTransition('toWalk')
704
+			self.FSM.ToTransition('toOffboard')
705
+		self.FSM.owner.move_walk_cam()
706
+		self.FSM.owner.check_pause()
707
+	def Exit(self):
708
+		print('ragdoll_player_fsm exited')
709
+		self.FSM.owner.obj['ragdoll_active'] = False
710
+		#pass                                
704
 
711
 
705
 #==================================== 
712
 #==================================== 
706
-            
713
+			
707
 class Dropin(State):
714
 class Dropin(State):
708
-    def __init__(self,FSM):
709
-        super(Dropin, self).__init__(FSM)    
710
-        
711
-    def Enter(self):
712
-        self.FSM.stateLife = 1
713
-        if self.FSM.owner.throw_deck != None:
714
-            self.FSM.owner.throw_deck.endObject()
715
-            self.FSM.owner.throw_deck = None
716
-            self.FSM.owner.show_deck()
717
-        self.FSM.owner.arm.playAction('reg_dropin3', 30, 50, layer=2, play_mode=0, speed=1, blendin=5)
718
-        self.FSM.owner.deck_arm.playAction('b_reg_dropin', 30, 50, layer=2, play_mode=0, speed=1, blendin=5)
719
-        self.out_triggered = False
720
-        # #player armature action name, start, end frames
721
-        # 'reg_dropin3', 30, 50,
722
-        # #deck action name, start, end frames  
723
-        # 'b_reg_dropin', 30, 50,
724
-        # #layer, speed, mode (0 = play, 1 = loop), blendin
725
-        # 1, .5, 0, 15,
726
-        # #intro, length
727
-
728
-        super(Dropin, self).Enter()        
729
-        
730
-    def Execute(self):
731
-        self.FSM.stateLife += 1
732
-        print('dropin')
733
-        eu = self.FSM.owner.get_vert_rot(self.FSM.owner.obj, self.FSM.owner.dropin_obj[0])
734
-        #print(eu, 'eu')
735
-        
736
-        self.FSM.owner.arm.playAction('reg_dropin3', 50, 50, layer=1, play_mode=1, speed=1, blendin=5)
737
-        self.FSM.owner.deck_arm.playAction('b_reg_dropin', 50, 50, layer=1, play_mode=1, speed=1, blendin=5)
738
-        
739
-        if dict['last_yBut'] == True and dict['yBut'] == False:
740
-            self.out_triggered = True
741
-        
742
-        if self.out_triggered:
743
-            self.FSM.owner.arm.playAction('reg_dropin3', 60, 80, layer=2, play_mode=0, speed=1, blendin=5)
744
-            self.FSM.owner.deck_arm.playAction('b_reg_dropin', 60, 80, layer=2, play_mode=0, speed=1, blendin=5)
745
-            self.FSM.owner.obj.applyForce([-15, 0, 0], True)
746
-            self.FSM.owner.obj.applyRotation([0, -.01, 0], True)
747
-
748
-        else:
749
-            self.FSM.owner.move_to_te()
750
-
751
-        if self.FSM.owner.arm.getActionFrame(2)> 78:
752
-            
753
-            self.FSM.ToTransition('toRoll')
754
-
755
-        self.FSM.owner.move_walk_cam()
756
-
757
-        
758
-        
759
-
760
-
761
-    def Exit(self):
762
-        self.FSM.owner.obj['getonboard'] = True
763
-        self.FSM.owner.walking = False
764
-        #self.FSM.owner.obj['getonboard'] = False
765
-        dict['walking'] = False
766
-        self.FSM.owner.obj['walking'] = False
767
-        self.FSM.owner.obj['requestAction'] = 'reg_air'
768
-        self.FSM.owner.obj['getoffboard'] == False
715
+	def __init__(self,FSM):
716
+		super(Dropin, self).__init__(FSM)    
717
+		
718
+	def Enter(self):
719
+		self.FSM.stateLife = 1
720
+		if self.FSM.owner.throw_deck != None:
721
+			self.FSM.owner.throw_deck.endObject()
722
+			self.FSM.owner.throw_deck = None
723
+			self.FSM.owner.show_deck()
724
+		self.FSM.owner.arm.playAction('reg_dropin3', 30, 50, layer=2, play_mode=0, speed=1, blendin=5)
725
+		self.FSM.owner.deck_arm.playAction('b_reg_dropin', 30, 50, layer=2, play_mode=0, speed=1, blendin=5)
726
+		self.out_triggered = False
727
+		# #player armature action name, start, end frames
728
+		# 'reg_dropin3', 30, 50,
729
+		# #deck action name, start, end frames  
730
+		# 'b_reg_dropin', 30, 50,
731
+		# #layer, speed, mode (0 = play, 1 = loop), blendin
732
+		# 1, .5, 0, 15,
733
+		# #intro, length
734
+
735
+		super(Dropin, self).Enter()        
736
+		
737
+	def Execute(self):
738
+		self.FSM.stateLife += 1
739
+		#print('dropin')
740
+		eu = self.FSM.owner.get_vert_rot(self.FSM.owner.obj, self.FSM.owner.dropin_obj[0])
741
+		#print(eu, 'eu')
742
+		
743
+		self.FSM.owner.arm.playAction('reg_dropin3', 50, 50, layer=1, play_mode=1, speed=1, blendin=5)
744
+		self.FSM.owner.deck_arm.playAction('b_reg_dropin', 50, 50, layer=1, play_mode=1, speed=1, blendin=5)
745
+		
746
+		if dict['last_yBut'] == True and dict['yBut'] == False:
747
+			self.out_triggered = True
748
+		
749
+		if self.out_triggered:
750
+			self.FSM.owner.arm.playAction('reg_dropin3', 60, 80, layer=2, play_mode=0, speed=1, blendin=5)
751
+			self.FSM.owner.deck_arm.playAction('b_reg_dropin', 60, 80, layer=2, play_mode=0, speed=1, blendin=5)
752
+			self.FSM.owner.obj.applyForce([-15, 0, 0], True)
753
+			self.FSM.owner.obj.applyRotation([0, -.01, 0], True)
754
+
755
+		else:
756
+			self.FSM.owner.move_to_te()
757
+
758
+		if self.FSM.owner.arm.getActionFrame(2)> 78:
759
+			
760
+			self.FSM.ToTransition('toRoll')
761
+
762
+		self.FSM.owner.move_walk_cam()
763
+		self.FSM.owner.check_pause()
764
+
765
+		
766
+		
767
+
768
+
769
+	def Exit(self):
770
+		self.FSM.owner.obj['getonboard'] = True
771
+		self.FSM.owner.walking = False
772
+		#self.FSM.owner.obj['getonboard'] = False
773
+		dict['walking'] = False
774
+		self.FSM.owner.obj['walking'] = False
775
+		self.FSM.owner.obj['requestAction'] = 'reg_air'
776
+		self.FSM.owner.obj['getoffboard'] == False
769
 
777
 
770
 
778
 
771
 
779
 
772
 #==================================== 
780
 #==================================== 
781
+
782
+#==================================== 
783
+			
784
+class Pause(State):
785
+	def __init__(self,FSM):
786
+		super(Pause, self).__init__(FSM)    
787
+		
788
+	def Enter(self):
789
+		self.FSM.stateLife = 1
790
+		super(Pause, self).Enter()        
791
+		
792
+	def Execute(self):
793
+		self.FSM.stateLife += 1
794
+		#print('******paused')
795
+		self.FSM.owner.obj['walk'] = True
796
+		if dict['npause'] == False:
797
+			n = self.FSM.prevState.__class__.__name__
798
+			n = 'to' + n
799
+			#self.FSM.ToTransition('toWalk')
800
+			self.FSM.ToTransition(n)
801
+		
802
+	def Exit(self):
803
+		pass
804
+
805
+#==================================== 

+ 3
- 3
scripts/actionsFSMlist.py View File

3842
 	#player armature action name, start, end frames
3842
 	#player armature action name, start, end frames
3843
 	'fak_BS_Board2', 1, 40,
3843
 	'fak_BS_Board2', 1, 40,
3844
 	#deck action name, start, end frames  
3844
 	#deck action name, start, end frames  
3845
-	'b_reg', 1, 40,
3845
+	'b_fak_bsboard', 1, 40,
3846
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3846
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3847
 	1, 1, 0, 10,
3847
 	1, 1, 0, 10,
3848
 	#intro, length
3848
 	#intro, length
3858
 	#player armature action name, start, end frames
3858
 	#player armature action name, start, end frames
3859
 	'fak_BS_Board2', 41, 80,
3859
 	'fak_BS_Board2', 41, 80,
3860
 	#deck action name, start, end frames  
3860
 	#deck action name, start, end frames  
3861
-	'b_reg', 1, 1,
3861
+	'b_fak_bsboard', 1, 40,
3862
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3862
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3863
 	1, .5, 1, 15,
3863
 	1, .5, 1, 15,
3864
 	#intro, length
3864
 	#intro, length
3874
 	#player armature action name, start, end frames
3874
 	#player armature action name, start, end frames
3875
 	'fak_FS_Board2', 1, 40,
3875
 	'fak_FS_Board2', 1, 40,
3876
 	#deck action name, start, end frames  
3876
 	#deck action name, start, end frames  
3877
-	'b_reg', 1, 40,
3877
+	'b_fak_bsboard', 1, 40,
3878
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3878
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3879
 	1, 1, 0, 10,
3879
 	1, 1, 0, 10,
3880
 	#intro, length
3880
 	#intro, length

+ 12
- 1
scripts/boneRecord.py View File

12
 #bone_list = ['root', 'head']
12
 #bone_list = ['root', 'head']
13
 
13
 
14
 def Record():   
14
 def Record():   
15
-    print('bone recording') 
15
+    #print('bone recording') 
16
     scene = bge.logic.getCurrentScene()
16
     scene = bge.logic.getCurrentScene()
17
     #own = cont.owner
17
     #own = cont.owner
18
     master = scene.objects['control_cube.002']
18
     master = scene.objects['control_cube.002']
50
         master[str(y) + '-pos'].append(pos)
50
         master[str(y) + '-pos'].append(pos)
51
         master[str(y) + '-rot'].append(rot)
51
         master[str(y) + '-rot'].append(rot)
52
 
52
 
53
+    # pl = master['foot.ik.R-pos'][len(master['foot.ik.R-pos']) - 1]
54
+
55
+    # if dict['player_class'].obj['ragdoll_active']:
56
+    #     rdfp = armature.worldPosition - scene.objects['npc_ed_arm_phys_foot.ik.R'].worldPosition
57
+    #     print('rd foot pos', rdfp)
58
+    #     #print(dict['player_class'].obj['ragdoll_active'], 'is ragdolling')
59
+    # else:
60
+    #     print('foot pos', pl)
61
+
62
+    #print(len(master['foot.ik.R-pos']), 'br length---')
63
+
53
 
64
 
54
 
65
 
55
     for y in deck_list:
66
     for y in deck_list:

+ 6
- 4
scripts/controller2.py View File

611
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
611
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
612
                 LAST_LEFT_FAK = 1
612
                 LAST_LEFT_FAK = 1
613
             own["LAST_LEFT_FAK"] = 1
613
             own["LAST_LEFT_FAK"] = 1
614
-            
614
+
615
     def fak_stance_left_off():
615
     def fak_stance_left_off():
616
         LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
616
         LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
617
         own["LAST_LEFT_FAK"] = 0
617
         own["LAST_LEFT_FAK"] = 0
1654
 
1654
 
1655
         if d2 > .3 and own['airup'] == 1 and localRay_v[0] == None:
1655
         if d2 > .3 and own['airup'] == 1 and localRay_v[0] == None:
1656
             #pass
1656
             #pass
1657
-            own.alignAxisToVect(gray.hitNormal, 2, .03)
1657
+            #own.alignAxisToVect(gray.hitNormal, 2, .03)
1658
+            #own.alignAxisToVect(gray.hitNormal, 2, .08)
1659
+            own.alignAxisToVect([0,0,1], 2, .08)
1658
         if d2 > .3 and own['airup'] == 0 and localRay_v[0] == None:
1660
         if d2 > .3 and own['airup'] == 0 and localRay_v[0] == None:
1659
 
1661
 
1660
             distance = own.getDistanceTo(gray.hitPosition)
1662
             distance = own.getDistanceTo(gray.hitPosition)
4267
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4269
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4268
         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)):
4270
         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)):
4269
             own['vert'] = 1
4271
             own['vert'] = 1
4270
-            print('vert hit')
4272
+            #print('vert hit')
4271
             ud_sens = .04      
4273
             ud_sens = .04      
4272
             if 'spine' in localRay_v[0] and lUD < -.04:
4274
             if 'spine' in localRay_v[0] and lUD < -.04:
4273
                 if STANCE == True:
4275
                 if STANCE == True:
4297
                 #     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4299
                 #     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4298
             else:
4300
             else:
4299
                 own.alignAxisToVect([0,0,1], 2, .1)
4301
                 own.alignAxisToVect([0,0,1], 2, .1)
4300
-                print('doing nothing')            
4302
+                #print('doing nothing')            
4301
 
4303
 
4302
     localHitDist = 1000
4304
     localHitDist = 1000
4303
     raytof = scene.objects['rayTo_f']
4305
     raytof = scene.objects['rayTo_f']

+ 12
- 2
scripts/game.py View File

2
 import FSM
2
 import FSM
3
 import requests
3
 import requests
4
 import platform
4
 import platform
5
+import os
5
 
6
 
6
 def phone_home():
7
 def phone_home():
7
 	url = 'https://shuvit.org/phone_home.php'
8
 	url = 'https://shuvit.org/phone_home.php'
12
 	print('phone home response')
13
 	print('phone home response')
13
 	print(x.text)
14
 	print(x.text)
14
 
15
 
16
+def get_map_list():
17
+	out = []
18
+	ldir = bge.logic.expandPath("//assets/maps")
19
+	out = os.listdir(ldir)
20
+	print('$$$$$$$$$$$$$$$$$$$$$$$out', out)
21
+	return out
22
+
15
 def main(cont):
23
 def main(cont):
16
 	own = cont.owner
24
 	own = cont.owner
17
 	dict = bge.logic.globalDict
25
 	dict = bge.logic.globalDict
21
 		own['cont'] = cont
29
 		own['cont'] = cont
22
 		dict['gameFSM'] = FSM.GameFSM(own)
30
 		dict['gameFSM'] = FSM.GameFSM(own)
23
 		dict['game_life'] = 0
31
 		dict['game_life'] = 0
32
+		dict['maps'] = get_map_list()
24
 		#phone_home()
33
 		#phone_home()
25
-
34
+	if 'game_life' in dict:
35
+		dict['game_life'] += 1
26
 	dict['gameFSM'].Execute()
36
 	dict['gameFSM'].Execute()
27
-	dict['game_life'] += 1
37
+	

+ 25
- 18
scripts/grindV2.py View File

330
 
330
 
331
         #print(own['inverting'])
331
         #print(own['inverting'])
332
         #if frames_grinding > 20 and own['inverting'] == False:
332
         #if frames_grinding > 20 and own['inverting'] == False:
333
-        if frames_grinding > 20:    
334
-            #print("setting stance")
335
-            if (rot == 90 or rot == -270) and STANCE == True:
336
-                #print("90 fak stance")
337
-                own['stance'] = 1
338
-                STANCE = 1
339
-            if (rot == 90 or rot == -270) and STANCE == False:
340
-                #print("90 fak stance")
341
-                own['stance'] = 1
342
-                STANCE = 1
343
-            if (rot == -90 or rot == 270) and STANCE == True:
344
-                #print("-90 reg stance")
345
-                own['stance'] = 0
346
-                STANCE = 0
347
-            if (rot == -90 or rot == 270) and STANCE == False:
348
-                #print("-90 reg stance")
349
-                own['stance'] = 0
350
-                STANCE = 0
333
+        #print('obj', grindDar.hitObjectList[0])
334
+        if 'edge' in grindDar.hitObjectList[0]:
335
+            #print('do not fucking change stance')
336
+
337
+
338
+
339
+
340
+            if frames_grinding > 20:    
341
+                #print("setting stance")
342
+                if (rot == 90 or rot == -270) and STANCE == True:
343
+                    #print("90 fak stance")
344
+                    own['stance'] = 1
345
+                    STANCE = 1
346
+                if (rot == 90 or rot == -270) and STANCE == False:
347
+                    #print("90 fak stance")
348
+                    own['stance'] = 1
349
+                    STANCE = 1
350
+                if (rot == -90 or rot == 270) and STANCE == True:
351
+                    #print("-90 reg stance")
352
+                    own['stance'] = 0
353
+                    STANCE = 0
354
+                if (rot == -90 or rot == 270) and STANCE == False:
355
+                    #print("-90 reg stance")
356
+                    own['stance'] = 0
357
+                    STANCE = 0
351
 
358
 
352
     def grindrotvel(obj):
359
     def grindrotvel(obj):
353
         joinit = 0
360
         joinit = 0

+ 12
- 0
scripts/levelLibload.py View File

1
+import bge
2
+
3
+def main(cont):
4
+    own = cont.owner
5
+    scene = bge.logic.getCurrentScene()
6
+    dict = bge.logic.globalDict
7
+    
8
+    mainDir = bge.logic.expandPath("//")
9
+    fileName = mainDir + 'assets/maps/' + dict['map'] + '/map.blend'   
10
+    path = bge.logic.expandPath(fileName)
11
+    bge.logic.LibLoad(path, 'Scene', load_actions=True) 
12
+    

+ 37
- 16
scripts/menuV3.py
File diff suppressed because it is too large
View File


+ 2
- 1
scripts/npause.py View File

119
         else:
119
         else:
120
             cont.activate(cont.actuators['walk'])    
120
             cont.activate(cont.actuators['walk'])    
121
         try:
121
         try:
122
-            own.setLinearVelocity(own['pre_pause_linvel'], 1) 
122
+            if own['walk'] == False:
123
+                own.setLinearVelocity(own['pre_pause_linvel'], 1) 
123
         except:
124
         except:
124
             pass    
125
             pass    
125
         cont.activate(cont.actuators['remove_overlay'])  
126
         cont.activate(cont.actuators['remove_overlay'])  

+ 29
- 27
scripts/pause_menu2.py View File

3
 
3
 
4
 def check_idle():
4
 def check_idle():
5
     dict = bge.logic.globalDict
5
     dict = bge.logic.globalDict
6
-    dict['menu_idle_timer'] +=1
7
-    idle = 0
8
-    if dict['aBut'] or dict['bBut'] or dict['xBut'] or dict['yBut'] or dict['ddPad'] or dict['udPad'] or dict['ldPad'] or dict['rdPad'] or (dict['lUD'] > .02 or dict['lUD'] < -.02) or (dict['lLR'] > .02 or dict['lLR'] < -.02) or (dict['rUD'] > .02 or dict['rUD'] < -.02) or (dict['rLR'] > .02 or dict['rLR'] < -.02):
9
-        dict['menu_idle_timer'] = 0
10
-    #print('idtime', dict['menu_idle_timer']) 
11
-    if dict['menu_idle_timer'] > 500:
12
-        idle =1
13
-    return idle                        
6
+    if 'pause_menu_text' in dict:
7
+        dict['menu_idle_timer'] += 1
8
+        idle = 0
9
+        if dict['aBut'] or dict['bBut'] or dict['xBut'] or dict['yBut'] or dict['ddPad'] or dict['udPad'] or dict['ldPad'] or dict['rdPad'] or (dict['lUD'] > .02 or dict['lUD'] < -.02) or (dict['lLR'] > .02 or dict['lLR'] < -.02) or (dict['rUD'] > .02 or dict['rUD'] < -.02) or (dict['rLR'] > .02 or dict['rLR'] < -.02):
10
+            dict['menu_idle_timer'] = 0
11
+        #print('idtime', dict['menu_idle_timer']) 
12
+        if dict['menu_idle_timer'] > 500:
13
+            idle =1
14
+        return idle                        
14
 
15
 
15
 def update_text(cont):
16
 def update_text(cont):
16
     own = cont.owner
17
     own = cont.owner
17
     scene = bge.logic.getCurrentScene()
18
     scene = bge.logic.getCurrentScene()
18
     dict = bge.logic.globalDict
19
     dict = bge.logic.globalDict
19
-    if dict['pause_menu_text'] == '':
20
-        scene.objects['menu_text'].text = 'menu > fuck' 
21
-    else:
22
-        if 'menu_text' in scene.objects: 
23
-            scene.objects['menu_text'].text = dict['pause_menu_text']   
24
-        if 'menu_text.001' in scene.objects: 
25
-            scene.objects['menu_text.001'].text = dict['pause_menu_text']               
20
+    if 'pause_menu_text' in dict:
21
+        if dict['pause_menu_text'] == '':
22
+            scene.objects['menu_text'].text = 'menu > fuck' 
23
+        else:
24
+            if 'menu_text' in scene.objects: 
25
+                scene.objects['menu_text'].text = dict['pause_menu_text']   
26
+            if 'menu_text.001' in scene.objects: 
27
+                scene.objects['menu_text.001'].text = dict['pause_menu_text']               
26
 
28
 
27
-#    scene = bge.logic.getCurrentScene()
28
-    for object in scene.objects:
29
-        if isinstance(object, bge.types.KX_FontObject):
30
-            object.resolution = 16     
31
-                    
32
-    info = ('Music > ' + dict['mu_artist'] + ' - ' + dict['mu_title'])
33
-    #print(info)
34
-    try:
35
-        scene.objects['music_info_txt'].text = info                       
36
-    except:
37
-        pass    
38
-                    
29
+    #    scene = bge.logic.getCurrentScene()
30
+        for object in scene.objects:
31
+            if isinstance(object, bge.types.KX_FontObject):
32
+                object.resolution = 16     
33
+                        
34
+        info = ('Music > ' + dict['mu_artist'] + ' - ' + dict['mu_title'])
35
+        #print(info)
36
+        try:
37
+            scene.objects['music_info_txt'].text = info                       
38
+        except:
39
+            pass    
40
+                        
39
                     
41
                     
40
 def main(cont):
42
 def main(cont):
41
     update_text(cont)  
43
     update_text(cont)  

+ 214
- 111
scripts/player.py View File

3
 from mathutils import Vector
3
 from mathutils import Vector
4
 import math
4
 import math
5
 import mathutils
5
 import mathutils
6
+import random
6
 
7
 
7
 dict = bge.logic.globalDict
8
 dict = bge.logic.globalDict
8
 
9
 
18
 		self.throw_deck_empty = self.obj.childrenRecursive["throw_deck_empty"]
19
 		self.throw_deck_empty = self.obj.childrenRecursive["throw_deck_empty"]
19
 		self.step = True
20
 		self.step = True
20
 		self.dropin_obj = None
21
 		self.dropin_obj = None
21
-
22
+		self.joystick_active_frame = 0
23
+		self.joystick_idle = False
24
+		self.idle_cam_dir = True
22
 		#self.throw_deck_obj = dict['level_scene'].objects['throw_deck']
25
 		#self.throw_deck_obj = dict['level_scene'].objects['throw_deck']
23
 		dict['walking'] = True
26
 		dict['walking'] = True
24
 		#print(self.obj.childrenRecursive)
27
 		#print(self.obj.childrenRecursive)
328
 
331
 
329
 	def get_vert_rot(self, own, object):
332
 	def get_vert_rot(self, own, object):
330
 
333
 
331
-	        if 'inited' not in object:
332
-	            object['inited'] = True
333
-
334
-	            for mesh in object.meshes:
335
-	                red_verts = []
336
-	                green_verts = []
337
-	                for m_index in range(len(mesh.materials)):
338
-	                    for v_index in range(mesh.getVertexArrayLength(m_index)):
339
-	                        vertex = mesh.getVertex(m_index, v_index)
340
-	                        if vertex.color[0] > .8:
341
-	                            loc = object.worldTransform * vertex.XYZ
342
-	                            red_verts.append(loc.freeze())
343
-	                        if vertex.color[1] > .8:
344
-	                            loc = object.worldTransform * vertex.XYZ
345
-	                            green_verts.append(loc.freeze())
346
-	                           
347
-	            red_verts = set(red_verts)
348
-	            #for v in red_verts:
349
-	                #print(v, 'red_vert')
350
-	            green_verts = set(green_verts)               
351
-	            object['red_verts'] = red_verts
352
-	            object['green_verts'] = green_verts
353
-	            
354
-	            size_red = len(object['red_verts'])
355
-	            kd_red = mathutils.kdtree.KDTree(size_red)
356
-	            size_green = len(object['green_verts'])
357
-	            kd_green = mathutils.kdtree.KDTree(size_green)    
358
-
359
-	            for i, v in enumerate(object['red_verts']):
360
-	                kd_red.insert(v, i)
361
-	            for i, v in enumerate(object['green_verts']):
362
-	                kd_green.insert(v, i)
363
-
364
-	            kd_red.balance()
365
-	            kd_green.balance() 
366
-	            object['kd_red'] = kd_red
367
-	            object['kd_green'] = kd_green    
368
-	            #print('kd built -------')
369
-	            #print(own['kd_red'])
370
-	        # Find the closest points to the player
371
-	        #co_find = control_bottom.worldPosition
372
-	        co_find = own.worldPosition
373
-	        found_red = object['kd_red'].find_n(co_find, 2)
374
-	        found_green = object['kd_green'].find_n(co_find, 1)    
375
-	        
376
-	        primary = Vector(found_red[0][0])
377
-	        secondary = Vector(found_red[1][0])
378
-
379
-	        lineVector = secondary - primary
380
-	        lineVector2 = primary - secondary
381
-	        if found_green != []:
382
-	            lv_green = Vector(found_green[0][0])
383
-	            
384
-	        eul = Vector((1, 0, 0)).rotation_difference(lineVector).to_euler()        
385
-	        
386
-	        te = dict['level_scene'].objects['temp_empty']
387
-	        
388
-
389
-	        rotation = te.worldOrientation.to_euler()
390
-	        if abs(rotation.z) > 3:
391
-	            te.applyRotation([0, 0, 1.570796*2], True)
392
-	        
393
-	        xyz = te.localOrientation.to_euler()
394
-	        xyz[0] = math.radians(0)
395
-	        te.localOrientation = xyz.to_matrix()
396
-
397
-	        if lineVector == Vector([0.0, 0.0, 0.0]):
398
-	            #print('vector is empty')
399
-	            pass
400
-	        else:
401
-	            te.alignAxisToVect(lineVector, 0, 1)
402
-	        
403
-	        te.worldPosition = primary
404
-
405
-	        if found_green != []:
406
-	            local = te.worldOrientation.inverted() * (lv_green - te.worldPosition)
407
-	            if local.y < 0:
408
-	                #print('flip vector')
409
-	                eul = Vector((1, 0, 0)).rotation_difference(lineVector2).to_euler() 
410
-	                if lineVector2 == Vector([0.0, 0.0, 0.0]):
411
-	                    #print('linVector2 is empty')
412
-	                    pass
413
-	                else:
414
-	                    te.alignAxisToVect(lineVector2, 0, 1)
415
-	                #print('align2', lineVector2)
416
-	                te.worldPosition = secondary
417
-	            else:
418
-	                #print('align1', lineVector)  
419
-	                pass
420
-
421
-
422
-	        #flip z axis
423
-
424
-	        #print(local, 'local')
425
-	        
426
-	        myhead = te.worldOrientation.col[2]
427
-	        worldUp = Vector([0,0,1])
428
-	        #worldY = Vector([0,1,0])
429
-	        dot_p = myhead.dot(worldUp)
430
-
431
-	        if dot_p > 0.9:
432
-	            pass
433
-	        else:
434
-	            #print('flip grind object rotation')
435
-	            te.applyRotation([1.570796*2, 0, 0], True)
436
-
437
-
438
-
439
-
440
-	        return eul
334
+			if 'inited' not in object:
335
+				object['inited'] = True
336
+
337
+				for mesh in object.meshes:
338
+					red_verts = []
339
+					green_verts = []
340
+					for m_index in range(len(mesh.materials)):
341
+						for v_index in range(mesh.getVertexArrayLength(m_index)):
342
+							vertex = mesh.getVertex(m_index, v_index)
343
+							if vertex.color[0] > .8:
344
+								loc = object.worldTransform * vertex.XYZ
345
+								red_verts.append(loc.freeze())
346
+							if vertex.color[1] > .8:
347
+								loc = object.worldTransform * vertex.XYZ
348
+								green_verts.append(loc.freeze())
349
+							   
350
+				red_verts = set(red_verts)
351
+				#for v in red_verts:
352
+					#print(v, 'red_vert')
353
+				green_verts = set(green_verts)               
354
+				object['red_verts'] = red_verts
355
+				object['green_verts'] = green_verts
356
+				
357
+				size_red = len(object['red_verts'])
358
+				kd_red = mathutils.kdtree.KDTree(size_red)
359
+				size_green = len(object['green_verts'])
360
+				kd_green = mathutils.kdtree.KDTree(size_green)    
361
+
362
+				for i, v in enumerate(object['red_verts']):
363
+					kd_red.insert(v, i)
364
+				for i, v in enumerate(object['green_verts']):
365
+					kd_green.insert(v, i)
366
+
367
+				kd_red.balance()
368
+				kd_green.balance() 
369
+				object['kd_red'] = kd_red
370
+				object['kd_green'] = kd_green    
371
+				#print('kd built -------')
372
+				#print(own['kd_red'])
373
+			# Find the closest points to the player
374
+			#co_find = control_bottom.worldPosition
375
+			co_find = own.worldPosition
376
+			found_red = object['kd_red'].find_n(co_find, 2)
377
+			found_green = object['kd_green'].find_n(co_find, 1)    
378
+			
379
+			primary = Vector(found_red[0][0])
380
+			secondary = Vector(found_red[1][0])
381
+
382
+			lineVector = secondary - primary
383
+			lineVector2 = primary - secondary
384
+			if found_green != []:
385
+				lv_green = Vector(found_green[0][0])
386
+				
387
+			eul = Vector((1, 0, 0)).rotation_difference(lineVector).to_euler()        
388
+			
389
+			te = dict['level_scene'].objects['temp_empty']
390
+			
391
+
392
+			rotation = te.worldOrientation.to_euler()
393
+			if abs(rotation.z) > 3:
394
+				te.applyRotation([0, 0, 1.570796*2], True)
395
+			
396
+			xyz = te.localOrientation.to_euler()
397
+			xyz[0] = math.radians(0)
398
+			te.localOrientation = xyz.to_matrix()
399
+
400
+			if lineVector == Vector([0.0, 0.0, 0.0]):
401
+				#print('vector is empty')
402
+				pass
403
+			else:
404
+				te.alignAxisToVect(lineVector, 0, 1)
405
+			
406
+			te.worldPosition = primary
407
+
408
+			if found_green != []:
409
+				local = te.worldOrientation.inverted() * (lv_green - te.worldPosition)
410
+				if local.y < 0:
411
+					#print('flip vector')
412
+					eul = Vector((1, 0, 0)).rotation_difference(lineVector2).to_euler() 
413
+					if lineVector2 == Vector([0.0, 0.0, 0.0]):
414
+						#print('linVector2 is empty')
415
+						pass
416
+					else:
417
+						te.alignAxisToVect(lineVector2, 0, 1)
418
+					#print('align2', lineVector2)
419
+					te.worldPosition = secondary
420
+				else:
421
+					#print('align1', lineVector)  
422
+					pass
423
+
424
+
425
+			#flip z axis
426
+
427
+			#print(local, 'local')
428
+			
429
+			myhead = te.worldOrientation.col[2]
430
+			worldUp = Vector([0,0,1])
431
+			#worldY = Vector([0,1,0])
432
+			dot_p = myhead.dot(worldUp)
433
+
434
+			if dot_p > 0.9:
435
+				pass
436
+			else:
437
+				#print('flip grind object rotation')
438
+				te.applyRotation([1.570796*2, 0, 0], True)
439
+
440
+
441
+
442
+
443
+			return eul
441
 
444
 
442
 	def move_to_te(self):
445
 	def move_to_te(self):
443
 		o = self.obj
446
 		o = self.obj
448
 		o.worldOrientation = te.worldOrientation
451
 		o.worldOrientation = te.worldOrientation
449
 		o.linearVelocity = [0,0,0]
452
 		o.linearVelocity = [0,0,0]
450
 
453
 
454
+	def check_pause(self):
455
+		if dict['npause'] == True:
456
+			self.FSM.FSM.ToTransition('toPause')
457
+
458
+	def check_idle(self, resetter):
459
+		idle = True
460
+		sens = .03
461
+		
462
+		if resetter:
463
+			idle = False
464
+		else:
465
+			if abs(dict['lUD']) > sens:
466
+				idle = False
467
+			elif abs(dict['lLR']) > sens:
468
+				idle = False
469
+			elif abs(dict['rUD']) > sens:
470
+				idle = False
471
+			elif abs(dict['rLR']) > sens:
472
+				idle = False
473
+			elif abs(dict['rTrig']) > sens:
474
+				idle = False
475
+			elif abs(dict['lTrig']) > sens:
476
+				idle = False
477
+			elif dict['aBut'] == True:
478
+				idle = False
479
+			elif dict['bBut'] == True:
480
+				idle = False
481
+			elif dict['xBut'] == True:
482
+				idle = False
483
+			elif dict['yBut'] == True:
484
+				idle = False
485
+			elif dict['udPad'] == True:
486
+				idle = False
487
+			elif dict['ddPad'] == True:
488
+				idle = False
489
+			elif dict['ldPad'] == True:
490
+				idle = False
491
+			elif dict['rdPad'] == True:
492
+				idle = False
493
+
494
+		if self.joystick_idle == True and idle == False:
495
+			self.arm.stopAction(6)		
496
+			self.deck_arm.stopAction(6)		
497
+			self.joystick_idle = False
498
+		if not idle:
499
+			self.joystick_active_frame = dict['game_life']
500
+		else:
501
+			idle_time = dict['game_life'] - self.joystick_active_frame
502
+			if idle_time > 400:
503
+				self.joystick_idle = True
504
+
505
+	def idle_anim(self):
506
+		if self.joystick_idle:
507
+			#if self.arm.isPlayingAction(6):
508
+			
509
+			if 1 == 2:
510
+				pass
511
+			else:
512
+				if dict['game_life'] % 280 == 1:
513
+
514
+						# 'reg_idle2_', 1, 120,
515
+						# #deck action name, start, end frames  
516
+						# 'b_reg_idle2', 1, 120,
517
+
518
+					#choice = random
519
+
520
+					s_list = ['reg_idle1', 'reg_idle2_', 'reg_idle3', 'reg_idle4', 'reg_idle5', 'reg_idle6', 'reg_idle7']
521
+					d_list = ['b_reg_idle1', 'b_reg_idle2', 'b_reg_idle3', 'b_reg_idle4', 'b_reg_idle5', 'b_reg_idle6', 'b_reg_idle7']
522
+
523
+					random_index = random.randrange(len(s_list))
524
+					
525
+					self.arm.playAction(s_list[random_index], 1, 120, layer=6, play_mode=0, speed=.5, blendin=15)
526
+					self.deck_arm.playAction(d_list[random_index], 1, 120, layer=6, play_mode=0, speed=.5, blendin=15)
527
+					#print('play an idle', s_list[random_index], d_list[random_index])
528
+					
529
+				if dict['game_life'] % 1280 == 1:				
530
+					self.idle_cam_dir = not self.idle_cam_dir
531
+			
532
+				#print('modded', dict['game_life'] % 280, dict['game_life'])
533
+				if self.idle_cam_dir:
534
+					dict['camera'].applyMovement([.0005, 0, 0], True)
535
+					dict['camera'].applyRotation([.0005, 0, .0005], True)
536
+				else:
537
+					dict['camera'].applyMovement([-.0005, 0, 0], True)
538
+					dict['camera'].applyRotation([-.0005, 0, -.0005], True)
539
+				# move_len = 2048
540
+		  #       if own['idlecampos_x'] < move_len:
541
+		  #           own['idlecampos_x'] += 1
542
+		  #       if own['idlecampos_x'] == move_len:
543
+		  #          own['idlecampos_x'] = 0
544
+
545
+		  #       if own['idlecampos_x'] < (move_len / 2):
546
+		  #           move = [.0001, 0, 0]
547
+		  #           freecam.applyMovement( move, True)
548
+		  #           freecam.applyRotation([.0001, 0, .0001], True)
549
+		  #       if own['idlecampos_x'] > (move_len / 2):
550
+		  #           move = [-.0001, 0, 0]
551
+		  #           freecam.applyMovement(move, True)
552
+		  #           freecam.applyRotation([-.0001, 0, -.0001], True)
553
+
451
 
554
 
452
 def update(cont):
555
 def update(cont):
453
 	#print('-------------player updating----------------')
556
 	#print('-------------player updating----------------')

+ 11
- 3
scripts/ragdoll.py View File

9
     return bone.pose_matrix * offset_m4.inverted()
9
     return bone.pose_matrix * offset_m4.inverted()
10
 
10
 
11
 def zero_constraints(own, scene):
11
 def zero_constraints(own, scene):
12
+    own['rd_incer'] = 0
12
     armature = scene.objects['Char4']
13
     armature = scene.objects['Char4']
13
     for const in armature.constraints:
14
     for const in armature.constraints:
14
         
15
         
120
             cont.actuators['Camera'].damping = .000001
121
             cont.actuators['Camera'].damping = .000001
121
             cont.activate(cont.actuators['Camera']) 
122
             cont.activate(cont.actuators['Camera']) 
122
             own.suspendDynamics(True)
123
             own.suspendDynamics(True)
124
+
123
             
125
             
124
     else:
126
     else:
125
 
127
 
133
             #scene.objects[armature].update()
135
             #scene.objects[armature].update()
134
             
136
             
135
             #cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
137
             #cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
136
-            scene.objects['control_cube.002'].worldPosition = scene.objects['control_cube.002'].worldPosition.lerp(scene.objects['ragdoll_parent'].worldPosition, .01)
137
-            #scene.objects['control_cube.002'].worldPosition = scene.objects['ragdoll_parent'].worldPosition
138
-
138
+            
139
+            #scene.objects['control_cube.002'].worldPosition = scene.objects['control_cube.002'].worldPosition.lerp(scene.objects['ragdoll_parent'].worldPosition, .01)
140
+            
141
+            #scene.objects['control_cube.002'].worldOrientation = scene.objects['ragdoll_parent'].worldOrientation.copy()
142
+            #scene.objects['control_cube.002'].applyRotation([-3.14/2,3.14/2, 0], True)
143
+            scene.objects['control_cube.002'].worldPosition = scene.objects['npc_ed_arm_phys_master'].worldPosition.copy()
144
+            scene.objects['control_cube.002'].worldOrientation = scene.objects['npc_ed_arm_phys_master'].worldOrientation.copy()
145
+            scene.objects['control_cube.002'].applyRotation([3.14/2,3.14/2, 0], True)
139
             #print('doing the active thing')
146
             #print('doing the active thing')
140
 
147
 
141
 
148
 
196
                 own['getonboard'] = True
203
                 own['getonboard'] = True
197
                 dict['walk'] = 0
204
                 dict['walk'] = 0
198
                 own['fall'] = False
205
                 own['fall'] = False
206
+                own.alignAxisToVect([0,0,1], 2, .99)
199
             if dict['lUD'] < -.08 and own['rd_incer'] > 200:
207
             if dict['lUD'] < -.08 and own['rd_incer'] > 200:
200
                 physBody = own['rd_rb']
208
                 physBody = own['rd_rb']
201
                 excludes = ['npc_ed_arm_phys_hand.R', 'npc_ed_arm_phys_hand.L', 'npc_ed_arm_phys_forearm.fk.L', 'npc_ed_arm_phys_forearm.fk.R', 'npc_ed_arm_phys_upper_arm.fk.L', 'npc_ed_arm_phys_upper_arm.fk.R']
209
                 excludes = ['npc_ed_arm_phys_hand.R', 'npc_ed_arm_phys_hand.L', 'npc_ed_arm_phys_forearm.fk.L', 'npc_ed_arm_phys_forearm.fk.R', 'npc_ed_arm_phys_upper_arm.fk.L', 'npc_ed_arm_phys_upper_arm.fk.R']

+ 8
- 2
scripts/scene_init.py View File

91
             print('starting music') 
91
             print('starting music') 
92
         else:
92
         else:
93
             print('not starting music', dict['music_player'])        
93
             print('not starting music', dict['music_player'])        
94
-            
95
-        for x in scene.objects:
94
+        
95
+        dict['sun_lights'] = []    
96
+        dict['ambient_lights'] = []    
97
+        for x in scene.lights:
96
             if 'hemi' in x:
98
             if 'hemi' in x:
97
                 if 'down' in x:
99
                 if 'down' in x:
98
                     x.energy = dict['ambient_strength']
100
                     x.energy = dict['ambient_strength']
101
+                    dict['ambient_lights'].append(x)
99
                 else:
102
                 else:
100
                     x.energy = dict['ambient_strength'] * .7    
103
                     x.energy = dict['ambient_strength'] * .7    
104
+                    dict['ambient_lights'].append(x)
101
 
105
 
102
             if 'sun' in x:
106
             if 'sun' in x:
103
                 x.energy = dict['sun_strength']
107
                 x.energy = dict['sun_strength']
108
+                dict['sun_lights'].append(x)
104
         #scene.world.envLightEnergy = dict['ambient_strength']   
109
         #scene.world.envLightEnergy = dict['ambient_strength']   
105
         #scene.world.envLightEnergy = 0
110
         #scene.world.envLightEnergy = 0
106
         
111
         
152
         own['grinding'] = False
157
         own['grinding'] = False
153
         own['ground_since'] = 100
158
         own['ground_since'] = 100
154
         own['last_transition_frame'] = 0
159
         own['last_transition_frame'] = 0
160
+        #own['aState'] = 'reg_roll'
155
         
161
         
156
         colors.update_shirt_tex() 
162
         colors.update_shirt_tex() 
157
         colors.update_truck_tex()
163
         colors.update_truck_tex()

+ 14
- 6
scripts/sound_man.py View File

4
 import bge
4
 import bge
5
 import aud
5
 import aud
6
 
6
 
7
+dict = bge.logic.globalDict
8
+
7
 def init_sounds(self):
9
 def init_sounds(self):
8
 	#pop
10
 	#pop
9
 
11
 
100
 			c.handle_buffered.stop()
102
 			c.handle_buffered.stop()
101
 
103
 
102
 	def Record(self):
104
 	def Record(self):
105
+		
106
+
107
+		self.history.append(self.h_queue)
103
 		self.history.append(self.h_queue)
108
 		self.history.append(self.h_queue)
104
 		#self.history.insert(0, self.h_queue)
109
 		#self.history.insert(0, self.h_queue)
105
-		
106
-		#print(self.h_queue, 'appended to history')
110
+		l = len(self.history)
111
+		#print(self.h_queue, 'appended to history', l)
107
 		#self.history.append(self.h_queue)
112
 		#self.history.append(self.h_queue)
108
 		#print('appending', self.h_queue)
113
 		#print('appending', self.h_queue)
109
 		l = len(self.history)
114
 		l = len(self.history)
110
 		if l > ((self.gd['replay_record_length'])):
115
 		if l > ((self.gd['replay_record_length'])):
111
-
116
+			#del self.history[0:1]
117
+			self.history.pop(0)
112
 			self.history.pop(0)
118
 			self.history.pop(0)
113
 			#self.history.pop(self.gd['replay_record_length'])
119
 			#self.history.pop(self.gd['replay_record_length'])
114
 			#self.history.pop(0)
120
 			#self.history.pop(0)
123
 			#print(self.history[frame], self.queue, frame, 'replay queue')
129
 			#print(self.history[frame], self.queue, frame, 'replay queue')
124
 		except:
130
 		except:
125
 			print('replay audio not playing', frame, len(self.history))
131
 			print('replay audio not playing', frame, len(self.history))
126
-		#print('h_queue', self.h_queue, frame)
132
+		#print('h_queue', self.h_queue, frame, (self.history))
133
+		#print('h_queue', self.h_queue, frame, len(self.history))
127
 		if self.h_queue is not []:
134
 		if self.h_queue is not []:
128
 			for ev in self.h_queue:
135
 			for ev in self.h_queue:
129
 				result = getattr(self, ev[0])
136
 				result = getattr(self, ev[0])
130
 				#print('ev0', ev[0])
137
 				#print('ev0', ev[0])
131
 				if result.loop:
138
 				if result.loop:
132
-					#result.loop_play(ev[1], ev[2], ev[3], ev[4])
133
-					pass
139
+					result.loop_play(ev[1], ev[2], ev[3], ev[4])
140
+					#pass
134
 				else:
141
 				else:
135
 					result.play(ev[1], ev[2])
142
 					result.play(ev[1], ev[2])
136
 					#print('... playing', result.name, frame, len(self.history))
143
 					#print('... playing', result.name, frame, len(self.history))
221
 		#own['sndmgr'].Record()
228
 		#own['sndmgr'].Record()
222
 	if not dict['playback']:
229
 	if not dict['playback']:
223
 		own['sndmgr'].update()
230
 		own['sndmgr'].update()
231
+		#print('updating sound manager', dict['game_life'])
224
 
232
 
225
 	#if dict['playback']:
233
 	#if dict['playback']:
226
 		#own['sndmgr'].Playback()	
234
 		#own['sndmgr'].Playback()	

+ 2
- 2
shuvit.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:d1ad57d6355aae70aaf5a7e4dc2ca1a6917ca514249d3c072e54524ac5e2b0d0
3
-size 125371052
2
+oid sha256:990b6a53606aad8b319016525a494c1d4b0188e41fa6619000ad8a44f891dd6a
3
+size 126713928

Loading…
Cancel
Save